ADC value not changing
Posted: Thu Feb 14, 2019 11:30 am
Hi All can you help? when I read the ADC pin on all of my ESP8266 8 pin boards I get a reading of 36 to 40 regardless of the input voltage on gpio 0
I have re uploaded the firmware numerous times including using modeMCU custom build by frightanic.com and still get the same results I've tried a different batch of chips in case the ones I have are bum. I'm at ripping my hair out point! I have tried the following code.
-- in you init.lua:
if adc.force_init_mode(adc.INIT_ADC)
then
node.restart()
return -- don't bother continuing, the restart is scheduled
end
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
Answer:
System voltage (mV): 36
System voltage (mV): 36
System voltage (mV): 36
System voltage (mV): 36
System voltage (mV): 36
If I change to
-- in you init.lua:
if adc.force_init_mode(adc.INIT_vdd33)
then
node.restart()
return -- don't bother continuing, the restart is scheduled
end
print("System voltage (mV):", adc.readvdd33(0))
print("System voltage (mV):", adc.readvdd33(0))
print("System voltage (mV):", adc.readvdd33(0))
Answer:
System voltage (mV): 3423
System voltage (mV): 3420
System voltage (mV): 3418
I've tried;
Rebooting then trying a read adc
new chips
adding a 2 amp 3.3 volt psu
all joints are soldered so no bread board faults
Has anyone had this before?
Any help much appreciated
I have re uploaded the firmware numerous times including using modeMCU custom build by frightanic.com and still get the same results I've tried a different batch of chips in case the ones I have are bum. I'm at ripping my hair out point! I have tried the following code.
-- in you init.lua:
if adc.force_init_mode(adc.INIT_ADC)
then
node.restart()
return -- don't bother continuing, the restart is scheduled
end
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
print("System voltage (mV):", adc.read(0))
Answer:
System voltage (mV): 36
System voltage (mV): 36
System voltage (mV): 36
System voltage (mV): 36
System voltage (mV): 36
If I change to
-- in you init.lua:
if adc.force_init_mode(adc.INIT_vdd33)
then
node.restart()
return -- don't bother continuing, the restart is scheduled
end
print("System voltage (mV):", adc.readvdd33(0))
print("System voltage (mV):", adc.readvdd33(0))
print("System voltage (mV):", adc.readvdd33(0))
Answer:
System voltage (mV): 3423
System voltage (mV): 3420
System voltage (mV): 3418
I've tried;
Rebooting then trying a read adc
new chips
adding a 2 amp 3.3 volt psu
all joints are soldered so no bread board faults
Has anyone had this before?
Any help much appreciated