Showing posts with label MAX485. Show all posts
Showing posts with label MAX485. Show all posts

Friday, January 30, 2015

The DMX Experience (Part 4 - new design)

I've spent the past few days designing a new PCB for the USB DMX interface. It's been an interesting experience working with Eagle again after some time, but after a few iterations and improvements I believe that I have found a pretty good design that fits all the hardware functions onto a rather compact form factor.

Current DMX board design

I've used A and B Series Neutrik XLR connectors that take up very little space, and I also managed to introduce galvanic isolation into the design (however I am not really sure whether or not the physical component spacing is sufficient to deflect an actual surge).

As you can see, the board incorporates an ICSP programming header; I included this for emergency use. The ATMega32u4 comes preprogrammed with a bootloader that allows flashing the firmware directly over USB. But since I don't have any experience with the process, I wanted to make sure that I can at least still test the rest of the circuit if problems come up.

Right now I'm waiting for all the parts to be delivered, so I can confirm the sizes of some of the components I had to build from scratch (are those optocouplers really that huge?).


Size testing the components.

Looks good, huh? If everything works out alright, I might finish this within the next week. Stay tuned!

Monday, September 9, 2013

Taking the bus (Part 3): The controller

You know the day is going to be good when the mailman rings at the door during breakfast time. Well, apart from the breakfast obviously. In my case, I was about to receive a box of fresh new and exciting components to build awesome stuff with:

Bunch of components
Among them was the ATMEGA328P microcontrollers I was eagerly waiting for to be able to build the controller module from my previous post. I already prepared the PCB (my first double-sided one, with lots of vias), meaning that I could start with all the SMD components right away:

Pilight controller board, partially assembled
After making sure that there were no shorts or dead solder joints on the board I was ready to add the headers and program the microcontroller:

Finished controller board

Port illustration
Size comparison: Full-size Arduino, Pilight controller, Arduino Mini
Programming with ArduinoISP
The programming step was a little troublesome, because I wired the cable to connect the controller to the Arduino incorrectly, meaning that my controller was missing ground and in constant reset state. Of course the cable was the last part I checked... However, after fixing it programming went fine.

After that, I hooked the board to the WS2801 LED pixel strand only to find out that i switched data & clock on the SPI port. Oh well. Luckily, I could make it work with a corresponding cable:

Controller in place
I previously named this the "Pilight universal controller" because I designed it to be able to drive all the various pilight devices - and so I needed to try the I2C port, too:

Pilight controller driving a PCA9685 PWM board
I'm very glad it all worked out so nicely. This first controller prototype will now resume its work on the pixel strand, and I am back to the drawing board to integrate the same microcontroller circuit into the LED dimmer board.

Update: Here's another short video of the controller in action. Enjoy :)


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.