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

STM32F103C Connection to MPU6050 Only works less than half the time

I am programming the STM32 Blue Pill board via the Arduino IDE. I have been stuck with this problem for a very long time and it is becoming immensly infuriating. The MPU6050 connects and gets ...
1
vote
2answers
31 views

How to check if two device has the same address on I2C?

I start a new project with Arduino UNO and MCP23017 expander. Using this, I can connect 8 chips on Arduino, by selecting different addresses ( from 0x20 to 0x27 ). My question is, if I connect two ...
0
votes
1answer
29 views

Compass heading not varying linearly

I am using an HMC-5983 magnetometer compass on my arduino uno to find the heading of a car I'm building.But my compass readings aren't varying linearly.For example when I physically turn my compass by ...
0
votes
1answer
25 views

FIXING BUG when Using Wire library to obtain compass heading

I am using the HMC-5983 magnetometer module to obtain the compass heading of a autonomous car I am building using the arduino platform.I'musing the Z axis and X axis to obtain the heading. However ...
0
votes
0answers
33 views

Arduino nano with 128x64px OLED freezing

I have an arduino nano, MCP3424 i2C ADC and a 128x64px i2C OLED display. The function is quite basic; the arduino receives information from the ADC and prints it to the screen as described in the code ...
0
votes
0answers
55 views

Reading I2C data from SW6106 register

I am using the SW6106 powerbank IC as an I2C but no matter what I have tried I couldn't read something other than "FF". Datasheet for the IC. Timing diagram for reading data: Timing diagram for ...
0
votes
2answers
41 views

What is the best data type to be used through i2C

i'm trying to send multiple commands to multiple slaves controlling motors. Slave Controller(Arduino Nano) will receive the command, and returns the current position of the motors to the Master(...
0
votes
0answers
41 views

i2c man in the middle

I'm developing a bridge, or man in the middle for touch controller and a system board connected with I2C. The connection is: Touch Controller(slave)---I2C---(master)STM32(slave)---I2C---(master)ARM ...
0
votes
1answer
38 views

I2C code working on Mega 2560 but not on Uno and nano

I have recently purchased this Heart rate sensor and was trying to make it work. I used this MAX30100 library I found on Github. For some reason when I use any of the given examples, they seem to work ...
0
votes
0answers
11 views

nodemcu nack error bh1750

I am trying to run a simple example of bh1750 on my nodemcu, code is #include <Wire.h> #include <BH1750.h> */ BH1750 lightMeter(0x23); void setup(){ Serial.begin(9600); Wire.begin(...
-1
votes
0answers
42 views

Adding oled library stops sound from working?

my code is using keypad library and oled display and piezo element. Without the oled code added everything works just fine. as soon as I add code for that, sound stops working. doesn't even call the ...
0
votes
0answers
79 views

Completing an action on button release help with delaying to give other modules time to repond

I'm currently having problems with my code it has several modules within the main one is my current keypad one working of a mcp23017. what I needed it to do is count how long a key is pressed and upon ...
0
votes
0answers
49 views

Byte not written to the memory

In the following code I'm computing crc and setting it as last (11th) byte in the array. The problem is it's sent on I2C just when I print it on the serial terminal. static constexpr uint8_t ...
0
votes
1answer
40 views

MCP4725 I2C address

I want to use four of MCP4725 DAC module at the same time but it only has two I2C addresses which can be set via jumpers: In page 10 of the datasheet it says: Device Address Selection pin. This ...
0
votes
1answer
33 views

Sending more than BUFFER_LENGTH(32) bytes in slave answer I2C

I need to send 259 bytes as answer to I2C master read request. AFAIK there is a buffer limit of 32 bytes in Wire.h and in HW (Arduino Nano). Is there a way sending 259 byte answer, or I have to choose ...
0
votes
1answer
62 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 ...
0
votes
0answers
26 views

