Shop OBEX P1 Docs P2 Docs Learn Events
visualising RS 485 signal for reproducing it with an arduino — Parallax Forums

visualising RS 485 signal for reproducing it with an arduino

Hello guys
i have a heat recovery ventillation system controlled with an HMI,it has 2 motors, one for air ventillation and one for air extraction,with the possibility of controlling the speed of the ventillation (speed of the motors)
i want to control the heat recovery system by changing the speed of both motors with a smartphone, via an arduino
the HMI is connected to the main board of the system through an RS 485 communication standard(as written in the manual) 4 wires: (2 wires for power:0V and 12V, and 2 wires A and B for data)
i am new in this field and i had the idea of somehow getting the data signals for each function of the controller and then recreating those signals with the arduino
what to do ?!
thank you

Comments

  • You do know that this is the Parallax Forum, not the Arduino.cc forum?
  • kwinnkwinn Posts: 8,697
    The signal is pretty straight forward. It is a differential signal, meaning that one wire is at (or near) 0V and the other at 5V for a zero and the opposite polarity for a one bit. The data is asynchronous serial and the typical data rate is from 19,200 baud to 115,200, although it can go faster or slower. The hard part is figuring out the protocol and commands. Hope you have or can obtain a manual.
  • You really need to include an RS485 transceiver chip. I would not try driving or receiving the signal just with microcontroller pins. The transceiver will provide much better driving current, as well as isolation from common-mode excursions and protect the micro from them.

    -Phil
  • "You do know that this is the Parallax Forum, not the Arduino.cc forum?" ...

    Yes Hal Albach, but to a new person I can see the possible confusion ...... See link below

    https://www.parallax.com/search?search_api_views_fulltext=Arduino
  • I think we should all strive to err on the side of generosity, when at all possible. If it's a question we can't answer, then we can suggest another place to get help.

    -Phil

  • kwinnkwinn Posts: 8,697
    I think we should all strive to err on the side of generosity, when at all possible. If it's a question we can't answer, then we can suggest another place to get help.

    -Phil

    + 1
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2017-03-16 07:59
    sino007 wrote: »
    Hello guys
    i have a heat recovery ventillation system controlled with an HMI,it has 2 motors, one for air ventillation and one for air extraction,with the possibility of controlling the speed of the ventillation (speed of the motors)
    i want to control the heat recovery system by changing the speed of both motors with a smartphone, via an arduino
    the HMI is connected to the main board of the system through an RS 485 communication standard(as written in the manual) 4 wires: (2 wires for power:0V and 12V, and 2 wires A and B for data)
    i am new in this field and i had the idea of somehow getting the data signals for each function of the controller and then recreating those signals with the arduino
    what to do ?!
    thank you

    I'll answer this the Parallax way since it has been asked in this forum. It is very very easy to do with the Propeller since any I/O pin can be a custom UART. In fact my Tachyon Forth system includes high speed UART objects that can be loaded into cogs at runtime and can and do drive RS485 chips. You only need two I/O to the RS485 driver chip, one for the combined TE/RE and one for the combined transmit and receive data. If you don't know what baud rate the interface runs at it is easy enough to type in a one line script that can report back the baud rate too.

  • JonnyMacJonnyMac Posts: 9,104
    edited 2017-03-16 13:55
    I chuck one in, too! If you need a ready-to-run Propeller board with built-in RS-458 circuitry (can be configured for half- or full-duplex, consider the EFX-TEK HC-8+

    http://www.efx-tek.com/topics/hc-8.html

    I have loads of code (including RS-485 drivers) in Spin (Propeller's native language), but like any other controller board, it can also be programmed in C, BASIC (PropBASIC), and Forth (Tachyon).

    Consider the Propeller for your project; you get a great processor and lots of assistance from folks in the these forums with real experience.

    Here's a real experience with the HC-8+: Disneyland called me because they needed a specialty control situation for the Nightmare Before Christmas display in the Haunted Mansion. The control element provided DMX data, and they wanted to turn four channels into LED control, and four channels into servo control. I was literally about to assemble the program in about 30 minutes using my DMX receiver, LED pwm, and servo output objects (libraries).

    Join the Propeller crowd! You'll have fun! And you'll be productive!
  • T ChapT Chap Posts: 4,223
    edited 2017-03-16 14:37
    Who knows if OP is even still paying attention or has moved on to arduino based forums. But it is not clear if he is suggesting the concept of sniffing out the data or if he has the commands on hand. If you don't have the commands then you can connect a datalogger like the one parallax sells or used to sell, it will record the data stream from Rs485 and display it so you can make some sense of what's happening Then you can start to learn how the signals behave. Typically in rs485 on a single pair of lines you have to set each device to either send or receive. This means that is is easier to have one device send commands or requests and the other simply watches and replies. Otherwise if both devices can send whenever they want on a single pair they could possible talk over each other. So if you can observe if one device is a master that sends commands and you can observe a result you can then emulate that easily in any micro. I like the MAX3430 device on my boards. One thing to be careful of is the time it takes to switch a device from Tx to Rx when you flip the enable pin. With an rs485 device chip attached to your micro you can then communicate easily just like serial IO except you must set the enable pin for tx or rx modes as a chip in my example can either send or receive but not both over a single pair. Rs485 just becomes serial data. Very simple stuff.
  • thank you everybody for your suggestions
Sign In or Register to comment.