ESP32 get data from max17043

Thread Starter

AttentionPls

Joined Dec 5, 2022
12
So I got this esp32 board https://www.waveshare.com/wiki/E-Paper_ESP32_Driver_Board and I successfully connected it to a screen and displayed text, and got the power from a 3.7v lit battery connected to max17043 that is also connected to a tp4056. Problem is when I try to connect the SCL and SDA to the board it stops displaying anything on the screen. i connected the SCL to the SCK and the SDA to SD1 Any idea what am I doing wrong?
 

Ya’akov

Joined Jan 27, 2019
6,856
welcome to AAC.

Could you draw a schematic or at least a wiring diagram showing what it is that you’re doing? It’s hard to tell what it is you’re having a problem with from the description you gave.
 

Thread Starter

AttentionPls

Joined Dec 5, 2022
12
welcome to AAC.

Could you draw a schematic or at least a wiring diagram showing what it is that you’re doing? It’s hard to tell what it is you’re having a problem with from the description you gave.
Well the only problem I actually have is getting the data of the battery measurements from the max17043 to the waveshare esp32, I am not sure what the l2c pins are in the waveshare esp32, do you know that by any chance?
 

Dave Lowther

Joined Sep 8, 2016
165
Connecting the SDA and SCL from to the max17043 to the GPIO 21 AND 22 stops the esp32 from booting, any idea why that could be?
I don't know why that would be the case. I just checked the schematic and it looks like GPIO21/22 are not connected anywhere except the ESP32 and J4. I've never had an ESP32 not boot when I use those pins for I2C. I haven't checked the max17043 to see whether you would need a level shifter to convert from the ESP32 3.3V to whatever the max17043 I2C voltage levels are.
 

Thread Starter

AttentionPls

Joined Dec 5, 2022
12
I don't know why that would be the case. I just checked the schematic and it looks like GPIO21/22 are not connected anywhere except the ESP32 and J4. I've never had an ESP32 not boot when I use those pins for I2C. I haven't checked the max17043 to see whether you would need a level shifter to convert from the ESP32 3.3V to whatever the max17043 I2C voltage levels are.
I am using the 5v on the waveshare esp32 which is connected to the VCC in max17043 and the max17043 is connected to a 3.7v battery
 

Dave Lowther

Joined Sep 8, 2016
165
I am using the 5v on the waveshare esp32 which is connected to the VCC in max17043 and the max17043 is connected to a 3.7v battery
The ESP32 chip will be running off 3.3V. There are a couple of 3.3V regulators shown on the schematic. I don't know if you need a 5V -> 3.3V level shifter between the max17043 I2C and the ESP32 I2C, but I suspect you do. I don't think a lack of level shifter would stop the ESP32 from booting, but it might damage the ESP32 because its input signals should not exceed 3.3V. https://randomnerdtutorials.com/how-to-level-shift-5v-to-3-3v/
Are you sure that you got the right pins on J4? I would do a continuity check between the pads on the ESP32 chip and the pins on J4 to be sure if I were you. Edit: text added "I can't see an image of the underside of the waveshare to see if there are markings for J4 pin numbers.
1670331981010.png
 

Thread Starter

AttentionPls

Joined Dec 5, 2022
12
The ESP32 chip will be running off 3.3V. There are a couple of 3.3V regulators shown on the schematic. I don't know if you need a 5V -> 3.3V level shifter between the max17043 I2C and the ESP32 I2C, but I suspect you do. I don't think a lack of level shifter would stop the ESP32 from booting, but it might damage the ESP32 because its input signals should not exceed 3.3V. https://randomnerdtutorials.com/how-to-level-shift-5v-to-3-3v/
Are you sure that you got the right pins on J4? I would do a continuity check between the pads on the ESP32 chip and the pins on J4 to be sure if I were you.
View attachment 282336
Would you suggest I move from the 5v to the 3.3v? I think that the esp32 I got it different from the one shown and maybe it requires 5v to operate the screen as well? Also I am pretty certain I have put it in the right pins

For some reason it now boots up well however it will not show any data from the fuel gauge
 
Last edited:

Dave Lowther

Joined Sep 8, 2016
165
Would you suggest I move from the 5v to the 3.3v? I think that the esp32 I got it different from the one shown and maybe it requires 5v to operate the screen as well? Also I am pretty certain I have put it in the right pins
I don't have time now to check how the max17043 should be powered nor what level its I2C pins are. Sorry, but I already delayed what I'm supposed to be doing in order to reply to your earlier posts. Maybe someone else reading this can help. Whatever ESP32 you have, the ESP32 chip must run off 3.3V. It's common to mix 3.3V ESP32 pins with other device's 5V pins. Level shifting is straightforward, there are plenty of 3.3 - 5V level shifter modules available on-line.
If you have an image of the underside of the board showing its pin markings and where you connected to the GPIOs for I2C that might help me, or someone, to check your connections
 

Thread Starter

AttentionPls

Joined Dec 5, 2022
12
Have you run an I2C scanner to check that the ESP32 can see the max17043 I2C?
There is one at this link https://www.esp32.com/viewtopic.php?t=4742
[Edit] added: I don't know how much previous experience you have of using I2C. Both the I2C lines require pull up resistors to Vcc.
Since I didn't have resistors at hand I tried without and from my understanding the fuel gauge would have known how to handle that, if that's not the case do you think it's fried or should I still get resistors to try?
I tried to run an ESP32 scanner but didn't get any results perhaps it requires a battery connected to the fuel gauge to show it (and I was afraid to connect a battery + to the PC at the same time)

