moli.hu
Posts: 3
Joined: Sat Apr 19, 2014 11:56 pm

measure own voltage through testpoints?

Tue May 27, 2014 3:10 am

Hello,
Is there a way to the Pi to measure it's own 5V voltage by soldering wires to the TP1+TP2 test points on the board and connecting them with something to the gpio? Or will it fry the board? I'm dumb to electronics. If it's ok, how to do it exactly? The Pi is fed from the mains through the microUSB port!

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: measure own voltage through testpoints?

Tue May 27, 2014 4:09 am

Yes, it is possible. You will need an ADC (Analogue to Digital Converter) of some sort, probably one that will connect to the I2C bus on the gpio. You will only need to conect to the +5V test point, as the 0V/GND point is already connected to the gpio GND internally.

You could also use the 5V pins on the gpio as a test point, rather than soldering wires to the board. If you do that you might as well monitor the 3.3V pin as well :)

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: measure own voltage through testpoints?

Tue May 27, 2014 4:17 am

moli.hu wrote:Hello,
Is there a way to the Pi to measure it's own 5V voltage by soldering wires to the TP1+TP2 test points on the board and connecting them with something to the gpio? Or will it fry the board? I'm dumb to electronics. If it's ok, how to do it exactly? The Pi is fed from the mains through the microUSB port!
The Pi is NOT fed from the mains through the microUSB. It is fed 5V DC.

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: measure own voltage through testpoints?

Tue May 27, 2014 4:20 am

I think you need a reference voltage. I guess the 3V3 rail could be used as it's meant to be regulated from the unregulated 5V input. You'd have to voltage divide the 5V down to get it within the regulated range to feed into the ADC.

moli.hu
Posts: 3
Joined: Sat Apr 19, 2014 11:56 pm

Re: measure own voltage through testpoints?

Mon Jun 02, 2014 2:47 pm

@rpdom:
You could also use the 5V pins on the gpio as a test point, rather than soldering wires to the board.
Is the 5V on the gpio the same as the 5V on the TP? I mean what was the reason of the Foundation to include a TP when that 5V could be measured on the gpio? There should be something behind this.
You will need an ADC of some sort
OK, what sort? I'm completly new to this, all i did so far was to solder a few wires my cat chewed on, solder back a displaced speaker to the pcb in my dect, solder off the beeper from my microwave (hated that), etc.
Please give me a shopping list with the item list i could google for and learn more about.


@joan:
I think you need a reference voltage.
ok, but what if that "3V3" is varied by the 5V input? Is it?
Could i calibrate the ADC by using a multimeter once? Or will the calibration drift away in time, or change with the temperature?

User avatar
Douglas6
Posts: 4860
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: measure own voltage through testpoints?

Mon Jun 02, 2014 4:04 pm

moli.hu wrote:I mean what was the reason of the Foundation to include a TP when that 5V could be measured on the gpio? There should be something behind this.
Can't help with your other questions, but I suspect the reason for the TP pads is simply to make automated testing easier. Easier to connect to pads via a coupla pogo pins in a testing jig than to try and connect to a GPIO pin, and less possibility of damage in a robotic testing process. A handy spot to poke a multimeter probe is just a side benefit. If you look at the schematics, I'm sure you'll find a direct connection between the TP pads and the 5V and GND GPIO pins.

User avatar
rpdom
Posts: 17173
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: measure own voltage through testpoints?

Mon Jun 02, 2014 4:26 pm

Douglas6 is correct in that the TPs are directly connected to the GPIO supply pins.
moli.hu wrote:ok, but what if that "3V3" is varied by the 5V input? Is it?
The 3V3 is supplied from the 5V input via a 3V3 regulator, so as long as the input is at least enough to drive that regulator then the 3V3 line will be exactly 3V3 (within tolerances).

hampi
Posts: 223
Joined: Fri May 31, 2013 11:29 am
Contact: Website

Re: measure own voltage through testpoints?

Mon Jun 02, 2014 4:49 pm

The voltage should be well constant if you are using a proper power supply. However if I would do a circuit like that I would probably use my own PiPIC https://github.com/oh7bf/PiPIC to start with and to get something functional rapidly, and modify the daemon code https://github.com/oh7bf/Tmp102d for writing the voltages to a log file. With a high common mode operational amplifier it would be interesting to measure the input current too from the voltage drop across the input fuse.

Edit: the code pipicpowerd.c is probably easier to modify in my case though needs more line deleting

User avatar
GTR2Fan
Posts: 1601
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: measure own voltage through testpoints?

Mon Jun 02, 2014 6:19 pm

Knowing the exact voltage isn't always necessary, and having a simple logic '0' or '1' below or above a set threshold might be sufficient.

You could use a cheap single opamp as a comparator (with a little hysteresis) comparing the 3V3 rail to a potted-down 5V rail and feed the output of the opamp into a GPIO pin via a resistor and a 3V3 zener to ground. I make that 1 opamp, 4 resistors, 1 zener diode. Cheap and simple.
Pi2B Mini-PC/Media Centre: ARM=1GHz (+3), Core=500MHz, v3d=500MHz, h264=333MHz, RAM=DDR2-1200 (+6/+4/+4+schmoo). Sandisk Ultra HC-I 32GB microSD card on '50=100' OCed slot (42MB/s read) running Raspbian/KODI16, Seagate 3.5" 1.5TB HDD mass storage.

Return to “Advanced users”