0

I am designing a water sensor using a 2N2222A BJT in Darlington (we are only limited to BJT,) two 5mm LEDs (20mA,) and buzzer. The probe simulates the touching of the water hence the resistance.

Water Sensor at 200k Ohm Resistance

My problem is that as the resistance in the probe increases from 5M Ohms and higher, the current goes through the green LED when it should be in the red LED. I changed the resistance of the probe from 5M ohms to 50M Ohms since the water is at 20M ohms.

Water Sensor at 50M Ohm Resistance

For anyone who wants to play with my circuit.

JRE
  • 67,678
  • 8
  • 104
  • 179
  • 1
    "*I noticed that when I dipped the wires into the water ...*" What wires? There are no probes in your circuit. Is LED1 the green one? What is the purpose of the piezo? Please [Edit] to clarify. – Transistor May 13 '23 at 14:18
  • Can you please use red wires for things connected to your +ve voltage source, black wires for things connected to ground, and make wires that are directly connected to each other (i.e. the same node) the same colour? It would make your breadboard so much easier to look at – kene02 May 13 '23 at 15:03
  • @Transistor the funny thing is that, due to electrolysis, the wires will disappear from the real circuit as well ;-). To the op, if the 450 ohms represents the presence of water, maybe your water is so clean that it offers a much higher resistance. – Sredni Vashtar May 13 '23 at 15:03
  • _"I noticed that when I dipped the wires into the water, the current going through the red LED decreased."_ Sorry: so what was the current through the red LED before you dipped the wires into the water? – kene02 May 13 '23 at 15:08
  • did you test the green Led separately? I mean, sometimes we get bad LEDs. Are you sure that it is functioning? – liaifat85 May 13 '23 at 13:43
  • As expected, the resistance in the water is too much. I simply connected a wire from the 5V and another wire from the base, and connect them by dipping into the water. The voltage after dipping was 5mV and wont turn on the red LED. Is there a workaround with this problem? –  May 13 '23 at 22:51
  • Pure water does not conduct. Salty water conducts a lot. Tap water is somewhere in between. Use a second transistor (a PNP) as an inverter to light the red LED when the 1st transistor and the water conduct. – Audioguru May 13 '23 at 23:08
  • I am a bit lost, is there a schematic or learning material that I can use for reference? –  May 13 '23 at 23:48
  • Here: avoid DC because electrolysis will eat your wires. https://youtu.be/I9UsJs2geFE you can do this with BJTs alone if you wish. Two for the multivibrator, one for the buffer and one for the signal amplifier. – Sredni Vashtar May 14 '23 at 00:40
  • 1
    Where are you lost? There are many sources of info on conductivity of water. See: https://byjus.com/physics/conductivity-of-water/ I showed a schematic in my answer that should be able to detect ordinary drinking water. You might be able to use two 2N2222 BJTs in darlington connection to get sensitivity comparable to an NMOS device, but you can't use an LED in series with the probes because there will not be enough current. – PStechPaul May 14 '23 at 00:41
  • 1
    `and a piezo` ... a piezo what? ... piezo is not a thing, but a type of a thing – jsotola May 14 '23 at 01:46
  • Once you have modified your circuit to solve your problems, please post it in your question, and mark the relevant answer as solved, so we can move on. And please add a probe for the voltage on Q2 collector, and the voltage on the diode side of R4. – PStechPaul May 16 '23 at 21:10

2 Answers2

1

The voltage drop across the darlington pair plus the voltage drop across the red LED exceeds the forward voltage of the green LED.

Gil
  • 4,951
  • 2
  • 12
  • 14
0

Be aware that there are at least two different pinouts for the 2N2222(A). A simple diode test will determine the location of the base, and then you can try swapping the other leads to determine the collector and emitter.

2N2222A variants

A better design might be constructed using an NMOS device in place of the BJT Q1. Sensitivity can be adjusted by varying the gate to source resistor:

schematic

simulate this circuit – Schematic created using CircuitLab

LED Current

Gate Voltage

(edit May 15) I added a speaker (buzzer) to the schematic. Here are the resultant waveforms:

Currents

Voltages

(edit May 16) I just noticed that when the MOSFET is off, and the green LED D2 is lit, there will be about 9 V reverse bias on the red LED D1 because of the resistance of the buzzer. Most LEDs are specified for a maximum reverse voltage of 5 or 6 V. To correct this, an additional diode can be put in series with D1, and another in series with D2.

