LTSpice first time user q

Thread Starter

pdc

Joined Mar 1, 2009
10
Hello,

I want to make a simple "dryness" checker for a hydroponic setup. I just finished reader about inverters and using one as a switch seemed plausible for this application. I made some probes from galvanized wire and got about 10k ohms in dirt when real wet. My power source is a small solar panel rated at 7v. Can't remember the amps at the moment, but probably dismal. But it does drive a small pump. Comes as a set from Harbor freight. The basic idea is to turn on a transistor when things are wet and turn it off when not and use the "when not" voltage available to drive the pump. Downloaded LTSpice this eve, created a "behavioral" resistor to represent the probes driving, or not driving the base of the transistor. The load is pretend, just using a resistor. The question is, would this be adequate as a simple switch for this type of application.

Thanks,
Paul
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
You might try it something like this:



Now that I re-read your problem statement, I see that I have the action reversed; this will turn on the pump (Rload) when the soil is dry, and turn it off when wet. Swapping Rsoil and R4 will invert the function; on when wet, off when dry - but you'll need to change (decrease) the resistance of R4.

The basic idea here is that R4 and Rsoil are a resistive divider; if the base of Q2 exceeds ~1.3v, the emitter of Q2 will source current to the base of Q1, turning on the load. Q1 amplifies the current available from the junction of R4/Rsoil. The collector current of Q1 (thus the base current of Q2) is limited by R1.

I don't know what purpose R3 is supposed to serve, but it wastes power. Perhaps you were using that as a sort of threshold control.
 

Attachments

Thread Starter

pdc

Joined Mar 1, 2009
10
Thank You for taking the time to look and improve on it. R3 was a guess at the load of the pump motor (haven't measured current on it yet). R2 was what I think is called a pull-up resistor. I was modelling it after a inverter in an old college text book titled "Principles of Integrated Electronics". I like your idea much better, because it can be reversed.

Thanks Again,
Paul
 

SgtWookie

Joined Jul 17, 2007
22,230
You're welcome.
Q2 could be replaced by a Darlington transistor to make the circuit response more of an "on/off" type thing, due to the greatly increased current gain/hFE of the Darlington. It would also increase the ON threshold from around 1.3v to around 2v.

I didn't use a Darlington for the load, as Darlington transistors have a built-in "loss" due to their relatively high saturation voltage. Even under light load, a Darlington will lose ~0.7v or more from collector to emitter.
 

Thread Starter

pdc

Joined Mar 1, 2009
10
I made the changes you suggested by reversing the voltage divider resistors and it looks really promising. A little tweaking and figuring how to get LTSpice to make the switch on time show up so I can see it, I get about 90K ohms of off time, which my measurements suggest would be good, at least for my tomato plants. Time to breadboard it up. This LTSpice thing is fantastic. I found it off of one of you posts, so another thanks.

Cheers,
Paul
 

SgtWookie

Joined Jul 17, 2007
22,230
Glad you're finding it useful. :)

I should have moved R3 to between the base of Q1 and ground; to keep Q1 turned off unless Q2 was actually sourcing current. 2k would be a good value to use.

Keep in mind that these simulations are just a starting place to more or less validate a design. The trouble with simulations is that all of the components are "ideal", and you can't buy ideal components. However, it does give one a good starting place for a circuit that would be worthwhile to breadboard.
 
Top