Wednesday, January 29, 2014

First proto PCB

I designed the first prototype brain PCB for my groovebox using a software called Eagle. The PCB wasn't pretty, but it was good enough to fill its short term job before it would be replaced with the next iteration. You can check the PCB design in the picture on the right.

Once the PCB design looked functional enough, I sent the design to Seeed Studio Bazaar so they would make me a small batch of these circuit boards. It didn't cost many tens of euros to get a batch of 10 two sided PCBs done and shipped back to me. Awesome!

The second picture on the right shows the PCB. The two larger white squares at the upper left corner are the MIDI input and output. The white square in the middle is the place where the microcontroller would go. The white line at the bottom is a row of 16 LEDs, which will be used to test and design the groovebox's step LEDs.

The lowest picture shows the same board with the components attached.

So I soldered most of the needed components on the board and powered it up. No magic smoke, so everything was likely to be fine. Then I ran the same software I had written for the previous board. Everything seemed to work just fine. Then I started turning on more of the LEDs and noticed that after around 8 or 9 of them lighting up, they all went crazy. Some already lit up ones turned off and some which were off turned on etc. Seriously WTF?!?

I spent two evening cursing and debugging my software. Eventually I decided that the bug wasn't in the software, but in the hardware.

So what was the problem then? I used a 5V regulator to feed both the LEDs and the MIDI circuitry and 3.3V to feed the microcontroller. Everything would have been just fine, but the 595 chips (serial to parallel data converter) controlling the LEDs assumed that the digital data sent to it would be of much higher voltage. This is because the assumed input voltage of the incoming data is relative to the operating voltage I use to actually power up the chip. So the 595 chip assumed incoming data of around 3.0-4.0 volts, but the incoming signal barely touched the 3.0 volts. This meant that the more LEDs I turned on, the lower the voltage became (since this thing ate up current). After turning on around 8 or 9 LEDs some of the incoming bits didn't get through to the 595 and the lights went wild on the board.

This sucked, so it was time to figure out how to fix this issue without having to reorder a new batch of PCBs all the way from China. If I changed the 5V regulator to a 3.3V one, then the signal sent from the microcontroller into the 595s would be in the right operating level and the LEDs would work just fine. This also meant that the MIDI circuit wouldn't get high enough voltage. So I had to choose which was more important: the LEDs or the MIDI I/O. I decided to go with the LEDs so I can get the UI design work started. Also if I really needed the MIDI right now, I could always connect the previous MIDI proto board to the pins on top of this new board.

After 10 minutes of solder work I had replaced the 5V regulator with a 3.3V one. Quick power up and hey presto! The LEDs worked exactly as they should!

Sometimes you have to sacrifice one thing to gain another.

No comments:

Post a Comment