Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:26 21 Nov 2025 Privacy Policy
Jump to

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.

Forum Index : Microcontroller and PC projects : I2C Bus Slaves - Who is? GY-21P Temp/Humidity Sensor

Author Message
steview_de
Newbie

Joined: 02/11/2022
Location: Germany
Posts: 12
Posted: 04:50pm 07 Dec 2022
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 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: Germany
Posts: 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

Regards
Michael
causality ≠ correlation ≠ coincidence
 
Pluto
Guru

Joined: 09/06/2017
Location: Finland
Posts: 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

Try with these and see if you get any response.
 
steview_de
Newbie

Joined: 02/11/2022
Location: Germany
Posts: 12
Posted: 08:43pm 07 Dec 2022
Copy link to clipboard 
Print this post

@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: Australia
Posts: 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
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025