We’re rewarding the question askers & reputations are being recalculated! Read more.

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
0
votes
2answers
2k views

Minimum value I2C-pull up resistor for arduino

I'm trying to determine the minimum value of pull resistor for Arduino Uno The datasheets says for arduino; VOL = 0,4 for IOL = 20 mA. (VDD = 5V) For formula for calculation of minimal pull-up is: ...
0
votes
1answer
81 views

3.3v Arduino I2C communication with motor controller powered at ~6v

I am trying to just use the voltage from 4 Alkaline AA batteries in series (6v nominal) to power a motor with the TI drv8830 IC. My question is, will this circuit (specifically just pulling the sda ...
0
votes
1answer
503 views

ToF VL53L1X sensor integrate with arduino

I have this latest version VL53L1X time of flight laser distance sensor: http://www.st.com/en/imaging-and-photonics-solutions/vl53l1x.html I study about this sensor, It says that sensor only Access ...
0
votes
2answers
259 views

Can I use 1 clock module for multiple Arduinos?

I want to connect an RTC to a master Arduino, send the time data to a slave Arduino through I2C, then connect an LCD to the slave and print it out. can it be done? A think it would mean that the ...
0
votes
1answer
899 views

Arduino UNO(master read) + NANO(slave write) i2c buttons+stepper

First of all, I'm new to arduino. Check the EDIT line below the two codes. I have connected motor shield to arduino uno. Connection between the two arduinos are A5 to A5, A4 to A4, 5V to 5V and GND ...
0
votes
1answer
61 views

IO with port manipulation while not interfering with i2c

I'm using an Attiny84 with the Tiny Core. I'm try to use port manipulation to write the lower four bits of port A. I'm using i2c which occupies bits 5 and 7. How can I write only to the lower 4 bits ...
0
votes
1answer
309 views

If an I2C connection is lost for a short period of time will it work if the connection is live again?

I'm using an ESP8266 with the Arduino library to read from a sensor(MPU9250 specifically). The readings are done via I2C but I'm using a library that abstracts these methods. The wires are not ...
0
votes
2answers
145 views

Getting error 32 in multi-master I2C sketch with library https://github.com/rambo/I2C

I am developing a multi-master scenario sketch with the https://github.com/rambo/I2C library, because this library will handle multi-master data collisions. I created a setup with two Arduino nano's ...
0
votes
1answer
1k views

Why am I getting only around 40% the range of my ADS1115 using an Arduino Uno?

I've connected my ADS1115 to an Arduino Uno as in the diagram (Vdd - 5V, Gnd - Gnd, SDA/SCL - SDA/SCL), all powered from the USB on a PC, with A0-3 unconnected, and am getting readings of around 3000 (...
0
votes
1answer
588 views

Problem to display Ntp time on an oled using U8G2 lib

So I have this code to get ntp time and display it on serial port. But I want to display it on a 1.30 inch I2C oled with a SH1106 controller using the U8G2 library. The only problem is I don't know ...
0
votes
1answer
1k views

Using TFT touchscreen with Arduino Uno R3 via I2C

I've recently gotten into Arduino, due to a friend asking to be part of a project. The project requires a few 24V LED strips to be controllable via PWM, probably over MOSFETs (we have someone else in ...
0
votes
1answer
269 views

SD begin affecting OLED display

Okay, I'm using u8g2 library for my OLED display. After calling SD.begin(4) function, I cannot display anything on my OLED. I'm using U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ ...
0
votes
1answer
155 views

Trouble with Arduino -> PSOC4 communications over I2C! (Multi master/ slave config)

Hello Stack Exchangers! I am currently working on a project which requires me to use PSOC4 - 049's to scan a series of inputs, and feed this data back to an arduino over I2C. The arduino, or in ...
0
votes
1answer
374 views

Multiple I2C devices on Arduino

I'm design a custom PCB based around the Arduino Zero/Adafruit Feather M0. The plan is to use a few I2C devices. I just had a few questions about whether I've designed the board correctly. You'll ...
0
votes
1answer
90 views

Not clear code procedure in Arduino wire library

The application code of sparkFun, has the following line which is difficult to understand. It's requested 6, because it's requesting 6 bytes for HMC5883L module. Wire.requestFrom(address, 6); if(6&...
0
votes
1answer
27 views

Is this a good function for I2C receive?

I'm trying to fix my I2C code: Is the following function correct because it has multiple returns. I don't know if that would work. uint8_t I2C_rx(uint8_t ack_rx) { uint8_t i; if (ack_rx) ...
0
votes
1answer
257 views

Trying to read from AD5934 using Arduino on I2C

I'm trying to read a block of bytes from an AD5934 Impedance converter (PDF) using I2C. This is my code so far Preamble: #define AD5934_Address 0xD #define AD5934_Start_Frequency ...
0
votes
2answers
202 views

Why it's not possible to manipulate the TWSR directly? [closed]

I think I forgot the reason for this SFR manipulation in microcontrollers; like, checking the TWSR in twi. The technique for checking the values of the TWSR is by masking it with another variable or ...
0
votes
1answer
366 views

Reconnect to I2C with a different address (ATTiny85)

My project requires to reconnect to an I2C bus as a slave. I can't reset my ATTiny physically because I2C + my project + a pin to trigger the reset isn't possible due to the limited amount of pins ...
0
votes
1answer
248 views

FIS1100 (IMU)/ I2C/ Arduino

I am a student and currently doing a semester project. The first goal is to get accelerometer and gyroscope data from FIS1100 using the Arduino (Uno). I've got the FIS1100 Evaluation Kit user guide ...
0
votes
1answer
146 views

Servo jitter with two atmegas

So i'm building my own quadcopter at this moment and I have designed a flight controller board for it using two atmega328p's. I've programmed it so that the first atmega receives al the data from ...
0
votes
1answer
615 views

Multimaster I2C with same address

I use the Wire Library and need to have multi-master setting. I see multi-master examples, where the masters have their own ID's -- which make sense. Now I have just connected three devices on the ...
0
votes
1answer
630 views

Using 2 GY521(mpu6050)s with Arduino Uno R3

I am working on creating a motion sensor based on an Arduino and MPU6050 interface. I'd like to retorfit my code to be able to read 2 mpu6050 devices. Besides defining a 0x69 address and setting AD0 ...
0
votes
1answer
5k views

Why is a delay(1) necessary before Wire.requestFrom?

I had a problem communicating an nodeMCU with an Arduino Pro Mini with I2C. To find the culprit, I finally wrote an Echo Server in Arduino: it receives a byte and responds the same byte. In the ...
0
votes
1answer
250 views

Confusion receiving I2C data from magnetic sensor

So, I've found the address of my device using a I2C device scanner. I then looked up the datasheet for a magnetic sensor I am trying to grab data from. I'm now trying to communicate with the device ...
0
votes
1answer
925 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
2answers
151 views

Hardware interrupts for buttons not directly assigned to pins

The Adafruit LCD shield offers an LCD and access to 4 button, using only a two wire connection with the Arduino. This is achieved with the MCP23017 I2C port expander IC. These buttons are not ...
0
votes
1answer
282 views

How to change a code for an I2C 16x2 to a 20x4?

I have found a sketch that someone wrote for a rotary encoder controlled LCD menu. The code is for an I2C that is 16x2 and I have an I2C that is 20x4. With the code that I found, the layers are all ...
0
votes
1answer
164 views

Reading HMC5883L hex values in 2's compliment C code

I want to develop my C code for HMC5883L. I have 2 questions for my current code development. My first question is: But what I found in the datasheet is that the values are in the 2's compliment, so ...
0
votes
1answer
358 views

Connecting an Arduino Nano, Mega and LCD via I2C works but fails when shutting down Mega

I have connected an Arduino Nano, Mega and a LCD via I2C/TWI (SDA/SCL). The Nano is playing the master while Arduino Mega and LCD are slaves. This works well till I power off the Arduino Mega. Of ...
0
votes
1answer
149 views

(SOLVED) Fast HW check: (18 digital + 4 analog to I2C ) Arduino Mini Pro + MCP23017 or STM32?

Arduino Mini Pro+MCP23017 or STM32 I want make device, which reads 17 digital buttons and 4 analog, process it somehow and send the result to I2C bus. Also there is a LED to be managed. I may want ...
0
votes
1answer
4k views

The working of a MFRC522 and its Interface protocols?

I've actually messed up and posted into the stackoverflow site, even though I'm probably not meant to. I've been given this datasheet, but even though it does explain somewhat how each host interfaces ...
0
votes
1answer
447 views

Cutting off OneWire/SDA line with transistors

I am developing a pcb for a design I am working on and I need to share a pin to be used by a ds18b20 (onewire) and some possible I2C sensors. There would be just one of each at a time. I was thinking ...
0
votes
1answer
650 views

I2C MCP4725 DAC connection speed

I'm trying to use the MCP4725 DAC from Adafruit (https://www.adafruit.com/product/935) to output some waveforms over a frequency range up to about 50kHz. At the moment, I'm simply sending values to ...
0
votes
1answer
4k views

OVF in serial monitor instead of data

I am currently working with two Arduinos and I'm trying to synchronize them. I want to get data from four LIS3DH accelerometers. The LIS3DH accelerometers are connected to the Arduino using I2C ...
0
votes
1answer
1k views

ESP8266-12E and MCP23017 , unable to identify the application

After googling much I have found that MCP23017 can be used with esp8266-12e for more number of output pins. I have tried all the programs from different tutorials on internet but could not make it ...
0
votes
1answer
264 views

Detecting I2C transfer with LED

I am going to do a project with a lot of Arduinos connected via I2C, where like of them can became master for a moment to announce an event. So I would like to see how much is the bus used. As there ...
0
votes
1answer
403 views

How to use potentiometer data from slave to master Arduino?

I'm trying to make a game where i can use one Arduino as a controller (the controller is a potentiometer) and the other Arduino sending the signals to the computer. Im trying to figure out ...
0
votes
1answer
385 views

Does receiving data with SPI stop the main loop?

I have a loop of code running on a Mega 2560 that is running at a certain speed, which I get from an Arduino Uno. I have tried to talk with I2C but when I receive the data from I2C, the whole code ...
0
votes
1answer
384 views

Arduino bug when “myFile = SD.open” is inside loop()

My Arduino resets / bugs each time I put myFile = SD.open in loop(). In setup() it works fine. I have a 20*4 LCD and an RTC connected to I2C, an SD card reader connected to SPI, and a fingerprint ...
0
votes
1answer
150 views

SPI Overflow in 328 slave with i2c sensor

I am working on creating sensor poller that is going to be polling multiple sensors and then, on request, provides its data to the master. The master polls the slave (SPI) at 50hz and the slave is ...
0
votes
1answer
2k views

How to turn I2C Sensors on and off with an Arduino Mega 2560?

I want to turn on and off I2C Sensors with the Arduino Mega 2560. I use one max. 0.4A NPN Transistor, which controls the Vcc line to the sensor. When I plug my Arduino into my laptop and the sketch ...
0
votes
1answer
340 views

How can I determine how many bytes an I2C master read from my Arduino acting as I2C slave?

I have an Atmega328 programmed using the Arduino software and libraries (but is standalone on on a board in the TSOP package) without bootloader and with ISP programming). I am using the Wire library ...
0
votes
1answer
443 views

Arduino which library for led 4x20

I am having an Arduino Uno and I want to add a LCD to it. My LCD is a C2042A with I2C shield on it. I tried the LiquidCrystal_I2C library but it doesnt work. I am not getting any errors the LCD is ...
0
votes
1answer
161 views

Arduino i2c communication between another arduino and a sensor

Can the following scenario exist? Microcontroller 1 sends a code to microcontroller 2 to start reading sensor data. Then Microcontroller 2 reads sensor data from sensor and sends it back to ...
0
votes
1answer
2k views

I/O expander with i2c interface vs Multiplexer

I am wondering where are the difference in between using something like: CD4067, which selects which pins to read/write from by "selecting" an address with 4 pins by writing to it. Versus the MCP23017 ...
0
votes
1answer
778 views

Code: Switch case and loop problem [closed]

Please am working on this automatic drink dispenser, i got a sample code as am still an amature. I seem to be stuck and i please need assistance. Components: I2C, keypad, LCD peristaltic pump. ...
0
votes
1answer
116 views

DS1307 RTC not working with CC3000 WiFi shield (I2C bus hangs)

I am trying to use a DS1307 (from Sparkfun, BOB-12708) with an Arduino Leonardo. I have connected the SDA, SCL, GND, and 5V pins from the RTC to the Arduino. However, with a CC3000 WiFi shield on the ...
0
votes
1answer
1k views

Second I2C address not accepted

I have set up 2 DHT22 sensors and 2 BMP280 sensors with an Arduino Uno SMD R3 board. The DHTs are working fine and are outputting correct temperature and humidity values to the Serial monitor. The ...
0
votes
1answer
218 views

PFC8574 4x4 keypad: correct wiring?

I bought a few PFC8574 and 4x4 keypads for a small project. I'm unclear on the correct wiring of the keypad to the PFC8574. On the Arduino Playground's site, there are pull-up resistors for each ...