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.

sequence two leds

Status
Not open for further replies.

prprog

Member
No idea on how to google for a circuit that can do this: I will have a piezo sensor/disk that when hit softly will turn led1 and then led2 with a delay of say 5ms. On the other hand if I hit the piezo sensor harder it will turn led1 and led2 with a delay of 1ms. In summary , led1 turn inmediatly in both cases but led2 will turn on with a delay depending on how hard the piezo sensor is hit. Both led turn off when led2 is lid for 1ms (or less). Please suggest a starting point. Thanks.
 
Your chances of getting an answer are much better if you tell what you are trying to do. Not just when to blink the leds but what they are for. Without knowing they why we often end up playing 20 questions. There is a lot of talent here. Someone may come up with a better but different idea then you have on how to do whatever it is you want to do.

You could setup a few 555s, a comparator or two and some logic gates to do this. Maybe an opamp or some other signal conditioning going into the comparator. Not my sort of project maybe someone can help you with that.

If you know how to program it would be easier to do with a uC, this is not real code but it should help you see what is happening.
Code:
do_forever
{
    howHard = wait_for_strike();  // howHard gets value for adc

    // set second delay based on howHard
    delayTime = 1;
    if (howHard is soft) then delayTime = 5

    // sequence LEDs
    led1_on 
    delayMs(delayTime) 
    led2_on
    delayMs(1)
    // go back to start of loop and read howHard again
}
 
Last edited:
sequence to leds

Thanks for the reply. The purpose is to eventually turn on 2 relays or analog switch with the same behaviour as the led. I used the example of the led because it was easier to me to explain. The idea is to be able to turn on the first relay inmediatly when the piezo sensor is hit, if the sensor is hit softly the second relay will be turn on at 5milliseconds, if it is hit harder the second relaywill be turn on at 1milliseconds. The turn on time is just as an example. Can this be done without a microcomputer, just by using transistors-IC's or other components? Thanks a lot.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top