Week 13 — Output devices

1. Intro

For this week assignment I fabricated a 5x4 led array using the Charlieplexing technique, that allows to use just 5 pins to control 20 leds. This method take advantage of the diodes, that allows the current to flow just in one direction; and the tri-state logic of a microcontroller pin, that can be set as "OUTPUT LOW", "OUTPUT HIGH", and "INPUT" (wich practically means that the pin is ignored). In this way you can control each led flowing the current in the right way through the led matrix, how many led you can control in relation with how many pins are you using can be easily calculate through this formula: leds=pin^2-pin.



2. The board

I was running out of time this week, so I just lasercutted the traces given in the fab academy repo.

Svg traces file
The board
Components



3. Lasercutting and soldering the board


After I've lasercutted it with the Fiber laser, I've soldered it. I couldn't find the voltage regulator, but after a while I've found a component with the same package without realizing that wasn't the right one, so I've – ingenuosly – soldered on the board.





4. Programming fail and debugging

As anticipated before, I've put an unknown component as voltage regulator, and in fact when I've tried to program it the terminal returned me an error. After a fast debugging session with Enrico I realized the mistake, so I desoldered the component and made a jumper in order to flow directly 5 volts to the circuit (cause we didn't have the voltage regulator with the same package in the lab).





5. Programming the led-array

Download the makefile and .c file

Solved the hardware problem the firmware – written in c – has been smoothly uploaded into the attiny through the single terminal command:

make -f hello.array.44.make program-usbtiny



I modified a bit the sketch in order to show letters. Looking at the code I got that you can turn on just one led at a time – I guess cause of the charlieplaxing technique – but thanks to the high speed frequency of the microcontroller you can bypass this issue and light up more leds at once cycling these more times with short delay.