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.

Timed Robot/Circuit - NEED A CIRCUIT TO TURN LED ON AND OFF AT SPECIFIC INTERVALS

Status
Not open for further replies.

zaidpirwani

New Member
Hi, I hope this question is in the right forum.

I am new to practical electronics, I am saying this as I have good theoretical knowledge but no practical experience.

I have to make a robot, I have assembled it. the goal is to run it in a desired path and switch on LEDs at specific places.

I am not using any kind of sensors and just want to turn the right motors at the right times.

For the sake of simplicity, I am testing with LEDs right now and if my circuit works then I will just change the LEDs with relays connected to motors, I can use both normal relays and latching relays (which only need a pulse to turn on or off).

Suppose I have 4 LEDs (L1, L2, L3 and L4) and they have to turn on and off like this.

1. Everything should remain off at first for about 10 seconds.
2. L1 should turn on for 10 seconds then turn off.
3. L2 should turn on for 5 seconds then turn off.
4. L1 should turn on for 25 second and then turn off.
5. L3 should turn on for 5 seconds then turn off.
6. L4 should turn on for 5 seconds and then turn off.
7. L1 should turn on for 20 seconds then turn off.
8. L4 should turn on for 5 seconds and then turn off.
9. L3 should turn on for 5 seconds then turn off.
10. L1 should turn on for 25 second and then turn off.
11. L3 should turn on for 5 seconds then turn off.
12. L4 should turn on for 5 seconds and then turn off.
13. THE END.



That's about it. I have tried using 555 Timers, in Monostable mode, but the problem is that 555 timers just turn on after trigger is pressed and then turn off after a while. But I need to turn on and then off at specific times.

I think a PIC, or BASIC STAMP II, or any other Microcontroller would work, someone also told me to use ATMEL 8051 but I do not know which one to use and more importantly how to use. I know a little bit Assembly Language and have sound knowledge of C language and BASIC.

Any help in this matter will be highly appreciated, as I have very less time to turn in the project I will be posting this same question on other forums also. Please guys help me as I have no idea where to start, I have been searching on the Internet for a week now and have not gotten anything. The goal is to get timing done. i don't care if there are 12 different timers for the job or if one microcontroller. Please people help me with this. or please guide me.

In my opinion, WHICH CAN BE WRONG, I just need to have a microcontroller, which would track time, we will have to write a program for that, (I think loops will do the trick OR is there anything else I can use, as I cannot get much information about timing through microcontrollers on the Internet) with 1 second accuracy and send pulses at specific times to specific pins to turn the relay on and off (as I had said earlier, I can use latching relays). No Input is required, only four output pins need to work so that for every one of the 12 functions defined above two pulses will be sent, one for on and one for off.

Again guys, I am very desperate and need help in this. Any help in this matter will be highly appreciated and I will be very grateful to you all.
 
Hi,

you can make use of a pulse with 1 sec interval together with 4017 counter to count 25 cycles ( you may need 3 counters) and reset at 26th, it start to give a logic high in the sequence of its out puts up to 25, you can use disired out puts, to latch and reset the LEDs.
example if you use 1st out put to "set" and 6th one for "reset" the interval would be 5sec. the same way you can wire for the rest of the LEDs. every LED needs a latching logic that can be done using 2 input NAND gates.

depends on your total time for once cycle of operation, i assumed its 25 sec, you can design it, since you have 5sec steps, you can use a high freq oscillator and deviders to get accurate 5sec pulses and then use it to drive 4017 counters.

i can futher draw you the circuit if you provide more information like a timing diagram. you can use very simple logic as i said to complate this project rather than a microprocessor.

Razeen
 
Last edited:
Could you please guide me, I mean circuit diagram or schematic would be nice, since I am a beginner I could not fully understand what you have posted, but I am currently looking up on google for 4017 counters.

Is my idea for the project wrong or not, it is in the last para of the first post, as I think that will be the simplest circuit, as I have no Input and only need 4 outputs.
 
As you can see in my post that I need to run the circuit for at least 115 seconds and I need a timer or a microcontroller which can send output to specific pins at specific time intervals for the relays to work.

Although it is important to mention here that the 115 second is a rough estimate, the real time can be as long as 150 or even 200 seconds. The maximum I can go is 240 seconds, but I tend to do it in 150 seconds as my robot is moving faster then I expected. 30 cm per second.
 
I would recommend a PICAXE 08M microcontroller. It's a Microchip PIC with a built-in BASIC interpreter. The 8-pin chip is cheap, about $3.50US. It has one dedicated input pin, one dedicated output pin and three pins that can be inputs or outputs. (for you: 1 input and 4 outputs) The BASIC program editor is free to download. Extensive manuals are also download-able. Programming hardware is a 3-wire serial cable and 2 resistors. The normal 4MHz clock is by an internal RC oscillator, that can be tweaked. Not as accurate as an external crystal, but from the sound of your requirements you are not looking at NIST Atomic Clock timing. ;)

