In this project we put together a handheld Utrasonic distance measuring device using the mcModule120 and a US-100 ultrasonic sensor! This is an example of using the ultra-low power nature of the mcThings platform to quickly and easily connect another sensor to create a cool IoT device/solution.
You can easily do this too into whatever enclosure you wish!
In a previous example, we had created a device that used the mcModule120 with an ultrasonic sensor to measure 'fullness' levels within a garbage can.
What could this be used for?Using this example to create your own version, you can build 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!
Just like our other project, we soldered the ultrasonic sensor to the mcModule120
We found a nice enclosure that included an opening for easy battery changes. We started with using step bits to drill two holes into the enclosure for the ultrasonic sensor:
Because the enclosure had the opening for the battery pack, we decided to connect a 2 x AA battery holder to the mcModule120. This way we can power the device using AA batteries and increase the life of the device dramatically!
We then inserted the ultrasonic sensor into the holes we drilled and installed the rest of the electronics into the enclosure:
We then put some batteries in, closed up the case:
And done!
You can use the code that is listed at the bottom of this project (you'll need to also use the sensor library in your programming as well). Depending on where you want to direct the information, you'll need to modify the code and also your gateway configuration. For help, check out the other ultrasonic example we put together.
Visualizing the dataBecause you can send the information to almost any IoT cloud application, you have the option to visualize or store the data based on your preference. mcThings works with many awesome partners that you can check out OR use a different application that can accept MQTT.
How long will this last?Depending on how often you ask the device to measure distance will determine how long the device will last. In this case, measuring every 30 seconds and relaying that to a cloud application, the device should last at least 8 years on 2 x AA batteries!
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.
Comments