I'm really sorry to hear that, I hope you are okay.betwixt said:Sorry for not replying, my mother died yesterday and I have had to travel to arrange funeral etc. I will reply in full later, at the moment I am trying to use internet on mobile phone - not easy!
Brian.
[Batt - ]------|--[Shunt as .22Ω]------GND
|
|---[Atmega ADC]
[Batt - ]------|--[Shunt as .22Ω]------GND
|
|--[1MΩ]---[Atmega ADC]
For I = 1 To 10 Step 1 'taking 10 readings
Adc0 = Getadc(0)
Adc1 = Getadc(1)
Temp_iin = Adc0 * 4.89 'adc * resolution = 5000mV [Note: at 3A, shunt voltage = 600mV]
Temp_iin = Temp_iin / 100 'scale at 0.1V. So Iin = 1A at 0.1V
Iin = Temp_iin + Iin
Temp_vin = Adc1 * 4.89 'adc * resolution = 5000mV
Temp_vin = Temp_vin / 1000 'scale at 5v
Temp_vin = Temp_vin * 4 'scale up 5v to 20v
Vin = Temp_vin + Vin
Waitms 100
Next I
Vin = Vin/10
Iin = Iin/10
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?