# Raspberry Pi small electric current

#### C0mfo0rd

Joined Feb 26, 2021
10
Good day. I have a question about measuring electric current using Raspi. I have a voltage of about 0-40V in the circuit. It has the shape of a sine. There is a resistance of 100komh - 10Mohm in the circuit. I need Raspi to measure my current. Can you advise me what parts to use for this? And any scheme? (I'm sorry for my english )

• Voltage - approx 40V
• current range - 1uA - 100mA
• Frequency - 1kHz
• It doesnt have to be very accurate. I want it to be mainly cheap.
• components - It doent matter what components I use.

#### dl324

Joined Mar 30, 2015
16,143
Welcome to AAC!
There is a resistance of 100komh - 10Mohm in the circuit.
Is the resistance fixed? Is one end connected to ground? A schematic would be helpful...

It doesnt have to be very accurate. I want it to be mainly cheap.
How accurate and how cheap?

#### C0mfo0rd

Joined Feb 26, 2021
10
Welcome to AAC!

Is the resistance fixed? Is one end connected to ground? A schematic would be helpful...

How accurate and how cheap?
I need to create a device that will measure resistances from 10kOhm - 100MOhm. The voltage has a sine wave 0-40V.
I don't know what price to expect.

#### dl324

Joined Mar 30, 2015
16,143

#### C0mfo0rd

Joined Feb 26, 2021
10
I have created a circuit in which the sinusoidal voltage is 0 - 40V and the given resistor is connected there. My job is to find out what resistance there is. I don't even know how to do it. So thank you in advance for any advice. The best would be some scheme ....

#### LesJones

Joined Jan 8, 2017
4,110
I was going to suggest using an INA229 (Or one of the other devices in that range.) from your initial specification but I'm not sure it fits in with your resistance measurement specifications. Your information on resistance measurement seem to require a range from 0.4 uA to 40 mA which is different to your original specification. As far as I know the Raspberry Pi does not have any analogue inputs so you need external A to D conversion. (Which devices in the INA229 range provide.)

Edit. From your comments in post #5 this sounds like homework or project work. Am I correct. ?

Les.

#### dl324

Joined Mar 30, 2015
16,143
I have created a circuit in which the sinusoidal voltage is 0 - 40V and the given resistor is connected there. My job is to find out what resistance there is. I don't even know how to do it. So thank you in advance for any advice. The best would be some scheme ....
Is this school work?

#### C0mfo0rd

Joined Feb 26, 2021
10
I was going to suggest using an INA229 (Or one of the other devices in that range.) from your initial specification but I'm not sure it fits in with your resistance measurement specifications. Your information on resistance measurement seem to require a range from 0.4 uA to 40 mA which is different to your original specification. As far as I know the Raspberry Pi does not have any analogue inputs so you need external A to D conversion. (Which devices in the INA229 range provide.)

Edit. From your comments in post #5 this sounds like homework or project work. Am I correct. ?

Les.
Yes. I need to measure a resistance in the range of about 1uA - 40mA.

#### C0mfo0rd

Joined Feb 26, 2021
10

#### LesJones

Joined Jan 8, 2017
4,110
Can you explain why you are trying to measure resistance this way ? Also is the resistor under test purely resistive or does it have a reactive component ?

Les.

#### dl324

Joined Mar 30, 2015
16,143
Post a schematic showing how the resistor is connected. Why are you trying to measure resistance with an AC voltage? It's normally done with a DC voltage.

Raspberry Pi doesn't have any analog inputs. Are you okay with adding an ADC?

#### C0mfo0rd

Joined Feb 26, 2021
10
I testing resistors. Pure resistive.

#### C0mfo0rd

Joined Feb 26, 2021
10
Post a schematic showing how the resistor is connected. Why are you trying to measure resistance with an AC voltage? It's normally done with a DC voltage.

Raspberry Pi doesn't have any analog inputs. Are you okay with adding an ADC?
The scheme is simple. Only the given resistor is connected to the source. So there is only source and resistance and I need to measure the current.

#### dl324

Joined Mar 30, 2015
16,143
I need to measure the current
You need to measure voltage. DVMs measure resistances by applying a known current and measuring voltage. They measure current by inserting a known resistance and measuring the voltage drop across the resistor.

Why do you want to use an AC voltage?

#### C0mfo0rd

Joined Feb 26, 2021
10
You need to measure voltage. DVMs measure resistances by applying a known current and measuring voltage. They measure current by inserting a known resistance and measuring the voltage drop across the resistor.

Why do you want to use an AC voltage?
Can you advise me on the specific components for this measurement, to draw a scheme? This voltage must be used in this measurement. I can't tell you the reason, but I know that those resistors will be powered by this voltage.

#### dl324

Joined Mar 30, 2015
16,143
I can't tell you the reason
I'm not a fan of solving problems for someone when they can't tell you why or what they're trying to do.

#### C0mfo0rd

Joined Feb 26, 2021
10
I'm not a fan of solving problems for someone when they can't tell you why or what they're trying to do.
In fact, it is the resistance of certain components that depend on the sinusoidal voltage.

#### LesJones

Joined Jan 8, 2017
4,110
My original suggestion of using an INA229 was made on the assumption that you needed to measure the voltage as well as the current. From what you now say you are assuming the 40 volts is constant so does not need to be measured. Using that device would have the problem of having to synchronise the sampling time to a fixed point on the waveform. I now think it would be better to measure the current at the ground end by measuring the voltage across a shunt resistor. As your current range covers such a large range (1 : 10000) I suggest switching in a number of different value shunt resistors. I suggest amplifying the AC voltage across the shunt resistors using a good quality op amp up to about 1 volt amplitude and the converting it to DC using an active rectifier. Why are you using a Raspberry Pi rather than one of the many microcontrollers that has a built in ADC ?

Les.

#### C0mfo0rd

Joined Feb 26, 2021
10
My original suggestion of using an INA229 was made on the assumption that you needed to measure the voltage as well as the current. From what you now say you are assuming the 40 volts is constant so does not need to be measured. Using that device would have the problem of having to synchronise the sampling time to a fixed point on the waveform. I now think it would be better to measure the current at the ground end by measuring the voltage across a shunt resistor. As your current range covers such a large range (1 : 10000) I suggest switching in a number of different value shunt resistors. I suggest amplifying the AC voltage across the shunt resistors using a good quality op amp up to about 1 volt amplitude and the converting it to DC using an active rectifier. Why are you using a Raspberry Pi rather than one of the many microcontrollers that has a built in ADC ?

Les.
I need to measure voltage and current and calculate resistance accordingly. I use Raspberry Pi precisely because I have it available and I would like to send my measurement results. I will buy an ADC if necessary.