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.

Filter by
Sorted by
Tagged with
1
vote
2answers
3k views

How to change i2c address for mpu9250?

I'd like to connect 12 mpu9250 sensors to one arduino board. I can't find documentation on how to change the addresses of mpu9250 boards. (i read through the reference ). Some tutorials talk about ...
5
votes
4answers
3k views

How to setup an I2C bus which stays valid if a slave is powered down or fails?

I have setup an I2C bus between 3 Arduinos (Master, Slave1 and Slave2) by connecting all 3 A4 pins together, all 3 A5 pins together and one GND pin of each Arduino to a common ground line. The 3 ...
5
votes
2answers
11k views

Multiple I2C sensors with the same address

I am trying to find the simplest way to connect multiple (preferably around 10-20) IMU sensors to one controller. There are two constraints: sampling at 60Hz and reasonably simple wiring as I want to ...
5
votes
2answers
5k views

What does this notation stands for? Wire.read() <<8 | Wire.read()

I'm using the Arduino's site test code for getting raw values from a MPU-6050 accelerometer + gyro. In the loop, there are this lines for getting the next data from its registers: Wire.requestFrom(...
1
vote
2answers
3k views

Arduino I2C communication between Raspberry Pi

We are trying to communicate between multiple Arduino's (in this example a Nano and a Mega) and a Raspberry Pi. The Raspberry pi is defined as master and the Arduino's as slaves. We would also like ...
0
votes
1answer
105 views

i2c Connection for MCP4725(Dac) with Esp8266 wemos d1 mini

------------ This question has been edited ------------ note: Dac and Adc is12bits my problem : I use two ESP. Using esp1, I read the Adc amount of the alternating signal (ECG) and send it to esp2 ...
0
votes
2answers
117 views

Arduino slave with 2 masters sharing the same I2C Bus?

Consider a scenario where two (or more) master devices (the NodeMCU's, in this case) share an I2C bus with one (or more) slave device(s), like thus: Would this be a feasible setup? In other words, ...
0
votes
1answer
79 views

Software I2C - sending data

I'm trying to read a voltage in from a power supply to an Arduino Micro, then send it to an oscilloscope through an I2C (MCP4725). I would use the default pins on the Micro but I want to wire three ...
10
votes
1answer
2k views

How to design and debug a custom I2C master-slave system?

How to proceed, when in need of a custom I2C master-slave system? What are the design criteria to apply? What are the debugging tools one can use to troubleshoot problems?
6
votes
2answers
47k views

Sending and receiving different types of data via I2C in Arduino

I have found a few good tutorials on how to send and receive data via I2C in connected arduinos. My limitation is now how to transmit different types of data like for instance, long, float, etc. Right ...
5
votes
3answers
5k views

How do I use two I2C LCDs with 4 pins?

I have two I2C LCD screens: one with 2 lines one with 4 lines. Both have 4 pins each: GND, VCC, SDA, SDL. I connect SDA and SDL to A4 and A5 respectively, and I display text on each one of them with:...
12
votes
3answers
28k views

How do I use I2C devices with Arduino?

I have a few useful I2C components, such as a 16-bit port expander (MCP23017), which I'd like to use in various projects. What do I need to do to make these work with Arduino? Will it work with any ...
6
votes
5answers
10k views

Alternatives to Wire library for I2C

I am looking for (reasonably easy to use and well tested) alternatives to the Wire library. Wire works very well, but: I only need the Arduino to act as I2C master and the Wire library seems to be a ...
7
votes
3answers
27k views

I2C 2 way communication between Arduino Uno and Arduino Mega

If I remove the transmission code from slave this works properly but I need to transmit from slave. Here is my master code #include <Wire.h> void setup() { Wire.begin(3); Wire.onReceive(...
5
votes
2answers
13k views

I²C with ATTiny85 at 8MHz using TinyWireM library

Hello fellow Arduino enthusiasts, I am trying to make the ATTiny85 talk I²C with a MMA7660 breakout board I have (it's an accelerometer, this is a follow up question to my previous one). I would ...
2
votes
3answers
3k views

Interfacing Arduino through USB or I2C?

I am planning to connect multiple Arduinos to my Raspberry Pi. There are basically two ways I can achieve that: Use an USB hub. Each Arduino will then be available through ordinary serial commands ...
0
votes
2answers
2k views

Two-way communication on multimaster I2C bus

I'm trying to send data both ways between an Arduino Mega 2560 slave and 2 Arduino Nano Zero (ATSAMD21G). This example is a simplified setup and code. There will be more masters along with passive ...
9
votes
7answers
50k views

I2C LCD Serial Interface Board not displaying text (wrong pins?)

I have a 1602 LCD screen that works fine on its own. However I wanted to free some pins by using an I2C / IIC LCD controller I purchased separately. While the controller seems to be communicating ...
5
votes
3answers
3k views

Arduino Due and BNO055 address in i2c mode

I have a project where I need to have several IMUs, the BNO055 shuttle board (I explained my project here), I manage to get the Euler angles from one BNO055 sensor, which have the address 0x29, ...
5
votes
1answer
13k views

How to connect new OV7670 FIFO to Arduino?

I bought a new OV7670 FIFO camera to connect to my Arduino UNO a few days ago. The picture of the cam board: I found this forum, it is nice try but it looks chaotic and confusing with about 50 pages,...
3
votes
3answers
787 views

What is the right way to query an I2C device from an interrupt service routine?

The ADXL345, for example, requires that interrupts are responded to by querying the INT_SOURCE (interrupt source) register. In example code for the SparkFun ADXL345 Arduino Library, there is code that ...
3
votes
2answers
5k views

I2C and SPI at the same time?

I would like to ask a question relating to the following communication setup: STM32 -- Arduino Pro Mini -- ADNS3080 sensor The interface between STM32 -- Arduino is I2C and the interface between ...
2
votes
1answer
366 views

What is the execution context of the function registered via the Wire.onReceive() method?

I'm basically wondering if it's OK to Serial.write() or print in the function I register to be called when I2C data is received. I can't seem to find the execution context or any warnings. http://...
2
votes
3answers
6k views

Receiving two-byte int values over serial

I am using Python smbus write_word_data method to send int values from a Raspberry Pi to an Arduino using I²C. This seems to be the correct method. When I send values from 0-255, I see the following ...
2
votes
2answers
380 views

Can I safely integrate 3,3v sensor with 5v Arduino UNO? How?

I plan to use Adafruit's RGB sensor with Arduino working as a RGB controller running on 5V. In my location, the 5V-compatible version of the sensor is not available. There is a 3,3V pin on my Arduino ...
1
vote
1answer
376 views

Modifying Arduino IMU library to rely on DSSCircuit's I2C Master Library

For an Arduino project I am working on, I am trying to modify the SparkFun 6 Degrees of Freedom IMU Digital Combo Board - ITG3200/ADXL345 to support DSSCircuit's I2C Master Library (https://github.com/...
1
vote
1answer
308 views

How can I identify, debug or fix a faulty IMU?

I have an LSM9DS1 breakout board by Sparkfun, and am communicating with it using a Mega 2560 over I2C. The board is given 3.3 V power as defined in the data sheet, though there seems to be confusion ...
1
vote
1answer
1k views

How to operate under linux an USB to I2C adapter based on the FTDI FT232R? [closed]

How can I easily use, from the command line, the USB to I2C adapter based on FTDI FT232R?
0
votes
1answer
897 views

HMC5883L not working in continuous mode!

I'm just starting with the HMC5883L, I'm writing my code with C and also my own I2C library. I noticed that the values on the Arduino IDE's serial monitor are constant. Then I developed a function ...
0
votes
0answers
449 views

trouble running i2c and spi at the same time

I know this question has been asked before but I am having trouble running I2c and SPI at the same time. I am attaching my code below. The problem when I run the code is that the LED's don't blink ...
0
votes
3answers
615 views

Multiple I2C slave devices on Arduino - Pull-up values

This question is asked a lot and I've found many usable details on different forums regarding adding pull-up resistors on SDA/SCL lines. I know that only one resistor should be added on these lines ...
0
votes
1answer
4k views

How to chooce SDA/SCL pair on Arduino Due ?

On Arduino Due, there is two pairs of pins SDA/SCL that I can use for I2C. There is SDA0 and SCL0 at, respectively, pins 20 and 21 and an another near AREF. How do I choose which one of them I use ?...
-2
votes
1answer
384 views

Control multiple MPU9250 to start collecting data at the same time [closed]

Is it possible to use multiple MPU9250s for data acquisition at the same time? I want to use 10 MPU9250s in human motion capture, but how make all MPU9250 work at the same time so that make the data ...