# Node for reading data of BME680 Sensor

**URL:** <https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039>\
**Category:** General\
**Created:** [1 April 2020 15:18 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039 "2020-04-01T15:18:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jobi](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jobi](https://discourse.nodered.org/u/Jobi)\
**Post date:** [1 April 2020 15:18 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/1 "2020-04-01T15:18:54Z")

</div>

Hello,  
I am totally new in raspberry pi programming and I started with a node-red project for measure temperature and humidity (Temperature 3 - 20 °C, humidity 80-100%).  
The measurement is going to be in a refigerator with high humidty so I wan't as less components as possible in there.  
I did find a node for the DHT11 (22) sensor and this is already working.  
Since I want to check if the BME680 sensor is more fitting for my project I want to connect both and compare the results in a database.  
I am looking now for the easiest way to get temperature and humidity reading from the BME680.  
Can anybody help me to archive this?

Regards Markus

---

<div class="post-metadata">

**Author:** ![user7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@user7](https://discourse.nodered.org/u/user7)\
**Post date:** [1 April 2020 15:31 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/2 "2020-04-01T15:31:39Z")

</div>

Hey, you can check this topic from while ago.  
Best solution would be to use an external module like a d1 mini for example and connect it to bme680. Values can be send via mqtt to you Rpi and nodered.  
I think the easiest way would be to use d1 mini, BME and EspEasy on the module

> [@BME680 and i2c communication](https://discourse.nodered.org/t/bme680-and-i2c-communication/15527):
>
> Hey, Have anyone managed to connect bme680 or similar i2c sensor in Nodered using i2c contrib node? Can you share the sample flow? I read the sensor datasheet, but looks like my knowledge is limited. I know the i2c adress and sensor is working in python, so wiring is good. I tried various numbers for command and bytes, but the values recieved are not good. Maybe I need to send specific command first, before sensor returns data? I also tried to use exec node, to run the python code directly, …

---

<div class="post-metadata">

**Author:** ![Jobi](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jobi](https://discourse.nodered.org/u/Jobi)\
**Post date:** [1 April 2020 15:58 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/3 "2020-04-01T15:58:19Z")

</div>

Hey thanks for the fast response.  
I already read this topic, but i was actually searching for a simple solution without using more parts then the pi and the sensor.  
Since there is a way to read the data with a python script (at least I read something like this) I thought it might be possible to get a simple solution without installing more parts (measurement will be at high humidity and i don't want to build in more parts like i really need).

---

<div class="post-metadata">

**Author:** ![user7](https://avatars.discourse-cdn.com/v4/letter/u/7ea924/32.png) [@user7](https://discourse.nodered.org/u/user7)\
**Post date:** [1 April 2020 18:43 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/4 "2020-04-01T18:43:47Z")

</div>

I really think its better to sacrifice a few dollar module than the Rpi.  
A solution is probably there but its not easy as you might expect.  
And when you discover mqtt everything goes to new level!.  
You also didnt tell how would you display the values?

---

<div class="post-metadata">

**Author:** ![Jobi](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jobi](https://discourse.nodered.org/u/Jobi)\
**Post date:** [1 April 2020 21:05 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/5 "2020-04-01T21:05:31Z")

</div>

Yeah i am afraid that you are right.  
But at least I want to check if anybody knows a different solution.  
I already made a dashboard in node red vor the visualisation and i store the data in an influx db. The stored data is shown in graphs via grafana.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [2 April 2020 06:01 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/6 "2020-04-02T06:01:48Z")

</div>

I concur with @user7 - something like a d1 mini is fantastic for this stuff, hook the sensor up, flash tasmota on it and it's automatically detected and all values can be send over mqtt. Have it up and running in 5 minutes (most work is probably the soldering part)

---

<div class="post-metadata">

**Author:** ![Jobi](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jobi](https://discourse.nodered.org/u/Jobi)\
**Post date:** [2 April 2020 06:27 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/7 "2020-04-02T06:27:23Z")

</div>

OK, probably somebody has a different solution, but I am defently checking the d1 option.  
Would it be possible to connect both sensors to the d1 mini?  
If so I could make a "sensor box" with the DHT22, the BME680 and the d1 mini.  
Then i would only need one cable for the powersupply of the d1.  
Is it possible to use the d1 without wifi but cable connection to the raspberry pi?

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [2 April 2020 08:30 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/8 "2020-04-02T08:30:45Z")

</div>

> [@Jobi](#):
>
> Is it possible to use the d1 without wifi but cable connection to the raspberry pi?

Which cable connection are you referring to?

The whole point of using a Wemos D1 Mini or equivalent is you can position it/them at a remote place.  
i.e. They are acting as a remote slave (that communicates to the RPi via MQTT protocol).  
You just use your RPi as a server running Node-RED and MQTT.

As @bakman2 said... quite a few people on this forum use Wemos D1 Minis to create "systems".

Take a look at one of my student's current project... (as it might give you some ideas).

> [@Solar-powered weather station](https://discourse.nodered.org/t/solar-powered-weather-station/12499):
>
> One of the students in my IoT Computer Club (here in the UK) is working on a personal project to design and build a solar-powered weather station (that will be located in one of the school's gardens) to monitor and report air temperature, humidity and pressure. Here are the [Objectives and list of items.](http://resources-area.co.uk/bohunt-projects/weather-station/objectives.pdf) The student has split the project into six manageable stages. [Using a solar panel to charge a Li-Ion battery and power a Wemos D1 Mini.](http://resources-area.co.uk/bohunt-projects/weather-station/stage_1.pdf)[Putting the Wemos D1 Mini into 'deepsleep' to conserve …](http://resources-area.co.uk/bohunt-projects/weather-station/stage_2.pdf)

---

<div class="post-metadata">

**Author:** ![Jobi](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jobi](https://discourse.nodered.org/u/Jobi)\
**Post date:** [2 April 2020 08:37 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/9 "2020-04-02T08:37:19Z")

</div>

I don't want a remote connection for this application (only if i have to make one).  
That's why I am looking for a solution without the D1 Mini.  
The measurement is going to be in a refigerator with high humidty so I wan't as less components as possible in there.  
I want to read the data from the BME680 directly from the pi with node red.  
But it seems that this is quite difficult, thats why I am checking the D1 option.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [2 April 2020 08:45 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/10 "2020-04-02T08:45:54Z")

</div>

It would have been helpful if you had said the sensor would be inside a refrigerator at the start of your post.

I have no idea what is the maximum length of an I2C cable you can use and still get reliable readings.  
I've not tried to use anything longer than 10 cms.  
Maybe other people on the forum can offer suggestions for you.

Have a look at this article about max length of I2C bus.  
Sounds like some people have managed several metres.  
[https://www.raspberrypi.org/forums/viewtopic.php?t=82049](https://www.raspberrypi.org/forums/viewtopic.php?t=82049)

PS:  
I wouldn't waste your time with the DHT11 as the humidity inside your fridge will 'kill it' in a short time.

---

<div class="post-metadata">

**Author:** ![Jobi](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jobi](https://discourse.nodered.org/u/Jobi)\
**Post date:** [2 April 2020 12:25 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/11 "2020-04-02T12:25:55Z")

</div>

You are totally right I edited right now, sorry.

Ok thanks for the information if there is no other way i will checkt the option with the d1 mini.

Ok, are there any other sesors fitting for this application?  
Temperature 3 - 20 °C, humidity 80-100%

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [2 April 2020 12:31 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/12 "2020-04-02T12:31:51Z")

</div>

The BME-280 might be suitable (and it is inexpensive).  
-40 to +85 deg C and 0 to 100% humidity.

If you can tolerate the shipping delay, Banggood and Ali-Express are worth checking out.

> **[CJMCU-280E BME280 High Precision Atmospheric Pressure Sensor CJMCU for Arduino...](https://www.banggood.com/CJMCU-280E-BME280-High-Precision-Atmospheric-Pressure-Sensor-p-1103115.html?gmcCountry=GB&currency=GBP&createTmp=1&utm_source=googleshopping&utm_medium=cpc_bgs&utm_content=lijing&utm_campaign=ssc-gb-all-newcustom-85-1118&gclid=Cj0KCQjwmpb0BRCBARIsAG7y4zY2q9eCjQ72N-49iNRIhRrRZkWR1PTNKahQRrATDBmvg34sGLVSk9oaAvzgEALw_wcB&cur_warehouse=CN)**
>
> Online Shopping at Banggood.com！

I would still consider using a Wemos D1 Mini placed outside the fridge and somehow get the I2C cable from the inside to the outside. All you would need to power the D1 is a 5V mobile phone charger.

You could draw some nice looking graphs on the NR-dashboard as well as saving the readings to a database.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 April 2020 12:46 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/13 "2020-04-02T12:46:12Z")

</div>

> [@Jobi](#):
>
> are there any other sesors fitting for this application?

Do you really need the humidity? If it were just temperature you could use an DS18B20 which can easily be directly connected to a Pi zero. Though even with that sensor then personally I would use a D1 Mini connected by wifi and using MQTT to communicate with my node red system (which is a Pi). With the Mini you don't need to worry about power failure wrecking the SD card.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [2 April 2020 14:24 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/14 "2020-04-02T14:24:52Z")

</div>

There's also the waterproof version of the DS18B20 (with a 100 cms long lead).  
My student is planning to make use of this component in version-2 of his Weather Station.

> **[5 pcs DS18b20 Waterproof Temperature Sensors Temperature Transducer:...](https://www.amazon.co.uk/DS18b20-Waterproof-Temperature-Sensors-Transducer/dp/B00CHEZ250)**
>
> 5 pcs DS18b20 Waterproof Temperature Sensors Temperature Transducer: Amazon.co.uk: Car & Motorbike

---

<div class="post-metadata">

**Author:** ![Jobi](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jobi](https://discourse.nodered.org/u/Jobi)\
**Post date:** [2 April 2020 14:28 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/15 "2020-04-02T14:28:57Z")

</div>

Yes that could be an option.  
I can try that, the distance will be approx. 2 meters.  
Then the pi and de D1 are right next to each other...but who cares...^^  
Just weird, that there is no solution with direct connection.

Yes I already did that, working with influx db and grafana (visualisation and adjustments with node red dashboard).

---

<div class="post-metadata">

**Author:** ![Jobi](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jobi](https://discourse.nodered.org/u/Jobi)\
**Post date:** [2 April 2020 14:30 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/16 "2020-04-02T14:30:07Z")

</div>

Yes I really need it and it should be rather accurate to have the humidity arround 95%.  
This refigerator will be jused to make camenbert cheese. 🙂

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [2 April 2020 14:31 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/17 "2020-04-02T14:31:46Z")

</div>

> [@Jobi](#):
>
> This refigerator will be jused to make camenbert cheese.

Well that is ultra important and crucial - need to get it "spot on". 🧀

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [2 April 2020 14:58 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/18 "2020-04-02T14:58:12Z")

</div>

> [@Jobi](#):
>
> Just weird, that there is no solution with direct connection.

There are, using other devices such as an Arduino, but the D1 Mini is so cheap and so easy to use (particularly PSU requirements) that it is easier to go that way. In fact I think you can power the mini from a USB socket on the Pi and pretty sure you can use the wired comms channel instead of the wifi but not certain of that.  
Are you just monitoring or using it to control the fridge too?

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [2 April 2020 15:20 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/19 "2020-04-02T15:20:59Z")

</div>

You can use the DS18B20W on a long wire since they are 1-wire devices and attach them to a Pi. I build a string of them to measure the temperature in 5 rooms on the third floor of our church all connected to one with. The wire (I used cat-5 cable) was about 20 feet (6 meters) long.

Then you can use one of the DS18B20 contrib nodes

---

<div class="post-metadata">

**Author:** ![Jobi](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@Jobi](https://discourse.nodered.org/u/Jobi)\
**Post date:** [3 April 2020 13:20 UTC](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039/20 "2020-04-03T13:20:50Z")

</div>

Ok thanks for that info.  
I want to regulate the temperature and the humidity.

[Next page](https://discourse.nodered.org/t/node-for-reading-data-of-bme680-sensor/24039.md?page=2)