I am very new to electronics and have huge knowledge gaps that I try to quickly mitigate
Here is my proejct and a quick diagarm I drew
20221206_190253.jpgschematics.png
 

Dave Lowther

Joined Sep 8, 2016
165
Edit: Deleted this post because I was assuming a bare max17043. Now I don't know whether the max17043 is in fact on a 'module' board with its own pull ups and 5V - 3.3V regulator
 
Last edited:

Dave Lowther

Joined Sep 8, 2016
165
Moved it to the 3.3v and didn't see any issues, however still not getting any readings from the max17043
I assume the scanner still doesn't detect it. It's hard to guess why that might be. Possible causes could be:
a) The max17043 module has been damaged by having its Vcc connected to 5V, or
b) The max17043 module from aliexpress was defective when you received it. Earlier I found a thread in some other forum where multiple people reported problems with that supplier of them, but others all had success with an equivalent module from sparkfun. Sorry but I can't find that thread again now.
c) There is something wrong with your wiring. I don't know if it's ok to leave QST and ALT not connected.
Are you following some guide on how to wire this up?
How did you find out what the function of the pins on the module is? Is there something marked on the underside of the board? I don't see anything on the aliexpress link you posted.
I tried to work out what's going on in the photo you sent, but I'm puzzled and can't completely work it out. I've attached what I think is going on. If I guessed correctly about the PC USB to 5V power, then I don't understand how the 5V is getting back to the ESP32 5V. I would expect the 5V from USB to go to the ESP32 5V pin [Edit: "assuming there isn't a 5V to 3.3V regulator on the underside of the module ->"] and the 3.3V pin of the ESP32 to go to Vcc on the max17043 module.
1670365193000.png
 

Thread Starter

AttentionPls

Joined Dec 5, 2022
12
I assume the scanner still doesn't detect it. It's hard to guess why that might be. Possible causes could be:
a) The max17043 module has been damaged by having its Vcc connected to 5V, or
b) The max17043 module from aliexpress was defective when you received it. Earlier I found a thread in some other forum where multiple people reported problems with that supplier of them, but others all had success with an equivalent module from sparkfun. Sorry but I can't find that thread again now.
c) There is something wrong with your wiring. I don't know if it's ok to leave QST and ALT not connected.
Are you following some guide on how to wire this up?
How did you find out what the function of the pins on the module is? Is there something marked on the underside of the board? I don't see anything on the aliexpress link you posted.
I tried to work out what's going on in the photo you sent, but I'm puzzled and can't completely work it out. I've attached what I think is going on. If I guessed correctly about the PC USB to 5V power, then I don't understand how the 5V is getting back to the ESP32 5V. I would expect the 5V from USB to go to the ESP32 5V pin [Edit: "assuming there isn't a 5V to 3.3V regulator on the underside of the module ->"] and the 3.3V pin of the ESP32 to go to Vcc on the max17043 module.
View attachment 282417
I followed multiple guides up until know, to achieve what I learned so far. I am connecting the USB directly to the esp32 board when I want to upload a new software, I got another max17043 I got from aliexpress that I will try to solder and test, also what you said is correct I forgot to connect an interrupt (the ALT) which is required, do you know where I will connect it on the esp32? I connected the max17043 3.3v as well

Also thank you so much for your help
 

Dave Lowther

Joined Sep 8, 2016
165
I followed multiple guides up until know, to achieve what I learned so far.
Is there one you could link to that you used for the wiring?
I am connecting the USB directly to the esp32 board when I want to upload a new software
That makes sense.
I got another max17043 I got from aliexpress that I will try to solder and test
Perhaps first I, or someone here, could help you check the wiring before you power it up?
, also what you said is correct I forgot to connect an interrupt (the ALT) which is required, do you know where I will connect it on the esp32?
It shouldn't be required to detect the I2C with a scanner.
I connected the max17043 3.3v as well
I assume you mean you connected the ESP3.3V pin to the max17043 module's Vcc.
Could you post an image of the underside of the max17043 module so that I can see if it has a regulator on that side and so as I can see the pin markings for the headers going to the ESP32? (Assuming that is how you know what each of those header pins function is).
 

Thread Starter

AttentionPls

Joined Dec 5, 2022
12
Is there one you could link to that you used for the wiring?

That makes sense.

Perhaps first I, or someone here, could help you check the wiring before you power it up?

It shouldn't be required to detect the I2C with a scanner.

I assume you mean you connected the ESP3.3V pin to the max17043 module's Vcc.
Could you post an image of the underside of the max17043 module so that I can see if it has a regulator on that side and so as I can see the pin markings for the headers going to the ESP32? (Assuming that is how you know what each of those header pins function is).
Guides:
https://how2electronics.com/interfacing-max17043-lipo-fuel-gauge-ic-with-arduino/
https://how2electronics.com/iot-based-battery-status-monitoring-system-using-esp8266/

Also yes I meant the ESP3.3v pin to the VCC in the max17043 module.

Perhaps first I, or someone here, could help you check the wiring before you power it up?
Sure what do you need from me?

20221207_004913.jpg
1670366882721.jpeg1670366882837.jpeg
 
Top