Microcontroller Driven Flashlight


Picaxe Ultimate Flashlight

(click images for better view)

After buying a few picaxe-08m chips for about $3.50 each, my first project was bound to involve blinking lights and sound. I called this the ultimate flashlight because it's complete overkill. What flashlight needs a piezo or a programming header? Anyway, with a piezo, white LED, button, and LDR, I programmed it to do some neat (but completely unnecessary) tricks:

  • Mode 1 - off - light fades in and fades out every 30 seconds to let you know its there
  • Mode 2 - on - light is on, auto-shutoff occurs after about 10 minutes
  • Mode 3 - slow strobe - lets you feel like you're watching an old-time movie
  • Mode 4 - breathing - light fades in and out like a heartbeat, after every 6 beats the piezo makes a breath-like sound
  • Mode 5 - light-dependent tones - the piezo plays tones which are proportional to the light it senses
  • Mode 6 - annoy your buddy (aka, mind-molester) - the flashlight will beep infrequently when it is dark, silent when the lights are on

I put the whole thing in a project box. No doubt the assembly could be better; the batteries should probably mount inside the box. With a bit of time, it can learn some new tricks. Reprogramming is easily done via the 3 pin header.

(click to enlarge)

Parts count:

  • 1 Picaxe 08M microcontroller
  • 5 resistors
  • 1 piezo speaker
  • 1 white LED
  • 1 light dependent resister
  • 1 pushbutton microswitch
  • 1 3-pin programming header
  • misc wire, project case, a piecce of protoboard, a battery holder

My schematic shown above and the accompanying code is here. Even with the unnecessary routines, the flashlight works just fine as a plain white LED light. And the current drain is extremely low.

This code is explicitly released under the GPL. And this page is licensed under a Creative Commons Attribution 2.5 License.

Write me if you find this project useful. Link to this page if it is relevant..

Playing with electronics may adversely affect your social life if you aren't already married. This project is provided without any warranty.

Read or write a comment on the hardware projects

Back to Picaxe Projects