Read Voltage and Amps from 3DR Power monitor uBEC

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

References

https://discuss.ardupilot.org/t/3dr-power-module/37684

Application

3DR ubec step down

Lithium Polymer (LiPo) Batteries

Arduino analogue read.

Pre-requisites knowledge

Arduino IDE

C++

Github

Download the github using the link below and save it in your Arduino projects folder.

https://github.com/brisbaneroboticsclub/Read3DRUbec

3DR ubec Pinout

The voltage and current sensor measures the voltage and current in the MAIN power circuit. It does not measure the 5 volt circuits.

Add a 12V DC motor to the main power circuit so we have some data to measure.

Connect the Arduino and motor to the ubec

ubecArduinoDC motor
GNDGND
GND
Voltage SensorA0
Current SensorA1
5V
5V
Main VCCMotor +ve
Main GNDMotor GND

On a DC motor, it doesn’t matter which terminal is GND or VCC, the motor will turn the opposite direction.

Run the Arduino code

Now open the Arduino code download from the github.

Connect the Arduino to your computer. Ensure you’re using the right COM port and board type and UPLOAD the code.

Notes:

The voltage and amp signal are received as a ratio of 5V. The Arduino reads the voltage and converts it to a number between 0 and 1023.

We need to rescale this value to represent our data.

We measured the voltage across the DC motor while it was working and recorded 7.3Volts. To rescale the data, we multiplied the analogue value by 50.

You may want to verify the voltage you are reading is the same as the voltage drop across your device on the main power circuit.

The amp draw was too low and we were unable to verify it’s data. We used the same calculation to measure the amps. If you have a better solution, please let us know.

Did it work for you?

If this didn’t work, please message us or raise an issue on our github.

https://github.com/brisbaneroboticsclub/Read3DRUbec/issues

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.