The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
3
votes
3answers
275 views

Solution for simple multi-Arduino communication network (or alternative?)

I know similar question has already been discussed here but I could not get clear answer. Here is the thing: I have one master device - Mega2560, and multiple (about 9 but could be expandedin future) ...
3
votes
2answers
456 views

ATtiny85 LM75 I2C

I would like to read temperature from a LM75 using the ATtiny85 running a core by SpenceKonde and utilizing the TinyWireM library. My Logic Analyzer does not pick up any I2C communication, when I ...
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 ...
3
votes
2answers
98 views

Need little bit of help on testing I2C sketch

I have this code I got from YouTube for communicating between two Arduinos. By typing 'R' manually into the serial monitor of the 'master' Arduino, the 'slave' will print "Success". I'm trying all ...
3
votes
1answer
537 views

Three or more Arduino slaves sending bytes to 2 different I2C devices

I'm trying to connect 3 Arduinos with this scheme: Arduino1 Master, Arduino2 Slave, Arduino3 Slave. The slave devices need to communicate with each other and I'm trying to programming Arduino2 and ...
3
votes
2answers
713 views

Does an I²C IO Expander needs additional resistors for outputs?

I have following setup (see also schematic in the end) Arduino Nano is connected via I²C to the PCF8575C (link) IO Expander. Both, SCL and SDA have 10kOhm pull-ups to 5V. The Expander pins are ...
3
votes
2answers
790 views

Wire Library send/receive

I'm doing a project that includes an Arduino Uno and custom hardware made by me. Everything is working perfectly independently, and I'm trying to implement a way for them (the Arduino and my hardware) ...
3
votes
1answer
942 views

Cannot read from 2 I2C slaves consecutively

I am currently trying to communicate between 3 Arduinos using I2C. One of them acts as a master, while the rest act as slaves. I can request data correctly from the master. But if I were to do 2 ...
3
votes
3answers
1k views

LCDs larger than 20x04 and 5" diagonal

Are there any i2c LCD screens that are larger than 2004 characters and larger than 4.8 x 2.7 x 1.2 inches in dimensions? I have the Sainsmart 2004 LCD but it can't display all the information that I ...
3
votes
1answer
49 views

When I verify the sketch I get several errors

I am extremely new to Arduino coding and have downloaded a sketch for the PCA9685 to use with model railroading and turnout control. When I verify the sketch I get several errors ... I don't even ...
3
votes
1answer
284 views

Alternative to UART/I2C LCD displays?

I'm building a MIDI synthesizer on Arduino Uno, and am considering user interface options. I see on Adafruit and Sparkfun there are 16x2 LCD panels available that interface via I2C serial or by UART,...
3
votes
1answer
1k views

Help with 1-Wire to I2C translate

Please, someone. I want to use a temperature sensor (DS18B20) in an I2C only shield (Tentacle Mini), but this sensor is One Wire only. Can I write an I2C code to change the 1-Wire to I2C for this ...
3
votes
1answer
2k views

I2C or SPI to control 6 motors?

I am a hobbyist & know little about electronics. I am making a robot arm, like this one. For which I will need 2 stepper motors (for elbow & shoulder joint) & 4 simple DC motors. Which ...
3
votes
2answers
346 views

Unstable system when controlling power to serial peripheral devices and sleeping

In the process of trying to make a small system that will last a while on 4 AA batteries, I've reduced my Arduino project to a barebones system that when asleep draws a tiny amount of current from the ...
3
votes
1answer
3k views

MCP7940 RTC Library

I am looking to implement a Microchip MCP7940 real time clock into my sensor data logging circuit that I have based on the Uno. Would the most logical solution be to attempt at changing an existing ...
3
votes
1answer
270 views

Adding devices makes I2C read 0

I'm using an Arduino Due with a logic level converter to interface with two different 5v sensors via I2C. Being of poor quality, these sensors have no data sheet. When either one of these sensors is ...
3
votes
1answer
103 views

