Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
Hey folks, first of all ... i don't know exactly if the search function here is really a help. Please excuse me, if i'm not able to control it. I searched for different key words (I2C, GY21), but cannot get any result i want to have.
Okay, following problem, after reading the manual. I added another slave to the I2C bus. A Temperature/Humidity Sensor, called "GP-21P".
I have it in my box from other µC projects.
2 Problems with it: I don't have the adress and i don't know how to get any data out of it.
So, is there a command to "scan" and show the participants on the I2C bus? And second: How do i get know wich data i have to read to get temp and/or humidity?
Thanks for help in advance.
"Stevie"
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 4147
Posted: 05:01pm 07 Dec 2022
Copy link to clipboard
Print this post
You can aways use such as
site:www.thebackshed.com/forum i2c scanner
site:www.thebackshed.com/forum i2c scan
in duckduckgo
John Edited 2022-12-08 03:03 by JohnS
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1682
Posted: 05:10pm 07 Dec 2022
Copy link to clipboard
Print this post
Hi Stefan,
please take a look: https://www.thebackshed.com/forum/ViewTopic.php?PID=176762#176762
Pluto Guru Joined: 09/06/2017 Location: FinlandPosts: 398
Posted: 05:39pm 07 Dec 2022
Copy link to clipboard
Print this post
Could be this one. Unfortunately you did not show the other side of the board.
Atmospheric Humidity Temperature Sensor Breakout Barometric Pressure BMP280 SI7021 for Arduino GY-21P By DIY
Found on AliExpress. Seems to be 2 sensors on the board: Si7021 humidity sensor I2C address 0x40 BMP280 temp and pressure sensor I2C address 0x76 or 0x77
@Pluto, you seem fully right. (Unfortunately the upload is not working at the moment :-/ )
On my output of the code from the link i found 6 adresses.
I use the command: I2C READ &Hxx, 0, 2, RData() (from p. 139 of the manual)
00 => with the "print" command i have only "0" on the "output" 3C => Print RData(0) => 1 / Print RData(1) => 1 40 => with the "print" command i have only "0" on the "output" 50 => Print RData(0) => 255 / Print RData(1) => 255 68 => Print RData(0) => 33 / Print RData(1) => 4 a bit later: => Print RData(0) => 7 / Print RData(1) => 18 a bit later: => Print RData(0) => 34 / Print RData(1) => 0 76 => with the "print" command i have only "0" on the "output"
On my bus there are: - RealtimeClock - SSD1306 OLED - GY-21P
"Stevie" Edited 2022-12-08 06:45 by steview_de
phil99 Guru Joined: 11/02/2018 Location: AustraliaPosts: 2833
Posted: 09:03pm 07 Dec 2022
Copy link to clipboard
Print this post
This version of the scanner also scans the System I2C
https://www.thebackshed.com/forum/ViewTopic.php?PID=194832#194832#194832 Edited 2022-12-08 07:15 by phil99