Delay Circuit

Thread Starter

itqaanmuslim

Joined Aug 14, 2010
11
Good Day to all

i have one question here..
I have done my vibration sensor circuit

When vibration sensor is vibrate ,output (LED) will be ON immediately

the problem is i want to set up delay for my circuit...
which is I want LED goes high after vibration sensor is vibrate for 10 second..
i have working will the hardware where i have use NE555 timer ,counter and comparator to make a 10 second delay for my circuit but totally my circuit did not function...

so i have decide to use PIC16F877 to make a delay circuit (refer attachment)...
can somebody help me with the coding because i am new with PIC..
 

Attachments

Thread Starter

itqaanmuslim

Joined Aug 14, 2010
11
Basically, i am doing my project entitle epilepsy detector..which used the concept of vibration..during research , i found that a person with epilepsy history will be vibrate in time period of 7 to 15 second..so have used vibration sensor as a part of the system...so i need vibration sensor to vibrate for 10 second to confirm as epilepsy attack...please help me on PIC coding to make 10 second delay...tq
 

Potato Pudding

Joined Jun 11, 2010
688
Okay, thank you, that helps.
Your vibration sensor seems to be only a contact gridded sphere with a gold plated bearing inside. As it shakes, the circuit it is in opens and closes as the ball bearing bridges contacts. It pulls the voltage through the 100k resistor between full 9V and ground.

And just for reference.

4093 Schmitt Trigger NAND LOGIC GATE

I will try and get back to this later with some ideas.
 
Last edited:

marshallf3

Joined Jul 26, 2010
2,358
Can't really recall what if anything I used this for but I did build it and it works like charm. I just found a time delay circuit formed by a dual comparator IC to be unusual.

As soon as the voltage on J1 goes high (or rises above the bias voltage set by R2 & R3) it starts charging C1 through the pot & R4. Once C1 has charged up to the same bias voltage, the second comparator's output latches as active low and energizes the relay. It will stay latched until J1 is taken low again or the power is removed and, due to the diode, is quickly ready to start the same timing interval over again from 0.

http://www.innoengr.com/examples/comparator_time_delay.jpg
 

Potato Pudding

Joined Jun 11, 2010
688
I am still working out from the diagram provided by itq.

Sensor normally grounds but vibration makes it break connection, so about 8V goes through differentiator to trigger the NAND which will normally be high on its output and drops which lowers the level on the integrator if there are enough vibrations.

I am not sure but I think the ouput of the NAND after the integrator is where the LED needs to be connected.

Vary the resistor and capacitor in the integrator (where it says to SELECT to give the ouput desired) and this circuit should work on its own.

You probably won't need a PIC or a timer. The hysteresis in the 4093 (previous link seems to misdirect) could be enough to give you the rest of what you need.

You only want to turn on an LED after a certain amount of vibration correct? I am going to work on a a variant of the given circuit. No added timers or Microcontollers.
 

Potato Pudding

Joined Jun 11, 2010
688
For starters try increasing the integrator capacitor and parallel the integrator resistor with another resistor that has a series diode to select for only charging the capacitor.

 

Thread Starter

itqaanmuslim

Joined Aug 14, 2010
11
oh tq..potato pudding..

Yeah...i want to turn on an LED after a certain amount of vibration
...(vibration sensor is vibrating for 10 second,then LED will be ON)

actually, l already connect that circuit...but as i said before when vibration sensor is vibrated, output (LED) will be ON immediately..
 

Potato Pudding

Joined Jun 11, 2010
688
Try changing the 470k Resistor probably to a 100k resistor and 220k potentiometer. That will give you a good range of variation to try.

The 33μ capacitor should be more than large enough so plan on reducing it to 8μ2 or 3μ3.

The altered diagram was only intended to give you a circuit that would not immediately turn on the LED when vibrated.

If it proves to only turn on the LED after 10 seconds of shaking that would be an incredible fluke.
 

Potato Pudding

Joined Jun 11, 2010
688


Let us know if the 33μF Capacitor (any larger size capacitor will do for testing) makes any difference for starters.

Then try to increase the charging current with the diode and resistor parallel if you still don't see any delay or enough delay.

If the LED is not lighting up easily enough now then try changing the main resistor path to a lower value wth a variable resistance.

It is a multiple step process.
 

Potato Pudding

Joined Jun 11, 2010
688
Multisim is so slow that you would have to be crazy to use it instead of actually breadboarding. It does have a whole lot of nice features but I can't wait normally ten minutes to look at what should take only ten seconds in a real circuit. And that is for a simple circuit!

It will tell you that the larger capacitor will increase the delay before the second NAND gate turns on the LED. In fact a larger capacitor will easily prevent the integrator from ever dropping low enough. You have to get the Capacitor to swing to the thresholds, but not too quickly.

I suggest that you look at a large value of feedback resistor from the output to the input of the second NAND gate. That will help to steer the circuit in fact it will create an oscillator if you let it overdrive the current from the first NAND gate.

You will probably not need the diode and resistor current bias parallel line and if you do you will have to decide which direction you need the bias. You can have it increase capacitor charge or drain depending on which way the diode is connected.

I really can't guess well enough what the vibration sensor signal looks like. I imagined it as about 30 Hz 50%. This will not lend itself to simulation unless you have a recorded sensor output to use as a waveform in the simulation.

Guessing and trial and error are probably enough, and the NAND gates are likely good enough for the whole circuit delay, but it would be fussy and sensor signal dependent.
 
Last edited:

Thread Starter

itqaanmuslim

Joined Aug 14, 2010
11
Tq potato pudding...

it look like my circuit is function

but i have one question here..

which one is better..

1. either i use low value of capacitor with high value of feedback resistor

or

2. high value of capacitor with low value of feedback resistor
 
Top