RPi + Arduino - communication over 30m?

26 views
Skip to first unread message

Dax Liniere

unread,
Mar 26, 2021, 6:35:09 PM3/26/21
to London Hackspace
Hey gang,

I'm planning a significant upgrade to my robotic microphone mover which involves adding a small OLED screen to the controller, presets and some other features. I think the best way to do this (for me with rudimentary programming experience) would be to put a Pi Zero running Node-RED into the control unit (joystick, buttons, OLED screen) and an Arduino on the remote end to control the 3 stepper motors and get feedback from 3-4 basic sensors.
Seems like a good way to run the Arduino is to load it with Firmata.

My concern is how to interface them in a robust way. I looked at RS485, but it seems like it won't work with Firmata because it's an asynchronous protocol.

Examples I've found that interface RPi with Arduino have all been over a USB cable or short wires from I2C pins.

Does anyone have experience with this and have an idea of the best way to do it?

All the best!
Dax.

Rowan Hoggarth

unread,
Mar 26, 2021, 6:58:06 PM3/26/21
to london-h...@googlegroups.com
Hi,

You can use RS484 transceivers to convert to differential if in full duplex. Instead of using just one pair of wires where the direction of transmission changes (as is the normal half duplex mode for RS485), simply use two pairs of wires. The need to switch the bus direction is the crux of the problem for asynchronous use: with one pair each for transmission and receive you can use asynchronous protocols in the same manner as you would with the simple TTL UART port.

To do this you need to use an RS485 transceiver that has separate terminals for RX and TX pairs (marked as A,B,Y,Z typically). For example SN65HVD1473 from Texas Instruments would work, but the more common MAX485 From Maxim would not work because it combines the pairs internally.

Hope this helps

R

--
You received this message because you are subscribed to the Google Groups "London Hackspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to london-hack-sp...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/london-hack-space/3d9fb7d6-43d5-4b11-9814-4dbff3d00f75n%40googlegroups.com.

Dax Liniere

unread,
Mar 26, 2021, 7:05:28 PM3/26/21
to London Hackspace
By the way, here's the first version of the RoboMic: https://vimeo.com/425310335

Dax Liniere

unread,
Mar 26, 2021, 7:13:17 PM3/26/21
to London Hackspace
Hi Rowan,
Thanks for the info, I really appreciate it. I did some more digging into that chip when I saw some mention of RS-422. I looked it up and it seems like its default configuration is 4 wires, separate pairs of RX and TX wires.
Would that be another way to do it?

On Friday, 26 March 2021 at 22:58:06 UTC Rowan H wrote:

Dax Liniere

unread,
Mar 26, 2021, 7:25:31 PM3/26/21
to London Hackspace
Yes, it looks like RS422 transceiver boards can be bought pretty cheap (£5 for a pair). This one on eBay uses MAX490 chip.

Medad rufus

unread,
Mar 26, 2021, 7:34:49 PM3/26/21
to london-h...@googlegroups.com
Nice video. Must be lots of fun moving the mic around with the joystick, even when not recording!

Medad



Rowan Hoggarth

unread,
Mar 26, 2021, 8:19:59 PM3/26/21
to london-h...@googlegroups.com
Hi,

Yeah MAX490 would do the trick. 

One note of caution is that despite being a differential signal, these are not isolated. The bus voltage relative to transceiver ground must stay within limits: with different power supplies at each end (sometimes crossing into different buildings) this is often the primary headache in industrial settings!

I would add a GND line between the two ends of the link so that the common mode voltage doesn't stray anywhere near the 12V or -8V limit. This solves one issue but creates the potential pitfall of a path that could pass some unintended current. If your robot end is running from battery power then there's no issue. Likewise if you are feeding power to the robot along the same cable. If however its actually the case that two independent mains derived power supplies are used at each end, I would strongly recommend at least one end uses an isolated transceiver. A DIY isolated end can be made with some opto-couplers between the transceiver and the micro-controller + an isolated DC-DC module that drives the transceiver only. That said i'm guessing this probably doesn't need to be applied here. In not so distant projects I have used MAX14853 as an isolated full duplex transceiver (~£5), it comes with most of the isolated power supply circuit internally, the user just has to provide the miniature transformer (~£2) and a schottky diode externally. 

R

Rowan Hoggarth

unread,
Mar 26, 2021, 8:24:13 PM3/26/21
to london-h...@googlegroups.com
Just had a look at your video of the robot and your website. Nice!

R

Adrian Godwin

unread,
Mar 27, 2021, 7:00:52 AM3/27/21
to london-h...@googlegroups.com
You can isolate RS422 with optocouplers. The usual way to do this is to have a small section of the driver at each end which is powered by a DC-DC converter and hence isolated, and put the RS422 buffers in that section with optocouplers to link them to the main part. 

Ethernet is also isolated and might be better if you want long distances as you can often use an existing network.


Rowan Hoggarth

unread,
Mar 27, 2021, 8:44:51 AM3/27/21
to london-h...@googlegroups.com
There are also a few sneaky isolated receivers on the market that do not require a separate power supply on the isolated side. 

Since its only the receiver, you do need to use a separate chip as the driver (Eg. MAX485, permanently set to TX mode), and also need to implement this at both ends of the link, rather than just isolating one end. In effect each pair remains referenced to the sending end, but is isolated at the far end by one of these self powered chips. These receivers work by having an on chip inductor placed across the receive lines, and on the other side of the internal barrier a hall effect sensor which senses the magnetic flux direction in the inductor. thus no power supply is needed on the isolated side as its just an (on chip) coil. It's essential to read the datasheets carefully for these type of receivers though because the termination resistor choice (and possibly a loading cap too) will be somewhat different than 'traditional' 485 termination/biasing.

Check out the IL610  from NVE for example.

R

Dax Liniere

unread,
Mar 27, 2021, 8:59:12 AM3/27/21
to London Hackspace
Hey everyone. Super-quick reply in fleeting moment of pause between childcare. ;)
I plan to put the power supply in the 'motor box' and send power over the cat5 cable to 'joystick box' (control box) along with the control signals (probably 422??), so I guess that solves the isolation/difference-of-potential issue.
My concern with ethernet/wifi is latency and learning curve. Also, I feel like a hard connection is more reliable (no IP addresses to get misconfigured, network masks, blah, blah.)

Dax Liniere

unread,
Mar 27, 2021, 9:06:42 AM3/27/21
to London Hackspace
And a Pi Zero draws 80mA with HDMI and wifi disabled, well-below the limits for cat6 cable. :)
Reply all
Reply to author
Forward
0 new messages