Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Random LED Flasher

Status
Not open for further replies.

swies2

New Member
I am looking to build a 12vdc flasher. Would like to have high power LED's used. Any help would be great. Specifically, would like 1-10 flash, 5-10 seconds off, repeat. I need something that provides a "random" or at least "pseudo" random sequence. Unit will only be used for 30-60 seconds at a time. When it resets, it is acceptable to repeat the previous pattern. Not just looking to build one, I need 50-60 units. Any ideas on fabrication or where I could purchase would be great.
Thanks in advance.
swies2
 
Last edited:
Hi there,


This project could be done with a single microcontroller chip of the very low cost PIC variety. You design a random number generator using some registers and use the output to drive the LED. You could randomize the on time and then randomize the off time and that should do it. Since it is a high power LED you'll also need a transistor drive circuit, perhaps with one transistor and two resistors.
It could also be random between resets, repeat on power up.
 
Just what I was thinking but I am a novice. I was just over at PICAXE looking at the 08m micro and the programming of it. Any chance on a schematic of it?
 
No program...just the hardware. The circuit on the right is to program a PICAXE-08M and test the operation. The circuit on the left is about all that is needed for standalone operation. Since you didn't provide data on the LED(s), I made the assumption that the lamp was a 12V LED module (internal current limiting), and didn't spec a MOSFET for Q1.

Ken
 

Attachments

  • Picaxe08Random.gif
    Picaxe08Random.gif
    39.9 KB · Views: 730
Last edited:
A critical point...is this circuit going to be used in a motor vehicle? If so, because vehicles are an electrically hostile environment, protection circuity would need to be added.

kKen
 
Just what I was thinking but I am a novice. I was just over at PICAXE looking at the 08m micro and the programming of it. Any chance on a schematic of it?

Hi again,


Have you built any electronic projects yet ? Even just resistors or light bulbs or something?
 
Built lots of Circuits. Just not any using PIC. Not sure what is the best method of approach to this one.
 
No program...just the hardware. The circuit on the right is to program a PICAXE-08M and test the operation. The circuit on the left is about all that is needed for standalone operation. Since you didn't provide data on the LED(s), I made the assumption that the lamp was a 12V LED module (internal current limiting), and didn't spec a MOSFET for Q1.

Ken

Ken;
Thanks so much for the information. I do not know anything about the programming, what would that take? I assume the schem. on the left has a 08M that has been programmed. And as for the specs, 3 or 9 vdc operation (2x"AA" or 1x9v)
Thanks in advance
Sean
 
And as for the specs, 3 or 9 vdc operation (2x"AA" or 1x9v)

In your initial post you said you were building a "12V" flasher. ??? Getting all the spec's laid out before you start a design makes it a lot easier. A PICAXE will run on 3VDC directly, so the regulator circuit would not be needed, but you need one for 9VDC.

would like 1-10 flash, 5-10 seconds off, repeat.

How long is the LED on and how long off, in the Flash mode? Or you thinking it will flash 1 to 10 times (again how long on), and then 5 to 15 seconds between each flash?

Programming requires exact details. Now too difficult, but "the devil's in the details".

Ken
 
Sorry for the lack of good details. It is a project in the works. Timing and power are not as critical as the "random" flash sequencing. I have any number of power sources to use including 3,9,4.5,12,18, and 24 vdc. Off and On times for the led are at the 3-5 "ons" /second. Would like to have the program pick a random number 3-20 and flash that many times at the 3-5 per second rate and do this every 10-12 seconds or so. The off time between flashes would be the same as the on time at 3-5/sec. I hope this clears some things up. If there is anything else, please let me know as I want to go ahead with this soonest.
 
If you take the micro controller route using a picaxe there is no shortage of help out there including a pretty good and helpful picaxe forum.

I would suggest you and scroll down the page till you see:

AXE001 PICAXE Manual picaxe_manual1.pdf
AXE002 PICAXE Manual picaxe_manual1.pdf
AXE003 PICAXE Manual picaxe_manual1.pdf

Those three manuals cover all the chips pretty well with no shortage of code samples to get you going. Additionally here in the US Spark Fun Electronics is a good source. They sell starter kits for chips like the 08M including a software disk but the software can be downloaded free online. Additionally the programming circuit Ken posted can be built on a simple piece of perf board for literally several bucks. That or buy a starter kit from Spark fun for about $15 USD and throw in a few extra chips at about $3 each.

These forums also have a very good micro controller section.

A Google of PICAXE will bring up literally hundreds of hits also.

Ron
 
Be aware that one of the trickiest part of your project is implementing "random". My wife says "it's only complicated if you understand it". ;)

The PICAXE forum has had discussions, and code snippets, on ways to achieve better pseudo random outputs.

Do you mean that 3-5 per second is just a range in which you want a fixed flash rate, or is it to be a "random" changing selection?

Ken
 
Hi again,

Yes that method works very well, i've implemented that too and i get very nicely random numbers that way, and one bit can be used as the output for a single channel requirement like turning an LED on or off. If the output bandwidth is too high, perhaps a software implemented counter on the output to reduce it to a few seconds apart or something like that. Ultimately a longer shift register would work even better although you have to have some way to control the shortest and longest pulse widths. It sounds like this app needs a 1 to 10 ratio or something like that, so maybe a shorter register length would do it, as long as the randomness was still good.
I havent thought this all through yet though for the low bandwidth requirement.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top