ESP32 gets data from Xiaomi Thermometers using BLE

  Рет қаралды 15,033

Volos Projects

Volos Projects

Күн бұрын

BLE, or Bluetooth Low Energy protocol, is widely used today for communication among various devices such as phones, smartwatches, smart home sensors, and home devices. The ESP32 also supports BLE, and in this video, I will demonstrate how your ESP board can communicate with Xiaomi Mijia 2 sensors. These popular sensors are affordable and accurate, and you don't need to worry about the battery.
Here is my code folder:github.com/Vol...
DEVICES:
M5StickC Plus2: shop.m5stack.c...
TTGO T-Display: www.lilygo.cc/...
☕️ Support me on:
KO-FI ko-fi.com/volo...
PATREON: / volosprojects
THANK YOU!

Пікірлер: 124
@digitald2007
@digitald2007 2 ай бұрын
Not only did I watch the whole video, I watched it more than once. I see you're closing on 100k subs, well done!
@Meowxhehe
@Meowxhehe 11 ай бұрын
All the video's you make are so unique and educative. Your video's have improved quite a lot which is truly amazing. Keep the good work up man!
@VolosProjects
@VolosProjects 11 ай бұрын
thank you :)
@arlo4051
@arlo4051 11 ай бұрын
I found bluetooth to be a lot of effort with little reward using it on an arduino and never really attempted it with the ESP. The ESP NOW does look promising though . Thanks for showing what is possible though, best to family.
@toddbu-WK7L
@toddbu-WK7L 11 ай бұрын
I always watch your entire video. Otherwise I don’t know how you plan to get rich this week. 🤣 I really like that you’re putting yourself on camera. I really enjoy seeing the face behind the channel.
@VolosProjects
@VolosProjects 11 ай бұрын
I appreciate that! hahah, nothing works my friend, still poor :)
@TekGeekDad
@TekGeekDad 11 ай бұрын
Always watch your whole video! And often am rewatching. The most beneficial are the ones where you go through the whole set up as many of these projects are sensitive to the steps in the setup. Especially the ttgo t-display s3 I have found. If you dont do the right steps with the right libraries and versions there are major issues. Fighting some right now with the display not showing or not able to connect via usb. Bought you coffee and will buy you some more. Appreciate all the help and example. Playing with the t-display long right now and definitely having challenges.
@VolosProjects
@VolosProjects 11 ай бұрын
Tnx man, can i help with problems you have now, what board you are fighting with now?
@VolosProjects
@VolosProjects 11 ай бұрын
oh, t-display long. Did you watch my video about that board?
@Link-channel
@Link-channel 11 ай бұрын
This video format rocks! 🥇 You're improving a lot! 👍
@VolosProjects
@VolosProjects 11 ай бұрын
Glad you think so!Tnx :)
@thehappycoder3760
@thehappycoder3760 10 ай бұрын
Thanks, I did watch it right through, there seems to be a bewildering number of ESP32s. I want to explore Bluetooth but it does seem to be a bit challenging, so thank you for this video tutorial it gives me an idea where to start with something that works.
@AerialWaviator
@AerialWaviator 11 ай бұрын
A handy tip for telling multiple BLE devices apart is to look at the RSSI value (when dis. It will vary with the square of distance, so has larger change in value when near, and less resolution further away. Using RSSI value could be used to display the closest device(s) and not display data from further away devices, or indicate location such as which device/room is nearest.
@tgoregon
@tgoregon 11 ай бұрын
All 11:38 were quite good. Great topic, fantastic video. I’ve been wanting to build a couple good esp based wireless outdoor temperature sensors to put about 30m from house in shady locations. Power and range are both challenging. Perhaps I should look into esp-now.
@sandrarocha2436
@sandrarocha2436 7 ай бұрын
Woow.. I started to follow you with the TTGO Board when we made a system to monitor and record the temperature of vaccines. And this video as the others is amazing. I would like to have one of this BLE Xiaomi thermometers, but I think we could use the monitor we did 3 years ago. Something that I miss from the TTGO in the ESP32-S3 is the DAC pin. By the way I watched you wholes videos and I love them.
@mohammadrostamvand4315
@mohammadrostamvand4315 11 ай бұрын
Your Video has been improved a lot, it is really appreciated. I watched the whole video.
@aburfitt
@aburfitt 6 ай бұрын
I watched the whole video. You do Great job. Thanks for Sharing
@osmanbulut6120
@osmanbulut6120 9 ай бұрын
First of all, thank you for your effort. The part I do not understand is how to obtain the service and characteristic codes.
@VolosProjects
@VolosProjects 9 ай бұрын
Thank you, i found service in some existing code, you can use phone app to check services of specific device, than you can read raw data and try to get something useful from it.
@reinholdu9909
@reinholdu9909 11 ай бұрын
Yeah 1st time I have parts at hand ... *(^_^)* ...so pls continue to use TTGO _Thanks for the 6 days & vid_
@MPElectronique
@MPElectronique 11 ай бұрын
Hi. Where did you find : ebe0ccb0-7a0a-4b0c-8a1a-6ff2997da3a6 ? Thanks. Marc.
@altitude1039
@altitude1039 11 ай бұрын
This is so kewl! Now I want to get some BLE sensors to try it out. I'm wondering if I can do this with my CanAirIO devices as well. Thanks for sharing 😊
@amtsgedicht
@amtsgedicht 11 ай бұрын
thank you! I'm always enjoying your videos! do you take lightning payments/tips?
@chrysophlax2007
@chrysophlax2007 10 ай бұрын
Thank you Volos. It was a great video.
@VolosProjects
@VolosProjects 10 ай бұрын
Thank you
@JohnTarbox
@JohnTarbox 10 ай бұрын
Great project presented very well. I thoroughly enjoyed it.
@VolosProjects
@VolosProjects 9 ай бұрын
Glad you enjoyed it!
@csabalenart7699
@csabalenart7699 11 ай бұрын
Great video. I'm really happy to find your channel and I'm getting a lot of UI inspiration from your videos. (I watched the whole video...twice). But there is one thing I'm not really sure why you're not using in your projects which is the flash in the ESP32. I mean you could easily save these settings (e.g. the BLE ID - device name pairs in your current example) to files on esp device instead of hardcoding them to the code. I think there can be a lot of potential (in addition to the config files) in using flash memory. For example in my current project I'm using it to store temperature/humidity/pressure data from a BME280 sensor and it would be super to show them in a nice chart/graph on a small screen like TTGO (I'm using Heltec ESP32 LoRa for this, that is an amoled, but the base idea I think will be the same), but of course it could be challenging because there are much more data stored in flash than I could display, so maybe just display a smaller portion or maybe scale down and get an avarage or something. I did not figure it out yet, because I'm concentrating on finishing the project and then I can work on the display part. Anyway I couldn't find good tutorial in charts/graphs with ESP32 and I think it would be super interesting to see your solution/idea to deal with a lot of data which obviously can't fit in memory at once nor to the display.
@nikthefix8918
@nikthefix8918 11 ай бұрын
Word of warning to those wishing to write non-volatile data to the flash programmatically: The relatively poor write endurance of flash could lead to problems if you accidentally code a write / erase loop which flashes tonnes of data continually. 10k - 100k cycles is quoted. Even with wear-levelling you could render a partition useless after just a few hours or even minutes. For development I prefer to use external FRAM which is fast and indestructible - 10 trillion (10^13) cycles - just so I can afford to make mistakes when experimenting. I also watched the whole video twice. :)
@VolosProjects
@VolosProjects 11 ай бұрын
thank you, both of you , for watching video twice... reason why i never use flash is simple, i still need to learn alot. Now i have new task to play with. Thank you! I will keep in mind what Nick sayed.
@pi_
@pi_ 11 ай бұрын
I watched and enjoyed every second of this video, very cool project
@VolosProjects
@VolosProjects 11 ай бұрын
thank you!
@muctop17
@muctop17 11 ай бұрын
I still have problems configuring that weird TFT library. Isn't there a pre configurated or easy configurable version for T-Display availible? There' so much other products and versions and possibilities inside I always get confused and messed up with ! 🙄
@TBoy58_405
@TBoy58_405 10 ай бұрын
Hi again. I have your code working on a T-Display S3. I only have one Xiaomi Sensor, but I’m getting readings on the display. I’m assuming you’re not getting any serial output with the S3. This maybe because of the ide settings in tools. It needs to be in CDC mode for the C3 and S3 boards. Set USB CDC On Boot “Enabled”, USB Mode: “Hardware CDC and JTAG”, Upload Mode: “UART0 / Hardware CDC”. That should do it. Let me know if it works for you. Take it easy 👍🏾🤓
@VolosProjects
@VolosProjects 10 ай бұрын
Hello Pete, thank yoi, yes it seem my cide work when there is only one sensor, more people reported me that also. So probably fix is in few lines of code. Thank you for your support an coffee.
@cbartley100
@cbartley100 10 ай бұрын
Code seems to work OK on ESP32-S3 with up to 3 x thermometers. for me - the 4th one is ignored - even though it shows up on nRF Connect OK. but not seen in BLESerial or BLEttgo, can only see a max of 3 units
@TBoy58_405
@TBoy58_405 10 ай бұрын
I’ve got four thermometers working with the T-Display S3, even with them in different rooms. The connections are unstable though, so sometimes two or three will connect, but sometimes four. It’s the same with the thermometers next to the display. It’s great when it’s working properly. More investigation needed 👍🏾🤓
@KjartanAndersen
@KjartanAndersen 11 ай бұрын
Nice project! How long do this sensor work between battery-changes? And what is the range?
@VolosProjects
@VolosProjects 11 ай бұрын
between one and two years, it depends on battery.
@reinholdu9909
@reinholdu9909 11 ай бұрын
my experience: _Battery:_ at least MORE than 22month - _Range:_ up to "through 4 concrete walls" without problems (different receiver thou)
@ivovass195
@ivovass195 11 ай бұрын
Great use, I want to do something similar and mainly standalone without depending on a hub/server or phone. Im curios about the range, can I have the ttgo in the living room and have the sensor is separate rooms and still get the readings? Thanks for sharing your projects
@ivovass195
@ivovass195 11 ай бұрын
I wonder if it would work with the t-pico C3 I have . Either way I know what to add to my next AliExpress order. PS yes watch till the end, 10min video are great
@ivovass195
@ivovass195 11 ай бұрын
If range is short maybe set an esp32 with 2 sensors sending data to tdispay
@vitalysacred
@vitalysacred 11 ай бұрын
I works because these board w/ BL V4.2 (maybe) I use the same board for my project w/ battery because other just doesn’t work w/ 4.2
@vitalysacred
@vitalysacred 11 ай бұрын
99% it’s about 4.2 version
@danielkukua1708
@danielkukua1708 11 ай бұрын
@VolosProjects I'm not a c programmer but ifndef means if it's not defined and you can define the number of ble devices in your arduino sketch (I think it has to be before the import of the library, but my knowledge of c is zero) - this will override the library value. No need to modify the library every time.
@VolosProjects
@VolosProjects 11 ай бұрын
thank you, yes you are right , ther is no need to edit library.
@SuperEuro
@SuperEuro 11 ай бұрын
Great job, I hope the corporation doesn't decide to sue you, like Haier #boycotthaier
@carlitosjrmx1
@carlitosjrmx1 11 ай бұрын
Could someone say me how contact to Volos for a Project Requirement.?
@VolosProjects
@VolosProjects 11 ай бұрын
Right now i dont have time for nothing big, if you need small project then we can talk. What you had in mind?
@carlitosjrmx1
@carlitosjrmx1 11 ай бұрын
Its a small Project...I am a Kofi supporter my alias is MEXICAN. Thanks in Advanced. Best Regards.
@VolosProjects
@VolosProjects 11 ай бұрын
@@carlitosjrmx1 my mail is arduino.2016@gmail.com
@dejanantolic1191
@dejanantolic1191 11 ай бұрын
Thank you for this tutorial, it is really helpful. I have two questions for you: - Did you change the original firmware in the Xiaomi devices? - How often temperature and humidity are updated? Thanks in advance 🖖
@VolosProjects
@VolosProjects 11 ай бұрын
Ne, bas sam htio da ne mjenjam firmware, za esp home potrwbno ga je mjenjati. Moji senzori su tvornicki. Senzor salje podatke svakih 6 sekundi, al se u mom projektu ekran updejta svake sekunde.
@dejanantolic1191
@dejanantolic1191 11 ай бұрын
@@VolosProjects Hvala na brzom odgovoru 😘
@classicryda120908
@classicryda120908 11 ай бұрын
im curious, lets say i want to build a desk clock using m5 screen module, if it runs on an AA or AAA battery, how long will it last?
@VolosProjects
@VolosProjects 11 ай бұрын
First it will not work on single battery, you will need 3 of them, lipo batteries are better choice. But if you want to use 3 Aa beteries and you want simple clock that shows only time, you will need to put board to sleep and update time once per minute. And this way you will get maybe few days of runtime. Boards with screens need lot of power just for backlight led
@Jindraxx20
@Jindraxx20 11 ай бұрын
Thank you for an other great video yet again !
@MrTubertub
@MrTubertub 11 ай бұрын
Great content. Thank you. How many Xiaomi thermometers can you add or is the max 4 per ESP32? What is the distance between floors/rooms that it can communicate? What about historical data? Ist it possible to monitor/log by day and time?
@SteveT_IoW_UK
@SteveT_IoW_UK 9 ай бұрын
As always, Excellent video & Code. I learnt how to use the Lilygo t-Display S3 and boosted Lilygo sales because of you. I've just spent weeks trying to get a T-Display S3 to use a BLE client (nimble and bluedroid libs) to display data from a JK BMS..works sometimes but highly unreliable and crashes. Did you conclude or have ideas why it doesnt work??. Im still working on it and just ordered and ESP32 Wroom to try on that. Im wondering if its problems with BLE on S3, or Display lib conflict? Ram usage? ..I fear im operating well beyond my intelligence level ! Cheers Steve
@temyraverdana6421
@temyraverdana6421 11 ай бұрын
Wow, an amazing lesson very useful. Thanks a lot
@VolosProjects
@VolosProjects 11 ай бұрын
Glad to hear that!tnx
@gyorgybalassy
@gyorgybalassy 10 ай бұрын
Great project, thanks for sharing it! Normally these sensors connect to a Xiaomi Smart Home Hub via BLE, so they can be remotely monitored with the Mi Home phone app. Can that work side-by-side with your solution, or BLE allows them to connect to only one other device, either the Hub or the ESP board at a time?
@ooooooooo164
@ooooooooo164 11 ай бұрын
Very interesting video and very good explanation 👍 Is it possible to Use a lilygo esp32 s3 module with tuya app or smart home app ? I have a tuya water sensor that I want to be displayed on the small lilygo esp32 s3 module. If you can help this will be amazing. I want to use dedicated small t3 displays for different tuya sensors. Like temp and humidity on one lilygo s3 display module and tuya water level sensor on another lilygo s3 module.
@0miker0
@0miker0 11 ай бұрын
Excellent video and monitoring temperature in different locations is very handy. Do you have any idea why it will not work on the ESP32-S3 boards yet? Possibly a different BLE type?
@VolosProjects
@VolosProjects 11 ай бұрын
Tnx mike, no, i tried and tried but i can find solution. I am waiting maybe someone will helo me.
@0miker0
@0miker0 11 ай бұрын
@@VolosProjects I see the T-Display uses BLE 4.2 and the S3 Pro board uses BLE 5.0. Will dig deeper...
@tomasmm
@tomasmm 3 ай бұрын
@@0miker0 Were you able to find out how to do it?
@0miker0
@0miker0 3 ай бұрын
@@tomasmm it’s been a while but yes, I believe it did work on the S3
@tomasmm
@tomasmm 3 ай бұрын
​@@0miker0 Do you remember how you made it? We can get the ID of the device, but we cannot read the rest of the data. We are using: std::string value = pRemoteCharacteristic->readValue(); Serial.println(value.c_str()); As it is in the code. But we get an output with weird symbols such as: The characteristic value was: � �
@madwilliamflint
@madwilliamflint 11 ай бұрын
Nice little project! I'm going to have to pick up a couple of these thermometers. Any idea how long the batteries last in them?
@VolosProjects
@VolosProjects 11 ай бұрын
Around 1.5 year. Thank you
@madwilliamflint
@madwilliamflint 11 ай бұрын
@@VolosProjects Oh wow! Yeah. I need some of these.
@DIY-Sensors
@DIY-Sensors 11 ай бұрын
4 Xiomi thermometers and 4 different temperatures, from 21.4 to 22.8. Did they lay there for a while or did you just collect them from different rooms?
@VolosProjects
@VolosProjects 11 ай бұрын
They were in diferent rooms, and in my hands, so readings are diferent
@Darkk6969
@Darkk6969 11 ай бұрын
Where you get those sensors? I don't see the link in the description.
@VolosProjects
@VolosProjects 11 ай бұрын
They can be found evrywhere, just google xiaomi mija 2 termometer
@TheTriangle2012
@TheTriangle2012 11 ай бұрын
Nice project and design as always. However , I doubt that BT connection is the right choise for reliable connection inside house, having walls and even sometime different levels. I think that using ESPNOW will be much more efficient, or for example LoRa. I realize, that in this particular project it is not possible to implement other types of connection, but it will be very interesting if you concentrate your attention on completely custom project ( I mean , including the temperature sensors, not standar ones).
@VolosProjects
@VolosProjects 11 ай бұрын
Yes , i needed to find good position for sensors and for esp32. But it works now. Esp now is great, but in that case i need 5 boards ,4 sensors and what is worst power suply for them. Thank you. I think i will make espnow tutorial next week.
@richpeacock
@richpeacock 11 ай бұрын
Thanks! Another beautiful video but I can't even get VS Code (Platform IO) to edit the TFT_eSPI - User_Setup_Select.h headers from your old video 😭 I think I may not be destined for any success as a coder. 😩 happy to buy you cofeeees
@VolosProjects
@VolosProjects 11 ай бұрын
Why you use platform io, belive me, you dont need ut. Use Arduino ide if you arr begginer.And just falliw my instruczions fir that vidro. You can use even nitepad to edit header files.
@cerulyse
@cerulyse 11 ай бұрын
These are good but the app app doesn't let you save a history that's the only thing annoying really, if you leave it constantly running it will run the battery down won't it? I think the thermometer keeps a history of temperatures itself somehow
@droganPaul
@droganPaul 11 ай бұрын
Always all the way to the end
@VolosProjects
@VolosProjects 11 ай бұрын
Thank you Paul :)
@bengtkarlsson9747
@bengtkarlsson9747 11 ай бұрын
Ofcourse i watch whole video 🙂
@georgzimmer4627
@georgzimmer4627 10 ай бұрын
Whole video! loved it
@djokinac
@djokinac 11 ай бұрын
odgledano do kraja i nema potrebe da te hvalim uobrazices se posle zezam se malo pozdrav
@VolosProjects
@VolosProjects 11 ай бұрын
Hvala, neka neka, fali zezancije ljudima 😀 .. uzivaj u vikendu sa svojima😀
@djokinac
@djokinac 11 ай бұрын
@@VolosProjects takodje i vama
@d.s.5515
@d.s.5515 11 ай бұрын
@Volos: How accurate are the sensors? And is there much difference after a few hours at the same location? I really like them but go nuts of sensors that are not accurate enough. PS: watch most of your videos to the end and love the short concept. Just enough info and not filling the 30 minute yt algorithm with blablablabla.
@VolosProjects
@VolosProjects 11 ай бұрын
After couple hours, diference can be up to 0.2 .. couple of years ago i was in search for good accurate sensor for tem, i tried many of them...i never finded goid ones with same readings. Most of them need calibration .
@groveh1
@groveh1 11 ай бұрын
To the end... Thanks!
@tma1818
@tma1818 11 ай бұрын
lily go?
@62f100
@62f100 11 ай бұрын
Cool project.
@jasonchambers3197
@jasonchambers3197 11 ай бұрын
Can you use the esp32 with those thermometers to provide data to home assistant?
@VolosProjects
@VolosProjects 11 ай бұрын
yes , people use them with home assistent
@zyghom
@zyghom 11 ай бұрын
I watched full ;-)
@VolosProjects
@VolosProjects 11 ай бұрын
Thank you!
@Yakroo108
@Yakroo108 11 ай бұрын
Nice project 👍👍👍
@rsvidenko
@rsvidenko 2 ай бұрын
What's wrong with your finger?
@ZoomtronicBlogspot
@ZoomtronicBlogspot 11 ай бұрын
whole video! pozdrav
@clebsoncorreia1427
@clebsoncorreia1427 11 ай бұрын
Hello from brazil
@maggot008
@maggot008 11 ай бұрын
Excelent project
@szanolli
@szanolli 11 ай бұрын
Hi Thank you for such an interesting implementation! Could you please kindly confirm the libraries you're using? I am using these and the nice display came up only for a brief moment once and now it doesn't anymore... Using library NimBLE-Arduino at version 1.4.1 in folder: C:\Users\AAAA\Documents\Arduino\libraries\NimBLE-Arduino Using library TFT_eSPI at version 2.5.34 in folder: C:\Users\AAAA\Documents\Arduino\libraries\TFT_eSPI Using library SPI at version 2.0.0 in folder: C:\Users\AAAA\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\SPI Using library FS at version 2.0.0 in folder: C:\Users\AAAA\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\FS Using library SPIFFS at version 2.0.0 in folder: C:\Users\AAAA\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.14\libraries\SPIFFS
@VolosProjects
@VolosProjects 11 ай бұрын
Did you install m5stick cplus2 board in ide and did you instal stick cplus2 library. Other libraries seems ok
@szanolli
@szanolli 11 ай бұрын
Oh thanks so much for your quick reply ​ @VolosProjects !! I am using the TTGO T-display - The serial port is showing that the modules are well dtected and data is read, but no image yet 😢
@szanolli
@szanolli 11 ай бұрын
@@VolosProjects only once briefly the image came up and then never again
@VolosProjects
@VolosProjects 11 ай бұрын
@@szanolli oh, sorry, than you just need setup tft espi library. Find my video how to setup or install ttgo t-display in arduino ide
@szanolli
@szanolli 11 ай бұрын
@@VolosProjects I will check thanks!!!
@marcm4895
@marcm4895 11 ай бұрын
I think I saw a gray hair.
@VolosProjects
@VolosProjects 11 ай бұрын
Hahah, there are many of them, years😀
@RichardNobel
@RichardNobel 11 ай бұрын
🧓🏻 I also have gray hairs growing on my head. 😱 Do you think it might somehow be related to electronics maker-projects? 😜
@nikthefix8918
@nikthefix8918 11 ай бұрын
@@RichardNobel That's why ElectroBOOM will never show grey. His head is always covered by a layer of soot!
@pillowanalyst
@pillowanalyst 11 ай бұрын
💥❤
Bluetooth Classic & BLE with ESP32
38:00
DroneBot Workshop
Рет қаралды 41 М.
T-Display S3 PRO - great ESP32 device for remote controlling
12:30
Volos Projects
Рет қаралды 78 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
The Best Band 😅 #toshleh #viralshort
00:11
Toshleh
Рет қаралды 22 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Connecting ZigBee devices using zigbee2mqtt
32:15
Электроника в объективе
Рет қаралды 129 М.
A RISC-V Stick-on
8:44
Jeff Geerling
Рет қаралды 432 М.
ZHA or Zigbee2MQTT - that's the question now!
29:03
BeardedTinker
Рет қаралды 44 М.
Hacking a weird TV censoring device
20:59
Ben Eater
Рет қаралды 3,3 МЛН
Room presence detection with Bermuda BLE and ESPHome
14:33
Home Automation Guy
Рет қаралды 32 М.
#337 LoRa Off-Grid Mesh Communication: Meshtastic (ESP32, BLE, GPS)
13:15
ESP32 Guide 2024 | Choosing and Using an ESP32 Board
41:06
DroneBot Workshop
Рет қаралды 356 М.
LoRa - Long-Range Radio for IoT | Arduino, ESP32, RPI Pico
1:07:58
DroneBot Workshop
Рет қаралды 361 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН