Timing with Arduino

Good day everyone,

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.

Thanks a lot!

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.

25 to 30 Hz seems pretty fast for a solenoid.


Rob

PaulS:

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.

I was able to get a picture of the valve setup today.

Manufactured by Numatics, the model is 051BA400M000061. I was also able to locate the data sheet for the device (http://www.fluid-controls.cn/product-datasheet/numatics-iso5599-2.pdf)

I hope this provides a little more information!

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?


Rob

Graynomad:
What exactly does this mean?

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?


Rob

Yes sir!

OK, all that's fair enough, if that's what you need then that's what you need.

a) I'm still worried about constantly running a solenoid like this.
b) They aren't fast enough anyway.

Also air is elastic, how long is the pipe/hose from the solenoid to the output? You could wind up not getting distinct pulses anyway.

The electronics and programming is easy and an Arduino can handle it, but you need someone with pneumatic experience I think.


Rob

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.

So we've made a small change to our strategy, we're trying to work the solenoid valve at 1 or 2 hz. Would this be easier to pull off?

Would this be easier to pull off?

Makes no difference to the Arduino, but the solenoid is probably breathing a sigh of relief.

So...after getting sidetracked with solenoid frequencies, what was the question again?


Rob

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)

Thanks so much for the help guys!

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.


Rob

Awesome!
I will rig it up today, keeping my fingers crossed!

Thanks!