Communication between arduino nano and MCP3424 over I2c pt. 2

I'm am completing a project of mine that uses an MCP3424 i2c 18bit ADC and an arduino nano to measure temperature with an NTC thermistor but am having trouble with the arduino wire library. This is my ...
1
vote
0answers
35 views

ESP32: Share I2C bus among multiple freeRTOS tasks - do I have to expect synchronization issues?

I recently inherited some firmware with weird problems in regards to the duration of reading sensor values. The board is based on the ESP32 Wrover MCU and has multiple sensors connected via the I2C ...
2
votes
1answer
139 views

OLED display hectic behavior - interference with other parts of the code?

Disclaimer: I'm a total novice to Arduino so please forgive me if the question may seem trivial, I'm trying my best to learn :) I'm working on a small project where I have a fingerprint sensor, a ...
2
votes
1answer
119 views

I2C communication between arduino and raspberry pi breaks under stress for unclear reasons. Why?

I am having a behavior I cannot explain while using arduino mega as a I2C slave for a raspberry pi master. I am showing here an idealised program that shows the issue. I experience pretty much the ...
0
votes
1answer
64 views

Sparkfun CCS811 Air Quality Sensor is just not workin

i have an Arduino uno board and a sparkfun ccs811 sensor. I tried to reproduce the howto from the sparkfun homepage (https://learn.sparkfun.com/tutorials/ccs811-air-quality-breakout-hookup-guide?_ga=2....
0
votes
1answer
37 views

Reset I2C connection with arduino as slave

I am currently using I2C serial communications with arduino as slave and raspberry pi as the master. I am sending sensor data from arduino to raspberry pi. I need to reset the I2C connection once the ...
1
vote
1answer
44 views

Why Wire.write twice?

I'm checking an example for the MPU6050 and got to this part Wire.beginTransmission(0x68); //begin, Send the slave adress (in this case 68) Wire.write(0x1B); //We ...
1
vote
1answer
48 views

Receiving i2c bytes on an attiny85

I've been trying to write a small i2c lib in C over the past week. I managed to get writing to slaves working (for example I can write to an ssd1306 oled) but reading (for example date/time from an ...
2
votes
2answers
145 views

I2C - Confusion

It's not often I ask a question. This one has me a little stumped though. Scenario: I have an 328PB (internal 8mhz), it speaks to a multiplexer on Wire1 (the PB's second IC2 - Minicore lib). The ...
0
votes
1answer
41 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
47 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
0answers
30 views

Emulate I2C BMP180

I want to know if possible to emulate a temp sensor such as BMP180 with Arduino. The reason I am asking this is : BMP 180 is obsolete, so I am trying to replace it with BMP280 I want to read the ...
3
votes
1answer
51 views

When I verify the sketch I get several errors

I am extremely new to Arduino coding and have downloaded a sketch for the PCA9685 to use with model railroading and turnout control. When I verify the sketch I get several errors ... I don't even ...
1
vote
1answer
44 views

I2C communication problem with two slaves (atlas scientific) and one Nano (official)

I'm working on a project using an arduino Nano (official) and two peripherals from Atlas Scientific (pH and DO) communicating via i2c. Everthing works fine when i use a usb alimentation connected to ...
0
votes
1answer
45 views

How do you write to a specific register using I2C communcation?

I am trying to write to a charging IC (BQ24193) and I am trying to figure out how to use I2C to write to a specific register so I can set up the charging IC properly. I have watched a few videos on ...
2
votes
0answers
35 views

qMenuSystem using DigoleSerial library doesn’t work on my I2C Monochrome OLED

Just like the title says I’m trying to make qMenuSystem to work with my oled display. Here is what I know so far about my display : - It's a Monochrome OLED 128x64 (Blue) Display - It's connecting ...
1
vote
2answers
130 views

Arduino I2C Wire.onReceive hangs after a few loops

