Author Options:

Controlling Solenoid Valves from a Computer? Answered

How would I go about controlling a few solenoid valves from a computer? These valves run off of 120v source. I understand the question is vague, but anywhere to start me off would be great.



Thanks for The Responses again guys. I am starting to narrow everything down. I have come across this http://cubloc.com/product/03_02cusb22r.php which requires BASIC, and I have been slowly learning it. Now another question. The point of the project is to run a Compressed air engine, using solenoids instead of mechanical linkage. I want to time the solenoids to be firing at the right time of the strokes. At first I wanted to use some functions saying at this point fire solenoids with a specific amount of delay. I'm not sure what sort of exponential function to use. I then thought that if I were to use some cranks sensors, I could tell the solenoids to fire every time the sensors fire. Would anyone know how to program that in BASIC? and what type of crank sensor I could use that would be sensitive enough for High RPMS? Thanks

I would worry about several things, can your program scan a sensor fast enough to trigger the valve. Can the valve be opened fast enough to let enough air into the cylinder when you need it, can it be turned off again, and can your program loop fast enough to cope with the engine speed. Cubloc is cute, but not really designed for this kind of duty from what I've just read.

Well that Cub device claims it has an execution speed of 36,000 times a second. If I were to be running a set of valves, It wouldn't exceed 500 times a second of code. The Valves being able to close and open aren't an issue that needs to be worried about at the moment as I can just move to a different device if needed. I just need to figure out a way of communicating to the valves. Every car now is monitored by OBDII and tons of sensors which easily keeps up with higher revving engines.

Every car now doesn't use a BASIC executable to run it. They use high speed processors and very complex control strategies. The information from the sensor has to be processed fast enough to control the process. 36 K might not be fast enough for you. 10 X that, I'd believe.

Given what you have now added to the question, I'd use an optoisolator and a transistor to fire the valve quickly.

Stick to relays, optos wouldn't drive solenoid valves directly. Steve

Thank you for your response! It was helpful. Is Adruino considered a relay device?

No. Look up "relay" in Wikipedia, and disambiguate it as an electronic component. Arduino is a microcontroller.

You can use relays that work on 5 volts but handle 120 volts that would then control the valves.

Or use optoisolators for the same purpose.

The point is that either will work from the computer and isolate it from the 120 volt line.

Google "serial control" or "parallel control" to find out how to interface the computer to the relay.

Thank you for your response! It was helpful. Is Adruino considered a relay device?

No, I don't think so. You would have to add a relay to the arduino. I could be wrong I don't hack/mod/invent with the arduino.