Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ATmega32A for current measurement

Status
Not open for further replies.

Georg

New Member
Hello!
I should like to use ATmega32A for measurement of the current on diode.
How to change the voltage on diode connecting external sources of the supporting voltage using microcontroller?
 
I'm not exactly sure what you require... You need to measure diode current! For what purpose? Are you making a diode tester? Or you need to work out current in a circuit design. AC/DC ?

You can work out the current using precision resistors, and reading the voltage on a analogue pin on the mega.
 
:confused: Are you asking how to use the micro to apply various voltages to a diode and then measure the resulting current through the diode?
 
alec_t, ronsimpson you are right. I'm asking about this scope. Thank you for the assistance.
The diode current is in mA and voltage is in mV. I it is necessary to realize the incremental measurement i.e record of the current-voltage dependency.
How I could to programme the incremental voltage on diode (step by step) from 0 till 500 mV and then from 500 mV till 0 mV ? Voltage step will be 5 mV or 20 mV.
Simultaneously I shall measure and write diode current for every value of voltage.
 
Last edited:
How I could to programme the incremental voltage
You could use the micro to control a D/A converter or digital pot to get, say, an output of 0-5V; then use a voltage divider to reduce that to the mV range you need. A buffer amplifier might be needed to apply the test voltage to the diode.
 
I know you want to change the voltage and measure the current. The problem is there is no current limit. Current can get very large.
SO
My plan is to set the current and measure the voltage.
I=0, V=0
I=2mA, v=30mV
I=2mA, V=50mV
......
I=500mA, V=540mV

The "PWM" is a output from the micro and goes from 0 to 100% or (0 to 5V).
The 0 to 5V is divided by 10 to get 0 to 500mV. This voltage is across R1 and sets the current.
You will get 2mA/step.
"ADC" is a input to the micro. You need to subtract the voltage across R1 to get a good value.
Voltage across D1 = ADC-(PWM/10)
 
ronsimpson, I'm grateful to you for detailed description and circuit. I will continue this project and hope inform you about my efforts if you not against.
 
I would suggest You, to use an Op Amp Current Source like Ronsimpson.
As steering Voltage for the Op Amp can be used the filtered PWM Signal from the 16Bit PWM of the Controller.
I think that Method is more exact then the usage of a simple Resistor.

At Ronsompson's Idea, You have to Measure the Voltage at the Anode and the Cathode of the Diode and calculate the Difference between.
Or you use a A/D Converter with difference inputs.
So You can measure the Diode Voltage with the A/D Converter without GND reference.
 
Last edited:
You can also use a shunt resistor in combination with huge magnitude resistors to make a voltage divider. It is not secure at all, but it is cheap and easy.
 
wkrug, thank you for your suggest.
PWM controls the voltage impulse width, but not the amplitude (as I understand).
I'm considering to use the R-2R DAC to adjust the input voltage from 0 to 5 V.
Different input voltages can be receive by driving the signals at the output ports of the microcontroller.
View attachment 67987
 
wkrug, thank you for your suggest.
PWM controls the voltage impulse width, but not the amplitude (as I understand).
When you RC filter the pwm, you get a stable voltage proportional to pulse width.
 
Last edited:
When you RC filter the pwm, you get a stable voltage proportional to pulse width.
Yes, that was the Idea behind this.
So you got an 16Bit D/A Converter with an 16Bit Counter.
You only have the supply voltage to be stable, because it have affection to the output voltage.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top