The tipping bucket is the most common automated rain sensor in an electronic weather stations. It uses two small buckets balanced like a see-saw to hold precise amounts of precipitation. As the buckets tip, a switch triggers an electronic circuitry to transmit the count to an indoor console, recording the rainfall as 0.254 mm (0.01 inches).
To calculate the rainfall collected in a tipping bucket rain gauge, you need to know the following:
- The bucket size: This is the volume of water that the bucket can hold before it tips over. It is typically measured in millimeters (mm) or inches (in).
- The number of tips: This is the number of times that the bucket has tipped over during a given time period.
Once you have this information, you can use the following formula to calculate the rainfall:
Rainfall = (Bucket size) * (Number of tips)
Here is an example of how to calculate the rainfall collected in a tipping bucket rain gauge:
Example:- Bucket size: 0.254 mm
- Number of tips: 100
Rainfall = (0.254 mm) * (100 tips) = 25.4mm
Therefore, the rainfall collected in the rain gauge is25.4 mm.
The current tipping bucket rain gauge is mostly using a reed switch, and here are the disadvantages:
One disadvantage of a reed switch is its susceptibility to damage from mechanical shock or vibrations. The switch consists of two reed contacts sealed inside a glass tube, and if subjected to excessive force or movement, the contacts may become misaligned or break, resulting in malfunction or failure.
I replaced the tipping bucket rain gauge reed switch sensor with the S2GO HALL TLE4964-3M (figure below).
The advantage of using the S2GO Hall TLE4964-3M is that it is a highly reliable and accurate magnetic sensor.
*Typo error on the Dashboard in the video - Rain Volume unit is in "mm" and not "cm".
EnvironmentalCarbon Dioxide(CO2) LevelMonitoring
The Node-RED flow above is for a weather station that monitors carbon dioxide levels and rain volume. It consists of the following nodes:
- MQTT In (CO2 sensor): This node receives messages from the CO2 sensor on the topic
CO2_sensor
. - Debug (CO2 sensor): This node prints messages to the console when it receives messages from the CO2 sensor.
- UI Gauge (CO2 sensor): This node displays a gauge that shows the current CO2 level.
- MQTT In (Rain Gauge): This node receives messages from the rain gauge.
- Debug (Rain Gauge): This node prints messages to the console when it receives messages from the rain gauge.
- Switch (Rain Gauge): This node routes messages based on their payload. If the payload is equal to
ON
, the message is passed to theCounter
node. - Counter: This node increments a counter every time it receives a message.
- Function: This node converts the counter value to rain volume in centimeters.
- UI Text (Counter): This node displays the counter value.
- UI Text (Rain Volume): This node displays the rain volume in centimeters.
- UI Chart (CO2 sensor): This node displays a line chart that shows the CO2 level over time.
- UI Chart (Rain Gauge): This node displays a bar chart that shows the rain volume over time.
The flow works as follows:
- The CO2 sensor sends messages to the
MQTT In (CO2 sensor)
node. - The
MQTT In (CO2 sensor)
node publishes the messages to theUI Gauge (CO2 sensor)
node. - The
UI Gauge (CO2 sensor)
node displays the current CO2 level on the gauge. - The rain gauge sends messages to the
MQTT In (Rain Gauge)
node. - The
MQTT In (Rain Gauge)
node publishes the messages to theSwitch (Rain Gauge)
node. - The
Switch (Rain Gauge)
node routes the messages to theCounter
node or theInject
node based on the payload. - If the payload is equal to
ON
, theCounter
node increments the counter. - The
Function
node converts the counter value to rain volume in centimeters. - The
UI Text (Counter)
node displays the counter value. - The
UI Text (Rain Volume)
node displays the rain volume in centimeters. - The
UI Chart (CO2 sensor)
node displays a line chart that shows the CO2 level over time. - The
UI Chart (Rain Gauge)
node displays a bar chart that shows the rain volume over time.
------------------------------------------------------------------------------------------------------------
Smart Home System Using PROFET+12V andAlexa Voice Control
Relay-based switches relays may have a higher chance of failure compared to solid-state switches due to mechanical wear and tear. Here I used PROFET +2 12V to switch on and off a 12V alarm, 12V LED light strip, and 12V exhaust fan. Solid-state switches are generally more reliable and less prone to failure, smaller in size, and have low power consumption.
Alexa for home automation provides convenience, ease of use, and the ability to control multiple devices using only voice, especially for physically disabled people. The use of Alexa and PROFET +2 12V is a perfect combination, as we can customize the output devices to be controlled compared to off-the-shelf devices made for specific use.
The Node-RED flow above is a simple flow to control two devices, a light and an exhaust fan, using Alexa voice commands. The flow also subscribes to the alarm topic and publishes the alarm status to the debug console. The alarm node is used for radar intruder alert in the next section below.
Device ControlThe Alexa-home
nodes are used to control the light and exhaust fan, respectively. These nodes listen for Alexa voice commands and publish the corresponding messages to the MQTT broker. For example, to turn on the light, you would say "Alexa, turn on the light." Alexa would then send a message to the MQTT broker on the topic profet/light
with the payload ON
. The mqtt out
nodes then publish the message to the devices.
The mqtt in
node subscribes to the alarm topic. When a message is received on this topic, the message is published to the debug console. This allows you to monitor the status of the alarm from the Node-RED dashboard.
Here is an example of how you could use the flow to control the light and exhaust fan:
- To turn on the light, say "Alexa, turn on the light."
- To turn off the light, say "Alexa, turn off the light."
- To turn on the exhaust fan, say "Alexa, turn off the fan."
- To turn off the exhaust fan, say "Alexa, turn off the fan."
-Node-RED Alexa Home Skill Bridge
The node-red-contrib-alexa-home-skill provides the end point node to bring your commands into Node-RED. The nodes have to be installed in the Node-RED.
You can find the Alexa Home Skill nodes in the alexa section of the Node-RED pallette.
Guide on how to use Node-RED Alexa Home Skill Bridge can be found here.
After adding devices on Home Skill Bridge devices tab, you need to add the Skill to your Alexa powered device. You can do this from Alexa app on your phone/tablet by searching for 'Node-RED' in the Skills section. Once enabled you will be asked to link your account. This will ask for the same username and password you used when you created the account here.
Once the accounts are linked you can discover the devices you declared earlier. You can do this from within the app or by saying "Alexa, discover devices".
Intruder Alert Using InfineonS2GO RADAR BGT60LTR11 Radar Sensor
I used radar sensors for intruder detection because radar sensors provide more precise and accurate measurements of an object's position and distance This can help in distinguishing between actual intruders and false alarms caused by other objects or environmental factors. Radar sensors have a wider field of view compared to ultrasonic sensors. This enables them to cover larger areas with fewer sensors, reducing the overall system complexity and cost.
The BGT60LTR11 Radar Sensor incorporates a 60 GHz radar transceiver, which enables high-precision sensing and detection of objects and their movement. This makes it suitable for applications for smart home automation for intruder or room occupancy detection.
The Node-RED flow shows how data is sent from an MQTT sensor to a Telegram bot. It works as follows:
- The
mqtt in
node subscribes to the topicradar_sensor
on the MQTT broker. - When a message is received on this topic, the
switch
node checks the value of thepayload
property. - If the value is
1
, the message is routed to thechange
node namedon
. This node sets thepayload
property to the stringtrue
.. - The
change
nodeson
andoff
also set thetopic
property of the message toprofet/light
andprofet/alarm
, respectively. - The
mqtt out
nodes then publish the messages to the MQTT broker on the specified topics. - The
change
nodes set thepayload
property of the messages to the stringsON
andOFF
, respectively. - The
rbe
node-Report by Exception (RBE) or filter node only passes on data if the payload has changed - The
function
node creates a new message object with the following properties:chatId
: The chat ID of the Telegram bot.type
: The type of message (message
).content
: The text of the message (Living Room Alarm {}
). - The
telegram sender
node sends the message to the Telegram bot. - The
debug
nodeoutputs the message to the debug console.
To use this flow, you will need to configure the following:
- The MQTT broker address and port in the
mqtt in
andmqtt out
nodes. - The Telegram bot token in the
telegram sender
node. - The chat ID of the Telegram bot in the
function
nodes.
Comments