November 24, 2011


Arduino Candle

This was supposed to be a halloween project for the pumpkin. I had the candle part that would dim when someone walked by the Passive InfraRed sensor, followed by green eyes fading up, blinking, then fading off and the candle fading back up. That was the plan but it turns out I didn't have the last minute alien face pumpkin carving skills so I just went with a standard government issue pumpkin face. I abandoned the fading, blinking eyes and PIR sensor and just used the candle. No dimming, just LED candle goodness without the black, scorched pumpkin ceiling that a real candle leaves. Maybe next year I'll practice the pumpkin carving earlier in October.

I'm just going to show the candle part for now. It can be used any time of the year, just find a nice cover or diffuser for it and you have some nice digital flame.

Here's how the candle looks:


This project uses just 4 PWM outputs from the Arduino, each one going to an LED. For this one I used two orange and two yellow LEDs to simulate the flame. (I wonder how it would look using different colour LEDs.) The PWM outputs are each randomized for intensity and for time. This gives a nice candle-esque flicker.

I've left this project on the full Arduino board. So far I've only used it in pumpkins so it hasn't been worth the effort to make up it's own circuit board. Maybe the wife will want to use it and I'll end up doing the circuit board, but for now I'll just drop the program on the Arduino if I need a fake candle.

Here's a circuit diagram for just the candle effect.

Here's a circuit diagram if you want the PIR sensor and eyes with the candle. This was the original project.

I have the code for the candle with the PIR sensor and eyes here. If you just want the candle effect, simply leave the PIR sensor and eyes LEDs out of the circuit and/or modify the code by removing the "void gloweyes" loop.


Link to Double Blog Facebook PageComment here

Top Canadian Blogs - Top Blogs

rss feed

Back to Top


October 15, 2011


YARGBLamp (Yet Another RGB Lamp)

Finally a project here on the Messy Bench. The YARGBLamp.

It seems that people who get into microcontrollers often like playing with the blinky, coloured goodness that are LEDs. I know I do. It also seems that a lot of people build some kind of colour shifting RGB lamp, hence "Yet Another RGB Lamp" (that's Red, Green, Blue. These three colours of LED light combine to make up all of the colours of the rainbow, just like on your TV or monitor). This particular lamp has a button to switch back and forth between colour and white light. That's one thing I haven't seen on these RGB lamps and I think it adds usefullness to this project.

The microcontroller of choice here is the Atmel AtMega 328p with the Arduino bootloader. This was prototyped on the Arduino development board, then the microcontroller chip was removed and placed on the perfboard along with a 16MHz resonator, a bypass cap, and the required wires needed to replicate the full Arduino board but without the size and expense of using the actual Arduino.

I used a 5 volt linear voltage regulator on board (your basic 7805) so I wouldn't be limited to using just one particular power supply. I now wish I had used a switching voltage regulator because with a 12v supply the 7805 had to dissipate those extra 7 volts, and at up to almost 1 amp it was getting pretty hot. I have roughly one bazillion wall wart power supplies around the house but do you think one of those supplied 7v to 9v at 1 amp? Of course not. I ended up buying one of those wall warts that switch between a range of voltages so guess what... I end up having to use one particular power supply. (The 7.5v setting keeps things as cool as the other side of the pillow, BTW.) I'd like to switch out the 7805 for a switching regulator, but you know how it goes. It works now so I'll probably never get back to it.

Circuit board.

OK, you there with your hand up. I know what you're going to ask and yes, the 328p is a lot of chip for this little project. I do have the chip burner and stuff to burn the smaller (and less expensive) Atmel AVR microcontrollers, I just need to take the time to learn and practice programming them.

As you'll see in the video below, the YARGBLamp does smooth, random colour shifting and each colour channel does so over random amounts of time. Everything is programmed to randomize on each pass through the program loop so you never see the same thing twice with this lamp. It looks a little dark and flickery in the video but that's just a function of filming it. I filmed it a bit underexposed so the colours wouldn't wash out, and the corresponding shutter speed makes it look a little flickery. In real life it's bright enough to light up a room enough to see by but not so bright that it's garish. It makes a nice mood lamp. There's no flicker either.

The lamp itself, by the way, is an Ikea Fado table lamp. It's a white glass globe about 10" in diameter. I removed the cord and bulb holder to add my own RGB PowerLED (Digikey part no. 67-2074-ND) and 4 conductor wiring. The LED is nicely diffused, and the white globe further makes for a nice, even light with no hotspots. I am quite pleased with the look of it.

LED mounted on the base.

Here's the circuit diagram.

And here's the Arduino code.

This was one of my first projects when I got my Arduino but I never really took it past the breadboard stage (like all of the things I've done so far). Now that I have this blog that I need to keep updated I'll be taking things to completion which is a good thing. It will make me finish off projects instead of just leaving them at the proof of concept stage. We all win.

I'll see you soon here with the next project. I have something for Halloween that I can post.


Link to Double Blog Facebook PageComment here

Top Canadian Blogs - Top Blogs

rss feed

Back to Top


July 28, 2011


Around the Messy Bench

Oh, hi. Come on in. Grab yourself a Redbull or a Jolt Cola and sit down. This place is totally nerd and techno-geek friendly. (Although I'm not a gamer, so your impassioned talk of the Play360 Wii-Station is lost on me.)

I guess a good place to start this blog would be my equipment list. It'll take some digging through the mess, but here goes:

I also have a TV for watching NASCAR (go Kasey Kahne), and a DVD player to catch up on the movies that people are talking about.

I hope to keep a steady pace with updating this thing. Time to do my own projects is a rare commodity, and sometimes often when I get the time I end up wasting it so I can laze about and vegetate. I hope to suppliment by showing cool things I see on the 'Webs, and if you have a project going I'll be happy to make you the star for a post or two.

See you soon. I have work to do.


Link to Double Blog Facebook PageComment here

Top Canadian Blogs - Top Blogs

rss feed

Back to Top