Saturday, August 31, 2013

Taking the bus

So you remember the bunch of boards I wired together for my previous post? Well, when I returned home today I was very happy to find a parcel full of electronic parts in the mail. It included the MAX3485 / MAX485 chips I ordered for this project, and with them I altered the circuit a little:


As you can see, most of the parts are still in place: bargraph display, PWM board, Arduino, Raspberry Pi. What you might be missing is the USB cable between the Pi and the Arduino: it's no longer necessary. Instead, the devices are now connected through a RS485 bus (the small, 3-wire cable that's visible between the Pi and the breadboard).

The amazing part is: In theory, when done right, that little cable can be extended to lengths of many meters, under certain conditions even kilometers. I don't think I will be going to such lengths, but that sure is enough to wire up a complete appartment or even house.

Another advantage of this concept is that I can daisy-chain multiple receivers to this bus, so that a single cable should be enough to wire up a whole lighting system.

This is very close to a DMX system already, however I think I will stick with the way it works now since I'm not sure wether the Raspberry Pi is capable of producing the necessary signal timing.

Some details.

Since the MAX3485 (a 3.3V compatible bus chip) was only available in an SMD package, I had to come up with a little testing shield in eagle:


This board is a mere transmitter due to the fact that the MAX3485 is designed for half-duplex mode. Switching between sending and receiving however would require an electronic signal that the Pi is (at least to my knowledge) unable to produce. I thought about wiring up a GPIO port, but this is purportedly too slow. Writing back to the Pi however is not really a requirement for my purpose, so I simply pulled the DE pin high, which means that this shield is only capable of transmitting data.

For the Arduino side, i wired everything onto a breadboard for now:


This is basically the same circuit, except that I used a MAX485 (the 5V equivalent) and pulled DE and RE low to put it into permanent receiving mode.

Next steps: I'm currently trying to figure out a protocol that will allow me to address multiple receivers on a single bus, without introducing too much of a delay. I'll post my results as soon as I worked something out.

No comments:

Post a Comment