Shop OBEX P1 Docs P2 Docs Learn Events
How to measure volts from VDC input — Parallax Forums

How to measure volts from VDC input

plau45plau45 Posts: 109
edited 2014-08-28 16:38 in Learn with BlocklyProp
I have no idea how to find the volts that the 6-9 VDC input has left in it without buying a measurement tool for it. I would like to be able to place this on a controller for me to view the battery life of my aircraft so I don't crash and burn with no battery life left. If any one can help me out or point me in the right direction it would be much obliged. This is on the activity board, using a 9 volt battery, and I am coding in C just so you all know. Thanks.

Comments

  • kwinnkwinn Posts: 8,697
    edited 2014-08-27 20:27
    There is a 4 channel adc on the activity board you could use for that. All you need to add is a 2 resistor voltage divider to reduce the input voltage to a 0 - 5V range. A couple of 10K resistors should work.
  • plau45plau45 Posts: 109
    edited 2014-08-28 06:52
    Ok after thinking about it I realized I would need to involve that. I just don't know how to link the ad channel. Is there anyway to do this through code and a couple of jumper wires and resistors or do I need to link the whole battery pack to the breadboard and than to the ad converter. This is where I got lost in figuring it out. I also plan on using this as a function with a return value instead of global variables.
  • kwinnkwinn Posts: 8,697
    edited 2014-08-28 14:42
    You could do it either way, but it would be wise to try it out on the breadboard first. Then if you want to make it permanent transfer it to the activity board.
  • plau45plau45 Posts: 109
    edited 2014-08-28 16:38
    Ok thanks.
Sign In or Register to comment.