Hubitat with Homemade Temperature, Humidity, Pressure and Light sensor

Thanks to you for sharing and bringing us such a great board. I would like to see your expert coding skills take the Garage EX code and make it even cooler :wink:
So far my monkey code with copy pasta has been working flawlessly!!!


I could not be happier, this is the best garage opener I've ever come across in all my IOT iterations, with added super benefit of nearly instant presence status using ST fob's with zero false positives!!!

3 Likes

Hi, was interested in using this with a pressure strip sensor such as https://www.superdroidrobots.com/shop/item.aspx/force-sensing-resistor-24-x-0-25-strip/1302 which has resistance ranging from 1MO (no pressure) to a little over 100 Ohms at 10kg.

I only have a basic understanding of circuits, but am I right in assuming that if I got the expandable board, I should connect that pressure sensor to the 5V and the AI connections, then the driver would report the voltage through the pressure pad?

@amosyuen, you will need to form a voltage divider to measure the resistance of the pressure strip.

Take a look at the following for voltage divider.

https://learn.sparkfun.com/tutorials/voltage-dividers/all

For the power supply, you can use the 5V pin to get the best range. With the right combination of the resistor value, you may get the full range of the load that you will need to measure.

Now, there is one complication with the sensor while the sensor is not loaded. 1M Ohm resistance is too high for a lot of ADC. You will have issue with this with most MCU (not just mine). Based on the page your linked and the datasheet, once the sensor has some pressure, the resistance is about 100K to 100 ohm. At this range, there should be no issue.

With a simple voltage divider, you may experience very strange reading when the sensor is not loaded. Once loaded, you may get to the point where it is in the range where the MCU can work properly to measure its resistance. If your use case is where the sensor is always loaded with some pressure, the voltage divider above is all you need.

If you need full range of the sensor resistance, you will need a voltage follower. It is a simple circuit that will decouple the impedance. Let me know if you need this information. I can google a link for you. This will require to work with op-amp. It is not a complicated circuit but it has more pins to deal with versus working with simple resistors.

Reading the AI pin is the easy part. You are correct that it would just a matter of reading the AI pin.

BTW, if you can share more detail of what you like to do, perhaps, it can be solve with different strategy. Would you need to know specifically the value of the resistance? Or do you just need it for presence detection?

Thanks
Iman

Thanks for all the info iharyadi, the use case is to put it underneath the sofa cushions and use it for presence detection. It doesn't need to be analog. I thought analog would be nice as I could easily fine tune the threshold on software side, but having a circuit with a threshold near the max weight (around 10 kg / 22 lbs) probably should be fine too.

This is correct. However, you are working on sensor which the resistance is quite high. This can cause issue for most ADC (not limited to what I am offering).

Since you are going to convert them to present or not present, you can move the decision and the threshold to hardware. A simple comparator will do. I do not have out of the box comparator in mind that ready to sell. However, I play around with the following.

https://www.ebay.com/itm/383967048661?_trkparms=ispr%3D1&hash=item59663833d5:g:yf0AAOSwqSlgMCjA&amdata=enc%3AAQAFAAACkBaobrjLl8XobRIiIML1V4Imu%252Fn%252BzU5L90Z278x5ickkxFtV7J5P58ubuVigtBH%252FewgR5cnoaeYaE878Hx8SVCYjRUnNh58KItVBPWgGOIPHbtlurgLxzGoygO0P1o3pjJAQ969zuYLjm7rsWFT5it%252F2bCyU4tPJC1Rh2s7yW0ZcjnC%252BbPBNxJU8cUTdFdqYcpzcbQ61CosX%252F%252F7p%252ByVjkvV5WYfwrk4CmkxHEP9lKeTRFpq8AFPvmAubDzPnURW%252FxTK3sILcpt7YTTfn%252FuugKaXW%252FJojQBIx9mzAO5my7qInjtf1L7dABr1D%252FB2QYwBQAF1AF9NhueD0HubXNE8eI239drhGzKdfOjvyfGPuxkBxv1FSMdzUSUHV1JifiMeRVsTUCg0xePRaUracom8sodmU2KJXszdW1EjfOocptPqCS9%252BIYZfSyfaiTxZ5W4nEBkD60n2Wt6HlFtRdYk%252BHWCx8zQIkFmfCvcg3%252FpmvH49gAUsiGJ02mkI4u1noCb5Cq%252BRxvHUnbztiQ5VOuQvX6TUkvtzEf8GJQdWttQLTj94%252BTsNJM%252B9%252Beb4CioXng2dfto8%252FfllmSbGEfgiR%252BkKbYVXItmmMa%252BrSGKraP3sJgCQ5u7GZtcsPvE9IY%252FIG6BCcuw1moGqnsp8zkfNZbitN0R2VioLuhgtOwPFVQ%252BxEqrtH2AGNOFN9fipdaIWTHWjG33D5nq0NefrKLmRq45fKGYVx1f5Nx0vubaoXbcz%252BCkrRQm6REutPMtVCtxjnDexJsQrsj%252FNqJoG4pdx60Kb7tcd%252BOkgkgB9QPE%252Bcww0fW37GtHMHAe95yC4IezvAfYOu1KGaov%252FFaH5nJJLpeNanozn6SR8G7NjTimJX6Reytiqz|cksum%3A383967048661b467c2ebbf544fa4bf724a4c97d9acc0|ampid%3APL_CLK|clp%3A2334524

Forget about the moisture probe, you can throw that away. The module (the one with pcb) is the one that you may reuse in this case. It is the comparator that I am talking about. You can connect the strip sensor instead of the moisture sensor. There is a potentiometer that you can adjust as the threshold. The only thing that you may have to adjust is the value of the resistance on that board. It may be designed to compare higher resistance value. But, you can be lucky that they may actually match.

You also mention the following.

If you want to play around with your sensor (perhaps you have already have one), that cushion may put the strip sensor in the range that we can measure. My impression from the datasheet is that the high impedance only when there is no pressure at all. You may have a chance that we can use voltage divider. I would keep that in mind.

1 Like

You might find the following helpful, although I will admit using these pressure sensors does take some tweaking to get the electrical circuit to behave reliably. It really does not matter whether you use @iharyadi awesome Zigbee solution, or an ESP8266 running my HubDuino software... Electrically, both systems need a reliable 'on/off' voltage signal to detect.

3 Likes

Hello Everyone,

I apologize for an extremely long hold on the BME680 project. I had the code and board ready. Then, the semiconductor shortage strike as we speak. I did not have a couple major components sourced (MCU and BME680 sensor) at that time.

I have managed as of a week ago sourced the MCU and BME680. Component availability is start to trickling in. However, the cost of the components are currently inflated in the factor of at least 2X especially with the quantity that I am making. Regardless the current challenges, I believe pushing forward the project is a must. Therefore, I did purchased the needed components and built 10 complete module for us.

The BME680 is an addon that plugged into the expansion ports of the Environment Sensor.

Where is what you will see in the hub.

BME680 comes with a gas sensor. It also comes with a proprietary software component to calculate some attribute such as the Indoor Air Quality (IAQ) index, CO2, VOC. With these additional information, we can use it to control our ventilation system better. I uses it with the nest integration and rule machine to start air circulation at some IAQ values.

I also learn that the sensor reading can help as secondary data to determine whether a room is occupied. It is not a good idea to use it as the primary sensor for this purpose. As a human, we produce CO2. As the room is occupied, the sensor reading will increase while a room is occupied. The reading is slow compared to other sensor such as PIR. At this point, it is nice that I can glace over my dashboard to be able to confirm whether a room is occupied. The reading becomes important in the case where you would like to determine whether there are too many people in the room since the reading will be extremely elevated at that point.

A note: BME680 has one gas sensor sensitive to variety of gas. The BOSCH software interpolate the reading and give us an estimate such as the CO2 and VOC level in the air. I do not think that it is able to differentiate the type of the gas. While reading the sensor and making a decision, I would read it the following way for the example above. The BME680 is reading 547.2 ppm if it is a CO2 "OR" 0.59 ppm if it is VOC. It does not mean that my current room contain 547.2 ppm of CO2 and .59 ppm of VOC.

The BME680 modules plugged in to existing Environment Sensor model RES005. The RES005 has BME280 which make the temperature, humidity and pressure measurement redundant just FYI if you are looing to use it RES005. I also make Environment Sensor model RES006. RES006 is the same as RES005 with BME280 removed.

The module also come with power outage detection. The Environment Sensor comes with recharge able battery backup feature. the BME680 add on module has a small circuit that will detect power outage when it lost the DC power.

