hello. i have problem with my mega board when i try connect I2C with sensor. Monitor always "no I2C devices". i already try many times with another libraries but result still like this. could somebody help me? thanks all. have a nice day.
Did you solder the headers on your unit ?
Pull-ups on the I2C Line ?
Tell us about your wiring and code…
Do you mean that you have uploaded the i2c scanner sketch to your mega?
Do you have any other i2c devices to test with? Like an RTC or some other sensor? Are they detected?
If not, post a schematic showing how you connected the sensor to the Mega.
Did you try adding external pull-up resistors to the SDA & SCL lines?
Have you read the pinned post re 'How to get the most from the forum'. We can't see what you are looking at.
I tried with SHT31 but still display “no I2C device”
I already tried pull-up 3.3V but they are the same
Vào Th 3, 7 thg 10, 2025 lúc 00:06 PaulRB via Arduino Forum <notifications@arduino.discoursemail.com> đã viết:
If your device expects signals at 3.3V you should use a voltage adapter in between as your MEGA will use 5V
i use VOM to measure voltage between GND and SDA,SCL about 3.3V
Vào Th 3, 7 thg 10, 2025 vào lúc 00:30 J-M-L via Arduino Forum <notifications@arduino.discoursemail.com> đã viết:
Mega is a 5V device. The pull-ups should be to 5V.
As mentioned, if your sensor doesn't tolerate 5V, and doesn't have voltage shifter circuit built-in, you will need to add an external voltage shifter circuit.
Does the back of your sensor look like this?
If so, it has a 5V-3.3V regulator and voltage shifter circuit, so you should power it with 5V and connect pull-up-resistors to 5V. However, it already contains some pull-up-resistors, so adding external ones should not be needed.
Then you need a bidirectional voltage converter to convert 3.3V I²C to 5V I²C.
https://www.sparkfun.com/sparkfun-logic-level-converter-bi-directional.html
https://learn.sparkfun.com/tutorials/bi-directional-logic-level-converter-hookup-guide#hookup-examples "Using the BD-LLC for I2C"
Hello PaulRB. Thanks for your help. I would like to confirm with you about my hardware connection between mega vs VL53L0X (same as your picture):
5V --- Vin
GND --- GND
SDA(20) --- SDA
SCL(21) --- SCL
just like above right? Also no more pull up to 5V right?
After i try, monitor still display: "Scanning... No I2C devices found"
This is example to test i2c scanner:
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not known.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
// V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
// by Arduino.cc user Krodal.
// Changes by louarnold removed.
// Scanning addresses changed from 0...127 to 1...119,
// according to the i2c scanner by Nick Gammon
// https://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
// As version 4, but address scans now to 127.
// A sensor seems to use address 120.
// Version 6, November 27, 2015.
// Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include <Wire.h>
void setup() {
Wire.begin();
Serial.begin(9600);
while (!Serial); // Leonardo: wait for Serial Monitor
Serial.println("\nI2C Scanner");
}
void loop() {
int nDevices = 0;
Serial.println("Scanning...");
for (byte address = 1; address < 127; ++address) {
// The i2c_scanner uses the return value of
// the Wire.endTransmission to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
byte error = Wire.endTransmission();
if (error == 0) {
Serial.print("I2C device found at address 0x");
if (address < 16) {
Serial.print("0");
}
Serial.print(address, HEX);
Serial.println(" !");
++nDevices;
} else if (error == 4) {
Serial.print("Unknown error at address 0x");
if (address < 16) {
Serial.print("0");
}
Serial.println(address, HEX);
}
}
if (nDevices == 0) {
Serial.println("No I2C devices found\n");
} else {
Serial.println("done\n");
}
delay(5000); // Wait 5 seconds for next scan
}
Thank you. Have a nice day.
I would say yes, that's correct.
But I guess you are going to say "I tried it and it didn't work".
My only suggestions now are:
- Try a different Arduino. Since you are using a breadboard, a breadboard-compatible Arduino would seem like a good idea to make things simpler and more reliable. But if all your Arduino are non-breadboard compatible models like Mega, use whatever you have.
- Try another breadboard, or a different part of the breadboard
- Try different connecting wires, or test the wires you are using with DMM.
- Your photos are not very clear or bright, but your soldering doesn't look great. Maybe try removing all the solder and starting over.
Please help us maintain a readable forum
➜ correct your post and add code tags around your code.
There is a small pencil
below your existing posts.
- click on this pencil ➜ that will let you edit your post.
- Select the part of the text that corresponds to the code
- Click on the
<code/>icon in the toolbar to indicate that it is code - click
Save Edit
(Also make sure to properly indent the code in the IDE before copying and pasting it here. This can be done by pressing ctrlT on a PC or cmdT on a Mac)
Thank you. I tried it with the ESP32-S3 Dev Kit, and it worked perfectly. Today, I’m going to buy and test it with an Arduino Uno.
Do you use any social media? Maybe we could connect and chat whenever needed?
Vào Th 4, 8 thg 10, 2025 lúc 01:47 PaulRB via Arduino Forum <notifications@arduino.discoursemail.com> đã viết:
We can connect anytime, on this forum.
Please don't forget to fix your code tags in post #10.




