Heltec ESP32 Wifi Kit & ADS1115
Hello, I need a hint…
I have a Heltec ESP32 Wifi Kit with Oled Display and a separate ADS1115
I would like to measure a DC voltage and show it on the display and send by MQTT to a broker later.
Now I have looked at the “ADS1115 16Bit AD converter” script by Matthias Busse and filled it up with the commands for the u8g2 display.
Without using the display, it correctly outputs the voltage and the bits received by the ADS in the serial monitor.
But as soon as I activate the display in the code I get an output with which I can not do anything and the bits are constantly “-1”.
This does not change if I put the measuring contact on a different voltage or pull against ground …
I hope you can help me.
Here is the script:
https://pastebin.com/QteyPpF96
Correct serial output:
19642 Gain: 1 range: + -4.096 Volt: 2.455250
19643 Gain: 1 range: + -4.096 volts: 2.455375
19645 Gain: 1 range: + -4.096 Volt: 2.455625
19644 Gain: 1 range: + -4.096 Volt: 2.455500
19693 Gain: 1 range: + -4.096 Volt: 2.461625
19680 Gain: 1 range: + -4.096 Volt: 2.460000
Serial output with activated display
ADS1115 with VDD = 5.07
-1 Gain: 0 range: + -6.144 volts: -0.000187
-1 Gain: 1 range: + -4.096 Volt: -0.000125
-1 Gain: 2 range: + -2,048 volts: -0.000062
-1 Gain: 3 range: + -1,024 volts: -0.000031
-1 Gain: 4 range: + -0.512 Volt: -0.000016
-1 Gain: 5 range: + -0.256 volts: -0.000008
-1 Gain: 5 range: + -0.256 volts: -0.000008
-1 Gain: 5 range: + -0.256 volts: -0.000008
-1 Gain: 5 range: + -0.256 volts: -0.000008
-1 Gain: 5 range: + -0.256 volts: -0.000008
-1 Gain: 5 range: + -0.256 volts: -0.000008
-1 Gain: 5 range: + -0.256 volts: -0.000008
-1 Gain: 5 range: + -0.256 volts: -0.000008
The wrong value is shown correctly on the display …
U: -0.000008V