¿Really 5V OUTPUT from analog PIN?

Hello everybody,

Today I have tried to connect a water pump with my Arduino Nano. The water pump works with a electricity of 1 to 6 volts. It is for this reason that I used an analog PIN to activate / deactivated .

What is my problem?

When i used the next code:

void loop() {
      float voltage;
      analogWrite(A5,255);  
      voltage = map(voltage, 0, 1023, 0, 255);
      Serial.println(voltage);       
}

The Analog PIN only returned 3.2/3.3 Volts. Is it normal?

Aditionally, I have changed the reference voltage for analog PINS without success ( Reference: analogReference() - Arduino Reference ):

analogReference(EXTERNAL);

Thanks for all!

Regards.

Yes, but what are you using to switch the power from your 6V power supply (and what power supply is that) to the water pump?

The pins A0 - A7 are analog INPUT pins, to output an analog voltage use one of the PWM pins, 3, 5, 6, 9, 10 or 11.
The Arduino pins cannot pass enough current to run a motor, you must use a power transistor between the power supply and motor, the signal from the PWM pin controls the transistor.

Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom... :slight_smile: