controlling valve on/off frequency

Status
Not open for further replies.

ribas

New member
Hi,

I'm kind of new in these things, if you can help it would be awesome!

I want to build a controller that allows me to change the frequency of on/off of a solenoid valve (5V). But, I also wanna have two input keys going to the Teensy and a small LCD - the goal is to increase or decrease the frequency within a certain range (let's say 0.1Hz - 2 Hz in 0.1Hz intervals).

Is this feasible or even possible?

Thanks!
 
This is feasible.

You'll need to take care to electrically isolate your solenoid valve from your microcontroller. When the magnetic coil in the solenoid is switched off, it can damage the microcontroller by dumping current resulting from the collapsing magnetic field. One common way to do this is with an optoisolator. The datasheet of your valve to should tell you if the frequency range is achievable. Any microcontroller will be able to go faster than your solenoid valve.

For input keys, I've found it very easy to use the touchRead() feature of the Teensy 3. You can connect a wire to just about any conductor to make a button. There are plenty of other button choices. There are a couple of gotchas with physical buttons. A pull-up or pull-down resistor is typically needed to avoid leaving an input floating. Also, the button press isn't a single instantaneous event. The input will need to be debounced.

There are also many LCD choices. I would look for something that required fewer wires than the old 16x2 LCDs with a parallel interface. These typically require about a dozen wires. If the LCD module has an I2C interface you'll only need four wires.

Hope this gets you started. :)
 
Thank you for the help and advice. Will google these things and try to figure out a way to do it! :)

Two simple questions:

1. Using the touchRead(), how can you differentiate different buttons? It's as easy as connecting them to different pins?

2. Any recommend cheap and small LCD with I2C?

Thanks again!



This is feasible.

You'll need to take care to electrically isolate your solenoid valve from your microcontroller. When the magnetic coil in the solenoid is switched off, it can damage the microcontroller by dumping current resulting from the collapsing magnetic field. One common way to do this is with an optoisolator. The datasheet of your valve to should tell you if the frequency range is achievable. Any microcontroller will be able to go faster than your solenoid valve.

For input keys, I've found it very easy to use the touchRead() feature of the Teensy 3. You can connect a wire to just about any conductor to make a button. There are plenty of other button choices. There are a couple of gotchas with physical buttons. A pull-up or pull-down resistor is typically needed to avoid leaving an input floating. Also, the button press isn't a single instantaneous event. The input will need to be debounced.

There are also many LCD choices. I would look for something that required fewer wires than the old 16x2 LCDs with a parallel interface. These typically require about a dozen wires. If the LCD module has an I2C interface you'll only need four wires.

Hope this gets you started. :)
 
Status
Not open for further replies.
Back
Top