Low power NOT gate - Page 1
Forum section: electronics / beginners

author: mat_fr
author_rank: Contributor
timestamp: December 17, 2014, 07:41:14 pm
content: Hi,I have a simple basic design question (maybe the answer won't be as simple). I want to make a dumb water level detector to light an LED when an opaque water tank is empty (love my plants...)Problem is: I'd like to power it by battery, and if possible make it last very long. So I went with a simple Not gate with 2 NPN transistors.This design is plain and simple, but actually it's when the probe is closed and the LED is off that the consumption is the most important. I measured about 600Kohms when the "probe", actually just 2 jumper wires, are in the water. I tried multiple resistor values, I can live with an LED consuming some mA, but the LED consumes less current than the R1 resistor put to ground by Q1. If I increase the values too much the LED is too dim. I tried to put another NPN in Darligton configuration, it worked better with high R1 values, but still too high for my liking. I also tried using a 555 to make the LED blink, hoping I would get a better lighting/consumption ratio, but it increased the quiescent consumption of course, so it doesn't solve my problem.I measured values as low as 1mA, but with a 1200mA/h battery that would only last a month or so.I'm curious about an elegant solution to this problem if there is any.

author: Zero999
author_rank: Super Contributor
timestamp: December 17, 2014, 11:04:41 pm
content: The solution is to use CMOS logic gates which hardly use any power, unless they're switching.Another problem with your circuit is it uses DC which can cause electrolysis and corrosion. Using AC will get round the problem.

author: mat_fr
author_rank: Contributor
timestamp: December 17, 2014, 11:13:51 pm
content: Quote from: Hero999 on December 17, 2014, 11:04:41 pmI was thinking about bipolar transitors to keep it minimalistic but I also have some old logic gate chips, maybe I can use a "4 NOT gate" chip, though it sounds like a waste.QuoteYou're right, but it would complicate if not disqualify entirely battery powering, wouldn't it?

author: Zero999
author_rank: Super Contributor
timestamp: December 17, 2014, 11:21:36 pm
content: Quote from: mat_fr on December 17, 2014, 11:13:51 pmIf it's a CMOS (CD4001, 74AC02 or 74HC02) not 7402 or 74LS02 then it'll work and have much lower power draw than the transistors. Just tie the unused inputs to either power supply rail. You can get single NOT gate ICs but they come in SMT packages.http://www.nxp.com/documents/data_sheet/74HC_HCT1G04.pdfQuoteIt is very slightly more complicated but it doesn't disqualify using a battery power because an oscillator can convert the DC signal to AC.

author: tautech
author_rank: Super Contributor
timestamp: December 17, 2014, 11:31:14 pm
content: Quote from: Hero999 on December 17, 2014, 11:21:36 pmHero999 made this post a while back with the best solution IMOhttps://www.eevblog.com/forum/beginners/which-sensor-to-use-for-salt-water-level/msg499829/#msg499829

author: mat_fr
author_rank: Contributor
timestamp: December 18, 2014, 08:15:41 am
content: QuoteThanks. I must admit that another goal for me was to make a pretty simple circuit on a perfboard to get back to electronics after a little pause, so I wasn't planning on making a PCB for SMT package or buy yet another component (my cupboard is full of unused parts) but, hey, why not after all?QuoteTrue, and anyway I tried a 555 to make the LED blink and use less power while being more visible, so I suppose it wouldn't hurt to use it as a DC/AC converter, I'll look for an example circuit.QuoteThanks, I'll look into it

author: Zero999
author_rank: Super Contributor
timestamp: December 18, 2014, 10:37:07 am
content: If you need to flash the LED then you might as well use those spare gates.

author: mat_fr
author_rank: Contributor
timestamp: December 18, 2014, 02:00:16 pm
content: QuoteI'm not sure I understand how this circuit works... I don't see where the AC power kicks in and I see a lot of what I suppose to be decoupling caps, but I fail to see the whole logic behind the circuit... I'll try to model it in LTSpice to see how it goes, but since I don't know the power source I'll have to search a littleQuoteHum... Here again I will definitely have to search for circuits able to make an LED blink using NOT gate...

author: mat_fr
author_rank: Contributor
timestamp: December 18, 2014, 03:15:08 pm
content: Quote from: mat_fr on December 18, 2014, 02:00:16 pmHo! I think I just got it. The upper left gate switches regularly from the RC circuit below? I'll need to test that

author: Zero999
author_rank: Super Contributor
timestamp: December 18, 2014, 05:05:18 pm
content: The origional design was for a level gauge. It's probably eaiser to understand if you just look at one section.Yes, it's a Schmitt trigger oscillator.C2 couple the AC to a rectifier and smoothing capacitor (D1, D2 & C4) which will be charged, unless there's water present.When the chamber fills with water the AC is short circuited to 0V via C3 and the water and C4 discharges through R4.

author: Whales
author_rank: Super Contributor
timestamp: December 19, 2014, 07:36:43 am
content: If you can get an N-channel mosfet then you can go the route of this circuit (see attached). I've just tested it with a2n7000, 3V from a flat pair of AA batteries and omitting the LED resistor. If anything it's too sensitive to conductionDisadvantage: corrosion -> not AC

author: mat_fr
author_rank: Contributor
timestamp: December 19, 2014, 08:08:47 am
content: Thank you both for your tips/explanations. I will test it this week end if I can (not sure I'll have the time before next month, Christmas is coming).

author: Zero999
author_rank: Super Contributor
timestamp: December 19, 2014, 01:31:00 pm
content: Quote from: Whales on December 19, 2014, 07:36:43 amThe drain and source are the wrong way round. As drawn, the LED will light continuously.

author: Whales
author_rank: Super Contributor
timestamp: December 20, 2014, 01:35:22 am
content: WoopsI draw them symmetrically when doing it by hand as you can generally infer the direction from diagram orientation, but not in this case.

author: mat_fr
author_rank: Contributor
timestamp: December 28, 2014, 12:00:11 pm
content: I couldn't find the time to fetch some 74hc14 to test the circuit before Christmas... Too bad, now all local stores are on vacation. So I ordered some from eBay and I'll have to wait a few weeks before I can test it.Still, I already found the schematics really interesting, so even if I have to wait to test it I can already thank you for the schematics and explanations.

author: dannyf
author_rank: Super Contributor
timestamp: December 28, 2014, 03:07:21 pm
content: You can replace Q1/Q2 with one mosfet, like 2n7000/7002.Put the led on the collector / drain.

author: mat_fr
author_rank: Contributor
timestamp: January 31, 2015, 12:11:20 am
content: Hi,Sorry I went quiet for some time: I was waiting for the chips and since I received it I was too busy to try the circuit.Thank Dannyf but since I'm aware of the DC current problem I'm willing to try the Hero999's solution (besides, it's interesting to understand how it works)Quote from: Hero999 on December 18, 2014, 05:05:18 pmWeren't you talking about C4 discharging through R3?I just tried the circuit but I couldn't make it work. I used different resistors values for R2 (1M) and R3(2M). I don't know how critical the values are, I suppose resistors have to be properly sized compared to the caps. With 3.3V VCC I could see oscillations on both sides of R1 (with 0-3.3V and 33%-66% of VCC on the other side, which seems the expected behavior) bu nothing after R2 (no water present so the C3 pin is floating). I supposed 3.3V is too thin for these resistors/caps values so I tried with 5V. But then I couldn't see any understandable state. I suppose I got it wrong somewhere, but I'll try to understand how to properly size res and caps. I've never went into A/C yet.Thanks for the help anyway.

author: 22swg
author_rank: Frequent Contributor
timestamp: February 01, 2015, 11:37:48 am
content: From experience anything metal dipped in water with a current ... wont last long . I saw a water sensor design that shone light through a filter to determine the levels. I was looking for a soil moisture sensor at the time after using the resistance of two copper wires , even with ac , lasted a month .

author: mat_fr
author_rank: Contributor
timestamp: February 01, 2015, 12:24:22 pm
content: Thanks for sharing your experience.I still can't make it work on my breadboard. Even the oscillation on the schmitt trigger is not stable (I think I have some contacts problems on my breadboard, but still, with 2 different ICs on 2 different locations the problem occurs), and I can't make the thing work properly. I'll try again later I think...

author: dannyf
author_rank: Super Contributor
timestamp: February 01, 2015, 12:55:55 pm
content: The original solution was simple enough and can be made to work for your application with simple modifications - as others have posited.The new solution you are trying seems to be overly complicated for such a simple task.Maybe it is of value as an learning exercise. Good luck with it.

author: KM4FER
author_rank: Regular Contributor
timestamp: February 01, 2015, 03:26:43 pm
content: Going back to the requirements I understand this to be for a plant watering system. In that case I wouldn't think continuous sensing is necessary. Checking water level once every 1, 5 or 10 minutes might be enough to meet your needs.If that is the case then a circuit that would sleep most of the time and only wake up occasionally to perform the test could extend battery life considerably. It could also have the positive side effect of minimizing corrosion of sensor electrodes since the amount of time there is current flow between them would be minimal.I'm thinking a small cheap microcontroller would be perfect for this but that is a whole different direction than the totally analog circuit you have been persuing. However there might be an analog way for you to use a timer to turn on the power to your sensor circuit only when sampling which could get you both longer battery and sensor life. Of course this would require a method of latching the LED to the ON state when a low level was detected.

author: dannyf
author_rank: Super Contributor
timestamp: February 01, 2015, 03:30:43 pm
content: QuoteThere are mcu-based urination alarms for kids: it detects moisture. Precisely the same way.

author: Zero999
author_rank: Super Contributor
timestamp: February 01, 2015, 04:39:17 pm
content: Quote from: mat_fr on January 31, 2015, 12:11:20 amYes, that's how it works.The capacitor values aren't critical, so long as they provide negligible impedance at the frequency of the oscillator compared to the resistors.Lowering the frequency may help if you're using a breadboard. Changing C1, C2 & C3 to 1nF and C4 to 10nF would make it work at 27kHz.Analysis of the circuit can be simplified by assuming all the capacitors are short circuit at AC, closed circuit at DC and the diodes just convert AC to DC minus one diode drop.R2 and R3 can then be treated as a potential divider with the resistance of the water as the load which is in parallel with R3.The problem then 47M is not a widely available resistor value. The resistor values could be divided by roughly 20, giving 1M for R2 and 2M2 of R3 (nearest E3 values) but that would reduce the sensitivity of the circuit to water.Another thing you could try is to eliminate R3 altogether and use a leaky capacitor for C3 such as an electrolytic capacitor and keep R2 at 2M2: try 1uF. It will take much longer to respond because of the large capacitor value but it shouldn't matter too much.

author: dannyf
author_rank: Super Contributor
timestamp: February 01, 2015, 08:43:30 pm
content: QuoteThat's not how the circuit works.

author: Zero999
author_rank: Super Contributor
timestamp: February 01, 2015, 08:57:19 pm
content: Quote from: dannyf on February 01, 2015, 08:43:30 pmThe oscillator produces a squarewave which is coupled to a rectifier (D1 and D2) via C2 and R2. The charge is accumulated on C4 which is discharged by R3.C3 couples the AC signal to the probe which detects water.When there's water present the AC signal is diverted to 0V.When the impedance of the capacitors is negligible compared to R2 and R3, at the oscillator frequency, the steady state voltage on C3 can be approximated by modelling the circuit as a potential divider consisting of a diode connected in series with R2 and the water's resistance in parallel with R3.The capacitor values and frequency of the oscillator are not important providing the impedance of the capacitors is low enough, so they can be eliminated from the calculation.Schottky diodes could be a better choice but watch out for the leakage current, especially given the high resistor values used.

author: mat_fr
author_rank: Contributor
timestamp: February 02, 2015, 10:02:18 am
content: Wow, I wouldn't have believed this subject would lead to that many comments.Quote from: dannyf on February 01, 2015, 12:55:55 pmAs a matter of fact, it is (though it would be useful)Quote from: Hero999 on February 01, 2015, 08:57:19 pmOK, I'll have to test it again with that description in mind.I was surprised to see that the square wave oscillation was not stable on my breadboard though. I'm not talking about it's frequency, just that it worked for a few seconds, then went flat. I had to play with the contacts to make it oscillate again. Weird, especially considering that the problem occured in multiple tries on different locations on the breadboard.I used schotky diodes in my test, I mostly have schotky in stock. I suppose it's critical when using 3V input.BTW the oscillation is triggered by a threshold in percents of VCC, and the 74HC14 is supposed to work down to 2V, so I would expect the thing to work as well at 5V as at 3V (except for diodes forward voltage). Am I right to assume that?

author: Zero999
author_rank: Super Contributor
timestamp: February 02, 2015, 11:01:52 pm
content: Breadboard has a lot of parasitic capacitance. Reducing the frequency of the oscillator may help because the parasitic capacitance will have a higher impedance, at a lower frequency but the values of the other capacitors in the circuit need to be reduced proportionally.Yes, Schottky diodes are a must at 3V but it should work at 5V with ordinary silicon diodes without any problems.