In this use-case, we put together a couple of impressively long-life ultrasonic distance sensors using the mcThings IoT hardware platform and then displayed the data in Ubidots, an awesome IoT cloud application! We're employing two different IoT communication networks (SIGFOX and mcAir) to relay the information to the cloud proving how easy it is to create feasible and realistic IoT solutions using mcThings.
Ok.....but exactly how 'Ultra-Low' power are we talking about?Since we are using two different devices and two different networks, we'll have different battery life estimates:
Ultrasonic sensor attached to an mcMod120 powered by a 3V lithium coin cell:
@ Twice per day measurement and published via mcAir: 2.5+ years!
@ Measuring every 30 seconds and published via mcAir: 2+ Months!
Ultrasonic sensor attached to an mcDemo205 powered by 4 x AAA
@ Twice per day measurement sent over SIGFOX: 6+ Years!
@ Measuring every 10 minutes sent over SIGFOX: 3+ Months!
*Note - Learn more about mcAir in the platform section below. Above estimates do not take into account potential environmental temperatures that may affect battery life
A real smart city solution (with many other use-cases!)Using either mcAir or SIGFOX, there are tons of feasible and truly realistic IoT solutions:
- Smart City - Imagine smart Garbage/Recycling/Bin/Container levels relayed back to a city control/dispatch center to increase efficiencies with vehicle routing, statistics, etc
- Large Facilities - Large facilities with hundreds of bins (like amusement parks, airports, hospitals, universities/colleges, etc)
- Agriculture - Imagine smart water troughs/feed/silo bins for livestock for real-time alerts on levels, etc
- Parking/Object detection - Imagine an easy to deploy object and distance sensor system for all sorts of different use-cases
- Fun Stuff - how quickly are your tomato plants growing? how high your cat can jump? guess your height? etc?
The mcThings platform includes 2 main components: mcModules and mcGateways. A powered and connected mcGateway creates the mcAir network (up to 200m range under optimal conditions) and bridges the information between the mcModules (within range) to and from the Internet. Using the IDE (mcStudio) and mcScript (ultra-low power programming language - a subset of VB.NET) allows you to wirelessly connect, debug and program modules with your customized scripts.
Note - You also require an mcDongle to complete firmware updates on the modules/devices and gateways! We recommend looking at the mcModule120 Dev kit which includes everything you need to get going!!
PIN 0 to VCC, PIN 1 to Echo/Rx, PIN 2 to Trig/Tx, GND to GND
We then drilled some holes into an enclosure, inserted the device and closed it up!
Using the pins on the mcDemo205, you can connect the sensor directly without soldering.. choose your own pins! We drilled two holes into the device enclosure and installed the sensor.
Installing into the bin:Depending on the enclosure you use and what you want to measure, you could use many methods for install. In the below we slapped on some double-sided tape and boom, installation complete!
Ubidots has an impressive device repository which includes example projects and information on bringing information into the application. Check out the mcModule walk-through on Ubidots to get started.
We created a library for the US100 and then wrote a short program to send the distance (in mm) every 30 seconds and out to the Ubidots cloud. See full code and library at the bottom of this project.
mcDemo205 - Modify the project code to package the information for SIGFOX. Then, you will need to create a webhook from the SIGFOX backend to be consumed and displayed into the Ubidots Dashboard!
Displaying the data in Ubidots dashboardUbidots is incredibly simple to use. Ensure that you check out the walkthough for information on sending data.
Using the visualization widgets allow you to see the data in real-time! With long-term testing, we found that the sensor seems to be accurate to within +-5mm and can measure up to 3 meters away.
The recycling bin in the cover gif is almost exactly 1 meter deep (1000 mm) so we setup the gauges in the dashboard to visualize the data as well as a table with showing the last message information and a historical graph.
You can also use the simple alert setup to receive a notification based on your requirements. In the above, if the device measured a distance of 200mm/20cm or less, an email was sent. You could send the information out in multiple ways for different use-cases!
Thanks for reading!We'd love to hear your ideas for other use-cases for this type of device! Please become a member of our hub here on Hackster to stay up-to-date with new projects! We've got plenty more to come.
Thanks!
Comments
Please log in or sign up to comment.