2

After failed attempt to combine a resistive wetness sensor with a multivibrator ( How to trigger multivibrator (or similar) from collector? ), I'd like ask a direct question.

What could be schematics for simple device, which has parallel wires in a textile with approx. resistance of 1MΩ when wet (and zero conductance when dry) as a sensor and some sound generator as a 8Ω speaker output? If possible, done with discrete transistors and other widely used cheap components (no ICs)?

Working voltage no higher than 5v DC.

I will still try answers to the above mentioned question, but I have a feeling, that the design I tried there is badly flawed.

Roman Susi
  • 985
  • 3
  • 13
  • 30
  • 1
    Are cheap and common ICs off the table? There are many problems (this being one) where an IC solution will be cheaper and perform better than a discrete solution, while still being very cheap and easily sourced. – Phil Frost Jul 10 '13 at 14:32
  • Nowadays even small microcontrollers are part of very cheap toys (which is IMHO overkill). I am hoping for solution, which does not require even PCB, so maybe SMDs are ruled out. Please, judge yourself, taking into account usefulness of the answer for large audience of people. – Roman Susi Jul 10 '13 at 14:43
  • I understand what you mean about microcontrollers. You can always glue an IC upside-down on a board [dead bug style](http://www.laureanno.com/RC/Aiptek-1-3M-RC-Switch1l.jpg) and solder to the leads if you have a simple circuit. – Phil Frost Jul 11 '13 at 03:31

2 Answers2

4

Here is a simple way to trigger a sound output whenever the moisture sensor's resistance drops to the 1 M range:

schematic

simulate this circuit – Schematic created using CircuitLab

  • When the sensor resistance is effectively infinite, the 2n7000 gate will be pulled low, hence it will not conduct.
  • As the sensor resistance drops towards the 1 M range, the voltage at the gate will be pulled higher, to the point where the MOSFET begins to conduct.
  • At this point, the piezo buzzer will begin to make a sound.

Continuous sound piezo buzzers are inexpensive, and need no additional circuitry: Once they have power, a tone sounds, and continues until power is removed (i.e. MOSFET stops conducting due to sensor drying up).

Such buzzers are available for as little as 50 cents, for instance on eBay, $2.90 for 6 units, with free international shipping.

Anindo Ghosh
  • 50,188
  • 8
  • 103
  • 200
2

You are likely to have two problems with this sensor:

  1. it has a very high output impedance (\$1M\Omega\$) and so can not supply much current
  2. it will change very slowly as it transitions from "wet" to "dry", but you likely want your buzzer or or off, not something in between.

Consequently, you want to measure the resistance with a high input impedance. And, you want something with a whole ton of gain, and perhaps some hysteresis, to keep the buzzer definitely in an on or off state.

There is a device that is cheap and available that does both these things: the comparator. LM339 is a very common variety. Comparators can also be made from discrete components, although it's usually more expensive to do so.

The comparator has two inputs, compares them, and outputs high or low based on which is greater. By connecting your resistive sensor through another resistor, forming a voltage divider, and measuring the voltage in the middle with the comparator, you can distinguish between wet and dry:

schematic

simulate this circuit – Schematic created using CircuitLab

Adjust R2 so that at the threshold you wish to detect, the voltage between R1 and the sensor is the same as the voltage at R2's wiper. You can also change R1.

Since the LM339 has an open collector output, you can conveniently use it to switch power to your buzzer circuit, provided you don't exceed the \$16mA\$ of current specified in the datasheet. If you need more current, follow it with another transistor.

If you still find that the circuit doesn't transition cleanly between on and off, adding hysteresis between the comparator and the buzzer may be the solution. A Schmitt trigger is a common circuit that does just that. 74HC14 is a common variety, or it can be built with discrete components or even the other 3 comparators in the LM339 with examples easily found on the web.

Phil Frost
  • 56,804
  • 17
  • 141
  • 262
  • This looks good. Some questions: 1) what is "1/4" before LM339? 2) Wikipedia mentions non-inverting comparator ( http://en.wikipedia.org/wiki/Schmitt_trigger#Non-inverting_Schmitt_trigger ) to implement Schmitt trigger, is it possibly suitable? 3) You mention buzzer circuit. Is it still just piezo buzzer or can I connect multivibrator at last? Thanks! – Roman Susi Jul 11 '13 at 03:22
  • @RomanSusi the "1/4" means you are using just a fourth of the IC (it has 4 comparators). The comparator-based Schmitt trigger would work fine. You can connect your multivibrator as long as you don't exceed the current specifications of the comparator; I don't know what current your multivibrator circuit requires so I can't say. If you use the comparator to drive an external transistor, you can handle a much larger current. – Phil Frost Jul 11 '13 at 03:26
  • Does it mean, that I can implement Schmitt trigger by using "2/4" of LM339 connected in non-inverting mode (as on the wikipedia page)? – Roman Susi Jul 11 '13 at 03:29
  • @RomanSusi it sure does. Probably that's what I should have suggested in the first place. You can even cascade them together for more gain, since you have 4. I'd build the circuit with just the comparator, and see if more gain or hysteresis is necessary. Buy several (they are cheap), and experiment. – Phil Frost Jul 11 '13 at 03:34
  • If the comparator has an open-collector output, how can it activate the external NPN transistor? – m.Alin Jul 11 '13 at 07:35
  • @m.Alin it isn't external. That's what the box around them is meant to indicate. – Phil Frost Jul 11 '13 at 11:28
  • @Phil My bad, I missed the box.. – m.Alin Jul 11 '13 at 11:34
  • @Phil Is that amplifier in the box? Can I use UA741 instead + NPN transistor? Also, does "buzzer circuit" mean, I can use, for example NE555N in astable mode + mosfet to generate sound with low ohm (8ohm) speaker? – Roman Susi Jul 16 '13 at 17:57
  • @RomanSusi the amplifier is a comparator. UA741 is an op-amp, which is [similar, but not the same](http://electronics.stackexchange.com/questions/72967/difference-between-differential-op-amp-and-comparator). The buzzer circuit can be anything you want that makes noise when given 5V. It could be a 555, it could be a piezo buzzer with an oscillator, or it could be your discrete multivibrator from earlier. The only requirement is that it doesn't draw more current than the comparator (or an external transistor, if you are using one) can handle. – Phil Frost Jul 16 '13 at 18:42
  • Thanks for explanation. I will wait for the proper part to arrive then. – Roman Susi Jul 16 '13 at 19:38
  • @Phil Frost: I've build the circuit, and accepted your answer. I have a small subquestion though: as I have 4 comparators on IC LM339N, can I also make an astable multivibrator with it as seems to be doable with opamp http://www.simplecircuitsandprojects.com/circuits/astable-comparator.html (if this is possible, I can even make a siren by using one more comparator, right?)? Thanks. – Roman Susi Jul 18 '13 at 20:09
  • @RomanSusi yes, that could be a very elegant solution. The only tricky bit is that circuit is using a 741 op-amp, which has a *totem-pole* output, which can sink and source current. The 339 has an *open collector output* which can only sink current, so you need to add a *pull up resistor* at the output to make it work. Hopefully you are now seeing why comparators are so useful and cheap :) I suggest you get a handful of comparators and op-amps and experiment. If you get stuck, you can always ask more questions. – Phil Frost Jul 18 '13 at 20:28