Schlagwort: sensor

  • Using historical data from sensors in Arduino Cloud

    Using historical data from sensors in Arduino Cloud

    Reading Time: 4 minutes

    Historical data can be essential to making your electronics and Arduino project work how you want them to. Data retention is one of the features that changes depending on which level of Arduino Cloud account you have. Here’s everything you need to know, so you can choose exactly the right Arduino Cloud plan.

    Data or Variables?

    When you add variables to your Things, the Arduino Cloud automatically generates sketches that include them.

    Hang on though. Aren’t we here to talk about data retention?

    Indeed we are. When we say “variables”, this is the term used to describe the data you send to your Arduino Cloud. It sounds a bit technical, but consider the word. “Variable” actually makes more sense than “data”, which is kinda woolly.

    Variables are information that changes or, you guessed it, varies. Temperature, for example. If you have a temperature sensor sending data to the Cloud, it’s a variable. Because the value of the data (the temperature) is always changing/varying. 

    So in your sketch it’s known as a variable. The different data retention options in the Arduino Cloud plans tell you how long the Cloud will store a record of those variables for you.

    Data retention options in Arduino Cloud

    Historical Data Options

    Each Arduino Cloud plan offers a different length of time for how long you retain sensor data, depending on your needs.

    If you’re running a home automation to turn the lights on when it drops dark, your system is working with (pretty much) real-time data. So 24 hours of sensor information is perfectly adequate. It’s not like you’ll be turning a lamp on or off based on yesterday’s ambient light levels.

    A weather station might work a bit differently though. If you’re measuring the temperature or rainfall or daylight hours, you may want to build a comparison to see how the weather is changing. In this case, an Arduino Cloud Entry plan would give you 15 days of data, allowing you to monitor and record recent changes in your weather station’s variables.

    Historical data for an IoT greenhouse, or maybe an aquarium or terrarium, would be much more important. Maybe it’s even an industrial project that’s monitoring equipment for predictive maintenance needs. In these cases, being able to look back at your variables over previous weeks and months could be essential. In that case, you’d go Maker or Maker Plus, so you can build dashboards with detailed histories of your measurements.

    It’s very possible that you don’t even know how much historical data will be useful to your project at first. You start on the free tier, decide that it’d be useful to have legacy information, and go up through the Entry plan and eventually settle on Maker. The project leads the way, until it’s delivering everything you need.

    Historical data in your Arduino Cloud

    Putting Historical Data to Use in Arduino Cloud

    Arduino Cloud is really clever when it comes to the data generated by sensors and used as variables. For example, you can specify how often new data is sent to your Arduino Cloud.

    Let’s say you’re monitoring Wi-Fi signal strength at the bottom of the garden, where a project (weather station, let’s say) is installed. If this is a solar and/or battery powered device, power consumption becomes essential. By changing the data sampling interval from updating a variable on Arduino Cloud every second to updating once a minute, you can extend battery life by a huge amount. The device is only operating a fraction of the time it was before, and the information is just as useful.

    Combined with 15 days or three months of historical data, you can build a detailed picture of Wi-Fi performance that lets you keep everything running perfectly. Or, if you need to find out when and why your signal has been dropping, the story is right there in your Arduino Cloud dashboard.

    Choosing the Right Arduino Cloud Plan

    So for all these reasons, you can see why different amounts of data retention are available in the Arduino Cloud plans. It’s not that all projects benefit from as much retention as possible. As we discussed, even some complex, elaborate projects barely need any. Others, which might be simple signal strength monitoring or rainfall measurement, need to know what was happening months ago.

    You have the choice, because the different Arduino Cloud plans offer different historical data options for different needs. If in doubt for what your project needs to work as intended, start on the free plan and work up from there.

    Choose Arduino Cloud Plan

    Website: LINK

  • Remote humidity detector

    Remote humidity detector

    Reading Time: 3 minutes

    We know crawl spaces are creepy, sweaty, and confining but, hear us out…

    You need to keep an eye on the humidity level in your crawl space, as it can seriously affect the whole house’s overall health. It’s ideal to be able to do this remotely (given the creepy, sweaty atmosphere of the space), and a Raspberry Pi allows this.

    Jamie Bailey took to Medium to share his Raspberry Pi setup that allows him to monitor the humidity of the crawl space in his home from a mobile device and/or laptop. His setup lets you check on the current humidity level and also see the historical data over time. You can also set alarms to be sent to you via text or email whenever the humidity level exceeds a certain threshold.

    The hardware you need

    • Power outlet or extension cord in your crawl space
    • Raspberry Pi (3 or 4) or Raspberry Pi Zero W (or WH)
    • BME280 temperature/humidity sensor
    • Female-to-female jumper wires

    The software you need

    Jamie’s walk-through is extensive and includes all the command line code you’ll need too, so make sure to check it out if you attempt this build.

    Assembly

    The BME280 sensor has four pins you need to connect to your Raspberry Pi. This will send the humidity data to your Raspberry Pi, which you’ll have already set up to let you know what’s happening remotely.

    • BME280 VIN pin connects to GPIO pin 1 (3.3V)
    • BME280 GND pin connects to GPIO pin 6 (GND)
    • BME280 SCL pin connects to GPIO pin 5 (SCL)
    • BME280 SDA pin connects to GPIO pin 3 (SDA)
    You can see the Raspberry Pi in a black case hanging in the centre against a floor joist.

    Once you have all your software sorted and your hardware connected, turn your Raspberry Pi off and take it down to your crawl space (monitor, keyboard, and mouse are no longer necessary). Jamie advises hanging your Raspberry Pi from the floor joists instead of letting it touch the ground, to avoid contact with any water. He put a nail in one of the floor joists and draped the power cord over the nail (see above). Turn your tiny computer on, make sure data starts flowing into your dashboard, and you’ve got yourself remote humidity sensor!

    PS We’re English so… is a crawl space the same as an attic or what? Asking for a friend!

    Never mind, Alex asked her American girlfriend.

    Website: LINK

  • Tired of queuing for the office toilet? Meet Occu-Pi

    Tired of queuing for the office toilet? Meet Occu-Pi

    Reading Time: 2 minutes

    This is the story of Occu-Pi, or how a magnet, a Raspberry Pi, and a barrel bolt saved an office team from queuing for the toilet.

    Occu Pi Raspberry Pi toilet signal

    The toil of toilet queuing

    When Brian W. Wolter’s employer moved premises, the staff’s main concern as the dearth of toilets at the new office, and the increased queuing time this would lead to:

    Our previous office had long been plagued by unreasonably long bathroom lines. At several high-demand periods throughout the day we’d be forced to wait three, four, five people deep while complaining bitterly to each other until our turn to use the facilities arrived. With even fewer bathrooms in our new office, concern about timely access was naturally high.

    Faced with this problem, the in-house engineers decided to find a technological solution.

    Occu-Pi

    The main thing the engineers had to figure out was just how to determine the difference between a closed door and an occupied stall. Brian explains in his write-up:

    There is one notable wrinkle: it’s not enough to know the door is closed, you need to know if the bathroom is actually in use — that is, locked from the inside. After considering and discarding a variety of ‘creative’ solutions (no thank you, motion sensors and facial recognition), we landed on a straightforward and reliable approach.

    The team ended up using a magnet attached to the door’s barrel bolt to trigger a notification. Simply shutting the door doesn’t act as a trigger — the bolt needs to lock the door to set off a magnetic switch. That switch then triggers both LED notifications and updates to a dedicated Slack channel.

    Occu-Pi Raspberry Pi toilet signal

    For the technically-minded, Occu-Pi is a pretty straightforward build. And those wanting to learn more about it can find a full write-up in Brian’s Medium post.

    We’ve seen a few different toilet notification projects over the years, for example this project from DIY Tryin’ using a similar trigger plus a website. What’s nice about Occu-Pi, however, is the simplicity of its design and the subtle use of Slack — Pi Tower’s favoured platform for office shenanigans.

    Website: LINK