ATMega328p-PU I2C problem with VL53L0X sensor

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello guys,

 

I have a problem with I2C communication between ATMega328p - PU, IR sensor VL53L0X for distance measuring and Nextion 3.5'' touch screen. ATMega is powered with 5V and sensor with 2.8V, so I decided to use TCA9517 for logic level translation. I designed my own circuit and pcb. But unfortunately I don't get any response from sensor. From software I call sensor every 1 second. On oscilloscope I see that ATMega sends data to sensor on SCL and SDA lines but I don't receive any measurement from sensor. As soon as I connect sensor 2.8V voltage drops to 1.9V.. Touch screen is used for displaying measured data from sensor and to mute buzzer for 1 minute. Buzzer is turned on when specific distance is measured by sensor and this part of circuit works fine, I can also program ATMega with ISP. I only have problems with I2C. But when I pull out ATMega and insert it to original Arduino UNO board with external logic level shifter builded with BSS138 mosfet's and resistors everything works like charm. I'm not very expirienced with circuit designing and after spending many days trying to solve a problem I really don't have any more idea what could cause this problem. In attachment I send also my schematics and pcb.

Could someone be so kind and try to help me solve this problem, please ?

Regards,

 

Peter

Attachment(s): 

Last Edited: Wed. Mar 14, 2018 - 09:18 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

2.8V dropping to 1.9V does not sound good. I would suggest you investigate that first starting with your regulators. What does the 5V rail do when the 2.8V drops to 1.9V? The 7805 needs at least 7V to give 5V out and you have an extra diode drop so you need around 8V in.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looking at your pcb, your ground fill has an island which is probably not tied to ground. Sorry to say that i would not consider your pcb viable. There’s plenty of room for improvement.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm using 8V for input voltage. Total circuit power consumption is around 168 mA, Nextion touch screen takes 145 mA and the rest is used by buzzer, ATMega, TCA9517 and VL53L0X. And voltage drop to 1.9V occurs only in case when VL53L0X sensor is in circuit. SCL and SDA pulses have 2.8-3V.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As I'm not PCB design expert I tryed to do my best with my first MCU based board. I just wanted to design single layer board with some jumpers (top layer on board) for prototyping and testing functionality of circuit. In Eagle IDE DRC passed through without any errors and warnings, but I'm sure that some things could be done better. When I highlight GND net I can't found any untied islands. Do you think that I should try a pcb design without ratnests ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The island is tied via a thin track. You power and ground tracks are a bit thin. Anyhow, you need to measure the voltages around your regulators.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Kartman, finally I found that reason for voltage drop is pull up resistor on Vcc+Enable pin on VL53L0X sensor. I throwed it out of circuit and now everything works as it should.

Thanks for your help and suggestions ;)

 

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good to hear. Next time you design a pcb, make your power tracks fatter.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will, thank you :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

with my first MCU based board

Wow, nice job on your PCB layout.

 

Kartman's comments aside, it looks a lot better than my first board!

 

JC 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you, DocJC, I did my best but, as I said, I'm no PCB design expert and I know that some details must be improved. But it's positive beginning smiley

 

Peter