I have an Arduino Motor Shield R3 and Uno. I'm trying to drive an air valve that I believe is controlled by Duty Cycle. It's like a relay, but instead of NO/NC contacts, it pushes a rubber puck against a hole allowing air to flow or not.
The winding in this valve has an impedance of 30 ohms and I'm using the 12v molex pin for an older external hard drive to power it.
When I try to use the motor shield it seems like values between 1-254 are outputting lower voltage, not an actual PWM output. When this happens the valve stays fully open until the analogWrite drops fairly low, and then the valve closes and I need to increase the analogWrite fairly high to open it again. I can't use analogWrite to control the PWM to the valve.
Is my motor shield smoothing out it's output and is that avoidable?
I tried some quick and dirty 'bit banging' with the delay command and values from 1-30ms, which worked, but the frequency was not fast enough.
int dim = analogRead(A5);
int dimmer = map(dim,0,1023,1,30);
delay(dimmer);
analogWrite(11, 0);
delay(31-dimmer);
analogWrite(11, 255);
I think I could use the microsecond delay, but I'm worried about not being able to read frequencies.