I2C - Confusion

It's not often I ask a question. This one has me a little stumped though. Scenario: I have an 328PB (internal 8mhz), it speaks to a multiplexer on Wire1 (the PB's second IC2 - Minicore lib). The ...
3
votes
1answer
1k views

Using SCL and SDA of ESP8266-01 with GY-30 BH1750FVI for lux measurement

I followed this tutorial to get lux measurement from GY-30 BH1750 with Arduino. It's working fine. But now I want to use it with ESP8266-01. I read Pin 4 is SDA and 5 is SCL for it. But it's not ...
3
votes
1answer
1k views

Arduino as Slave to Return Multiple Values

I'm having trouble trying to get my two Arduino Unos to communicate with each other over i2c. I'm trying to have the master request for analog values from the slave by sending a request to the slave ...
2
votes
3answers
1k views

Calling I2C functions inside an ISR

I have an Adafruit 2.8" cap touch display, which has an interrupt pin (IRQ). I tried to use this with my Arduino Nano, but encountered a problem: When trying to get the touched point from the display ...
2
votes
4answers
163 views

Can an Arduino Micro receive commands from another microcontroller when hardwired together?

I plan to build functioning reaction wheels, controlled by an Arduino Micro. Ideally, I'd like to have the reaction wheels, and the micro, be a single unit which would receive external commands from ...
2
votes
2answers
419 views

Connect two Arduinos using I²C (wiring)

Altough having found a lot of documentation concerning wiring of I²C buses, I'm still not sure about the following question: If both devices use separate power sources, is it a good idea to connect ...
2
votes
3answers
271 views

Control I2C relay board from two Arduino Uno

how can I make multi master Arduino device to work with single I2C device? As both the master device are 20 m away from Slave device, I am using the I2C relay board to connect with 2 Arduino boards ...
2
votes
3answers
763 views

How to do I2C on Arduino with SDA and SCL pin already used

i have a Arduino screwshield from sparkfun that I purchased: https://www.sparkfun.com/products/9729 which I used to put between my arduino uno and my 2.8" TFT LCD touch shield so that I am able to use ...
2
votes
1answer
2k views

Wire.h library works on Uno but won't compile for ATtiny85

TL;DR: Arduinos are current hungry so I want to switch my microcontroller code works on Uno, I change upload to ATtiny85, code doesn't compile Wire.h breaks at the TWBR input Should I keep trying to ...
2
votes
2answers
8k views

Problems with I2C connection on ESP8266 - 12F, which pins should I use?

Previously I had pined the temp/hum sensor HDC1080 with an Arduino using this sketch and everything worked fine. Now I want to run it over an ESP-12F, I uploaded it but it has issues at the time of ...
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 ...
2
votes
1answer
7k views

Wire.endTransmission() Hangs

I have written a code that transmits data over the I2C channel, The device ID and every other stuff is working fine. The only issue being that my code gets stuck at Wire.endTrasnmission(). I found ...
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
3answers
304 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 ...
2
votes
3answers
566 views

I2C Temperature Sensor Communication Issue

I'm currently learning I2C and having some issues displaying the correct temperature in the serial monitor. I am using an Arduino Uno and an SI7021 temperature sensor from Sparkfun; here's the ...
2
votes
1answer
2k views

Performing multiple Wire.writes() - does endtransmission slow things down?

Here's a question for anyone knowledgeable of the ways of I2C. I'm curious about sending multiple writes to a device and was looking at the code for a MPU9250 module. There is a nice library that ...
2
votes
2answers
2k views

SDA/SCL pins Arduino Uno

I am trying to figure if SDA and SCL pins from Arduino Uno is a TTL or a CMOS technology. I am not able to find this info anywhere but regarding it is a I2C protocol it does make sense to be a TTL ...
2
votes
1answer
895 views

