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
1answer
56 views

How do I stop the slave from running the code until master sends a new value? I2C

I'm a total noob when it comes to Arduino. I'm slowly learning stuff. I was trying this code which basically gets input in Arduino1(master) and displays the character in serial monitor of Arduino2(...
0
votes
1answer
176 views

Stabilitiy Problem for Interrupts Code related to Flow sensor

There is a problem with code related in link Interrupts Problem with Flow sensor. Code is working but when I stop the pumps, flow value on lcd is frozen until I reset the arduino. And when I start the ...
0
votes
2answers
728 views

I2C call during Wire.requestFrom

Which I2C command happen during Wire.requestFrom(address, quantity)? Is it correct that Wire put a Start condition, then 7-bit address appended with read bit? How would that be different from Wire....
0
votes
1answer
3k views

How to make I2C work on RS485?

I'm trying to optimize the communication (minimize wires) on a project where I can control a motor and toggle some 230V devices by using RS485 and I2C. On this project, I'm using an Arduino (Mega) ...
0
votes
2answers
377 views

I2C Read Operation in TCA9539

I am using this TI device TCA9539 (http://www.ti.com/lit/ds/symlink/tca9539.pdf) with the pins A1 and A0 tied to ground resulting the write address to 0x74. I don't have any issues writing to this ...
0
votes
1answer
42 views

Change values of timer using I2C

I'd like to alter the "LED_T_ON" values using an I2C enabled device (i.e. RPi) Code for Arduino Mega slave: //slave #include <Wire.h> #define SLAVE_ADDRESS 0x08 const int PWR_LED = 43; int ...
0
votes
1answer
562 views

Arduino-compatible micro-controller with both I2C and CAN

I am looking for a controller that works with Arduino (i.e. there is official or third-party support for the controller in the Arduino IDE and core libs) and has both built-in CAN and I2C buses. I was ...
0
votes
1answer
6k views

MEGA I2C and interrupts on 0,1

Looking at the pinout for the Arduino MEGA: I see that Pins 20 and 21 can be both SDA and SCL or Interrupts 0 and 1. If I'm using an Adafruit I2C 16x2 RGB LCD Shield connected to the SDA and SCL ...
0
votes
1answer
43 views

adafruit LSM9DS0 Library - ok with Uno but compile error with LinkitOne?

I'm calling an adafruit Flora LSM9DS0 magnetometer using the Adafruit library with the following sketch: #include <Wire.h> #include <SPI.h> #include <...
0
votes
2answers
500 views

Splitting SCL and SDA pins

For a robotics project I am using an MCP23017 I/O Port Expander in order to have more pins available, and I am also using a PS2 controller for input. Both of these require pins 4 and 5 (because these ...
0
votes
1answer
457 views

4-wire shielded cable for I2C and power

I have two PCBs with ATmega328 that will communicate through I2C protocol. The master will also provide power for the slave, which is located at a relatively short distance (30-40cm or 12-16 inches). ...
0
votes
1answer
2k views

Reading values from TTP229 capacitive touch sensor on arduino

I would like to be able to read the raw capacitive sensor values from a TTP229 chip through i2c in Arduino. I have one of these breakout boards to play with : My goal is to get values similar to ...
0
votes
1answer
5k views

Arduino Mega - I2C pins (20/21) unreliable [closed]

Has anybody else noticed that the Arduino Mega pins 20/21 are exceedingly unreliable over long periods of time? It has been the case four times now where I have hooked up no more than 3 I2C devices to ...
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 ?...
0
votes
1answer
816 views

How to find the pin map for the LCD 1602 I2C adapter module?

I'm working with I2C to work with my LCD 1602 and the I2C adapter. This module has 16 pins and I don't know how to communicate with it. I2C sends 8-bit packets. What are the commands to deal with ...
0
votes
1answer
626 views

I2C communication, wrong response

With reference from http://www.gammon.com.au/i2c I tried the example there. However I am getting the wrong response and readings. At startup the Master will request for slave address. I should get a ...
0
votes
2answers
764 views

Servo motors not working when called upon using I2C

So I'm using this movement() function inside the slave Arduino Uno, which basically handles two stepper motors and one servo motor. When I call this function through the Serial.read() of the Arduino ...
0
votes
1answer
166 views

Connector for I2C sensor

Im about to develop some home automation. It should be possible to connect new sensors to the main computer. Thats a Arduino. What can be used as a connector for the I2C sensors? It should be ...
0
votes
2answers
193 views

How to make Arduino to stop updating i2c data when meet a condition and wait until it receives another serial input from processing?

I am currently making a robot with Arduino Uno, D6T omron thermal sensor (i2c sensor) and some other sensors. My thermal sensor will always update the data in array form. It will display 4 data arrays ...
0
votes
2answers
326 views

Resistor on SPI Chip Select Pin

I'm working on a modular CANBUS system for offroad racing. The idea right now is that the main Arduino (1284p at the moment) will be the only one connected to CANBUS, and other modules will have their ...
0
votes
2answers
3k views

What is the I2C address of a sensor?

I have connected BMP180 sensor: to Arduino and was able to read its values with appropriate samples (from Adafruit BMP085 Library and Adafruit BMP085 Unified). Apparently, this sensor is sending ...
0
votes
1answer
330 views

Use TSL2561 and DS1307 RTC together

I want to use a TSL2561 light sensor and a DS1307 RTC and a couple of other sensors like DS18B20, AS3935, ML8511, MQ135, 433 mhz sender together with an Arduino. However on Adafruit I read this today (...
0
votes
2answers
3k views

How do you send data via I2C without the wire library?

I have the following digital potentiometer: DS1803-100 which, according to the datasheet, can be controlled using a two-wire serial interface. I have managed to get it working using Wire, however I ...
0
votes
2answers
96 views

Global Arrays read as Zero

I have written a code for my Arduino which spans multiple files, In the file containing the main task, i have a Global Array like this addr_t childAddr[NUM_CHILDS] = { CHILD1_I2C_ADDR, ...
0
votes
1answer
2k views

need help hooking up an oled display

recently i bought this oled display . http://www.wvshare.com/product/0.96inch-OLED-A.htm how can i connect it with arduino . Driver Chip is SSD1306 . Supported Interface are 3-wire SPI, 4-wire SPI, ...
0
votes
1answer
30 views

I2C Communication with the ICM-20789

I am trying to interface with the ICM-20789 over I2C. DataSheet I have been successfully able to get all three gyroscope readings and all three accelerometer readings. I am now trying to get the ...
0
votes
1answer
29 views

I2C Wire.onRequest not detected

I want to know why Wire.onRequest can not detect below massage and what I can do to detect it.(I am not able to change I2C massage) I was able to read this part of the massage with wire.onReceive: ...
0
votes
1answer
33 views

I2C master/slave maximum requestEvent message size

Using a NodeMCU master and an Arduino slave (Wire.h on both sides), is there a maximum message size (32 bytes?) for the answer that the slave sends from requestEvent()? If so, is there any solution ...
0
votes
1answer
34 views

Header file or library to test i2c FRAM?

I found a header file to test a i2c eeprom 24LC256, but I used this to test my eeprom CAT24C32.The test sketch works fine. I modified the line BLOCKSIZE 8 because my eeprom have 32byte page write only....
0
votes
1answer
21 views

request for a member “X” in something not a structure or a union

i was programming a Self Balancing Robot, I am writing the code in vscode using platformio extension. when i put the code i need to get the angle out of the gyro in another file (named angle.c) ...
0
votes
1answer
62 views

i2c slave write to ARM powered device master

I want to communicate to an ARM microprocessor via I2C protocol (Multitech mDot, which uses Mbed platform). I successfully receive data from it (and got it displayed on Arduino's serial monitor), but ...
0
votes
2answers
50 views

Update time in RTC over I2c fails

I am communicating two arduinos using the I2C protocol and sending from the slave to the master the integer value of UTC to update the time in the RTC module. When the master receives the UTC value ...
0
votes
2answers
51 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 ...
0
votes
1answer
30 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
125 views

Is it possible to send a float Array over I2c

I have tried it several times myself but i never could send or receive it properly. I am asking myself if it is possible and if so could someone explain how? Cheers.
0
votes
2answers
66 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 ...
0
votes
1answer
88 views

ATTiny85 I2C connection with Arduino Nano

I am trying to send and receive data using I2C between an Arduino Nano and an ATTiny85. The ATTiny is mounted on this board: Link I've tried to reach the slave with the simple I2C scanner, but I don'...
0
votes
1answer
231 views

Weird behavior with char/uint8 arrays

So I'm trying to read an 8-byte character string from an I2C device and print it to the serial console. This raw 8-char array is not terminated when it comes from the device, so I'm pretty sure I need ...
0
votes
1answer
396 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 ...
0
votes
1answer
457 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 ...
0
votes
1answer
364 views

Resetting I2c Address - MLX90614

I was using my MLX90614 IRTherm sensor flawless and bought two more. I have connected two sensors serial with pull-ups to SDA --> A4 and SCL --> A5. After digging the internet I found out that I ...
0
votes
1answer
48 views

Hot Swap Sensor

Is there a way to have a sensor be hot swappable, as in it can be disconnected and reconnected without locking up the Arduino? I have an I2C sensor that I want to be able to disconnect and reconnect ...
0
votes
1answer
949 views

ADS1115 : measuring 5v voltages and powering with 3.3v

I have a project where I need to measure 0 - 5 V. I’m using a ADS1115 to have a better precision, connected to a ESP12. Since the ESP is only 3.3 V tolerant and the ADS powered by 5 V (...
0
votes
2answers
78 views

How to control two devices with Arduino? [closed]

I want to control two devices: AC Humidifier I have a DHT11 sensor for temperature and humidity. I want the AC to turn on when the temperature is greater than 30°C, and off when it's less than 20°C....
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
72 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
484 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
246 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
852 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 ...