Ken
 
Last edited:
Thank you very much for your replies (Thanks to all), I am currently using Yenka (From Crocodile technologies) it can be used to program real PICs using flowcharts and it is quite easy, but it does not let me see the actual code, which is by the way required for my project, however I have looked at the PICAXE 08M and I am thinking of using it in my project, but can you please guide me a little more and can you please give me some good links on this microcontroller, so I can make the programmer and then complete my project. On other note: I do not need exact timing but at least 1 second accuracy is needed.

Thanks again, for you timely response, hoping to hear back from you.
 
This is a very easy microcontroller project. Just pick any microcontroller you want, or that you could most easily program. You could use choose an 8051 by NXP. That way all you need is a MAX232 to program it over UART using a program called Flash Magic.
All you need is a delay routine that you pass the amount of seconds and call it after lighting a LED.
 
Thank you very much for your replies (Thanks to all), I am currently using Yenka (From Crocodile technologies) it can be used to program real PICs using flowcharts and it is quite easy, but it does not let me see the actual code, which is by the way required for my project, however I have looked at the PICAXE 08M and I am thinking of using it in my project, but can you please guide me a little more and can you please give me some good links on this microcontroller, so I can make the programmer and then complete my project. On other note: I do not need exact timing but at least 1 second accuracy is needed.

Thanks again, for you timely response, hoping to hear back from you.

PICAXE Forum - Powered by vBulletin
The top of the Forum page has links to company's web site, manuals, the free editing/programming software, and chips' data sheets. The editor includes a flow-chart program, but is mostly intended for new (Jr High/High School) programmers learning basic program structure. The people on the forum are very, very helpful...and civil.

The one second accuracy is easily achievable within your time periods.

The "programmer" is just a 3-wire (Tx-Rx-Gnd) cable from your (PC) computer's serial port to two resistors on the chip's serial input pin...nothing more. OK, most newer computers don't have a serial port, so you might need a USB to serial converter cable also. (I've also heard the parallel printer ports are becoming a thing of the past. :( )

Ken
 
i will shortly post you a diagram to do it without a micro controller, you can use it if you couldnt do it with a controller as sugested by others. it will have some flexibility to change the timings by simple changes in soldering.

razeen
 
i will shortly post you a diagram to do it without a micro controller, you can use it if you couldnt do it with a controller as sugested by others. it will have some flexibility to change the timings by simple changes in soldering.

razeen

Oh!, that would be great, and thanks for your offer, I am looking forward to see what you can teach me. I would have replied earlier, but my Internet connection was down yesterday and I could not post a reply here.

Also now, I am thinking of making a Microcontroller project and also your so that if at the last moment any timing changes I will just change the circuits, thanks again, and also many thanks to colin mac and KMoffett as I am also building one with micro controllers.

To KMoffett, I will look at the forum and thanks again, you guys don't know how much you have helped me in this, I will post here again if I get stuck, or if I complete my project.
 
just to confirm, at a certain instant, only one LED is ON? i mean there is no overlap? also when one is turned OFF the same instant other one will be ON ( no delay?)except at the begining? i have almost sketched the circuit, wish to draw it and post it soon.
 
Last edited:
circuit for the project

am attaching you the circuit of the timer, at the final stage i didnt complete for LED 3&4 not to make it so difficult for you to read. you can easily know how it should come and you can configure even more out puts as you wish. also you can make it for more time by simple addition of ICs.

the circuit can be discussed as three parts.
1) time base for 5 sec out puts- gives one pulse in every 5 sec
2) a series of decade counters, that will make logic high in its out puts one by one when the pulse is received. out-1 to out-36 in this case ( total maximum time- 36x5=180 sec)
3) set re-set latch for LED drive circuit with 8 input for set and reset, can be varied as per requirement.

i hope you can understand how it works, if you assemble it as appears it would work great.
for any information about the ICs used you can access the following site and search for the datasheet. all of them are mostly available, or even you can use similar types.

Datasheet catalog for integrated circuits, diodes, triacs, and other semiconductors, view

any problem or question feel free to send.

best of luck

razeen
 

Attachments

  • TIMING CCT.JPG
    TIMING CCT.JPG
    102.4 KB · Views: 1,060
OK, I have to throw in the alternative. One 8-pin DIP vs sixteen 14- and 16-pin DIPs. This is why I started refreshing my 30 year old BASIC programming skills, and using these microcontrollers.

;)

Ken
 

Attachments

  • Picaxe08Min4LED.gif
    Picaxe08Min4LED.gif
    20.9 KB · Views: 756
Last edited:
ken,

what you posted would be a good altanative to him, he may need repeated cycles once it is started. hope that also could be programmed.

razeen
 
Thanks to all

THANK YOU GUYS, Many thanks to all, I will try both the circuits and will soon post the finished project, here.

Again many many many thanks to all who helped, I will post back if I get stuck (again).
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top