DRV8871 and I2C NACK issue [Review Request] - Page 1
Forum section: electronics / projects

author: harry-iv
author_rank: Newbie
timestamp: April 23, 2025, 12:08:12 am
content: I am currently working on a daughter board for an ESP32 V2 by Adafruit. This daughter board is used to drive a 12V peristaltic pump (it works off of 9V) through a DRV8871 motor driver, convert 9V battery power to 5V for the ESP32 via a buck converter, connect with a MS5837 depth sensor via I2C, and also has a Texas Instruments INA3221 power sensor. When running this setup, I can read the depth from the depth sensor reliably, but when I run the peristaltic pump, I get this error frequently:22:40:44.167 -> E (114007) i2c.master: I2C hardware NACK detected22:40:44.167 -> E (114007) i2c.master: I2C transaction unexpected nack detected22:40:44.167 -> E (114007) i2c.master: s_i2c_synchronous_transaction(924): I2C transaction failed22:40:44.167 -> E (114013) i2c.master: i2c_master_multi_buffer_transmit(1186): I2C transaction failedAt first, I thought it would be the EMI from the peristaltic pump causing the issue (since it's close to the daughter board in the setup I've got), but when powering the peristaltic pump without the DRV8871 (just through a separate power supply), there were no NACK issues. The next step I took was running the pump from a DRV8871 breakout board from Adafruit, with the ESP32 providing the input signals. I powered this breakout board from the 9V power that was being provided to the daughter board, and the issue went away. Even though this is a "solution" to this problem, I still don't know exactly what was causing it, so I tried to replace the DRV8871 IC I had on the daughter board with a new DRV8871 IC. I also in this process removed the buck converter which is on top of the DRV8871 to see if the noise generated from it would cause any issues. However, the problem was still there, so this ruled out the possibility of a faulty IC (it's also from DigiKey which is a reliable source). This makes me think it's a layout issue on my daughter board. Could anyone possibly give me any suggestions for the source of my error? Thanks.

author: thm_w
author_rank: Super Contributor
timestamp: April 23, 2025, 01:23:45 am
content: Where are your i2c pullups?I don't think there are any on the ESP32 board:https://cdn-learn.adafruit.com/assets/assets/000/109/518/original/adafruit_products_FV2_sch.png?1646779441

author: harry-iv
author_rank: Newbie
timestamp: April 23, 2025, 02:35:13 am
content: I have a 10k pull up resistor for both the SDA and SCL lines.

author: squadchannel
author_rank: Frequent Contributor
timestamp: April 23, 2025, 03:24:48 am
content: 10k is insufficient.4.7k for 5V and 1.5k for 3.3V, good start point.

author: pcprogrammer
author_rank: Super Contributor
timestamp: April 23, 2025, 06:52:08 am
content: Quote from: thm_w on April 23, 2025, 01:23:45 amThat was the first thing to spring to my mind.And even though they are there, the 10K is way to high for reliable communication. I would recommend 2.2k.The fact that thm_w did not spot the pullups, and neither did I on a first glance, goes to show that this schematic format being used more and more is really crap. Use wires to make connections and not net names, labels or ports, when the intention is to share it or ask questions about it. Especially when it concerns pullup or pulldown resistors.

author: thm_w
author_rank: Super Contributor
timestamp: April 23, 2025, 09:40:57 pm
content: I didn't even see those resistor networks, partly what pcprogrammmer says and partly here I don't think using a resistor network is justified. Its more difficult to route, more difficult if you need to swap out one value, and all that is gained is maybe a few cents savings.In this case you have access to the through holes for SCL/SDA though, so you could mod in some resistors from there, not too difficult.

author: harry-iv
author_rank: Newbie
timestamp: April 25, 2025, 04:55:40 am
content: So I changed the effective pull-up resistance value to 1.6k ohms and the issue still persists. I still think this comes back to something I did wrong with laying out the DRV8871. Are there any glaring issues? Thanks for all the feedback btw.

author: pcprogrammer
author_rank: Super Contributor
timestamp: April 25, 2025, 05:56:39 am
content: It could then be a power supply issue. You wrote that you convert the supply from a 9V battery to 5V with a buck converter, and it might be that the voltage drops to much when the motor is started.Which buck converter are you using?What are the resistors R1, R2 and R3. Are these actual resistors or are they ferrite beads for EMI and noise suppression?

author: thm_w
author_rank: Super Contributor
timestamp: April 25, 2025, 09:16:43 pm
content: The layout is definitely not ideal, ground pours have thin connections to other ground areas.Do you have an oscilloscope to monitor the I2C line and the power lines while you are testing?