Ingenious chap required

Thread Starter

ian.blue

Joined Jul 12, 2011
31
Sparky,
The circuit which you gave me is not working as planned.
My one transistor circuit works like this;
As soon as the float switch is closed the transistor switches on and the LED illuminates.
No matter how long it is closed the time delay will only start when the switch is opened. It will reset as soon as the switch is closed.

With the 555 the timed period starts immediately when it is triggered and continues regardless of the switch being opened or closed.

I can overcome the dimming effect by employing a relay . This works perfectly and achieves the desired effect.

Thanks anyway for your effort and help.

Good luck
 

Thread Starter

ian.blue

Joined Jul 12, 2011
31
peeseebee,

This is a terrific solution.
I just love the simulator. Never come across this before.
Your circuit achieves the requirements exactly.
Well done!

Cheers Ian
 

PeeSeeBee

Joined Jun 17, 2011
56
peeseebee,

This is a terrific solution.
I just love the simulator. Never come across this before.
Your circuit achieves the requirements exactly.
Well done!

Cheers Ian
I never knew about the online simulator until I saw it in KJ6EAD's post. I tried the circuit out first in "Yenka".

Have you actually built it? I wanted to try it out, but I've lost my breadboard. I get confused with all the different configurations of 555 timers. That's why I prefer op amps. Much easier to understand.
 

SgtWookie

Joined Jul 17, 2007
22,230
Just a couple changes...

I moved the 1k resistor between the cap and switch connection so that the switch contacts would not get blasted.

Decreased the cap size from 1m to 100uF, and increased the timing resistor from 22k to 220k. Timing is the same, but the cap is smaller physically, and usually smaller = less expensive for the same type.

I also adjusted the output range for the opamp - someone was saying 741's, and they can't see within 2v of either rail.

http://www.falstad.com/circuit/#$+1...6+0+0+40.0+0.0+0.0+0.0+0.5 w+48+240+48+304+0
 

PeeSeeBee

Joined Jun 17, 2011
56
Yep. I was a bit worried about the switch contacts directly across a charged capacitor. Having a resistor in series with the cap through the discharge path will certainly increase the life span of the switch.

I don't know what kind of switch the OP will be using, but I thought that if it was a spring loaded push-to-make momentary type, & there was a resistor in series with the cap, then the cap might not fully discharge if the button was tapped quickly. Depending on how consistant the delay needs to be & how long the switch will be closed for each time, this probably won't be a problem.

The reason I put the 1k resistor in that position, is that earlier on I suggested using a pre-set pot in place of the main timing resistor. If the pot had been set to minimum resistance & the switch closed without that 1K resistor in place, it would have shorted the power rails. If the OP is only going to use fixed resistors, then it's not a problem of course.

Agree about the timing components. The lower value timing cap will also be kinder to the switch contacts.

I don't know why I left the output range of the op amp at 0 & 12v. I knew that a 741 wasn't capable of that range. 2 to 10v is much more realistic.

Cheers.
 

Thread Starter

ian.blue

Joined Jul 12, 2011
31
These solutions are great!
I should reiterate the function of the circuit.
It is to indicate when the liquid level in a tank is low.
There is turbulence in the tank and the float switch ( rated at 1 amp ) tends to bob up and down and would therefore give false signals. That's where the timer comes in. If the level stays low for 10 seconds the alarm is given.
Now, I had given up when Sparky's circuit didn't work and concentrated on my analogue /electro mechanical solution. I had taken advantage of the changeover contacts on the relay and utilising a dual colour LED used the n/c contacts to change the LED from green (level ok) to red ( level low).
So two questions :
1. Would it be possible to achieve this digitally?
2. The ic shown has 8 contacts. Which contacts correspond to the diagram?
 

PeeSeeBee

