Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
2answers
39 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 ...
0
votes
4answers
43 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
1answer
29 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
0answers
40 views

Lost with Nano and i2c

I've been struggling with some code that was failing to "begin()" any devices on my i2c bus. I've uploaded a scanner program from arduino playground which lists the addresses of any i2c modules found. ...
1
vote
1answer
33 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
46 views

i2c code hanging - tried all connections

I'm trying to connect a TCA9548a breakout to my nano (also tried using an uno), but it can't recognise it - using the i2c scanner it just hangs on 'scanning...' I've tried everything suggested in ...
0
votes
0answers
28 views

Arduino IDE + Metro + I2C device (Grideye) + Code for Uno = weird results?

I have been working successfully with the arduino uno and a thermal camera device called grid eye. There is a board available at the popular suppliers of arduino addons. For the uno, the code looks ...
0
votes
2answers
52 views

MPU-6050 with Arduino - postmortem

I'm working with MPU-6050 with Arduino Uno. I copied the code below from Arduino Playground - MPU6050. Code : // MPU-6050 Short Example Sketch // By Arduino User JohnChi // August 17, 2014 ...
0
votes
1answer
26 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 ...
0
votes
2answers
36 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
0answers
23 views

Having trouble reading directly from VEML6075 UV sensor from its registers(I2C)

I'm kinda new to Arduino and decided to dive deeper into learning abit more about Arduino; So i decided to grab a Sparkfun VEML6075 UV sensor and try to: 1) Initialise it 2) Take readings from it ...
0
votes
0answers
26 views

LCD not displaying any character with I2C or when used separately

I have an arduino uno and pin connection for I2C are - SDA --> A4 SCL --> A5 VCC --> 5v GND --> GND This the code i am uploading taken from the examples - #include <Wire.h> #...
1
vote
1answer
35 views

Wire.h missing - Failing to upload I2C 16x2 LCD sketch

I am total newbie in Arduino and for the last 3 days I am trying to figure this out. I would like to use an I2C display for a project. I have installed the LiquidCrystal_I2C, but when I try to upload ...
0
votes
1answer
22 views

Question on pin management using PCA9534PW IO Extender

There is an IO expander PCA9534PW, Arduino UNO. I don’t really understand how I can manage this expander using UNO over I2C. I found an example, but here is the reading mode. What I need: Set the ...
0
votes
1answer
60 views

Possible to connect 3 MPU9250 to Node MCU without multiplixer?

Is the idea of connecting AD0 pins of MPU9250 is still valid like the 2nd answer of this question? - How to change i2c address for mpu9250? I have connected 2 sensor as test. SCL & SDA of both ...
0
votes
1answer
78 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? ...
3
votes
2answers
90 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 ...
0
votes
1answer
65 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/...
0
votes
0answers
43 views

How to interface Arduino with NXP PCA8561 LCD segment driver?

I've just bought few NXP PCA8561AHN LCD segment drivers to do some tests which unfortunately did not went as expected. I'm familiar with expanders and segment LED displays but LCDs seem to be way ...
1
vote
0answers
48 views

Is it possible to use I2C and SPI ons the same Clock line?

I'm trying to connect an I2C OLED display and an n RF24L01 WiFi module to an ATTiny85. But I only need 1 extra pin. Is it possible to use the same clock wire/pin for the I2C and SPI device? Maybe with ...
0
votes
0answers
40 views

SerializeJson not working when using softserial

IDE:1.8.8 Board:Arduino UNO When I use the code below, I get result of print like this. { "result": [ { "ID": "01", "Value": [ "2", "1", "13" ] } ] } But when I use SoftwareSerial and in the setup ...
0
votes
2answers
38 views

Connecting multiple MAX30100/30102 via I2C

I want to connect multiple (up to 4) MAX30100 or MAX30102 oximeter sensors to an Arduino via I2c. But I could not find a solution to change/assign the I2C address. implementing-pulse-oximeter-using-...
0
votes
1answer
41 views

I2C potentiometer mess

I bought a few MCP4651 dual 8 bit I2C pots for a project. After browsing the arduino libraries and finding nothing,"No big deal" I thought to myself ... I've already written I2C libraries for other ...
0
votes
0answers
36 views

What is the difference between the digital temperature sensors SHT31 and DHT11 or DHT12?

I am looking for a digital temperature sensor with I2C interface. I found the SHT31 and the DHT12 (compatible to DHT11). Both also include humidity sensors. And I found libraries for both of them. ...
0
votes
0answers
38 views

Problem I²C Communication between Arduinos

My Problem seems to be that my I²C slave randomly disconnects. I have an Arduino Due communicating with a Arduino Chestnut board (bought hardware). I now measure data with the Due and then send the ...
0
votes
1answer
49 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'...
2
votes
2answers
97 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 ...
0
votes
0answers
39 views

