This is my first post here! I'm a complete newbie with respect to Arduino, but I want to use it for a project I'm doing.
As far as the setup goes, I'm connecting the Arduino to a solenoid valve, and I want to control the opening/closing with a program (which defines the frequency of the air going through the valve).
I'm targeting frequencies of around 25 to 30 Hz (which roughly translates to a switching on/off signal every .04 to .03 seconds).
I would like to know if these frequencies are achievable. I have a hobby Arduino kit, which uses an UNO board.
16MHz / 30Hz ~ 530000 cycles, that's like 256000 cycles before the Arduino has to trigger something (assuming that 30Hz is like switching something on and off 30 times a second) - seems a lot to me. I hope the ATmega328 will not fall asleep in between g
I'm targeting frequencies of around 25 to 30 Hz (which roughly translates to a switching on/off signal every .04 to .03 seconds).
The Arduino can perform 16 millions instructions per second. 0.04 seconds is an eternity. Direct port manipulation, rather than digitalWrite(), can cut down the time needed to switch a pin even more.
The real limiting factor appears to be your hardware. How fast can the solenoid valve react?
How are you powering the solenoid valve? What is the Arduino actually controlling? A transistor, I hope.
I'm targeting frequencies of around 25 to 30 Hz (which roughly translates to a switching on/off signal every .04 to .03 seconds).
The Arduino can perform 16 millions instructions per second. 0.04 seconds is an eternity. Direct port manipulation, rather than digitalWrite(), can cut down the time needed to switch a pin even more.
The real limiting factor appears to be your hardware. How fast can the solenoid valve react?
How are you powering the solenoid valve? What is the Arduino actually controlling? A transistor, I hope.
Yes, the idea is to control using a transistor. I will be going in to look at the valve tomorrow, therefore I should be able to provide more details.
It's too hard to pick the exact device from that table but the fastest of them seem to energise in 12mS and de-energise in 38mS, that's say 50mS for a cycle or 20Hz, almost what you are after but many of them were slower.
BUT
That will mean the solenoid is running continually turning on and off, they don't mention duty cycle but I can't imagine it's designed for that sort of usage.
which defines the frequency of the air going through the valve
What exactly does this mean? Do you need pulses of air every 30-40mS?
The piezo setup that we're using requires pulses of air at certain frequencies so as to facilitate a sort of oscillatory motion on a rubber layer on top of which the piezo strip is attached.
I'm sorry if the previous wording I used was ambiguous!
Graynomad:
Do you need pulses of air every 30-40mS?
I'm no air expert, but couldn't you use some sort of fan turning at the required speed with a nozzle directed at the blades? That would interrupt the air at the frequency that the blades pass in front of it.
The initial question was whether I could run the solenoid at those frequencies - which I then learnt was more of a hardware limitation than anything on the Arduino.
My next (and last question hopefully) is, can I use the solenoid controlling circuit that I found in the Arduino.cc repositories?
(Arduino Playground - HomePage)
Yep that circuit looks good. You just have to ensure that the transistor is up to the job with your solenoids and the ones in that data sheet all seem pretty small at just a few 100mA, well within the TIP102's ability I think.