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
2answers
683 views

Arduino Zero (ATSAMD21G) - I2C - continuous wrong data flow

I encountered a strange behavior while running 2 way transmission tests between 2 Arduino Zero (ATSAMD21G), one master and one slave. Wrong data is being continuously transferred both ways. The ...
1
vote
1answer
2k views

I2C requesting more then one byte

I got an Arduino Uno set up as an I2C master to an ATtiny85 slave, using the Wire (Master) and TinyWireS (Slave) libraries. Communication works good. I have been able to keep the network running ...
1
vote
1answer
134 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 ...
3
votes
1answer
565 views

Alternative to UART/I2C LCD displays?

I'm building a MIDI synthesizer on Arduino Uno, and am considering user interface options. I see on Adafruit and Sparkfun there are 16x2 LCD panels available that interface via I2C serial or by UART,...
1
vote
2answers
5k 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: ...
3
votes
1answer
2k views

Help with 1-Wire to I2C translate

Please, someone. I want to use a temperature sensor (DS18B20) in an I2C only shield (Tentacle Mini), but this sensor is One Wire only. Can I write an I2C code to change the 1-Wire to I2C for this ...
0
votes
0answers
39 views

Non-blocking TWI using ISR and WDT [closed]

I've written a TWI library that is non-blocking by being purely interrupt-driven and using the watchdog timer to detect when the TWI bus freezes. Alternatively, the Read/Write functions can wait (i.e. ...
0
votes
0answers
37 views

Problem Using pins A4 and A5 for input and output I2C

Hardare used: Arduino nano ( old Bootloader ) Oled Monochrome Display ( 4 pins, 128 x 32 ) MPU 6050 Both display and MPU use A4 and A5 as I2C communication protocol, They interfere, as the MPU is used ...
3
votes
1answer
36 views

First I2C project - Unable to get any servo movement with PCA9685

I'm working on a project where I need to run multiple servos. For now though, I'm trying to get a single MG90S servo running with a PCA9685 servo driver but I'm unable to get any movement from the ...
0
votes
1answer
26 views

Two-Wire Interface (TWI) Frequency and SMBus Compatibility

Have I understood the ATmega328P datasheet correctly regarding the TWI clock frequency? From §21.5.2 Bit Rate Generator Unit, the TWI clock frequency is calculated as follows: Then solving for TWBR: ...
1
vote
0answers
40 views

Wire library causing samd21 based board to stop working

A bit of a general question, but asking in case someone has stumbled onto a similar problem before. A friend and I designed a custom PCB board based on the ATSAMD21G microprocessor. The board has a ...
2
votes
2answers
46 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
19 views

My PN532 doesn't detect RFID card when connected with ESP32 in I2C mode while it works perectly with Arduino Uno

I have a Elechouse PN532 module (bought here - https://robu.in/product/pn532-nfc-rfid-read-write-module-v3-kit/). When I try to use to it with I2C and connect it to my ESP32 (DOIT ESP32 DEV KIT V1, 30 ...
1
vote
0answers
47 views

DS3231 RTC not working with ESP32

I am using ESP-32-WROOM-32 with a RTC DS3231 module. I have connected SDA & SCL pins of RTC DS3231 with ESP32 D22 and D23 pins. Also, the VCC of RTC is connected to 3V3 of ESP32 and the GND of RTC ...
1
vote
1answer
323 views
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 ...
2
votes
1answer
38 views

How to control multiple servo motors at the same time with protothreading using an I2C PCA9685 PWM board?

I'm trying to use protothreading to control two (and eventually four) servo motors over I2C using a PCA9685 PWM board. To start, I am simply trying to sweep the two motors back and fourth at the same ...
1
vote
0answers
31 views

I2C 16x2 LCD - Will Initialize (sometimes) - Holds Up The Code

Basically I have a keypad, that when a certain code is entered, it will write either "Wrong code" or "Good code" on the LCD. At the same time a timer will count down until 0 is ...
1
vote
0answers
120 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/...
-1
votes
0answers
33 views

Possible causes of i2C values all being set to max

Is there an obvious reason why all i2c values could suddenly start reporting max values? I am using an Adafruit M0 feather. Attached to the M0 is a temperature sensor, RGB sensor, and accelerometer, ...
1
vote
2answers
59 views

Writing to a specific I2C register

I am trying to write to a specific register, but value doesn't change. Working with SenseAir Sunrise CO2: Info from i2c guideline from sensor manufacter https://rmtplusstoragesenseair.blob.core....
1
vote
2answers
68 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 ...
0
votes
1answer
203 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 ...
2
votes
1answer
843 views

Getting inverse values of acceleration and tilt for the MPU 6050

I'm using the I2C library to connect to a GY-521 board and, when executing the getAcceleration() methods I get gyro values and viceversa.. This is my setup (I'm using a proto shield but that shouldn'...
1
vote
1answer
43 views

Pca9685 & WS2818B, 1 Nano

Arduino n00b here. I currently have an Arduino Nano set up to run 6 servos from a PCA9685 board. I'm looking to add 6 switches and 6 LED indicators to switch servo positions. What I'm curious about is ...
1
vote
1answer
45 views

AW9523B I2C on Arduino Nano

I'm testing the AW9523B IO expander with an Arduino Nano. I can't get the device to be recognized. Using I2C scanner to find all attached I2C devices. I've connected AW9523B to the correct pins to the ...
1
vote
1answer
36 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 ...
2
votes
1answer
32 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 ...
3
votes
2answers
125 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
votes
1answer
37 views

SMBus on ATTiny204 [closed]

So I want to connect multiple LED Panels with dynamic addressing to a Master Controller. Seems like SMBus should be able to do that, however I don't find any Library for the Arduino framework. Does ...
0
votes
1answer
730 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 ...
1
vote
1answer
39 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
52 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
146 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
43 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 ...
0
votes
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
73 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
58 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
40 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
73 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 ...
3
votes
1answer
59 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
1answer
50 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 ...
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
142 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
53 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 ...
1
vote
1answer
110 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
2 3 4 5
14