Close

​In which I can finally get to the code

A project log for Interactive Color LED grid with IR touch sensing

My wife wanted some hardware to program with processing. I wanted to design some PCBs

engunneerengunneer 06/30/2016 at 01:040 Comments

(November 2015)

Or not.

I wanted to get each panel tested individually before ganging them together. For this, I used an Arduino Leonardo because I had one handy. I wrote the basic functionality without any of the serial interface, and a simple test mode that just lights up any LED with touch data. This leaves the serial port free for debugging, and I can focus on the hardware debugging.

Since it's just for a single panel, I used Adafruit's NeoPixel library for the WS2812Bs and the Arduino's native ShiftIn for the shift registers. The hardware setup is not dissimilar to this sparkfun tutorial, though that was not the code I followed.

After some testing, I discovered that the shift registers appeared to be working (I could short high some of the spare bits at the end of the chain), but all the touch sensors always returned 0, even though the comparators should all have been putting out a 1... To the datasheet! Now look at the schematic and guess what i missed.

[screenshot is on my other computer]

Yes, the LM339 is open collector. No, I did not pull up the outputs in any way. No, I don't have enough parts (or project budget) to order a third rev of PCBs.

The only remaining answer is a great british/australian word for wedging more components into a design: bodging! The space between two LM339s just happens to be exactly the length of two 0603 resistors end to end, and the pin adjacent on one side also happens to be Vcc. The resistors on edge also happen to be the same height as the TSSOP chips, and the thickness is just a hair under the TSSOP pitch.

225 bodge resistors later and strands pulled from the thinnest stranded wire I had means the hardware is complete yet again. This time, the code all worked, and the boards could be individually debugged and fully tested.

Discussions