Xmas RGB LED PIC Toy Gift Project

I wanted to make something special for people I know to give as Xmas gifts this year, so I went into engineering mode and came up with something fairly simple, but still fun. Admittedly, this isn’t for everyone, but I don’t care; if they can’t at least pretend to appreciate my hard work and creativity, then they just won’t get the cooler stuff I’ll make next year! That didn’t happen with anyone, fortunately; they all at least seemed vaguely interested. My sister didn’t like the blinking, though, so she gave hers to my mom. Everything was purchased through Mouser.


Close-up of one of the devices (1.25″)x(2.125″).

Essentially, it is a small PCB with two CR2032 batteries (soldered in, because battery sockets seem to cost twice as much as the batteries themselves!), a 5[V] regulator, a pic16f616 microcontroller, an RGB LED, two phototransistors, and some passive components. The PIC is programmed in C (compiled with SDCC, and programmed via ICSP with PicProm), and designed to cycle the RGB colorspace at a cycle rate and PWM frequency which varies depending on input from the two phototransistors.It has many uses! Annoy strangers! Cause epileptic seizures! Run down the batteries and ask me to replace them! Put them in your storage/trash and hope I never ask about them again! It doesn’t matter!


Schematic (created with Eagle 5.11 Light).


PCB Layout (created with Eagle 5.11 Light).


One possible use. Music by The Black Dog. Note: The moving lines are just an artifact of the image sensor on my camera playing catch up with the PWM drive of the LEDs; the real devices do not cause scrolling lines to occur in real world use,

On the long, ranting personal experience and electronics construction details side, this was a very fun and time-crunched project to make. I came up with the idea of making something using a surface mount microcontroller and an onboard battery about one week before Xmas; I had the parts list ready (with a rough idea of how to combine it all) on Sunday and made the order with Mouser on Monday afternoon. Kim ended up paying for them, because I am broke until school starts again; she also helped me with some testing and conceptual feedback, so these were partly her gifts to my family as well. I am very fortunate that Mouser is located in Texas, because I not only get to pay taxes (wait, what?), but Ground shipping only takes two days! I took those two days and used them to make sure my programming equipment was up to date and could work; I was able to get some pic16f54 devices programmed, but it turns out the pic16f616 line is a newer breed that wouldn’t work with my programmer (the passive one on the PicProm website ended up working just fine on my breadboard). I used a 0.300″ SOIC->DIP adapter for the chips, which are 0.150″ wide, so it took some work to get them on there with wire extensions. From there, I just tried various things based on the datasheet and some examples of using SDCC available around the web. I was rushing, but I still didn’t have a finalized design until Thursday evening.


SOIC Breakout board used for prototyping during the design process.

That’s when the real fun began! I’ve been using the well-known laser toner transfer method for a while for making PCBs, as well as a Cupric Chloride etchant (HCl and Hydrogen Peroxide as main ingredients), but I need something better for surface mount work (especially since I will need to use what I learn for my Senior Design project soon; I have some (2mm)x(2mm) ICs just waiting around to be used! The photoresistive process has been backed as allowing much better resolution, little to no distortion, and easily reproducible results. Fortunately, Mouser sells a product by MG Chemicals which is a photosensitive film that can be applied to bare copper (which can be found cheap online at Parts Express, btw). I wasted a 12″x11″ piece of the film because the instructions are flawed, however; they claim it turns from “green to blue” when exposed to UV light, but, in fact, it is BLUE ALREADY! It changes to a darker blue when exposed, as I found out after further testing and concluding that just leaving it outside for 10 minutes or so (even on a thoroughly cloudy day) is enough UV exposure to do the job. None of my compact fluorescent bulbs did the job, probably because they have a UV filter on the inside of the glass tube.

I don’t actually care enough to tell MG Chemicals that their instructions for the 416DFR-5 product are faulty and that the film is never green at any point in the process. I hope someone else trying out this dry film product finds this page and discovers this fact before wasting a sheet or worrying that their new roll of film has already been exposed and tosses it out!

I made a big (7.5″)x(8.5″) board of 24 of the devices, and I had originally intended to use a silver solder paste and a toaster oven to reflow solder everything at once, but the boards ended up coming out inconsistent with a few being too blurry (I need to invest in some plates of thick glass) and a most having missing traces (I need to improve my technique for applying the film to the boards (done in the dark with red an yellow LED lighting, btw!). Thus, I ended up hand-soldering all of them, producing a total of 12 completed devices after staying awake for 24 hours straight, and we left for Houston an hour later. I finished the four I used for the above picture/video today, and the other 8 PCBs are far too messed up to salvage. +163XP and (2x) Level UP!

Leave a Reply

Your email address will not be published. Required fields are marked *