# analogRead DC Motor - Negative value

I was trying to play with Arduino this weekend and connected a DC motor to `A0` and `GND` to measure the voltage it provides when I rotate it.

However, when I rotate the DC motor with my fingers to test out the readings I see that when rotated clockwise it generates voltage that can be read in Arduino. But when I rotate it counter-clockwise the values I get are 0 - this is probably because DC motor generates negative voltage (?).

How do I fix this so that no matter the direction of the turn I get always positive value?

I am trying to build a simple anemometer, just for fun for kids and plot the values, however can't do much when I get 0 on `analogRead` when wind blows from the other direction..

thanks for any input into this.

• What you're doing is a bit like using a DC motor as an AC generator. So to convert a negative voltage to a positive on in this case you can use a rectifier circuit (its basically an arrangement of 4 suitable diodes) or buy it ready made. The rectifier will make the voltage positive all the time which is what you seem to want-though youll probably need another circuit to sense the direction of the wind. A brushless DC motor is probably a good choice for making an motor based anemometer. Commented Sep 4, 2016 at 9:03
• anemometers only rotate in one direction, because of the shape of the cups. PS you might want to add a resistor between the motor and the Arduino pin, to prevent damage if the voltage is above 5V or below 0V. Something like 10kOhm. Commented Sep 4, 2016 at 9:52
• Some anemometers do measure direction of wind e.g. see wikipedia Commented Sep 4, 2016 at 10:19
• @qwerty10 some do, but not the one shown in the picture. Commented Sep 4, 2016 at 12:25
• @Gerben, thank you - that makes sense to allow the motor to spin in only one direction. All i really need is to show kids if there was wind or not and how 'big' it was - no details, just a fancy color graph. Let me try that, thank you all for your help.
– PeeS
Commented Sep 4, 2016 at 13:15

Another way is using Voltage divider to provide `1/2 Vcc` to one of the motor terminals. But then you can measure just `1/2 Vcc` in both directions (without another Voltage divider)