Joined Jun 17, 2011
56
These solutions are great!
I should reiterate the function of the circuit.
It is to indicate when the liquid level in a tank is low.
There is turbulence in the tank and the float switch ( rated at 1 amp ) tends to bob up and down and would therefore give false signals. That's where the timer comes in. If the level stays low for 10 seconds the alarm is given.
Now, I had given up when Sparky's circuit didn't work and concentrated on my analogue /electro mechanical solution. I had taken advantage of the changeover contacts on the relay and utilising a dual colour LED used the n/c contacts to change the LED from green (level ok) to red ( level low).
So two questions :
1. Would it be possible to achieve this digitally?
2. The ic shown has 8 contacts. Which contacts correspond to the diagram?
Ahh...right. I think the application must have been mentioned in a different thread.

OK...on to Mk4 LOL. I have changed the "level OK" LED to green & added a red "low level" LED. I have adjusted the timing resistor to 150K to give 10 second delay, although in practice, the tolerance of the electrolytic capacitor will affect the actual timing.

I gave the pinouts for a 741 in post 11, but I have now also added them to the simulation.

SgtWookie...I have returned the 1K resistor back to it's original position as a safeguard in case a preset is used as the timing resistor, but added a 220Ω discharge resistor in series with the cap. I replaced the switch with a momentary type, & if the capacitor was fully charged when the switch was momentarily closed, the timing reduced from 15 seconds to just 7 seconds. I found that a 220Ω was a compromise. What do you think?

http://www.falstad.com/circuit/#%24+1+6.0E-4+10.20027730826997+50+5.0+43%0Aa+224+240+352+240+0+10.0+2.0+1000000.0%0Aw+224+224+192+224+0%0Aw+224+256+128+256+0%0Ar+192+224+192+32+0+10000.0%0Ar+192+224+192+432+0+10000.0%0Ar+128+256+128+320+0+220.0%0Ac+128+320+128+432+0+1.0E-4+10.060353361188726%0Aw+128+256+48+256+0%0Aw+128+432+48+432+0%0Aw+352+240+416+240+0%0Aw+128+32+192+32+0%0Aw+128+432+192+432+0%0Ar+416+240+416+128+0+470.0%0Aw+192+32+416+32+0%0A162+416+32+416+128+1+2.1024259+0.0+1.0+0.0%0Aw+416+32+544+32+0%0AR+544+32+608+32+0+0+40.0+12.0+0.0+0.0+0.5%0AR+544+432+608+432+0+0+40.0+0.0+0.0+0.0+0.5%0Aw+48+256+48+320+0%0Ar+416+240+416+336+0+470.0%0A162+416+336+416+432+1+2.1024259+1.0+0.0+0.0%0Aw+192+432+416+432+0%0Aw+416+432+544+432+0%0As+48+320+48+432+0+1+true%0Ar+128+32+128+144+0+150000.0%0Ar+128+144+128+256+0+1000.0%0Ax+241+217+249+221+0+15+2%0Ax+244+276+252+280+0+15+3%0Ax+316+230+324+234+0+15+6%0Aw+288+224+288+32+0%0Aw+288+256+288+432+0%0Ax+293+292+301+296+0+15+4%0Ax+293+201+301+205+0+15+7%0A
 

Thread Starter

ian.blue

Joined Jul 12, 2011
31
This is amazing your ingenuity is unlimited!!
I asked for this tongue in cheek.
Just need to get the bits now and unfortunately going on holiday.
I will be using a trimmer to fine tune the time interval.
Thank you so much.
Ian
 

SgtWookie

Joined Jul 17, 2007
22,230
OK, so the switch has a rating of 1A.
With the cap charged to 12v and a 1k resistor in series with the switch, the instantaneous current on closing the switch would be about 12v/1k = 12mA.
With a 220 Ohm resistor, the instantaneous current would be about 54.5mA; about 4.5x as much.

220 Ohms, ~100ms closed, 55mS to 1v, 69mS to 1/2 supply (trip point)
1k Ohms, ~250m closed to 1v, 15.3mS to 1/2 supply.

