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.

1
vote
0answers
826 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] = ...
0
votes
1answer
259 views

problem data I2C to sensor GY955/BNO055 (China)

I want to ask, I have a problem when running the Arduino sensor, I can't output data, but it's detecting that the sensor address has been paired. Like I2C has a problem or locks it. Last night it ...
4
votes
3answers
647 views

Crash when datalogging MPU-6050 to SD card

On an Arduino Pro Mini, I'm using Jeff Rowberg's stuff in i2cdevlib to read from the MPU6050, and using SdFat to write data to an SD card. Each part in isolation is fine, but when both DAQ and logging ...
0
votes
2answers
198 views

How to connect MPU9250 with NodeMCU using SPI or I2C Slave?

I want to connect 3 MPU9250 sensors, but since there is just one I2C bus, so there are another 2 sensors I want to connect through SPI. Library used - https://github.com/bolderflight/MPU9250/blob/...
-1
votes
0answers
24 views

i2c callbacks occur in wrong order

I'm trying to implement a an SMBus slave and discovered that when the master sends a SMBus ReadByte command, the onRequest and onReceive occur in the wrong order on both a Uno and a Zero board. Some ...
0
votes
0answers
39 views

Calculate pullup resistor, cat5e ftp

let me describe my schema, i got one arduino and one esp32 connected over i2c using 30m cat 5e ftp cable, I'm using 12v to power up both devices, each of them have dc-dc converter that convert to 5V, ...
1
vote
1answer
489 views

I2C wire.h send 2 variables

I am trying to send 2 variables with wire.h. I tried with this code: MASTER RECEIVER: #include <Wire.h> // include la libreria #include <LiquidCrystal_I2C.h> #include "RTClib.h" ...
0
votes
0answers
17 views

Does LabVIEW Linx affect the communication speed with Arduino?

I am using LabVIEW to connect to Arduino Mega. I control a logic gate to switch the current On/Off and at the same time there is an I2C connection with a sensor. It came to my attention that the ...
0
votes
1answer
21 views

Increasing speed of Vl6180x Sensors

I have 5x vl6180x pololu ToF sensors. I have managed to hook up all of the sensors to the arduino via I2C by making each sensor startup at different times and when they do, changing their addresses, ...
1
vote
0answers
23 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 ...
0
votes
1answer
19 views

Trouble with i2c on ESP8266

I have used with partial success I2C with the ESP8266. When it works, it works well, with many devices on the bus. I've examined the signals on a 'scope to assure Vlo, Vhi, Tr, and Tf. However, ...
1
vote
0answers
375 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 ...
0
votes
0answers
27 views

Arduino 3.5" TFT Display going blank after sending data through I2C

I'm trying to use I2C to send and receive commands between an Arduino UNO R3 and an Arduino Mega R3, with a 3.5" TFT display connected to the Mega. I have verified that my display is fully functional ...
0
votes
0answers
33 views

I2C between two arduinos

I have 4 gyro sensors that communicate to arduino uno using I2C and then arduino uno sends the data to arduino mega. I was wondering if I could use i2c for this purpose or if I should look for other ...
0
votes
1answer
263 views

Docs for using i2C LCD with Newliquidcrystal_1.3.5 library?

