Photoresistor triggered solenoid, need help

Jan 02, 2006 37 Replies

I am digital electronics noob and it's been a long time since I've even tinkered with this stuff. I am trying to design/build a simple circuit to test a software application I am developing. I have a 12v solenoid that I want to fire/push when I light up a certain area of the monitor.



I was hoping to use a photoresistor which I can tape to the monitor. I have an assortment of 5 but the one I was trying to use has a resistance of 800 ohms when the monitor is lit and 12k ohms when the monitor is dark.



Can anybody suggest some approaches or even better design a simple circuit that I could use to do what I described.



Summary of current parts, I can purchase additional ones if needed:



12V/3A power supply CdS Photoresistor (800 in light, 12k in dark) NPN transistors
741 Opamp chip
12V solenoid (30Watt power rating)

Wow, thanks for the quick replies. I'm going to give the suggestions a try in the morning. In regards to writing output to the serial or parellel port, the idea with this circuit is to test the software timing externally without adding any new components to the actual system.

It can be done straight with one NPN transistor like the 2N3904: one side of the photoresistor to the +12v, the other side to the base of the transistor, then another 33o ohm resistor from the base to ground. The emitter also to ground. A load from the collector to +12v cannot drive more than a hundred milliamp so you may need to add a more powerfull transistor at the output or a small relay (don't forget the reverse diode in parallel with a coil to kill reverse voltage spikes when transistor switches off...)

Tim

the

use

connect

to

When you say "Light up the Monitor" are you just sellecting an area? If so, you can write code to the serial or parrellel port that will energize the relay.

The concept is to take the 741 and use a pair of resistors from 12V to Ground to make are referance voltage which is connected to one input on the

741. Use the photoresistor and a fixed resistor to make voltage the goes above the and below the referance voltage as the light is on and off.

The output of the op amp will go hi or lo as the light goes on and off. use the op amp out to drive the transistor thru a resistor to the base, connect the emitter to ground and the collector to the solenoid with the other end of the solenoid to +12V. Put a diode across the solenoid with the cathode to the +12 to prevent the inductive kick when from the solenoid when it is turned off from destroying the transistor.

You might have to swap inputs to the 741 to make the solenoid On and Off under the correct conditions.

Dan

Dan Hollands 1120 S Creek Dr Webster NY 14580 585-872-2606 dhollan3@rochester.rr.com www.QuickScoreRace.com

With only a 12V supply, the 1n914 isn't needed.

At this point the 741 isn't doing much, how about designing it out of the circuit?

Thanks, - Win

Not really an issue. With a 12V supply the 2n2907 has only 3.25V on its base, and there's no transistor that has reverse Veb breakdown below, say 5V, so a diode isn't needed to "protect" the transistor. In fact the supply voltage can be raised to 18.5V for 5V breakdowns. I've personally never seen an NPN breakdown voltage below 6V.

Thanks, - Win

It's Aylward VOLTAGE bias ?:-)

...Jim Thompson

| James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | | http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

I come back with this ASCII schematic. This can do the job without any op amps.

+12V o---------+-------+-----+ | | | | | | | | | | C | | O | | I | [Cds] L | | | | | | | | | | | +-|>|-' | | 1N4001 | | D1 | | |/ Q1 +-----| 2N3055 | |>

R1 [330] | | | gnd o----------+-------+

When the Cds is 12K, there is only 0.3V at the base of Q1 so it is off. When Cds is 800 ohms or even a few kiloohms, the base is heavily driven, enough for a 2N3055 to latch the solenoid. The impedances are so low that, unless the distance between the Cds and the transistor is very long, there is no need for shielded wires. Even in extreme conditions (space radiation, nearby transmitter, ligthning, etc :), a small 0.1uF capacitor can be added at the base to filter any interfere.

Alright, you've all confused me to some degree =) I'm not sure there was a consensus as to which of the above circuits will work. I favor simple ones as I mentioned before, I'm rather ignorant and unexperienced with most of this stuff.

All the parts I currently have are from RadioShack which is where I'll ideally get any further needed parts because they're close by and I don't have to order them. The transistors I have are a 2N4401 and a package of these generic switching transistors ...

formatting link

I'm ready to run out and get any additional parts I need and build this bad boy, let me know which one I should take a crack at first. Thanks again for so much help!

Not enough gain? All right! Then let's go for a cheap Darlington... ;)

+12V o---------+-------+-----+ | | | | | | | C | | O | | I | | L | [Cds] | | | | | | +-|>|-| | | | +--+ | | | | |/ | Q2 +--| | 2N2904 | |> | | | |/ Q1 +-| 2N3055 | |>

R1 [330] | | | gnd o----------+--------+

Oops again! Damn keyboard..! I meant 2N3904 for Q2 of course, as the 2904 is a PNP... even worse lockup!

Tim

It is non-trivial driving that big solenoid with a 741 comparator. You will need something like this: View in a fixed-width font such as Courier.

. . .------------------------------+-------+-----+------. . (+)-----+------+----. | | | | . | | | | | | | . | |\\|741 | | S | | . | | \\ | | S [3.3,1/2W] | . | | >--------[470]-. | S | | . | | / | | | S | | .12VDC | |/| [2.7K] .|>|-+ [39/5W] S | | . +| | | |914 | | | | | . === | | | |< | | | | . 100U | +-----+--|2N2907A | | | | . | | | |\\ | +-|>|-' | . | | | | |/ | 3A,100V +| . | | | +-----|2N3055 | === . | | | | |> | 10U . | | [1K] [2.2K] | |/ | . | | | | +-----| 2N3055 | . (-)-----+------+----+----------' | |> | . | [100] | | . | | | | . '------------------------------+-------+------------+ . . . . . .

If the CdS is located any distance from the main circuit then you will want to use shielded twisted pair to connect to it. A simple threshold detector that requires no adjustment would be something like this: View in a fixed-width font such as Courier.

. . 12V . | . .------+----------. . | | | . [3.9K] [4.7K] | . | | .-[33K]------. . | | | | | . | | | |\\| 741| . .-[12K]-+---------+-----|+\\ | . . ---. | | | | >---+->

. | | | |/ +--------|-/ . ----- | TP .---+-----|2N2222A | |/| . /\\ /\\| XXXXXXXXXXXXXX | |> | | . ----- | -------------' | | | | . CdS | | SHLD | [100K] | [4.7K] | . '--- ' | | | | | . | | | | | . '---+-------+------+----------+ . | . --- . /// . .

This one does a little better on pickup suppression: View in a fixed-width font such as Courier.

. . 12V . | . .------+----------. . | | | . [3.9K] [4.7K] | . | | .-[33K]------. . | | | | | . | | | |\\| 741| . .-[12K]---+---------+-----|+\\ | . . ---. | | | | >---+->

. | | | |/ +--------|-/ . ----- | TP .---+-[10K]-|2N2222A | |/| . /\\ /\\| XXXXXXXXXX | |> | | . ----- | ---------' | | | | . CdS | | SHLD | [100K] | [4.7K] | . '--- ' | | | | | . | | | | | . '---+---------+------+----------+ . | . --- . /// . .

The solenoid driver portion: . . .------------------------------+-------+-----+------. . (+)-----+------+----. | | | | . | | | | | | | . | |\\|741 | | S | | . | | \\ | | S [3.3,1/2W] | . | | >--------[470]-. | S | | . | | / | | | S | | .12VDC | |/| [2.7K] .|>|-+ [39/5W] S | | . +| | | |914 | | | | | . === | | | |< | | | | . 100U | +-----+--|2N2907A | | | | . | | | |\\ | +-|>|-' | . | | | | |/ | 3A,100V +| . | | | +-----|2N3055 | === . | | | | |> | 10U . | | [1K] [2.2K] | |/ | . | | | | +-----| 2N3055 | . (-)-----+------+----+----------' | |> | . | [100] | | . | | | | . '------------------------------+-------+------------+ .

What's with all the 2N3055s? Surely a power mosfet would be better - you could drive it straight from the 741. Perhaps with a pulldown or use a LM358 instead, to make sure it turns off.

John Devereux

Ugh- you're such a stickler for economizing on parts, but you never know what transistor he will eventually use.

I see what you mean- but just in case pickup proves to be a problem, the

741 leaves the option of unlimited filtering of the CdS line while maintaining microsecond grade switch times into the driver, and besides using 741's is fun.

Geez- thanks for the inside scoop:-)) I don't see power MOSFETs in the OP's parts list lineup though....2N3055s are available from RS and the overhead is only 10% of his solenoid dissipation. The only RS MOSFET, the IRF510, is unsuitable and they are $2 each.

10mA base drive for a '3055 2.5A load makes for an Ic/Ib=250, that's not even on the charts. Your circuit will hang . Why don't *you* breadboard it?

I just knew you'd appreciate my pearls of wisdom there :)

No reason to suspect his "NPN"s are 2N3055's either though, right? If he is going to have to buy a suitable transistor anyway, perhaps there are better choices.

Hmm... why is it unsuitable (technically)? Seems like it should work. How much do all those transistors add up to, plus that 5W resistor if he can get it?

John Devereux

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required