Questions tagged [i2c]

Inter-Integrated Circuit (I²C) is a bus for low speed peripherals. Use this tag for questions regarding how to use I²C with an Arduino, or for problems with I²C and your Arduino.

151 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
286 views

Handling non-standard I2C read response lengths with Wire library

I'm trying to read from a Sam&Wing XW12A 12 channel touch sensor IC using I²C. The IC responds to an address read packet with 16 uninterrupted bits representing its state. However, since I²C ...
Jim's user avatar
  • 161
5 votes
0 answers
7k views

Why is Wire.onReceive() called during requests?

I'm building a complex I2C-based networking protocol and have noticed that the Wire.onReceive() handler is called both for I2C read and write operations. When the master writes to the slave, it is ...
Jeremy Gilbert's user avatar
3 votes
0 answers
130 views

Using 2 VL53L4CD ToF sensors and getting error after getting first reading

pretty new to arduino stuff and was hoping to get some help with my code. I'm trying to use 2 ToF sensors and get continuous readings from them. I understand that I have to use the xshut feature and ...
nh1628's user avatar
  • 31
3 votes
0 answers
2k views

How to use SPI to set/ read registers for a sensor (Avoiding need for Github Lib)

Ok so as some readers might have seen, my current project involves using MPU's. The idea is sending data via CAN bus to a controlling MCU to then send to a raspberry pi to perform the calculations ...
Ross Hanna's user avatar
3 votes
0 answers
504 views

Connecting arduino and EV3 using I2C

I'm trying to connect arduino uno and ev3 by using this guide (http://www.dexterindustries.com/howto/connecting-ev3-arduino/), everything works perfectly but when i tried to use analogRead block to ...
haxscramper's user avatar
3 votes
0 answers
147 views

How can I send a number from a master and make the slave read it?

I am building a fan controller using an Arduino and a Raspberry Pi (the Pi is the master and the Arduino is the slave). The Raspberry Pi generates random numbers and I want the slave (Arduino) to be ...
THN's user avatar
  • 31
2 votes
0 answers
348 views

Scrambled Text on SSD1306 Using ESP32-S2

SSD1306 OLED display connected to an ESP32-S2 over hardware I2C. I noticed that the text will sometimes get scrambled or lag during a screen update. When left running long enough, the screen will get ...
subcanny's user avatar
2 votes
0 answers
62 views

MPU9250 and MPU6050 not working with SAMD21 board

I am trying to use an MPU6050 with my SAMD21-based board (a LightAPRS W-2), but it doesn't work. The sensor definitely works, as I can get data from another 3.3 Vlogic-level board, and the sensor ...
Charlie Nicholson's user avatar
2 votes
0 answers
172 views

Wire library causing samd21 based board to stop working

A bit of a general question, but asking in case someone has stumbled onto a similar problem before. A friend and I designed a custom PCB board based on the ATSAMD21G microprocessor. The board has a ...
Zhelyazko Grudov's user avatar
2 votes
0 answers
114 views

SPI Arduino slave not recieving data correctly

Using an STM32L476RG Nucleo microcontroller board as the SPI master and an Arduino mega as a slave with pin 52 for SCLK, pin 53 for SS and pin 51 for MOSI on the Arduino. There is no issue with the ...
Osz's user avatar
  • 21
2 votes
0 answers
612 views

OLED display on I2C causes esp8266 to reset

I have connected two temp sensors and an OLED display to a NodeMCU using I2C. When the program reaches the instruction to print the measurements on the display the program crashes and NodeMCU resets ...
Zaffresky's user avatar
  • 183
2 votes
0 answers
986 views

Connecting OV2640 with 17 Pins Binocular Camera module, to any microcontroller (System clock on module pin 18 -NC)