I bought a 20x4 I2C LCD from OddWires. (https://www.oddwires.com/20x4-lcd-display-with-i2c-interface/) It came with ZERO specs or documentation. After some hair-pulling I was able to figure out how to ...
1
vote
2answers
51 views

Problem with reading data from HMC5883L in GY-86

I am trying to read the data from GY-86 with my arduino UNO. While reading MPU6050 and MS5611, it works quite well. But somehow I can't read anything from HMC5883L. Here is the code I used: #include &...
-2
votes
1answer
57 views

How to use I2C library

My A4 and A5 pins are already hooked up to a LCD and I want to connect a MPU6050 as well. In a separate thread, someone told me to use SoftI2CMaster library to use other pins as SDA ans SCL. But I don'...
2
votes
3answers
114 views

I2C interference SENSOR(SCL+SDA) and MasterSlave comm

I am building a weather station with an Arduino slave (dedicated to a rain gauge - depicted below as a reed switch) and a NodeMCU master with some additional sensors. One such sensor, a BMP280 uses ...
0
votes
2answers
45 views

Using MPU-6050 without I2C

My target is to use multiple MPU-6050 at once, I searched on the internet and found that they can be hooked up really simply. Just connect in parallel and use I2C-Scanner. Then get those addresses and ...
0
votes
2answers
39 views

Sharing serial output from one to many arduinos (plus a computer) via USB hub

I am trying to send rotary encoder output from an UNO to seven Trinket M0s and a computer via a (powered) USB hub. Currently the UNO → Laptop bit works great, serial monitoring works via the hub ...
1
vote
0answers
38 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 ...
1
vote
2answers
41 views

Two sensors using I2C

We have two sensor one of them(MPU6050-gyro) is communicating using I2C, the other is via SPI(SD card reader). Now, we need an additional component as a sensor that the barometer which communicates ...
1
vote
2answers
1k views

Reading data from airspeed v3 eagle tree

I am trying to get values from this sensor Airspeed v3 from eagle tree but it seems my I2C is not working properly. I bought a module in third party mode and followed these instructions from the ...
1
vote
1answer
50 views

conflict with different i2c devices

I am trying to communicate with two i2c components using an arduino nano - some ADS1115s and some i2c flow sensors each connected to a different i2c multiplexer, but they seem to be conflicting. ...
0
votes
0answers
29 views

i2C master/slave Arduino uno Programming to run 2 motors at once off separate boards [duplicate]

I am attempting to run a master/slave receiver arduino using two arduino uno's. I'm synchronizing both Arduino to control 1 dc motor and 1 stepper motor at once which each of the Arduino UNO board ...
2
votes
0answers
3k 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 ...
1
vote
4answers
2k views

Running a 7 pin OLED with 4 pins (I2C)

I have an OLED with this 7 pin pinout: I want to use an existing code i found that makes use of U8Glib. But in the example, use uses 4 pins to control the OLED via I2C. This is the pinout he uses: ...
1
vote
3answers
2k views

Multiple VL6180X distance sensors interactive problem

I am trying to use a VL6180X distance sensor and an Arduino Uno board for individual sensor doing individual distance sensing. This sensor follows the I2C protocol. Since for the same type of sensor, ...
0
votes
1answer
332 views

Reading RAM from SH1106 OLED Controller through I2C

Summary: I'm having trouble with writing a program to get RAM data from an SH1106 OLED controller via i2c. In the first part of the question I've written the assumptions I've made to get informations ...
2
votes
0answers
117 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 ...
1
vote
1answer
102 views

ESP8266 I2C datasheet pins not the same as several examples

According to espressif datasheet of the ESP8266 it uses MTMS (I2C_SCL) and GPIO2(I2C_SDA) for I2C. However in several examples I've seen the typically use is GPIO(4&5) or GPIO(0&4) to ...
0
votes
1answer
927 views

I2C requesting more then one byte

I got an Arduino Uno set up as an I2C master to an ATtiny85 slave, using the Wire (Master) and TinyWireS (Slave) libraries. Communication works good. I have been able to keep the network running ...
3
votes
3answers
307 views

Is there any limitation with Arduino Nano serial communication distance?

I am trying to build Project which communicate multiple Arduino Nanos. I wanted to understand if Arudino Nano is capable of doing that, while doing research I came across post where it says ...
2
votes
2answers
278 views

AtTiny85 and MMA8452Q accelerometer cannot connect using i2c

I am trying to connect the MMA8452Q with AtTiny85 using the TinyWireM library. I made the proper hardware setup with pull-ups on SCL and SDA pins - tested it on Arduino Uno and it works, however ...
1
vote
1answer
55 views

Working with Wire core library

I'm studying the Wire library code driver utility/twi.h to learn how twi buffering and ISR management work. What I did actually, is that I copied the header/source files from the Arduino path F:\...
-1
votes
1answer
159 views

What is best way to get data from sensors if arduino is slave?

Im working on a project where i have motor controller(arduino nano) being i2c slave. Its job is to get RF24 data and control motor and at same time send data to master about motor... Currently i have ...
0
votes
1answer
33 views

Arduino help adding a second mpu 6050 sensor my working code

Background information: I currently have this arduino code that uses one mpu 6050 sensor to get angles in the x, y, and z directions and then display them to the user nicely. Code can be found here ...
-2
votes
2answers
239 views

coding problems

I'm working on a Arduino controlled solenoid motor project that I found on Instructables. I have been able to piece together what I think is most of the code but I'm getting some syntax errors and was ...
0
votes
2answers
655 views

I2C conflict with 2 Arduinos

I am having some trouble connecting my 2 Arduino Nanos with I2C. I have this configuration: SLAVE RECEIVER Nano with DS1037 and LCD 16x02 on I2C. MASTER SENDER Nano. After some time the Slave ...
1
vote
1answer
213 views

What does the numbers behind lcd (0x27) means?

I can't seem to figure out what the numbers in after 0x27 means. I understand that 0x27 stands for I2C address and POSITIVE stands for the back light, but what does the other numbers mean? ...
0
votes
1answer
82 views

Multiple slave(sender) to one master (receiver)

I beg your help to my project I wish to send the data from slave to master but only one data is receive out of two slaves. //master #include <Wire.h> void setup() { Wire.begin(); // ...
0
votes
1answer
25 views

compare char receive from Slave writer to Master reader with I2C

Im trying to send data from slave (writer) to master (reader) then compare it to declared 'char p[]' to turn on the lights but somehow i cant make it work. ////master reader #include <Wire.h&...
0
votes
1answer
234 views

I2C EEPROM “hangs” on endTransmission()

I am working on the 24LC256 EEPROM, wired as such, except 3.3v to the EEPROM, with 'scope clamped on SDA and SCL. I'm using an address scanner script with a few tweaks, 57600 baud, 10kOhm pullups, ...
0
votes
2answers
606 views

I2C communication between 2 Arduinos with updated wire library

I would like to enable communication between two Arduino 101. From what I have read, the best method is to use I2C using the wire library. However, it seems as though the newest Arduino IDE has an ...
0
votes
1answer
500 views

Arduino UNO inconsistent I2C register reading from ArduCam

I have an Arducam hooked up to an Arduino UNO. The code I am running looks like this: #include <Wire.h> #include <ArduCAM.h> #include <SPI.h> #include "memorysaver.h" const int CS ...
0
votes
2answers
58 views

How to get average of 16bit ADC readings?

I have an Adafruit ADS1115 analog-to-digital converter, configured in single ended mode. I want to average over 3 sensor readings to increase the reading stability. //initialize variables int16_t ...
2
votes
1answer
113 views

Accelerometer (I2C) and Fona Shield (software serial) won't work together

I am using a Fona 808 shield with an Arduino Uno and the LSM303 accelerometer. The accelerometer is connected via I2C and the Fona uses software serial. My project requires the accelerometer to be ...
0
votes
1answer
234 views

How to change speed of multiple servos acting at the same time with PCA9685 module?

I'm using the PCA9685 module with its Adafruit library. In my code I have one object of the servodriver class that has 14 channels (controlling 14 servos basically). void Positioning(){ ServoDriver....
0
votes
4answers
56 views

How can I hook up multiple MMA8451 accelerometers, (I2C protocol) using one Arduino Mega?

How can I hook up four (adafruit) MMA8451 accelerometers (using I2C protocol) using one Arduino Mega? What I'm confused about is I only have one SDA and SCL on the Arduino Mega obviously. So how can I ...
0
votes
2answers
52 views

HD44780 display incorrectly black-on-blue instead of white-on-blue

I have a generic HD44780 compatible 16x2 LCD display, with an already soldered on PCF8574 module. Its backlight is blue, and the characters are supposed to be white (on blue). It is connected to a ...