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
705 views

Connect arduino nano and ESP32 with I2C on the GPIO7 and GPIO8?

I made a mistake connecting SD0 (GPIO7) and SD1 (GPIO8) with the SDA and SCL on my arduino nano. I got confused with GPIO21 and pin21 and GPIO22 and pin 22! Since I made a PCB prototype, I would ...
2
votes
2answers
57 views

MPU6050 does not give output

I need help getting my MPU 6050 to actually give me data. As of right now, my program is only reading 0s from the gyroscope and when I move it, the values all go to -1 and the program just stops until ...
1
vote
1answer
38 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, ...
2
votes
1answer
48 views

I am in need of a usable communication library on 1-4 pins of ATTiny84 instead of I2C

I messed up when designing my PCB and just assumed that I could use software slave I2C with ATTiny84. The reason I did so is - I needed to use all of the analog inputs. The pins I have on my ...
2
votes
2answers
141 views

What is “tws_delay” and how can I use it? (with an ATTiny85)

EDIT: Alright I'm stupid, I had the 2012 library installed somehow, maybe when I downloaded it indirectly from another old tutorial site. Thanks a ton to Peter Freerick for pointing that out! It ...
0
votes
1answer
30 views

Multiple I2C devices connected to one Arduino Uno?

Is it possible to connect more than one I2C device to an Arduino Uno? I know that the SCL and SDA pins are on analog pins A4 and A5 respectively, but there are also two pins labeled SCL and SDA ...
1
vote
1answer
37 views

How to stop Single Analog Pin Keypad Matrix (Using Resistors) from receiving Interference from Livewire/other Sensors?

I saw a tutorial on linking a keypad using one pin, utilising several resistors: http://razibshahdat.blogspot.com/2018/05/one-single-analog-pin-keypad-control.html I have this keypad, a 16x2 LCD, a ...
1
vote
3answers
1k views

Multiple I2C BREAKOUTS with pull-up resistors doesn't work [UPDATE]

[UPDATE] Now it works fine but the as soon as I add the GY-521 module (hardware not software), it starts sending me crapy info Project uses: Arduino Pro Mini as brain FTDI as a programmer GY-521 ...
0
votes
1answer
71 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 ...
2
votes
1answer
48 views

Can you use multiple arduinos to run two programs simultaneously?

If I want to run 2 different programs simultaneously, can I do this with 2 arduinos wired together? Context: I’m building a robot that will balance with reaction wheels while doing other tasks. I ...
0
votes
1answer
42 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
36 views

Trying to use I2C accelerometer and SPI OLED

I'm trying to stream the data coming from my I2C MMA8452Q accelerometer to an Adafruit-based SSD1351 OLED RGB display that uses SPI via an Arduino UNO. When I run example code for the accelerometer I ...
1
vote
0answers
48 views

ESP32 + Attiny85 AC Dimmer

I am working on an AC Dimmer project using ESP32 and Attiny85. Note : I know ATtiny85 is overkill for this project, And it can be done without Attiny85, I have already done this using ESP32 alone. ...
0
votes
1answer
26 views

DS1337 with shared I2C pull-up

I have a project using an ATMEGA328P and a DS1337 RTC chip. The DS1337 is an 8 pin IC with VCC at pin 8 and GND at pin 4. According to the datasheet both pin 5 (SDA) and pin 6 (SCL) need an external ...
1
vote
1answer
30 views

How to properly send bytes between RPI and Arduino over I2C while using ISR without IOerrors?

I have a I2C connection between an RPI 3B+ and Arduino Nano. I want to send a key and a corresponding value byte, and the arduino does something with that inside a timed ISR. Which works. But I get ...
3
votes
1answer
58 views

Why am I only receiving the first address byte? (I2C Protocol)

Expecting the slave to ACKnowledge and return data, but it does not. This is my protocol. This is my Datasheet. Also FYI I'm on an Arduino Fio but I am not inheriting the Arduino library. #include &...
1
vote
0answers
20 views

How do I read from a correct data address of LIDAR using Arduino in I2C?

I need to read the distance data from a lidar in I2C using an Arduino Nano. Currently, this is the code I've written. unsigned int readDistance() { unsigned int dist = 0 ; // LiDAR actually measured ...
0
votes
1answer
27 views

How to set 16x2 LCD I2C display backlight?

I have 16x2 LCD display with a I2C backpack. This is the library I am using https://drive.google.com/drive/folders/16_UqfwFm4VKWcdeJfDmHRV2Hj_IoaTai?usp=sharing So as given in the code below, by ...
4
votes
2answers
4k 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 ...
1
vote
1answer
43 views

