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.

reasonably simple led circuit.... I think

Status
Not open for further replies.

Macka

New Member
I want to make a circuit with 6 led's, when a button is pressed it will randomly choose one led to turn on. the led needs to stay lit for 2 seconds then turn off.

has anyone got any ideas?

ps i want to avoid using IC's
 
well, im kind of a n00b when it comes to electronics, i know basics, but not enough to design a circuit.

If i absolutely have to use ic's then i will, but i would like to avoid it.
 
To complicate things even further?, the easiest solution is to use a PIC, this would make your project as electronically simple as possible (one chip, the leds, a few resistors, and one capacitor) - at the expense of writing the software for it!.

To do it in hardware is going to require many more complications, and almost certainly multiple chips?.
 
a solution not using pics

ok this wouldnt be proper randdom, but then again its fairly hard to get 'real' random.

use a very fast A stable, say a 555 clocking at say 1MHz, this is used as the clock pulse for a counter.
with the counter lint the 7th output pin to reset.
use a switch to trigger a 2 second monostable. the monostable when triggerd will stop the 555 astable by holding it high.

the display will be a set of 6 flashing leds, if you get the astable fast enough they'll all look as if there fully on. when you press the button the monostable will stop the the sequence at a praticaly random position. the only problem being when its reseting you wont get any leds lit this will be 1/7 times aprox.

also it will have a relativly high power consuption, but nothing to bad.

its a simple way of doing it, would work better if you could find a counter chip that has a display enable pin, so you can turn the display off while its flashing.
 
As I understand it, there's an easy way around the problem whereby 1/7 times no LEDs would be lit. All you would need to do is have an output LED for the 0 count. Then, if you happened to press the stop button while the counter was at 0, you'd still have an LED lit and this would be a completely valid "random" selection. Still, we're talking about a project here which would require some basic understanding of digital electronics before it could be properly designed. Not too difficult though.

Brian
 
i want to avoid using IC's
The only way I am with you on avoiding IC's is if you are exceeding 25V. and even that, I wouldn't even make a circuit because anything over 12V IMO is ridiculous with the exception of turning on large motors.


I want to make a circuit with 6 led's, when a button is pressed it will randomly choose one led to turn on.
the led needs to stay lit for 2 seconds then turn off.
So when do you want the 2 second timer to start, when you release the button, or as soon as you touch the button, or only while the button is pushed? Your answer to this question will determine some of the IC's to use.

As for truly random, I doubt you will get an answer, but you can do some sort of randomness as follows.

When the button is pressed, a 4017 counter is continuously going through all 6 LED's until a clock feeding the counter stops. If the clock is at the right frequency, you just might get a random number each time.
 
The only way I am with you on avoiding IC's is if you are exceeding 25V. and even that, I wouldn't even make a circuit because anything over 12V IMO is ridiculous with the exception of turning on large motors.

I want to avoid IC's because I dont understand whats going on inside the chip, but with components i can follow the tracks and try to understand how it all works.


So when do you want the 2 second timer to start, when you release the button, or as soon as you touch the button, or only while the button is pushed? Your answer to this question will determine some of the IC's to use.

I want it so the 2 seconds starts once the LED is lit.
Button pressed
random LED chosen, led lit, 2 seconds starts
End of 2 seconds, LED turns off

As for truly random, I doubt you will get an answer, but you can do some sort of randomness as follows.

I do computer programming so i already know anything electronical cant be truly random, but i want to get it reasonably close


When the button is pressed, a 4017 counter is continuously going through all 6 LED's until a clock feeding the counter stops. If the clock is at the right frequency, you just might get a random number each time.

That sound like an good idea, but do the leds light up when they are being cycled through?

thankyou
 
The LEDs will glow at about one sixth of their normal brightness since each LED is being switched on for one sixth of the cycle.

You will have to connect the first LED to output 0, second LED to output 1 etc. and connect output 6 to the reset pin so once it steps to output 6 the counter is reset back to 0. You will need a resistor in series with the LEDs to limit the current to a safe level.

The oscillator and 2 sec timer could be done using a 4093 Quad Schmitt Trigger NAND package.

Len
 
When u buy an IC does it come with a diagram labelling each pin or do u "just have to know"?

if so could someone please put up a diagram
 
There are many internet sites that provide IC data sheets.

www.alldatasheet.com

If you are searching for say the 4017, type the number in and select the appropriate category - "starts with" or "included" so select "included".

Searching on 4017 only will also find ICs such as the 40174, etc. So you need to look for the 4017.

If you know more of the type number include it to narrow the search. In this case, try CD4017B.

Len
 
andrew12345678 said:
When u buy an IC does it come with a diagram labelling each pin or do u "just have to know"?

Each IC purchased will have a number visible on top of it. Do a search on the internet for the number and you should be able to find a datasheet for it which explains how the IC works, and what each pin represents.

For most digital IC's, Ground is the lower right pin, and VCC (or +5V) is the top-left pin. Each IC will have one short, uneven side. The side usually has 1/2 a circle carved out of it. when this side is facing left, the chip is then turned the right way. Pin 1 starts at the bottom left and goes to the bottom right, then from the top right to the top left.
 
Is this right?

**broken link removed**

for some reason the picture isnt showing, butif u go to th url it will show the picture.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top