Buffer to string

I'm a bit of a noob, so excuse if this is more obvious to me than to you. I want to convert a u16 to a string. The u16 is the data coming in from the sensor. I need it as a string, or anything else ...
0
votes
1answer
118 views

Issues with I2C and Wire.Available()

I am working on a project which requires communication from an Arduino Due (Master) and an FDC2214Q1 C to D IC (Slave), but there is some variability as to whether the code works or not depending on ...
0
votes
1answer
49 views

Same output on displays with different I2C-addresses (AdaFruit library, ESP32)

I've got two displays hooked up to a ESP32 via I2C and I'm using the AdaFruit library. All handling display output is packed in a own library. As I was testing I only had one display set up and ...
0
votes
0answers
38 views

Bit Bang I2C with port manipulation on AtTiny84: new pinout doesn't work

So I am trying to understand bit banging and port operations. I'm developing a breakout board with an ADXL343 IMU read by an AtTiny44 via i2c. I adapted this code from MIT's How To Make Almost ...
0
votes
1answer
68 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
0answers
34 views

LCD displays weird characters

I have connected the LCD by the 3 wire method using the LiquidCrystal595 library+74HC595 register shift; sometimes "hello world" is displayed but other times the LCD displays weird characters. How to ...
0
votes
1answer
160 views

Slow refresh rate on I2C OLED screen

I'm trying to create a small handheld console with 6 buttons and an I2C 0.96" OLED display: https://imgur.com/a/AKiRMWN The directional buttons use the analog pin and different resistors technique to ...
1
vote
0answers
27 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 ...
0
votes
0answers
130 views

Arduino pulse oximeter max30100 didn't work

I have a school project that help babies who has a heart problem, I'm using an Arduino UNO R3, HC-05 Bluetooth and pulse Oximeter MAX40100(RCWL-0530), and I'm using the library at https://github.com/...
1
vote
1answer
71 views

How to initialize and run PCA9685?

I'm trying to write a simple code for initializing and running the PCA9685. I tested the board with Adafruit library and it's working. But I just want to develop a simple code to include it in my ...
0
votes
0answers
45 views

Using TCA9548A to read 30 ADCs

I want to read 30 differential ended analog sensors. Using ADS1115 16 bit this is possible, but we end up having only 4 address on I2C, so i chose TCA9548A breakout board with 8 I2C multiplex channels,...
0
votes
1answer
354 views

SSD1306 allocation failed when adding a constant

I am trying to get this code working: #include <Button.h> #include <SPI.h> #include <Wire.h> #include <Adafruit_GFX.h> #include <Adafruit_SSD1306.h> #include <RTClib....
0
votes
2answers
39 views

Accessing multiplexed I2C and UART pins of STM32F103 in arduino IDE

I want to access both of the multiplexed I2C and UART pins in the same program. I am programming in Arduino IDE.Can anyone please tell me how to access same pins for different functionalities?
0
votes
0answers
161 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
149 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
0answers
53 views

LCD (I2C) issues with pull up resistor

I'm close to finish my first DYI project. But a never seen issue on the breadboard has apprear as soon as assembled. The LCD is always / totally blank/black. When I remove the 4.7 K ohm pull-up ...
2
votes
0answers
122 views

How to use SPI to set/ read registers for a sensor (Avoiding need for Github Lib)

Ok so as some readers might have seen, my current project involves using MPU's. The idea is sending data via CAN bus to a controlling MCU to then send to a raspberry pi to perform the calculations ...
0
votes
2answers
75 views

Bad Communication with Multiple I2C Devices

I have an Arduino Micro connected to two I2C devices. An MPU-6050 that is powered by 5V (though it has its own voltage regulator on it) and a Altimeter that is powered by 3.3V. They are both connected ...
0
votes
3answers
232 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
0answers
35 views

Why is Wire.endTransmission(true) returning 10?

Question: The follow code is printing 10 over and over again (with spaces in between). I have an I2C device connected at 0x60, and nothing connected at 0x61. I'm confused by this because the Wire....
2
votes
3answers
180 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 ...
0
votes
0answers
40 views

Teensy freezing when reading ir sensor

I have a teensy that controls a motor and reads from a ir sensor, GP2Y0E02b. The issue i run into is that at random times the teensy seems to freeze, the main code stops printing but the interrupt ...
0
votes
2answers
128 views

How to manage variable I2C read lengths requiring address incrementation (Wire/I2C/EEPROM IC emulation)

The question is about how to have information/control of a variable length read for an Arduino acting as a slave device. The concrete context is that I want to emulate an EEPROM IC. A byte write to ...