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
0answers
34 views

Unable to write, or read a sensor's registers. Do I have an error in my code?

I'm trying to write to register the change some settings for a sensor I'm using (BNO055) and then read the same register to verify if the changes are successful. However, the only value I'm able to ...
1
vote
1answer
26 views

Sending a struct over i2c

How would you send a struct from an i2c slave when requested by an i2c master? Slave Struct Respdonder Sketch (Seeeduino Xiao) #include <Wire.h> struct TransmitData { int a; int b; int c; ...
1
vote
0answers
26 views

How to connect multiple MPU-9250 IMU sensors to a single Arduino Uno? [duplicate]

The datasheet says the I2C bus limits itself to only two MPU-9250 sensors. How can I control multiple (>2) MPU-9250 through a single Arduino Uno? Is it possible to add another bus? Please, help.
0
votes
1answer
43 views

Is my BMA421 locked up?

I have been trying to set up the BMA421 motion sensor in a nrf52 based smart watch, using the datasheet for the BMA423, which has the same interface. I had got the sensor working well with the ...
1
vote
0answers
35 views

Prevent flicker - Lcd with I2C module?

I have a 16x2 LCD with a I2C interface, and a Esp8266 based NodeMCU. I Have an issue where the second line of the LCD is flickering, but somehow the first line does not flicker. Why does this happen ...
0
votes
1answer
43 views

How to change i2c address of Lidar Lite v3 using LidarLite library (Solved)

I have 2 Lidars which are Lidar Lite v3 and Lidar Lite v4, both of these sensor having the same i2c address. I'm trying to change my Lidar Lite v3's i2c address on arduino mega2560 using a function ...
1
vote
1answer
212 views

Multiple Wire.write() not working for Arduino Nano I2C

Code for Master #include <Wire.h> void setup() { Wire.begin(); Serial.begin(9600); } void loop() { Wire.beginTransmission(9); Wire.write('c'); Serial....
2
votes
1answer
40 views

Can't read data from registers using I2C

I am trying to read data from the registers 6, 7, 8 and 9 of the STC3100 (Data Sheet) using an arduino uno. I followed this tutorial: https://howtomechatronics.com/tutorials/arduino/how-i2c-...
-1
votes
2answers
42 views

Serial and I2C not working together

I have very peculier problem. When I run this code SSD1306 fails to initialize. Output at serial console is: 20:26:33.194 -> MPU6050 OLED demo 20:26:33.532 -> SSD1306 allocation failed #include &...
1
vote
1answer
26 views

How detect I2C errors with requestFrom()

I am going to use MCP23017 chips, and some of them will be cabled with a 1 meter max unshielded cable. I am expecting that certain transmissions may toss errors. So I want to tackle this problems by ...
1
vote
0answers
38 views

How to use pins for I2C that is used from other hardware?

I am using ESP32 CAM for one project and I have a sensor that is I2C connected to pins 21 and 22 (default I2C). The sensor is working fine until I turn on the camera. The camera uses this pins (21,22) ...
2
votes
2answers
32 views

TTGO TS I²C adress

I'm working on a project using TTGO TS wich communicate wih arduino via I²C protocole How can I find the adress of TTGO TS board used in I²C communication ?
2
votes
1answer
35 views

What's the time out of Wire.begin()?

Here's a schematic of my project: The purpose is to make laptop work as keyboard for desktop PC. Nano uses Serial.read() to get keystrokes from laptop and forwards key press and release data to ...
1
vote
1answer
66 views

Is it advisable to use Serial.write in an ISR when loop() routinely uses Serial.read?

I do not know much electronics. I have Nano v3 as I2C master, it reads 5-byte packets (of delimtted data) from PC's USB port, processes it and forwards it. I now need to implement a way to signal PC ...
1
vote
3answers
21 views

What is the difference between serial begin() and wire.setClock() for I2C communication?

I am a new Arduino IDE user and have a simple question below For I2C transmission speed setting, there are serial begin() and wire.setClock(). Some sample codes just use Serial.begin() without Wire....
2
votes
3answers
107 views

send values from arduino uno to wemos d1 r1

I have a weather project in which I have to measure the temperature and humidity ( dht22 sensor ), the pressure and other things and then show them in a local web page ( usings wemos d1 r1 ) in either ...
2
votes
0answers
51 views

SPI Arduino slave not recieving data correctly

Using an STM32L476RG Nucleo microcontroller board as the SPI master and an Arduino mega as a slave with pin 52 for SCLK, pin 53 for SS and pin 51 for MOSI on the Arduino. There is no issue with the ...
1
vote
0answers
53 views

