PCB with ATmega328P and MPU6050 not working

Hello everyone,

my friend and I have been working on a PCB. It contains an ATmega328P which is supposed to communicate with an MPU6050 via I2C. It also contains a circuit for charging a connected Li-Ion battery as well as a 3.7 to 3.3V converter.

We are able to flash the ATmega and control the transistor connected to D8. However we are unable to communicate with the MPU via I2C.

We have tried soldering an MPU6050 breakout board to the ATmega on the PCB which was working correctly. It only fails when trying to read out the value of the MPU6050 on the PCB.

We assume that the problem lies in the circuitry of the MPU on the PCB as the code seems to be working correctly,

Schematic: https://imgur.com/vnx9WT2

Top layer: https://imgur.com/tPTVLIv

Bottom layer: https://imgur.com/a/xuviKP1

We'd be very thankful for any help you could provide us with :)

Posted May 12, 2019, 7:59 PM UTC

38
megaden31•

you didn't connect pin 8 (V Logic on the MPU-6050) to Vcc, quick fix to verify that this is the problem is to solder a botch wire from pin 8 (or the terminal on C9 that is not connected to the GND, whichever is easier) to Vcc

3
404responseOP•

We connected the MPU6050 according to this schematic by sparkfun: https://cdn.sparkfun.com/datasheets/Sensors/IMU/Triple_Axis_Accelerometer-Gyro_Breakout_-_MPU-6050_v12.pdf

In the schematic it's connected to GND.

We will try connecting it to VCC, thanks for the hint :)

0
megaden31•

that page includes the link to this [datasheet] (http://43zrtwysvxb2gf29r5o0athu.wpengine.netdna-cdn.com/wp-content/uploads/2015/02/MPU-6000-Datasheet1.pdf). Page 21 and 22 have the pinout and typical circuitry. If you use the MPU-6000, it would make sense to connect pin 8 to GND at all time (active low chip select). But that pin on the 6050 is for V_logic, so I dont know why they would connect it to GND, and through a cap no less. But i could be wrong

2
404responseOP•

Ok, thank you. We'll try connecting it to VCC.

1
MidnightMarauder•

It’s powered externally from the header (VIO is connected to pin 4). They should have made that more clear in how the wires were drawn on the schematic.

1
theOTHERbrakshow•

There isn’t a whole lot to go off of here but I would say check the value of your pull ups on the I2C line. If you are communicating at its max speed 10k might not have enough drive strength especially at 3.3v. As a quick test slow down the comms or swap them for something like a 4.7k. Or do the right thing an calculate the correct values. Cheers

2
shurik179•

I'd certainly put smaller pullup resistors, probably 2-3.3K, not 10 K

1
[deleted]•

[deleted]

1
anovickis•

apply power to VLOGIC pin should be the fix

1