First order of business was to work out roughly a maximum size for the pcb so I knew what I had to work with. After breaking out the ruler, I figured that I had a 40 x 30 mm rectangle or a 50 x 40 mm oval-ish shape, plenty of spacefor everything if I made a double sided board and use SMT components.
Next I had to work out what components I was going to use. I had already decided on using the WS2812 rgb leds used in adafruit’s Neopixel products. They are nice and bright, require only one pin to control multiple leds and there are existing code libraries I can use for testing. As for the other components, I was slightly torn between a more powerful microcontroller with plenty of i/o pins and something simpler. I was considering trying to add a wireless transceiver to the project at a later date and so picked an Atmel 328p (although I changed my mind later). It is way over-powered for the task but I am very familiar with it and I felt that it provided more options for expanding the project later. With the microcontroller and leds picked the only components left was a 4.7K pull-up resistor for the reset line, a 16MHz crystal with two 22pF load capacitors and a 6 pin header for my ICSP programmer.
I chose to use 4 leds in an effort to ensure that the glowing effect worked well. Given how bright they are, I could have gotten away with fewer. I didn’t have any surface mount components to hand so I used through hole resistors, capacitors and crystal. I opted for a pretty spacious board layout as this was the first time I’d tried soldering a SMT microcontroller and as it was only a proof of concept it didn’t really need to be as small as possible. I did try my hand at a double sided board but gave up trying to get the alignment right on the pcb miller and just used small wires to connect the vias.
My experience soldering the SMT components was rather good. With help from a pair of tweezers and some flux I was able to pin the components down and tack a few legs in place. Once tacked into place I could go around the other pins and do a semi-decent solder joint before returning to the tacked down pins. I’d quite like to try using solder paste and a stencil with hot air or a reflow oven at some point, but for now this technique is ok. The through hole components were actually more of a pain as the holes in the board aren’t plated and I wanted to keep most of the components on one side of the board.
Rather surprisingly, when it came to testing the board, it worked first time. I used avrdude and my usbtinyisp to flash the fuses. The only thing that needed to be changed in the fuses was to specify a 8+MHz external crystal oscillator. I went with an lfuse value of 0xDE and left hfuse and efuse at their defaults. A really handy site for working out fuse values for AVR devices is eleccelerator.com, although if you have Atmel Studio installed you can find the same functionality there. I loaded up one of the demos from adafruit’s Neopixel library, set the number of leds to 4 and uploaded the code.
As you can see the leds were really bright, which was brilliant (haha) as they need to illuminate the fairly thick limpet shell. You can see in the video that the limpet glows nicely but also that colors blend fairly well. I was quite pleased with the result, although there were a few things I wanted to do in the next version:
- This version of the board was powered externally, so a battery and voltage regulator need to be added.
- Replace the Atmega 328p with an Attiny 85 as I decided that I’m going to keep it simple. The Attiny 85 still has a fair bit of RAM/PROGMEM that I can leverage at a later date or it can be replaced with a lower spec Attiny to lower the cost.
- Move to surface mount components so I can make the pcb fit into a limpet shell.
- Make a proper double sided board.
- Remove the bulky programming header.
- Add filter caps to each led.