Digispark Rev.3 Kickstarter ATTiny85 using all 6 pins

i have some trouble to use i2c and the other pins at the same time. im tring to control the attiny over i2c with a arduino and the attiny should control a 28byj-48 stepmotor. i started to setup the ...
2
votes
1answer
1k views

How do I use I2C from an Arduino Uno when I have a GSM shield mounted?

This may be an extremely obvious question but I don't seem able to find a definitive answer. I have an Arduino Uno and a Sim900 GPRS/GSM shield fitted on top of it. I had I2C working on the Arduino ...
1
vote
1answer
112 views

Arduino with LCD Display does not reset/restart/start on connection to power

A friend and I have been working on an Arduino Sketch that does a request to a local API, parses that data and prints it out on an LCD Display. When we upload the sketch to the Arduino it does exaclty ...
0
votes
1answer
51 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 ...
0
votes
1answer
83 views

Two Arduino boards with I2C sensors

I am new and lost. I have been searching the internet about how to transfer data of multiple sensors from one Arduino to another using I2C but no luck. All the codes and tutorials online focus on ...
0
votes
1answer
95 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 ...
2
votes
1answer
107 views

Convert float to byte, from Arduino to Raspberry Pi i2c

I'm trying to send the temperature value from the DHT sensor to a raspberry pi through I2C. Which is the best way to do it?. The temp value is a float, and I think I have to convert it to byte and ...
0
votes
1answer
55 views

Read from lux hangs in bright light

I am using VMEL6040 sensors and occasionally under bright light the read can hang, rather than using a wdt to recover I would like to ask some questions about the library. as for debugging the sensors ...
1
vote
1answer
232 views

NodeMCU V3 and MPU6050 strange values

I am new to this platform, so please if I do something against the regular rules please let me know so I can learn. Now my problem: I have a nodeMCU V3 connected to a MPU6050. Using my Arduino Uno I ...
1
vote
0answers
22 views

avrdude: stk500_recv(): programmer is not responding Arduino LCD_I2C Upload problem ( port not found and …) [duplicate]

i have problem to upload the LCD I2c Example program to Arduino UNo. the code are shown below: //YWROBOT //Compatible with the Arduino IDE 1.0 //Library version:1.1 #include <Wire.h> #include &...
4
votes
4answers
12k views

I2C connection freezes Master if Slave disconnects

I am using I2C to successfully request critical data from a Slave device (I have to use requestFrom() in the Master) but if, for some reason, the power disconnects from the Slave device then the ...
1
vote
0answers
42 views

Connecting esp8266 to spi/i2c video doorbell pins [closed]

The Vimar k40910 video doorbell exposes the following pins on its board: vin (5v) gnd sda scl clk data As far as I understand, pin 3-4 are for I2c while 5-6 are for SPI. Is there a way to connect to ...
0
votes
1answer
33 views

I2C pull up resistors and an I2C MUX

I have a rig with 5 light sensors on an I2C mux and I am wondering if I need only 1 pull-up resister set for the whole bus or one on each branch from the mux? Or should I remove all the pull-ups from ...
1
vote
0answers
30 views

How to name the temperature sensors instead of printing address using ds2482-100 and ds18b20 sensor- Help

I am using 10 ds18b20 Temperature sensors using with "DS2482-100" I2C board and Arduino so when I am getting the output like this:- "ROM = 28 46 04 1F 0D 00 00 74 96014B467FFF0A100A 25....
1
vote
1answer
49 views

Error in I2C Communication Between Arduino and Raspberry Pi

The code below sends data to Raspberry Pi every 20 millisecond. The code works fine but sometimes python throws an error. Why this is happening? Should I give more time between writeData? Error: > ...
2
votes
2answers
41 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 ?
1
vote
0answers
57 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 ...
1
vote
1answer
297 views
1
vote
0answers
38 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
35 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
27 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.
1
vote
1answer
325 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....
-1
votes
2answers
49 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 &...
2
votes
1answer
47 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
vote
1answer
45 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
43 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) ...
1
vote
1answer
813 views

PCF8583 with Arduino delay of one second?

I'm trying to interface the RTC chip : PCF8583 with Arduino Uno. I'm using exactly the circuit shown below except instead of the variable capacitor near the crystal oscillator, I've used a 22pF ...
1
vote
2answers
554 views

Regarding using I2C with Arduino for Silicon Micro-structure 5852 D 1.5 psi

I am trying to get output from a sensor (micro-structure 5852D), but I only get two outputs: 11 and 255 for even applying pressure. The following is my code, please show me how to over come this ...
2
votes
1answer
38 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
74 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
53 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....

1
2 3 4 5
14