Water level project circuit help needed

KMoffett

Joined Dec 19, 2007
2,918
Yes, but 3.3K would be a standard resistor. This not a critical value and would depend a lot on the actual gain (Hfe) of the transistor. I use a base current of 1/10 the collector load current as a rule of thumb to assure saturation. The PNP >to NPN was to change to a common emitter configuration (per Analogkid) and give you a open relay on water contact, as you had requested. The PNP in my design gives me the proper function of an inverting common emitter, with the added timer.

Ken
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Yes, but 3.3K would be a standard resistor. This not a critical value and would depend a lot on the actual gain (Hfe) of the transistor. I use a base current of 1/10 the collector load current as a rule of thumb to assure saturation. The PNP >to NPN was to change to a common emitter configuration (per Analogkid) and give you a open relay on water contact, as you had requested. The PNP in my design gives me the proper function of an inverting common emitter, with the added timer.

Ken
Thanks. I am not up to speed on standard resistor values, but I understand they play a big part in circuit design. I put a 3.3K in because, as you alluded to, that's what I had on hand.

Well, your additions work wonderfully. I did learn at first that you have to follow the design very closely, and one should really look over their work to ensure it was followed correctly. I fried a 558 because I had the diode in the wrong place, and backwards to boot.....

Once I replaced it the relay would immediately energize when power was applied. I did not have a 200K trimmer on hand, so I had just used 100K instead. I then put another 100K in series, and voila, a ~7 second time delay.

Thank you very much for your input. Now, out of curiosities sake, and for functional learning purposes, what are the weaknesses of this circuit? Where is it liable to fail? Or is it pretty solid in its design? I just want to make sure I don't build this on the edge of using sub standard components, and have it fail shortly after installation.

Not asking for someone to do the work for me, but what do you look at when determining such things? I 'assume' that the original circuit was thought about in this regard, but then the fact that it did not have the resistor between the base and gate output makes me have doubts. Hope this makes sense.

Just now understanding how things work its tuff for me to think further ahead and see weak points, but I know its something you should do when doing something like this.
 

KMoffett

Joined Dec 19, 2007
2,918
Yeah! Good for you. There are a lot of bad designs or designs that didn't make the correct translation to schematics on the web.

Hard to tell what will fail. To little information on your use and environment.

I used an online calculator to pick some approximate values for C5 and R3+R4.
http://www.talkingelectronics.com/pay/BEC-2/Page49.html
Part way down the page is Frequency Calculators. I used the first one. Plugged in standard values for C5 and different ones for R3+R4 until I got a time that was close to 5 seconds.

Ken
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Yeah! Good for you. There are a lot of bad designs or designs that didn't make the correct translation to schematics on the web.

Hard to tell what will fail. To little information on your use and environment.

I used an online calculator to pick some approximate values for C5 and R3+R4.
http://www.talkingelectronics.com/pay/BEC-2/Page49.html
Part way down the page is Frequency Calculators. I used the first one. Plugged in standard values for C5 and different ones for R3+R4 until I got a time that was close to 5 seconds.

Ken
Ok, I was seeing something like that for the timer values on the 555. I have 100uf caps coming and only had the one 47uf available. So I was thinking maybe I can figure out resistance value and use the 100uf.

I guess I was thinking more of the failure points specific to the circuit itself(if there is any). Like if you had the parts in a controlled environment, is there any parts in the circuit that are on the edge of being not rated high enough.

I guess, thinking about it, the 4093 seems to have high enough ratings, the 558 does to, so just making sure the resistors are rated high enough is all I guess?(1/4 watt vs 1/2 watt).

I wonder too if there is anything else(like the base resistor) that I should have for circuit protection.

I guess about all I can do is put it in place and see how it works in the environment it will be in. Not like I am going to be building these things for the masses or anything.
 

KMoffett

Joined Dec 19, 2007
2,918
I'm beginning to worry about the 4093 gate discharging C5. I was even wondering if discharging the 47uF would be a problem exceeding the gate's maximum output current (8.8mA @15V). I think I need to reconsider my design. Probably replace the diode with a transistor/resistor. But that might require more changes. I'm doing this as I have time.

Ken
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
I'm beginning to worry about the 4093 gate discharging C5. I was even wondering if discharging the 47uF would be a problem exceeding the gate's maximum output current (8.8mA @15V). I think I need to reconsider my design. Probably replace the diode with a transistor/resistor. But that might require more changes. I'm doing this as I have time.

Ken
Interesting, that's kind of what I was thinking - as far as trying to think about what might happen with the circuit itself. I really don't expect you to list all the details, just point me in the direction I should go. That helps a bunch.

If/when I find info I'll be sure to post also.
 

KMoffett

Joined Dec 19, 2007
2,918
OK a mod to solve my concern. I show two options for the output section:
Upper uses two AND gates of the 4093 and a PNP transistor.
Lower uses one AND gates of the 4093 and an NPN transistor.
Either would work.

Ken

WaterLevelWithDelay2.gif
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Ok, but as far as your concern goes, is there a way to measure the amperage? I have a fluke 789 process meter and have it hooked up between the gate output and diode. My min/max is -0.463/4.477

Or is this not a good way of measuring?
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Just as a side question, thinking about keeping things relatively simple, would just using a 555 timer work instead of the cap/resistor/dual gate setup?
 

KMoffett

Joined Dec 19, 2007
2,918
1. The current pulse to the gate's output is very short. I don't think that a DMM will catch it. I used a scope across a 100 ohm resistor in series with the diode. I got a peak of 80mA through the resistor with a 47uF cap.

2. A 555 could be made to work, but it won't make it any more simple. You would need the same timing components. You already had two unused gates on that chip.

Ken
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
1. The current pulse to the gate's output is very short. I don't think that a DMM will catch it. I used a scope across a 100 ohm resistor in series with the diode. I got a peak of 80mA through the resistor with a 47uF cap.

2. A 555 could be made to work, but it won't make it any more simple. You would need the same timing components. You already had two unused gates on that chip.

Ken
Ok. I tried the top one. Used a 2N222(I believe it is an equivalent?) and the circuit did not work. When power is first applied it the relay is off(probes not touching) then it comes on after a few seconds and will not go back off(de-energize) probes touching or not.

Is it the 2N222 causing the issue?
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
I should do more research I guess. Been a long day, time to go home. Be back at it tomorrow.

As far as the 555, will using it relieve the over amp issue on the gate output?
 

KMoffett

Joined Dec 19, 2007
2,918
The top circuit requires a PNP transistor (BC558). If by "2n222" you mean 2N2222, it is an NPN transistor. A 2N2222 may be substituted for the 2N3904 in the lower circuit.

There are all sorts of 555 water level circuits out there, but from my searching they are all "DC driven" And, you would have to add another 555 to include your delay.

Google: 555 water level circuit

I'll have to think about it, but I don't think it would be any simpler.

Ken
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
I was using it in place of Q2, which I assume is apart of both circuits? Then using the 558 for Q1.

I don't mean to imply your circuit is not simple. I really like it to tell you the truth. I guess my vocabulary is not conveying what I really mean.

I think the circuit is good as a base. I have googled and this is the most simplistic one using AC for the probes, which in my case is mandatory.

I'll revisit my board in the morning. Maybe I miss wired something. But I followed the main circuit, using 2n222 for Q2 and the did the rest based off the upper line.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Quick thought. Would a current limiting diode work in the first circuit? The one with the timing based on resistance/capacitor.
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Showing my ignorance, but constant thinking(even when not at work), what about putting a 1.5K resistor between pin 14 and 12v. Wouldn't this limit the total current available to the IC to 8mA?
 

AnalogKid

Joined Aug 1, 2013
12,130
A rule of thumb is that for a typical transistor to be "hard saturated", that is, firmly in the middle of the saturated portion of its operating curve as opposed to right on the edge of linear operation, the base current should be 10% of the collector current. In truth it depends on the transistor. I think this is a good number for low-gain power transistors, but for today's small signal types with gains of 100-300, it seems a bit high. Base current translates directly into power dissipated in the device, and one of the benefits of saturated operation is reduced power dissipation, so I tend toward 3% to 5%. So take the relay coil current, divide by 10 or 20, and that is the base current. The resistor voltage is around 11 V (12 V minus Vbe minus the low output voltage of the gate (approx. .3 V)). With the current and the voltage you can calculate the base resistor with Ohm's Law.

As for the logic polarity, here is a quick analysis. When water hits the contacts, the input to the first gate goes high. There are two gates and an inverting transistor in series, and the timing components do not affect the eventual logic polarity, so as the signal progresses through them it becomes low, then high, then low at the collector. Since the other side of the relay coil is low (GND), there is no voltage across it and the relay is off.

ak
 

Thread Starter

TwoTon

Joined Aug 6, 2015
119
Well the circuit did not work when I got in. Double checked everything and then I saw it. Capacitor was in backwards. I need to slow down when I'm doing theses things.

Turned it around and the circuit would work, but only for a moment. Found an old power supply with a 47uf cap and replaced the capacitor, replaced Q2(just in case), and she works now.

Couple questions though. One is the time delay, it is now 11 seconds. Can I change this via changing the capacitor and resistance values like we talked about before?

Second question is to see if I understand the circuit correctly. The changes you made were to put the "loads"(if that's the right term) on the transistors, relegating the NAND gates to just switching the transistor - which I assume does not draw much current?

If this is correct, how do you determine the amount of current a transistor draws to the base? Is this what is listed as the 'collector current' on spec sheet?

I'm guessing it's not, seems that the collector current would be the max current allowed to flow through the transistor when switched on. Which, being 600 mA, is quite a bit more than the NAND gate, which makes complete sense to do it this way.

Am I on the right track?
 
Top