There may not be any problem having a 9 V reverse bias on the LED, as discussed here.

PStechPaul
  • 7,195
  • 1
  • 7
  • 23
  • Unfortunately, we are only limited to transistors as this is only a class based project. Can I swap the nmos with a transistor? –  May 14 '23 at 00:34
  • 1
    @janandrei A MOSFET is a type of transistor. It looks like what you're asking is whether you can exchange the FET for a BJT? In tht case, yes, but you'll need to modify things. – Hearth May 14 '23 at 00:40
  • 1
    You will probably need to connect two BJTs in darlington configuration to get sensitivity comparable to a MOSFET. – PStechPaul May 14 '23 at 00:43
  • @PStechPaul From what I learned from your suggestions, I updated my [circuit](https://imgur.com/a/hdcDPNN) into this. When I want to simulate the touching of the water I change the value of 225k Ohms to 20M Ohms and connect it to the 12V - everything works perfectly. I placed my circuit onto the breadboard and tested it. The green LED turns on and when I connect the 225k Ohms to the 12V (this acts as my probe and simulating the touching of the water) both of the LED turns on, which should not be happening. Can you please suggest as to what I should change? –  May 15 '23 at 11:05
  • I also wanted to insert a (3 - 24V) buzzer to indicate the touching of the water. Is it okay that I parallel it to the LED? –  May 15 '23 at 11:10
  • 1
    @certdelulu you must insert D3 from the circuit PStechPaul has suggested in your circuit to turn the green LED off if the red one is on. – Jens May 15 '23 at 15:43
  • @certdelulu The voltage across the LED (D1) will be too low (about 1.5-2 V) to drive the buzzer. You could put it from the 12 V supply to the drain of the MOSFET. I'll add it to my answer. – PStechPaul May 15 '23 at 19:29
  • @certdelulu The added transistor Q2 is not connected as a true Darlington, but it will probably work as shown. You should put your updated schematic in your question. – PStechPaul May 15 '23 at 19:57
  • Last question, where should I put my probe is it the R1 or R3 that I will disconnect? Thanks! –  May 15 '23 at 20:34
  • 1
    R3 simulates the probe. It might be good to keep perhaps a 1 Meg resistor in place to protect the gate from static discharge when handling the probe. The DC sweep of the resistance of R3 shows the resistance and voltage where it will conduct enough to provide the turn-on threshold of the MOSFET. For your two-BJT circuit, threshold will be about 1.4 VDC. – PStechPaul May 15 '23 at 21:10
  • @PStechPaul. I have updated my circuit and I am encountering another problem. Is the R2 necessary for the circuit or can I eliminate it? I am using a 5mm LED (I edited the values to a 20mA to follow the required ratings) and when I checked with my simulation the current passing through the circuit is only at 10mA so it wont turn on the LEDs. –  May 16 '23 at 02:38
  • Most LEDs have a MAXIMUM current rating of 20 mA, and will be quite bright with 10 mA. You may reduce the value of R2, but unless the LEDs have internal current limiting circuitry, or if the power supply is similarly limited, eliminating R2 will result in their destruction. – PStechPaul May 16 '23 at 03:34
  • @PStechPaul. As per your recent suggestion I added another diodes to the [circuit](https://imgur.com/aMdlwMe) though it doesn't seem to solve the problem that the green LED (5mA on current) lights up when the probes are "dipped". Removing the speaker from the circuit solve this issue. Is there another way of implementing it in the circuit? I also saw this material about [darlington triplet](https://electronics.stackexchange.com/questions/609043/darlington-triplet), do you think I can you this in my circuit to power the red LED and speaker? –  May 16 '23 at 12:54
  • 1
    You also added a diode in series with the red LED, so you still have the same problem. You probably don't need that diode, so removing it will probably fix your problem. Also, if you tie the collector of Q1 to 12V, perhaps with 2k in series, Q2 should be driven into saturation and the voltage drop will be only 100 mV or so. The speaker (buzzer) probably draws enough extra current to cause a higher C-E voltage. Hopefully this answers your question so it can be marked as solved, and no further discussion will be needed. – PStechPaul May 16 '23 at 21:03