Raspberry Pi small electric current

Thread Starter

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.
 

Thread Starter

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.
 

Thread Starter

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
3,488
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
13,087
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?
 

Thread Starter

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.
 

LesJones

Joined Jan 8, 2017
3,488
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
13,087
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?
 

Thread Starter

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
13,087
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?
 

Thread Starter

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.
 

LesJones

Joined Jan 8, 2017
3,488
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.
 

Thread Starter

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.
 

Reloadron

Joined Jan 15, 2015
6,058
Raspberry Pi does not have analog inputs. So before anything else you need an A/D converter in front of your Raspberry Pi. Once you get the ADC front end voltage is measured directly (in the range of your ADC) and current is measured by measuring the current through a known resistance. Likely easier to buy a current module and use that. The rest is in the code.

Ron
 
Top