While on DC power, it will report DC as below. It will turn to battery the event of power loss.

Some of you have reach out to get the BME680. I will try to look back on my email and reach back to you for the update on the pricing for the modules. If I miss you, please send me a PM. Currently, I only make the BME680 in very limited quantity. The cost is high for the components. However, if there are huge demand, I am would love to make them at much higher quantity so that we can lower the cost by buying in bulk.

Thanks
Iman

7 Likes

Hey @iharyadi was thinking about the other day. Now that Hubitat allows zigbee firmware updates, are you considering posting your updates on the platform?
Keep it coming!!!

1 Like

I am new to hubitat. could i use esp32 as a bluetooth receiver over lan? If not what device to i need to get for hubitat to receive bluetooth data. Can we use a bridge like this one

What I want to build is a ZigBee weather station. No station exist that's ZigBee.
I can build on with a PI but looking for something simpler.

Hello Everyone,

For those requested the BME680 modules, they should start to be delivered. I just want to write small instruction here. The basic work started the same as paring Environment Sensor. Please get the latest DTH Environment Sensor from my github.

Please add BME680.groovy to your DTH. There is also Power Detector.groovy that you may want to install. Obviously, you will need to use battery if you want to take advantage the power detector. I can notify the hub when it detect power outage.

Once the Environment Sensor is paired, you can go to its detail page and add the following information.

Please pay attention to the double quote on the Serial Children Handler. It should be as follow.

[{"Page":2,"DH":"BME680"}]

I have seen somehow the double quote got upside down. It will cause the DTH not to get installed.

Step 2 and 3 is optional if you want to take advantage the power outage detection.

Please click the Save Preference on step 4. A new BME680 will be automatically created. You can go to its detail page and rename it.

Within 10 to 15 minutes, the BME680 should start sending data. I personally wait at least 24 hours before I use the gas related data. The gas data is not absolute. Bosch have custom software to learn the environment and use it to give estimate reading. In my experience, the reading will get better as the time goes. You will see something like below.

image

Finally, thank you for trying out the BME680 modules. I hope we can put to a good use. The BME 680 modules is based on STM32 Arduino code. I will make it open source for us to improve the BME680 addon module. I do have less than a handful BME680 modules left. Let me know if you are interested.

Thanks
Iman

1 Like

I received my devices a few days ago and paired one yesterday, I've tried to get the BME to show up and am not having any luck. I've copied your serial child handler no luck, I used a child handler you did for my serial temp device correcting the device name. No luck. Any suggestions where I should look? BTW if you have any more I will I'm interested in another.

Thanks!

I am assuming the Environment Sensor has paired up as you mentioned.

Did the BME680 child device show up? If it is not showing up, would you mind open the log window and watch it as you save preference.

I remember that I helped you with another child device that had issue. Please make sure that the double quote " is correct. At the time, It was upside down.

I still have some BME680 if you still need it. Just let me know when you would like to get it.

Thanks
Iman

BTW, The EnvironmentSensorEX.groovy has recently been updated. Please update yours.

The child device does not get created.

Thanks

Please double check that this is the setting that you use.

[{"Page":2,"DH":"BME680"}]

Here is the comparison what is good (yours) vs bad (mine).

It showed up as a child device, possibly the updated code helped.

As always thanks,

Please give it a day or so to run before you use the numbers which are related to the GAS reading. This is not exactly an AI. But, BOSCH does some machine learning to generate the IAQ. The value after it started will not be dependable.

I will be going out of on vacation on June 19th. If you need another one, please let me know before the 19th.

1 Like

thanks for making this available to us. Is there an stl available to print a case for it? thanks again.

Hi @alexm, I do not have stl file for it. They are a 2 pieces PCB stacked one on another. It will be hard to make case based on the STL files. It is probably better to take approximate measurement and build a case for it.

I do have concern about cases. The module that I make is not a sleepy Zigbee end device. It is a zigbee repeater. It will never sleep. The MCU generate a very small heat that dissipated without any problem. If you case them, the heat cannot escape which will make the environment sensor reading a problem. I am aware that some member who use my sensor case them. I do not have any issue with that. However, my personal recommendation is not to use a case.

If you need to protect the sensor from extreme weather, coating the module with conformant coat or nail polish is something that I personally do.

The BME680 cannot be coated in any case.

Thanks
Iman

1 Like