USB/Optocoupler controlling a solenoid

wayneh

Joined Sep 9, 2010
17,498
Try this.
Max.
+1
That's exactly what I was picturing.

Do we know the solenoid current requirement? That impacts the choice of the darlington. Sort of. You could just choose one rated up to 5A or so and assume it's overkill unless you choose a whopper of a solenoid. The solenoid current will be related to the mechanical work you need it to do, which you need to estimate. Force and distance, that sort of thing. If you need it to exert a force of 10 lbs for 0.1 feet in 0.1 sec, that requires a power of at least 1 ft•lb/s, and whatever that converts to in watts.
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
28,686
By the way.... is there anything in special that I should worry when I purchase those items?
In what way, the part numbers are pretty common and standard.
The resistors only need to be 1/4watt.

IIRC the TIP120 is rated for 5a continuous so unless this a really large solenoid, which I don't envision by the sound of the application, and the normal medium size 24vdc hyd sol is around 1.5a.
Max.
 

Thread Starter

rafaelluizmesquita

Joined Aug 8, 2013
38
+1
That's exactly what I was picturing.

Do we know the solenoid current requirement? That impacts the choice of the darlington. Sort of. You could just choose one rated up to 5A or so and assume it's overkill unless you choose a whopper of a solenoid. The solenoid current will be related to the mechanical work you need it to do, which you need to estimate. Force and distance, that sort of thing. If you need it to exert a force of 10 lbs for 0.1 feet in 0.1 sec, that requires a power of at least 1 ft•lb/s, and whatever that converts to in watts.
The solenoid does not need to be very big. It only will lift a squared frame with a mirror of about 6" to 7" in the side. It's not gonna be more than 200 grams.
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
Are you manufacturing this yourself?
If so you can calculate the current (I) by measuring the resistance.
I(a) = E(24v)/R (resistance of the coil).
Max.
 

Thread Starter

rafaelluizmesquita

Joined Aug 8, 2013
38
Are you manufacturing this yourself?
If so you can calculate the current (I) by measuring the resistance.
I(a) = E(24v)/R (resistance of the coil).
Max.
I could manufacture it by myself. But it would be as reliable as an industrialized one. We need it to be reliable and cheep... I didn't receive any response about the kind of solenoid they will use. It seems that they want to you a two way solenoid, like a push-pull thing. This is funny because those are kind of expensive. Either way, I am about to purchase the components that you said it would work. I see that it makes perfect sense. Seems that the optocoupler only works fine with a controlled voltage in its 5V terminals. I really need to have some kind of electronics course...
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
It seems that they want to you a two way solenoid, like a push-pull thing. .
If it is a double acting valve or solenoid, then there are two coils involved?
It may help to get some idea or details of the project as so far it has been rather vague?

Seems that the optocoupler only works fine with a controlled voltage in its 5V terminals..
I showed 5v as you had mentioned USB port?
The Optocoupler as shown requires 5v and the switching signal.

I really need to have some kind of electronics course...
Right here!;)

http://www.allaboutcircuits.com/vol_3/index.html
 

Thread Starter

rafaelluizmesquita

Joined Aug 8, 2013
38
hahaha! Great Max... Thank God you guys are helping me out... I will show up with a whole lot of problems in the future...

Well... I just got their message. They will purchase this solenoid: http://www.digikey.com/product-detail/en/F0464A/527-1023-ND/668308

So do the same circuit will work for this solenoid. In fact they will purchase two of those. One to pull the window open and other to pull the window close. I wonder if I could use pin 5 and 4 to control each one of those solenoids...

Well... for now I will test the whole thing with LEDs. I will purchase some LEDs and try to light one with 5V on one side and light the other when the power goes out.

That would be a great exercise...

Thank you one more time Max!
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
That appears to be a retained by power on type, rather than latching so it just needs 600ma continuous which is well within the range of the TIP120.
It may be possible to use the latch/unlatch type solenoid using the same as the latch solenoid for the unlatch shutter, but you would need bi directional switching in this case.
You will need two circuits for each solenoid in your case.
Max.
 

Thread Starter

rafaelluizmesquita

Joined Aug 8, 2013
38
only because I'm curious, how do you remotely control via a USB port, using the proposed circuit?
We already have a script to send a pulse to control any usb port we can shut it down for exemp. So,the goal should make the script shut down one of the usb ports at moment we need the window to open. Whenever we finish our business we can just turn it back on and close the window.

My original thought was to use pin 4 and 5 with two solenoids. Whenever one pull one side the other relax.

But we can substitute one solenoid using a spring. Solenoid push the spring and the window. Whenever we want it to close the spring push itback.
 

Thread Starter

rafaelluizmesquita

Joined Aug 8, 2013
38
That appears to be a retained by power on type, rather than latching so it just needs 600ma continuous which is well within the range of the TIP120.
It may be possible to use the latch/unlatch type solenoid using the same as the latch solenoid for the unlatch shutter, but you would need bi directional switching in this case.
You will need two circuits for each solenoid in your case.
Max.
I've said to my professor to order the parts. Let me see if he Will trust in this or not. Meanwhile I'll study a little bit. Thanks Max and thank you guys. I'll be back to you in a couple of days.
 

shortbus

Joined Sep 30, 2009
10,045
only because I'm curious, how do you remotely control via a USB port, using the proposed circuit?
I agree with GetDeviceInfo, how are you using the USB? In the home CNC machines they are just now starting to come up with "break out boards" for them to control the motors. You would need, I think(could be wrong) A separate control and dedicated wire to each solenoid, to use USB. If just shutting the USB on and off, all of the connected devices would operate/trigger at the same time.
 

Thread Starter

rafaelluizmesquita

Joined Aug 8, 2013
38
I'm thinking that the USB spec doesn't provide for shutting off the power bus. On device suspend, or nothing connected, you can idle down to .5 ma @ 5 volts. You could toggle the data lines, but they are sunk with 1.5Kohms.
They only ask me to worry about the circuit part. I don't think I need to worry about that. But anyway, we have plenty of usb ports available... so it should be no problem at all to use one usb port per solenoid and two separate circuits if the requirement is that.

I am fairly confident that they can just enable and disable one specific usb port. Once they do that, we wont have 5V or the other way around, activating the solenoid or not. So it should be no problem to control that right?
 

Thread Starter

rafaelluizmesquita

Joined Aug 8, 2013
38
If multiple outputs are required it may be wiser to look at the parallel port, if available, and use it as an I/O port, which has been done for some time now?
You can find alot of info out there on controlling the P.P.
http://www.linux-cae.net/Projects/Parallel/Dage/parport.html
Max.
lol... it worked Max!!!... The circuit that you posted here, worked almost perfect... Whenever I switch to off the 5V, the 24V goes off...

But still we have a minor problem... Whenever I switch to off the 5V, the 24V goes off, but slowly... starts with a couple mV then in 3 or 4 seconds goes to zero... what do you think the issue is?
 
Top