These pins are on the module: 3.3V GND VSYNC SCL SDA HREF D0-D7 DCLK PWDN I have tried many codes and connections of the OV7670 Monocular cameras, none seem to work(Instructables , Circuit Digest , ...
ian noronha's user avatar
2 votes
0 answers
227 views

qMenuSystem using DigoleSerial library doesn’t work on my I2C Monochrome OLED

Just like the title says I’m trying to make qMenuSystem to work with my oled display. Here is what I know so far about my display : - It's a Monochrome OLED 128x64 (Blue) Display - It's connecting ...
h4x7o0r's user avatar
  • 23
2 votes
0 answers
356 views

STM32F103C8 - Arduino Mega FAST MODE(400000L) I2C communcation not working

I'm trying to connect a stm32F103C8 board (master) to an Arduino Mega (slave) over I2C. I have a master and slave program which runs perfectly fine when the clock frequency for I2C communication is ...
Sushant Rasalkar's user avatar
2 votes
0 answers
233 views

Using TCA9548A to read 30 ADCs

I want to read 30 differential ended analog sensors. Using ADS1115 16 bit this is possible, but we end up having only 4 address on I2C, so i chose TCA9548A breakout board with 8 I2C multiplex channels,...
root0's user avatar
  • 21
2 votes
0 answers
796 views

How to read the busy flag on LCD?

I have a standard 16x2 LCD screen and I have it hooked up to my Arduino UNO via a I2C backpack (4-bit mode). Since I want to learn about the lcd at a lower level I’ve decided not to use the LCD ...
DanB91's user avatar
  • 121
2 votes
0 answers
625 views

I2C on ATtiny85 and Si4703 radio

I've got an Si4703 breakout from Sparkfun, which communicates via I2C. I have gotten it to work very easily using a regular 3.3V Arduino Pro Mini, but am now trying to move everything over to an ...
JeffThompson's user avatar
2 votes
0 answers
2k views

How to prevent Wire.requestFrom from hanging?

I'm trying to read data from an Arduino Uno I2C slave via Wire.requestFrom() on an Arduino Uno master. The slave's onRequest handler is simply: void I2C_Send() { byte myArray[4]; myArray[0] = ...
Cerin's user avatar
  • 1,608
2 votes
0 answers
302 views

Adafruit Trinket 3v with LED matrix backpack producing error

I have been wanting to create a Arduino watch. I built the circuit with an Adafruit Trinket 3v and an Adafruit LED matrix backpack (8*8). When I try to upload this example code: /*********************...
Merlin04's user avatar
  • 121
2 votes
0 answers
149 views

Reprogramming a specific slave from the master ATTiny 85 (connected to IDE)?

Given that every ATTiny connected already has a bootloader (micronucleus) installed, here's my theoretical chain: Computer > Master ATTiny (Connected via USB) > ATTiny Slave A > ATTiny Slave B Is it ...
jamcube's user avatar
  • 21
2 votes
0 answers
223 views

Too many Bytes Using Ultrasonic Sensors

I need to send one transmission and record multiple distances with 4 receivers, but everytime I use more than 2 receivers, the serial data does not print. What can I do? P.S. I'm using 5 SRF-02 ...
Umbus's user avatar
  • 143
2 votes
0 answers
681 views

ATtiny85 + HC-05 + Oled = smart watch

I am using an ATtiny85 for making a smart watch. Bluetooth module HC-05 with ATtiny85 pins PB3->TX, PB4->RX and it works. Secondly I have connected a 0.96" OLED on PB0 (SDA) and PB2 (SCL) and this is ...
Vipin's user avatar
  • 21
2 votes
0 answers
812 views

I2C — set int pin

I am using a blend micro board, where the digital pins 4, 6 and 7 are reserved. I have connected a MPU6050 which uses the I2C protocol, so there is the need for the i2cdev lib to handle that. The ...
philipp's user avatar
  • 141
2 votes
0 answers
115 views

Teensy and MS5803 sensor

I'm trying to use the MS5803 pressure sensor with a Teensy 3.2. Compiling the Sparkfun, or other, libraries, however, results in no output. Can you provide guidance on how to modify the libraries to ...
Andrew Milich's user avatar
2 votes
0 answers
187 views

Basic communication between Cotek and Arduino UNO

I am trying to get a reading from my Cotek through my Arduino and have it display on an LCD screen. When I run the code, though, nothing shows up. I am EXTREMELY new to using pretty much all this ...
lwang94's user avatar
  • 21
2 votes
0 answers
156 views

I2C with an arduino, a PI and an IO expander

im working on a project which requires alo i/o pins. For that reason i bought a pcf8574P 8bit I/O expander which uses the I2C protocol. The problem is how to combine the Rasp PI and the arduino. For ...
Meletis Flevarakis's user avatar
2 votes
0 answers
428 views

Receiving multiple bytes from an RPi using the i2c protocol

Trying to send bytes from an RPi as a master to an Arduino as a slave. The send uses the write_byte(addr, value) function and seems to be working perfectly. The Arduino however has issues with ...
Ali Harvie's user avatar
2 votes
0 answers
1k views

Unexpected Timer Conflicts (Uno)

I've been working on a project (Arduino Uno: Atmega328) that implements a gyroscope (which is used with the LSM9DS0 spark-fun library) that is communicated with through I2C and uses a Servo library. ...
Sock314's user avatar
  • 153
2 votes
0 answers
237 views

GPS - Speed doesn't update as should - EM408 & Arduino Mega & GSM

I'm developing a system that will get the GPS signal and send it though the GSM with information about position, speed and temperature from some digital sensors. Currently I'm using the GPS EM408, ...
Canela's user avatar
  • 21
2 votes
1 answer
196 views

Can't get MMC3416xPJ to work

I needed a magnetometer with a high Output Data Rate (ODR). This is because I wanted to measure AC magnetic fields of around 20-80 Hz. So I decided to go with the MMC3416xPJ prototyping board which ...
Nadim Ahmed's user avatar
2 votes
1 answer
977 views

Getting inverse values of acceleration and tilt for the MPU 6050

I'm using the I2C library to connect to a GY-521 board and, when executing the getAcceleration() methods I get gyro values and viceversa.. This is my setup (I'm using a proto shield but that shouldn'...
Alvaro's user avatar
  • 121
1 vote
0 answers
174 views

How to use multiple PN532 over i2c bus(es) and SPI?

I am working on a project that involves 3 PN532_modules to an ESP32, which sends the Tag_ID over BLE. Plan A was to use One module on i2c_1, second on I2C_2 and third over SPI. The SPI one works as ...
user91535's user avatar
1 vote
0 answers
487 views

LiquidCrystal_I2C, lcd.begin() causes runtime error on Arduino Mega2560

I have tested the library and LCD with simple script and everything worked fine. Now I am trying to add the LCD functionality to my working program but the code reaches the lcd.begin(); function it ...
Jesus Soto 's user avatar
1 vote
0 answers
148 views

Pool pump man-in-the-middle SDA/SCL with ESP32

Hey all I have found some code on GitHub that works with my pool pump but it seems my model is a little newer than the one they used on on their GitHub. Most things seem to work but what doesn't is ...
StealthRT's user avatar
  • 257
1 vote
0 answers
98 views

LIS3DH not working with arduino

I am new to LIS3DH and tried to interface it with Arduino Uno. I have made the circuit as follows- LIS3DH : Arduino Uno SCL : SCL (GPIO18) SDA : SDA (GPIO19) 3.3v : 3....
ABD's user avatar
  • 11
1 vote
0 answers
155 views

VL6180X returning to its default i2c address after shutdown

According to this thread the VL6180X after changing the i2c address the new address should persist after a power down. but when i changed mine it came back to its default address at 0x29. Here is the ...
DrakeJest's user avatar
  • 229
1 vote
0 answers
158 views

Arduino Wire library master reader, slave sender example not working

I tried i2c EPROM and that worked pretty fine with arduino master. then i wanted to establish i2c communication between 2 arduinos such that both exchange each other's sensors data. I am not able to ...
mohsin ali's user avatar
1 vote
0 answers
51 views

Help with the Arduino Wire I2C Communication with MAX16826 LED Controller IC

I'm trying to read and write to this MAX16826 LED controller evaluation board through I2C. There is no specific library for this IC so I have to use the Wire library and the datasheet to try to ...
Agriculex's user avatar
  • 139
1 vote
0 answers
69 views

I2C and logic shifter troubleshooting

I'm attempting to use a SparkFun bidirectional level shifter (Link here) to connect up a 3.3v wii nunchuk to a 5v Arduino Uno circuit. For now all I'm trying to do is write the position of the ...
ThorsHammer171's user avatar
1 vote
0 answers
45 views

Audio range with custom waveshape

I am planning to use several Arduino to produce audio range analog signals. I need to use custom waveshapes generated on the fly. As far as I understand, there are two paths: Aquiring a DAC, but can ...
huhu roro's user avatar
1 vote
0 answers
65 views

Flight controller board Reprogram

Recently in my scrap yard visits, more and more I find cheap quad-copters and remote controllers of all kind. I have built up quite a collection of boards and spare parts to create my own army of ...
GiuBu's user avatar
  • 11
1 vote
0 answers
163 views

Could not find AHT? Check wiring! How do i connect an AM2315C - Encased I2C Temperature/Humidity Sensor to a STM32F103C8T6?

am a little new at this so i sincirely need your help. So I have a temperature & humidity sensor i got from http://www.aosong.com/en/products-70.html which is probably based on the AM2315C - ...
Agent 96's user avatar
1 vote
1 answer
344 views

LILYGO TTGO T-Display cannot detect MPU 6050 Accelerometer, Gyroscope and Temperature Sensor

I've been trying to connect a MPU 6050 Accelerometer, Gyroscope and Temperature Sensor to a LILYGO TTGO T-Display to get readings displayed on the serial monitor (for starters). The wiring is pretty ...
C Vith's user avatar
  • 103
1 vote
0 answers
759 views

I2C / TWI: set up atmega328p as slave

I try to run an atmega328p as a i2c slave. even with the bare minimum the slave acts as its not wired at all: NACK is transmitted after request (see logic analyzer). The master should read a constant ...
micro_'s user avatar
  • 21
1 vote
0 answers
387 views

Can a sensor have multiple I2C addresses?

So I'm having a weird issue with a TCA9548A multiplexer. When I run the scanning code given on the adafruit website, I get the following result: TCAScanner ready! TCA Port #0 TCA Port #1 TCA Port #2 ...
rakhshak's user avatar
1 vote
1 answer
1k views

DS3231 RTC not working with ESP32

I am using ESP-32-WROOM-32 with a RTC DS3231 module. I have connected SDA & SCL pins of RTC DS3231 with ESP32 D22 and D23 pins. Also, the VCC of RTC is connected to 3V3 of ESP32 and the GND of RTC ...
Excalibur's user avatar
1 vote
0 answers
128 views

I2C 16x2 LCD - Will Initialize (sometimes) - Holds Up The Code

Basically I have a keypad, that when a certain code is entered, it will write either "Wrong code" or "Good code" on the LCD. At the same time a timer will count down until 0 is ...
GeorgeWTrump's user avatar
1 vote
0 answers
648 views

ESP32 + Attiny85 AC Dimmer

I am working on an AC Dimmer project using ESP32 and Attiny85. Note : I know ATtiny85 is overkill for this project, And it can be done without Attiny85, I have already done this using ESP32 alone. ...
Mayoogh Girish's user avatar
1 vote
0 answers
202 views

How to name the temperature sensors instead of printing address using ds2482-100 and ds18b20 sensor- Help

I am using 10 ds18b20 Temperature sensors using with "DS2482-100" I2C board and Arduino so when I am getting the output like this:- "ROM = 28 46 04 1F 0D 00 00 74 96014B467FFF0A100A 25....
Khangesh's user avatar
1 vote
0 answers
137 views

Unable to write, or read a sensor's registers. Do I have an error in my code?

I'm trying to write to register the change some settings for a sensor I'm using (BNO055) and then read the same register to verify if the changes are successful. However, the only value I'm able to ...
Zhelyazko Grudov's user avatar