I2C seems to stop working when I attach an AF motor shield

I have a cheap MPU 6050 chip that communicates over 3.3V I2C. I can talk to it just fine on my Leonardo. If I add an additional Adafruit Motor shield (the old one), my MPU 6050 demo sketch hangs ...
2
votes
1answer
739 views

Lockup while evaluating Wire.requestFrom function (Arduino)

I am currently working on a Arduino project that combines an InertiaOne IMU sensor board (from Atmel), with an Arduino UNO and two motors driven by a Makeblock driver board. All sensors communicate ...
2
votes
2answers
192 views

Risks when commanding multiple chips with same address via I2C

I know that I2C devices are supposed to have unique addresses when used. What if I still use multiple devices with the same address, what can go wrong? Let me describe the situation: I have multiple ...
2
votes
1answer
640 views

How can I2C be made to work through a level shifter?

I am attempting to use a bi-directional level shifter for an IMU to shift the SDA and SCL lines in an I2C implementation, however cannot get the level shifter working with the Arduino at all. It feels ...
2
votes
1answer
88 views

Arduino Uno and I2C

How does the arduino uno talk with i2c? i saw the circuit and it use analog input pins but as far as i know you cant use them as output. How does he send data over those pins?
2
votes
1answer
711 views

unresolved overloaded function type for Wire.onReceive

I am attempting to make an I2C slave out of my Arduino and I can't get past the Wire.onReceive function. Here is my code. The documentation says to just add a function that has the style of void ...
2
votes
2answers
3k views

Conflict between OneWire and I2C?

I have two Arduino boards and I want to make them communicate via I2C. The first board (slave) should read a temperature value from a DS18B20 sensor (OneWire) and send it to the second board (master) ...
2
votes
1answer
4k views

Do I need Kalman Filter after I read DMP data on MPU6050?

In my project I need to use as noiseless as possible data from a MPU6050, I do have some nice DMP data, what will happen if I apply Kalman filter above it? Will I get more noiseless data? Or will it ...
2
votes
1answer
185 views

Interfacing Arduino Leonardo with PCA8574AN

I'm trying to interface my Leonardo with a "Mindsensors Magic Wand" - 8 LEDs connected to a PCA8574AN chip. On the manufacturer's page, they say it's compatible with Arduino, however no instructions ...
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
1answer
221 views

9 DoF Sensor Accelerometer Readings Inconsistent

I have the following sensor stick: https://www.sparkfun.com/products/10724 It has an accelerometer, gyroscope, and magnetometer. I have connected it to an arduino and am reading the accelerometer ...
2
votes
2answers
851 views

Sending a string from RPi to Arduino - Working Code

I've been researching for 2 days now trying to figure out how to receive a string via I2C on an Arduino. There are plenty of questions online but no real solutions or full tutorials... and sadly I ...
2
votes
4answers
485 views

lcd not display

is it my coding wrong or my board have problem because my lcd does not display anything. here my coding #include <Wire.h> #include <LiquidCrystal_I2C.h> // set the LCD address to 0x27 ...
2
votes
1answer
378 views

I2C communication between Arduino Due and Nano

I'm trying to communicate between two Arduino Due and Nano. Nano as Master and Due as a slave. As given in the library description Wire Lib When the master request for data from the slave, first it ...
2
votes
2answers
299 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 ...
2
votes
1answer
2k views

5 inch TFT LCD for Arduino

I want to use a 5 inch 800x480 TFT display (touch not needed) with an Arduino (mega, uno or due). I'm thinking of buying this display: link (buydisplay.com). How can I connect this ? I have also ...
2
votes
3answers
3k views

ToF Laser Sensor (VL53L0X) not working

I have this time of flight laser distance sensor: http://www.dx.com/de/p/cjmcu-vl53l0x-tof-laser-distance-measuring-sensor-module-purple-449081#.WSbn52jyi70 The example code of the VL53L0X-arduino ...