Electronic – arduino – Serial bus Raspberry Pi to multiple AVRs

arduinoraspberry pirs485serial-bus

Background: I'm trying to replace the electronics for a ice hockey scoreboard. The old electronics had the following issues:

  • It stop working. I have since discovered that a couple of diodes and capacitors had burnt out.
  • The controller was wired. We want to get rid of the wire running down the length of the rink.
  • The connectors for the controller gave lots of issues. I have had to re-soldered them countless times.

Photo of Scoreboard

The scoreboard is approximately 3.5 meters across.

I plan to stick a Raspberry Pi at the scoreboard. I plan to put a wifi usb dongle that support ap mode, and run hostapd. Scorekeepers can then connect to the Raspberry Pi via a web interface from a tablet/laptop.

I plan to replace the incandescent bulbs with LEDs, possibly OSRAM LR G5AP-BZCZ.

I originally planed to use i2c GPIO extenders. But I have since learnt that the wiring for a i2c bus need to be as short as possible. This would mean that I would need a lot of cabling from the gpios to the leds. Hence I arrive at my question.

Question: I would like to have AVR microprocessor for each 7 segment or each 2 7 segments who's job is a GPIO extender. These would be placed physically near to the LEDs. I would like to communicate from Raspberry Pi to the multiple AVR microprocessors over a common serial bus.

I have read that RS-485 can have multiple host on a bus. And as my communication is in one direction (output from the Raspberry Pi,) I hope that this can make the solution simpler.

Can the Raspberry Pi and AVR do RS-485 using there existing serial interfaces? What circuitry is needed to do this?

Best Answer

There are standard RS422/RS485 transceiver ICs available

Here you'' find many pages of RS485 related ICs at Digikey

You can use standard asynchronous serial data using RS485 if desired. "Rolling your own" multistation code should not be too hard [tm], but it's an oft invented wheel - there will be many people already offering software (much for free) that does this.

The CAN bus lives on top of RS485, but is probably overkill for what you want.


Superb application note

AN-218 Implementing a RS-485 Multi-drop Network

This is targeted at ZBASIC but is liable to be of direct relevance to your application.

  • This application note describes how to interface ZX devices with a RS-485 multi-drop network. RS-485 networks are used by many industrial applications including process control, building automation and even the control of lights at a concert. A RS-485 header board and example hookup is provided to explain the simple hardware required to get started with networking ZX devices. The software included with this application note gives a sample application and a reusable set of APIs to send and receive messages on a RS-485 network. Here is a table of contents to help with document navigation.

Here you find ...

RS485 Multidrop Wiring Diagram & RS232 - RS485 comparison

They say -

  • RS485 is sometimes termed as RS485 Multidrop LAN since it can connect several devices in a LAN network environment. These devices are all connected to a single pair wire. Transmit and receive share the same two wires.

  • Officially the RS485 specification allows only 32 nodes (devices) on the LAN. However, I.C. manufacturers have developed RS485 drivers capable of allowing 128 to 255 nodes on an RS485 LAN. We use these next generation RS485 drivers in our products. This means that you can use our Converters and Remote I/O devices in more expansive situations.

enter image description here


Useful tutorial Wikipedia - RS485

Lots of ideas here from G's image search