I have an Arduino Leonardo (master) and a Polulu A-star 328 PB(slave). I intend to use the slave to actuate some servos. I've modified the code from https://www.arduino.cc/en/Tutorial/MasterWriter to ...
0
votes
1answer
26 views

qMenuSystem Oled I2C can't make it work

I'm trying to make the qMenuSystem to work with my I2C Monochrome OLED display but without any luck. To summarize all here's what's with it : - the qMenuSystem is using a library called : ...
0
votes
0answers
24 views

Why is I2C OLED failing to initialise when SPI device is added to project (SD.h causing issue)? [duplicate]

My project uses an RTC, GY-521 MPU-6050 3-Axis Gyro and MakerHawk OLED Display Module. All working fine together to show current date and time as well as displaying Acceleration on 3 Axis. I now want ...
0
votes
1answer
33 views

Slave to Send Data after Receiving Command using I2C

I want to have my Slave Arduino to send signal to Master after the command was made. But the Slave Arduino does not proceeds to sending the signal after doing the command. What is wrong with my code? ...
0
votes
1answer
38 views

Understanding datasheet of a HCHO gas sensor

I have a gas sensor whose datasheet is attached: DS-HCHO Now it says that UART communication is needed (P2P) where it (module) waits for Data Frame before tx the data frame to host which I need. ...
0
votes
0answers
534 views

Using ESP32-CAM (with ov2640 camera image sensor) to send image via USB

I was trying to obtain image from ESP32-CAM (with ov2640 camera image sensor). I obtained the image through camera web server by connecting the ESP32-CAM and PC to same wifi network. A USB to TTL ...
0
votes
1answer
33 views

Two arduino boards with sensors i2c

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

Setting up I2C with HTU21D, no response after beginTransmission

I'm playing with the temperature/humidity sensor HTU21D. Datasheet: https://www.te.com/commerce/DocumentDelivery/DDEController?Action=showdoc&DocId=Data+Sheet%7FHPC199_6%7FA6%7Fpdf%7FEnglish%...
0
votes
1answer
61 views

Communication with sensor KMX63 in I2C

I trying to use a new sensor the KMX63 with a Arduino Uno board, my sensor is on a evaluation board made by kionix. For the connexion il linked as follows: | Pin Uno | Pin evaluation board | | A5 | ...
0
votes
1answer
43 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 ...
-1
votes
1answer
45 views

Arduino detect order of objects

I'm trying to find a way to detect blocks being placed on grid on a table. The table will have fixed places where you can place the blocks, but the user is allowed to place the blocks in any free slot....
0
votes
1answer
185 views

Changing I2C address of MPU-6050

Is it possible to change I2C address of MPU-6050 ? I am trying to connect a bunch of MPU-6050 to my Arduino. Almost all of them are running on the same address. Few are running on different address. ...
0
votes
2answers
294 views

Arduino slave with 2 masters sharing the same I2C Bus?

Consider a scenario where two (or more) master devices (the NodeMCU's, in this case) share an I2C bus with one (or more) slave device(s), like thus: Would this be a feasible setup? In other words, ...
0
votes
0answers
38 views

I2C freeze on master

On my first big Arduino-project I made a game using the following Arduino's and the I2C-protocol: 1x Mega as master 4x Mega as slave 2x Uno as slave The Arduino's controll a physical game where the ...
-2
votes
1answer
76 views

Arduino as Slave on I2C bus to read data from other I2C devices

Good afternoon; I am a bit new to the world of I2C bus. I'm trying to implement a project that have Arduino MEGA as a master and Arduino nano as slave. I have some I2C sensors that i want the slave (...
0
votes
1answer
36 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
25 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
151 views

i2c Connection for MCP4725(Dac) with Esp8266 wemos d1 mini

------------ This question has been edited ------------ note: Dac and Adc is12bits my problem : I use two ESP. Using esp1, I read the Adc amount of the alternating signal (ECG) and send it to esp2 ...