Arduino Uno I2C two sensor connection Issues

I have been working on trying to get the MAXREFDES#117 PPG and the LIS3DH Accelerometer to run together. I am modifying the sample code found here to do so: https://github.com/...
1
vote
1answer
36 views

Arduino Nano Every I2C PORTMUX

Arduino Nano Every schematic informs us that we can use ATMega4809's pins PF03 and PF02 to communicate via I2C. ATMega4809 manual says in page 19 that in order to use those pins as I2C we need to use ...
0
votes
0answers
46 views

I need to make button to turn off my alarm on clock

well I get task to make school project alarm clock using arduino, xd as you can see im not very good at it i mean i know something but not everything so please can someone help me, i copied this code ...
0
votes
0answers
17 views

want to get data from one IMU and Arduino simultaneously using I2c communication

I want to get data from an other Arduino and IMU using I2c communication and wrote a code given below but it is not working for me , #include<Wire.h> // Define Slave I2C Address #define ...
1
vote
0answers
41 views

How to get a stable LED lighting without scintillation over I2C bus

I built an 8x8 led matrix using white 5mm LEDs. I drive the LEDs using the MCP23017 connected to an Arduino over the I2C bus. The wiring of the LEDs in the matrix is such that a row is made up of 8 ...
1
vote
1answer
48 views

Is it possible to change and save I2C address programatically?

I want to drive 3 i2c devices on a single i2c line. Is it possible to achieve this without using A0,A1,A2 pins? I thought the address of i2c devices should be programmatically changeable. 2 mcp23017 ...
0
votes
0answers
42 views

Using MPU6050 with ESP32 Cam- MPU Not Detected

Hi I'm trying to build a self balancing robot using my esp32 cam, but so far I haven't been able to setup my mpu6050 with it.I'm using the adafruit libraries with the given example sketches. The only ...
2
votes
1answer
90 views

Can't Turn Off Internal I2C Pull-Ups on ESP32

I've designed a custom ESP32 board around the WROVER-IE module. To keep power low, I'm using a GPIO-controlled high-side FET to turn off unused peripherals when in deep sleep mode. The issue: I've ...
1
vote
0answers
30 views

send command to Slave and receive response over I2c

