# Datalogging Voltages, but volts too high

Discussion in 'General Electronics Chat' started by eduncan911, Jun 14, 2012.

1. ### eduncan911 Thread Starter New Member

Nov 14, 2011
14
0
Hello. Tried searching a bit but didn't see any topics posted related to what I'm doing.

My end goal is simple: I need to data log some analog voltage that varies over time.

Now to accomplish this, I've come up with a few ways. Please provide other cheap suggestions I haven't thought of. I've looked into building my own usb-like device (no computer I have has a serial port! lol). Programming the microcontroller, while I can accomplish it, it's a bit out of scope for my overall goal (graphing a few dozen tests for a bigger project).

Most likely I'd like to pick up one of these pre-built units instead:

http://numato.com/8-channel-usb-gpio-module

It's nice and inexpensive. Since it is basically a serial-over-USB, that means the fastest i can read is limited to the USB bus - about 10ms. The manual indicates that the device itself is a bit slow though, and could take about 50 to 100ms. For my purposes, that is fine (10 Per Second). I just need to read voltage and data log it over a long period of time.

The second purpose of this thread is to ask how to safely read these voltages with such a device. The device I am reading has variable voltages that range from 0 - 12 VDC and draws roughly 4 Amps of current (+/- 0.5Amp depending on temps). The USB serial device I linked to above has a max input of 5VDC, and obviously operates on a much lower current overall.

I don't want to blow it up. So obviously I need to scale this down. My resistor calculations are a bit rusty, so I ask everyone to verify my logic to do this safely:

1) take the input by connect jumper wires in parallel to the main load circuit.
2) solving for Vout = Vin * R1(R1 + R2) , I come up with two resistors: R1= 1kΩ and and R2 = 500Ω, respectfully.
3) install the R1 1kΩ 1/4 Watt resistor inline with the jumper wires from the positive+ side.
4) Then, install the R2 500Ω 1/4 Watt resistor in series connected to R1, and the other side of R2 connected to ground-.
5) I would then, finally, take a 3rd jumper wire at the R1 and R2 junction, to get 4V output from 12V on the main circuit.

I would like accurate readings, so is 1000 Ω and 500 Ω a good start? Should I go higher or lower?

Using small 1/4 Watt resistors is ok? Or because of the original 4 Amp load of the original circuit I am measuring, do I need some massive 5 Watt resistors instead?

Thanks in advance!

2. ### Jony130 AAC Fanatic!

Feb 17, 2009
3,993
1,116
I think that all you need is to buy two resistors.
R1 = 22K and R2 = 11K all resistors 1/4W. And you can also add some Zener diodes for input protection.

3. ### crutschow Expert

Mar 14, 2008
13,523
3,392
1kΩ and 500Ω are likely lower resistor values than needed. The A/D input impedance of the module is not specified (it should be) but it can likely operate fine with ten times that impedance or 10kΩ and 5kΩ. That will minimize any loading of the input signal.

1/4W rated resistors are fine. The power rating of the resistors is determined solely by the measured input voltage across the resistors (V$^{2}$/R). It is unrelated to the current used by the circuit you are measuring.

Note: Since 500Ω is not available in standard 1% values use 11.8kΩ and 5.9kΩ. Those will give a voltage reduction within 1% of the theoretical 0.3333.

Last edited: Jun 14, 2012
4. ### eduncan911 Thread Starter New Member

Nov 14, 2011
14
0
Thanks guys for the re-assurance.

Perfect! That's the type of accuracy I was looking for, and thank you both for catching it and providing alternatives.

5. ### ErnieM AAC Fanatic!

Apr 24, 2011
7,443
1,628
The scheme looks fine. While I can make out the "Microchip" marking on the device I can't make out the exact part number they typically want 5K or 10K max as the source resistance. Either way, 11.8kΩ and 5.9kΩ yields 3.9K so it should work.

You can always calibrate this thing by measuring what you put in with a DMV and making a "fudge factor" to correct what your PC gets. So the absolute accuracy of the resistors is a wash, but their long term stability will affect the accuracy.

Also, since you have a resistance between the voltage in and the micro it self-protects to a large extent, so you need not add say a zener (that will affect the accuracy).

6. ### eduncan911 Thread Starter New Member

Nov 14, 2011
14
0
Thanks guys! Well, I should have known The Shack wouldn't have anything better than 5%.

So, I picked up a 50k ohm multi-turn linear potentiometer for the most granular control. You can see
it colored blue on the breadboard.

Hooked it up to the actual 12VDC source to calibrate it at 3.99VDC. See attachment.

Does anyone see a problem with that logic?

Thanks again!

File size:
70.9 KB
Views:
26
• ###### IMG_20120617_212000 (Small).jpg
File size:
40.4 KB
Views:
25
Last edited: Jun 18, 2012