I am working on creating a blood pressure monitor, and need to have a mini air pump (KPM14A) inflate our arm band. The mini pump works great if we plug it into the 3.3V power input and the ground, however we cannot get it to inflate 'on command' from the pins.
I know that the Arduino 101 digital pins 3,5,6, and 9 can be utilized as the analog input pins, and if we use 255 it should equate to a voltage of 3.3 V. However, this does not run our motor. We have checked the output voltage with an LED and with a multimeter.
Does anyone know what I am doing wrong?
void setup() {
pinMode(9, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(9, 255);
}
I am working on creating a blood pressure monitor, and need to have a mini air pump (KPM14A) inflate our arm band. The mini pump works great if we plug it into the 3.3V power input and the ground, however we cannot get it to inflate 'on command' from the pins.
I know that the Arduino 101 digital pins 3,5,6, and 9 can be utilized as the analog input pins, and if we use 255 it should equate to a voltage of 3.3 V. However, this does not run our motor. We have checked the output voltage with an LED and with a multimeter.
Does anyone know what I am doing wrong?
void setup() {
pinMode(9, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
analogWrite(9, 255);
}
A couple of things:
Pins 3,5,6,9 may act as PWM pins. These aren't analog outputs although they serve for what you want. For more information about PWM, you can search the web. In any case, they cannot be analog inputs.
You can't conect a motor to a pin in the arduino because they can only provide 20ma of current. I would use a proper motor driver.
Just to expand on edsa's response, take a look at this example that uses an arduino with a transistor to control a motor in one direction. Basically, the transistor allows you to use the small output current from the arduino pins to control a power souce capable of supplying larger amounts of current.