I don't know how rapidly the fluid sloshes around in the container, or how often the light flashes on and off - or how rapid the flashing is.

There is no hysteresis provided, which could cause some bouncing around. It would be easy to add hysteresis with a feedback resistor.

Here is a variation with hysteresis:
http://www.falstad.com/circuit/#$+1...+64+0+34+9.353610478917778+9.765625E-55+1+-1

I've had to swap the signals for the inverting and noninverting inputs in order to implement the hysteresis, and swap the red and green LEDs around. The voltage divider resistors were changed to 20k, and the feedback resistor is 10k. With the way the output can't swing within a couple volts of the rail, the feedback results in a hysteresis of about 4v, or swinging between 1/3 and 2/3 of the supply voltage. This will eliminate flashing if the switch contacts are bouncing and the cap charge is near to 1/2 of the supply.

I added O-scope displays so that you can see what's happening with the voltage levels on the inverting (-) shown on the left scope, and noninverting (+) on the right scope. This will help you to more easily visualize the hysteresis, and what it does.

To simulate it without the hysteresis, just delete the wire that connects the 10k resistor below the opamp to the opamps' output.

Of course, this changes the timing; the time period will be extended to about 16.7 seconds. Decreasing the cap to ~68uF will get it back in the ballpark.

Also, the green LED starts off being illuminated until the time period expires by the cap charging; if the switch is still open at that point, the red LED will come on.

If you wish for the red LED to come on immediately on power-up if the switch is open, then the low side of the capacitor needs to be connected to the 12v supply. That modification is shown in this circuit:
http://www.falstad.com/circuit/#$+1...+64+0+34+9.353610478917778+9.765625E-55+1+-1
 
Last edited:

Thread Starter

ian.blue

Joined Jul 12, 2011
31
Yes the red light should come on if level is low on power up.
The level can drop low from periods between 2 and 20 minutes ( a bit unpredictable) but it will only normally remain low for periods of say 1 to 5 or 6 seconds.
 

SgtWookie

Joined Jul 17, 2007
22,230
I like the clever way you showed the op amp power connections.
That wasn't my idea - PeeSeeBee originally showed the power rail connections with his first Yenka-created circuit, and later added them into the Falstad circuit in reply #27.

Falstad is limited, but you can still do a lot with it.
 

KJ6EAD

Joined Apr 30, 2011
1,581
Thanks for the correction on attribution to PeeSeeBee. I would consider Falstad more of a demonstrator than a simulator but it's useful since that's often what's needed here.
 

PeeSeeBee

Joined Jun 17, 2011
56
I've only just noticed that the Falstad simulation doesn't show a correct current reading from the +12v supply when the 741 is sourcing current.

The source current through the LED is 17mA, but the supply current is only 1mA. Magic!
 

Thread Starter

ian.blue

Joined Jul 12, 2011
31
Now that I have got round to building this circuit there are two problems.
1. When either light illuminates the other light also glows.
I have overcome this by amending the circuit as shown.
2. When power is initially applied and the level is low, the green ok light switches on and only changes to the red light after a period of time.
I have not found a solution for this.
Any ideas anyone?
 

Attachments

Sparky49

Joined Jul 16, 2011
833
Guys,

just a quick note to say sorry for not replying to this thread. I was on holiday, and by the time I got back, I had forgotten about this, and it had fallen down a couple of pages.

Sorry again for not following up,
Sparky.
 

Thread Starter

ian.blue

Joined Jul 12, 2011
31
OOps Sorry Sgt Wookie!
I did not read your post carefully and now having re-read I realize that you had already solved the problem of the red light needing to come on if there was low level on power-up.
I will rewire and test.
Ian
 

Thread Starter

ian.blue

Joined Jul 12, 2011
31
No, still glowing..........indecisive.
I think on this occasion my solution is better.
The other light is completely off.
A few milliamps quiescent current is insignificant.
Thanks for your suggestions.
Ian
 
Top