Find I2C Addresses on Arduino (I2C Scanner)

Sdílet
Vložit
  • čas přidán 24. 07. 2024
  • Find code and diagrams at: www.elithecomputerguy.com/201...
    I2C devices allow you to add numerous sensors and displays to your Arduino project using only 2 communication wires. The issue can be that since I2C is an Addressable Communication Protocol that you need to know the addresses of the I2C devices. This scanner sketch will allow you to determine what the addresses are of your I2C devices.
    Functional Parts in the Project:
    Arduino Uno - store.arduino.cc/usa/arduino-...
    20 x 4 I2C LCD Screen - amzn.to/2JVuKzn
    560 Piece Jumper Wire Kit - amzn.to/2MsCLjL
  • Věda a technologie

Komentáře • 34

  • @cmgkochi6418
    @cmgkochi6418 Před 3 lety +2

    you helped me from going crazy. the lcd address turned out to be 0x3f and i was trying with all the i2c lcd libs with no progress. finally found your video and code. nice work thanks a lot

  • @superpesbarbos
    @superpesbarbos Před 4 lety +2

    Very awesome video! Everything is pretty clear and sounds simple after your video.

  • @Graham1904
    @Graham1904 Před 4 lety

    I am not sure exactly how this works, and I know I2C very well, but this scanner works like a dream. I had an I2C LCD delivered the other day and the spec sheet said 0x27 for the address but I could not get it to work. I ran the scanner only to find that the address was totally different, not even close! Well described video.

  • @soloperformer5598
    @soloperformer5598 Před rokem +1

    Thank you. This video was excellently presented with clear and concise guidelines and has been a great help.

  • @Electronics61
    @Electronics61 Před 2 lety

    Great video. Worked right away with Serial Monitor output. Many Thanks.

  • @ahnafpiash
    @ahnafpiash Před 10 měsíci

    Thanks for all the trouble explaining the code. really means a lot..

  • @mikmik3965
    @mikmik3965 Před 2 lety

    Great script ,Thanks alot.

  • @dellodel9502
    @dellodel9502 Před 2 lety

    First of all thanks for every things you gave us.
    I have some ATMEL uC from trash and i would lik to reprogram them but i don't know the value of their working frequency (crystal) !!.
    If i want to reprogram them with known frequency program using the SPI protocol , the SPI clock pin will allow me to do it? ( without knowing the value of the clock).
    In other way the clock pin of SPI protocole will replace the crystal clock ( at least during reprogramming operation ) ?.
    Thanks.

  • @drtechtek2165
    @drtechtek2165 Před 5 lety

    because of you i bought one :p

  • @anil3009
    @anil3009 Před 3 lety

    i am using an HDC2021 sensor and it has two addresses , is it possible select the detected address for the measurement.?..if yes could you please help me ..

  • @pcbmicro
    @pcbmicro Před 4 lety

    Sharp Tuto thanks help a lot for debugging and lurning :P

  • @ilhamrahmatmuharam8501

    hello sir, I am an arduino beginner user ,, I want to use a pressure sensor with type xgzp6857 and will be processed by arduino, this sensor uses the i2c communication protocol, I have found the i2c sensor address is 0x6D, but this sensor does not yet have a library for arduino, how can I use this sensor so that the pressure reading can be displayed on the serial monitor?
    maybe you have an idea for this problem?
    thank you

  • @tommunchback1044
    @tommunchback1044 Před 2 lety

    Thank you, I tried running the i2c scanner and had nothing but errors with the table and the switch functions it calls, what a headache. Your sketch is simple and sweet.

  • @nicneufeld226
    @nicneufeld226 Před 3 lety

    If we are communicating between an arduino to another arduino, how can we find the address of the arduino? this sketch doesn't work for that. Thanks

  • @ORagnar
    @ORagnar Před rokem

    2:50 Don't you have to specify which is the clock and which is the data? Also, how do I know that the scan program is outputting to those specific pins?
    12/16/22

  • @nitinjimiwal2163
    @nitinjimiwal2163 Před 2 lety +1

    sensor address is not showing

  • @christiancoding
    @christiancoding Před 4 lety

    Thank you

  • @3D_Printing
    @3D_Printing Před 3 lety

    should it start for(address = 0;

  • @gokulnath7914
    @gokulnath7914 Před 3 lety

    Thank u sir

  • @JJnamedbyBelgi
    @JJnamedbyBelgi Před 3 lety

    What should I do if it says "Devices found: No I2C devices found" although a module is connected?

    • @richardjelinek5038
      @richardjelinek5038 Před 3 lety

      Check cables, make sure the device isn't fried. You could have a 10bit addressing only I2C device (very exotic), that will not be seen by this scanner.

  • @K-Luxuriant
    @K-Luxuriant Před 4 lety

    Sir I ran it for my Arduino UNO & its showing "no i2c devices found!"... What should I do now? I'm also not able to connect BMP280 sensor!

    • @elithecomputerguy
      @elithecomputerguy  Před 4 lety +1

      you either miswired your device, or it's broken

    • @K-Luxuriant
      @K-Luxuriant Před 4 lety

      @@elithecomputerguy But Sir the accelerometer sensor is running perfectly with UNO. Also when I searched for I2C with BMP280 connected, it shows its register address. I checked the wiring thrice & it looks okay. I'm actually confused on what should I do now..

    • @shaputer
      @shaputer Před 3 lety

      @@K-Luxuriant Some things don't work with other Arduinos. Example Oled only works with a NANO.

  • @saskiacurls6045
    @saskiacurls6045 Před 2 lety

    I love you

  • @3D_Printing
    @3D_Printing Před 3 lety

    2c_scanner Arduino UNO to PCA9685 16-Channel 12-bit PWM Servo motor Driver I2C Module For Arduino Robot E5 just keeps saying Scanning Scanner in more like a GUI not a text display what is wrong: Wires correct and baud rate is the same as code

  • @nitinjimiwal2163
    @nitinjimiwal2163 Před 2 lety +1

    Its just showing device found

  • @bigdealwhocares
    @bigdealwhocares Před 27 dny

    I'm just throwing this out here to maybe help someone else in the future. I realize I'm responding to a video that is now a few years old. I'm just starting with Arduino. I have an Arduino Mega 2506 R3. I first connected my i2C display to the A4 and A5 pins on the Arduino. This did not work, I had to use pin 20 (SDA) and pin 21 (SCL). This is probably pretty obvious to most people, took me a few Google searches to figure out.

  • @richardjelinek5038
    @richardjelinek5038 Před 3 lety

    Hm. Nice try Eli, but nope. Close, but nope. First off, you cannot iterate 1 -> 127. You omitted 0 because you probably know it's special (I2C broadcast), but it's not the only one. If you look up the I2C reference you'll see addresses 0-7 are reserved as are 120-127. So in fact, you need to restrict the scan space to the interval [8;119]. You probably just got lucky with your attached devices that they didn't go mad when receiving one of the reserved addresses. Second, you need to assume some device might get mad and lock up your I2C bus, which is why you need to implement a scan timeout as well as a I2C bus reset for a full fledged I2C scanner.