Transistor water alarm

Transistor water alarm

As my pack of 100 NPN transistors off e-bay just arrived it seems like a good idea to try to use them. While I have basic electronics knowledge I never actually took the time to learn how to make transistors work so this would be the perfect moment to do just that. So I took one and placed it on my prototyping board and started experimenting. After creating the most basic transistor LED circuit I was very surprised to see how much it actually amplifies; it could light up the LED just by me moving my hand around its base. Of course I knew that’s possible I just expected that to be something you do with at least a Darlington if not even more amplification.

Having that down I had to figure out how to invert the signal so that I get a NOT gate, as I needed the light to be on when the transistor was not amplifying, not when it was. So I sketched the following diagram in conjunction with breadboard experiments:

Where A and B are the terminals that go into the soil, and the 68K resistor is purely defined by the expression “good enough”. I might have been able to use a higher one but

I = U/R = 5/68000 = 0.07mA

was good enough. Note: the Arduino is there because it was the only way for me to deliver power to the board using its VIN and Dupont connectors. I could have done the project using only one transistor and the Arduino to invert the signal but I really like cutting energy wherever I can so I spent the extra time doing it low-level.

While there is current flowing from A to B through the humidity in the soil, the first transistor conducts so current prefers to go directly to ground instead of towards the second transistor. When the connection is broken, the first transistor closes and current flows to transistor two which then conducts through the LED, lighting it up.

I then put the components on a solder breadboard and managed (surprisingly) to make it work without any other sketches or diagrams.

After adding the two sense wires the circuit was done and working. I attached an USB connector and am feeding it from a standard USB brick but a lithium cell would work fine I imagine.

By the time I’m writing this I discovered a big issue with the device which you might have noticed. Hopefully the next related post will successfully remedy it.

Thanks for reading!

Leave a Reply

Your email address will not be published. Required fields are marked *