so I have an Arduino mega as the master and an attiny84 as the slave the master can send a command S to the slave and the slave should respond with TRUE so here is my code: master: bool GetOnline(){ ...
1
vote
0answers
68 views

Reusing Digispark ATtiny85 micro-USB as 1-wire bus

I'm working on a project of my home plants irrigation/hydroponic system(not cannabis!)) just chilies and other eatables). Also I'm trying to recycle modules, wires and other projects' leftovers such ...
1
vote
2answers
70 views

I2C Devices Interference

I am currently trying to connect 3 I2C Devices to an Arduino Mega, as detailed in the fritzing sketch. The Sensors are: Max86150 PPG Sensor on a breakout board (5v), MLX90614 IR Temperature Sensor (3....
1
vote
1answer
34 views

Having trouble with MPU6050 and AFE4404 printing together, potential conflict?

I am having trouble getting the two sensors to work together. There are a total of four sensors connected to the Arduino, and while the MPU and AFE individually work fine with the other two sensors, ...
1
vote
0answers
50 views

I2C and SPI connection in the same-time [closed]

I want to make code between to devices , the communication between the I2C master to master , but in the sometime the one of the connect with other device SPI bus master to slave . how it work?
1
vote
0answers
96 views

Random artifacts on SSD1306 OLED screen

I'm having a really strange problem with my screen. It's connected in i2c to my Arduino Nano and I'm using a rotary encoder to navigate through a menu. At startup everything is fine, but when I change ...
1
vote
0answers
21 views

Help Convincing Wiimote a Nano is a WiiMotion Plus

I want to replace the outdated gyro in a wiimotion plus with a BNO055. Based off what I've read from wiibrew, and im currently trying to get the wiimote to recognize the nano as an extension over I2C. ...
1
vote
0answers
26 views

How to know if a tof VL53L0x sensor is dead or not

I bought a bunch of VL530X time-of-flight sensors on Aliexpress. They seemed to work fine. Then I connected two of them on the same Arduino Uno board to test with the Adafruit example "dual"....
0
votes
1answer
36 views

Recommend an Arduino Uno shield to monitor the state of 5 DPDT electrical switches

I have a project where I need to monitor the state of 5 DPDT electrical switches with Arduino Uno. Also, the Arduino board will be measuring the output from 3 thermocouples on 3 of the analogue pins ...
1
vote
1answer
83 views

Reading I2C registers as slave device

I need to read the registers of a message gotten from onReceive(). I read here that There's nothing "magic" about the register pointer: it's simply the first data byte in the packet. So ...
0
votes
1answer
56 views

I2C_anything from Nick Gammon. Value of two senders to be received and printed by receiverslave

Following the suggestion of Fiendish to post here: Hello Nick, thank you very much for this I2C-anything library that works a treat with two arduinos (one sender, one receiver). Is there any suggested ...
1
vote
1answer
169 views

How to close/end a Wire.begin()?

I have an ESP32 cam, and I attached an i2c light sensor to it. I need to read the light level at startup, then I don't need the i2c connection again. The problem is, the board uses 2 i2c connections I ...
0
votes
1answer
26 views

How to you initialize a reset on a sht30 digital thermometer?

I have a sht30 that will output correct temperature readings for about 5 min and then will drift off. So I'm trying to hit the reset every few seconds to keep the readings accurate. I am on a nano ...
0
votes
0answers
46 views

Use I2C to control one of three DS3502 Adafruit digital potentiometers on the same I2C bus

My teammate and I recently purchased a handful of DS3502 digital potentiometers (https://learn.adafruit.com/ds3502-i2c-potentiometer/pinouts) from Adafruit, and we'd like to be able to control them ...
1
vote
0answers
62 views

MAX30102 showing Heart rate: 0.00bpm / SpO2: 0%

I am using a MAX30102 to monitor SpO2 and heart rate using the https://github.com/oxullo/Arduino-MAX30100 library and the minimal example, but it is not showing any value change. It only shows zero ...
0
votes
2answers
80 views

Cannot display a chr string using Wire.read() and u8g2.drawStr()

I'm still getting myself acquainted with C++, so I expect this is a very basic issue I'm facing. I've got an OLED screen connected to a Teensy LC and can display text on it just fine. The Teensy ...
1
vote
1answer
76 views

How to put Arduino Nano in low power sleep mode (<0.05mA)

I'm trying to put an Arduino Nano in low-power mode using this guide: Arduino Low Power - How To Run ATmega328P For a Year On Coin Cell Battery. The article suggests 3 things: use the Low-Power ...
0
votes
1answer
75 views

Grove Base Kit Multiple I2C Connection

I tried to connect two modules that require I2C connection and they won't work at the same time. I used the Arduino Sensor Kit - Base. This kit does not need any connection, you just have to code to ...
1
vote
0answers
65 views

Configure Trinket M0 as I2C peripheral

I am trying to use I2C to communicate between my XBee3 (controller) and an adafruit trinket m0 (peripheral). I'm pretty confident I have the modules connected properly (trinket SCL/pin 2 to xbee SCL/...
4
votes
1answer
84 views

Problems with green TWI (I2C) port on Arduino Braccio Shield

Summary: The green TWI/I2C port on my Braccio shield I2C port hasn't worked for me so far. Looking for advice or information please. Detail: I'm using the Arduino (Tinkerkit) Braccio robot arm for ...
1
vote
0answers
54 views

convert 16 bit into array of two 8 bits by use of union [closed]

I want to transmit a 16 bit data through I2C between STM32 and Arduino. But STM32 HAL command of I2C data is of 8 bits. Can I please get any suggestions to do that? Should I use union or just typecast ...
1
vote
0answers
135 views

Arduino Nano Every Vin 5V fixes I2c problems

I had problems with connecting my devices via I2C. The "requestfrom" constantly hanged and the endtransmission sometimes gave NACK responses. After disconnecting the devices from 12V and ...
1
vote
1answer
146 views

SoftWire Library Programming Questions for I2C with Digital Pins

I am trying to use 3 TOF10120 Laser Sensors with one Arduino that all have the same, fixed I2C Address. I don't believe it is possible to change the I2C address of the TOF10120, but if I am wrong, ...
0
votes
1answer
133 views

Sending 4 analog values from one arduino to another with I2C

I have modded a cheap drone controller to output its joystick values to an Arduino Nano. I made it to output its 4 pot values using I2C to another Arduino don't ask why. So my problem is that I need ...
0
votes
0answers
101 views

Max. external ADC speed with ESP32 (SPI or I2C)?

What is the maximum speed for external ADC I can expect to get with ESP32? I'm planning to have 16-bit ADC connected to I2C or SPI whichever gives more speed. How that information is calculated from ...

1
2 3 4 5
14