Author Options:

How can I create a system where the LED flickers when the person touches it (Kinda like lightning effect) Answered

I'm doing a project where I'm trying to mimic raining effects and I'm wondering how can I create a lightning effect by touch sensor. I need it to be small and light cause I'm trying to make it portable. I'm kinda new to electronics and so far have only built a basic LED circuit. Any help please?


The forums are retiring in 2021 and are now closed for new topics and comments.

4 years ago

You don't say where you are but in most parts of the world you can buy the Picaxe micro controller


all of the family from the 08 to the biggest 40 support touch for a touch sensitive button and have output ports to drive an LED.

The programming is fairly easy and the manuals tell you all you need to know with a very friendly support forum if you get stuck. (see web site above)

Hint playing music to the LED via the tune command will make it flicker like a candle flame.



Answer 4 years ago

I'd second that, PICAXE is the way to go, it's cheap and simple, even for beginners.

Good tip from Rick as well regarding playing music to the LED to create a flicker, apparently playing the Silent Night tune works quite well. In case you're confused by the talk of playing tunes to an LED with PICAXE, Google it and it will make sense.

For another way to create a really authentic candle flicker you can use a couple of LED's with the code below, check out Step 4 of my cauldron Ible for more info:


symbol led_1_brightness = w0
symbol led_2_brightness = w1
symbol pausetime = b6
symbol spool = b7
symbol pause_mod = w2

led_1_brightness = 300
led_2_brightness = 500

pause_mod = time + 700
for spool = 1 to 8
random pausetime
random Led_1_brightness
random Led_2_brightness
let Led_1_brightness = Led_1_brightness // 351 + 50
let Led_2_brightness = Led_2_brightness // 300 + 50

pwmout c.0, 99, Led_1_brightness
pwmout c.2, 99, Led_2_brightness

let pause_mod = pause_mod // 21
let pausetime = pausetime // 15 + pause_mod

pause pausetime
goto main