This project will show you how to use the mcThings IoT Hardware platform to easily measure temperatures and then display them into the Wia.io cloud application! This will allow you to visualize the incoming data among many other features that Wia.io offers.
We'll use the built-in temperature sensor in the mcModule120 and then send that temperature information, via the mcGateway, to Wia.io for visualization. Wia.io has a Hackster hub, so be sure to check it out too!
Potential use-casesThere are so many things you can do with the mcThings platform! You can create almost any type of IoT solution and then display/store/etc the data using multiple cloud options!
In this particular example, there are tons of use-cases where having multiple battery operated devices relaying temperature (and other info) back to the cloud would be very useful. And since the mcModule120 can last for up to 5 years using a single coin-cell battery, the possibilities are endless! Check out the product brief for the mcModule120 in the schematic section of this project or, check i tout on our website
- Grocery/retail temperature monitoring: Imagine a grocery/retail store where you can measure the temperatures within the freezers/coolers/fridges and then have a real-time dashboard to visualize that data. This could provide very impressive ROI, energy savings and a reduction in lost product.
- Cold-Chain monitoring: Imagine being able to track and alert on temperature fluctuations within a cold-storage facility. This could provide impressive ROI, allow a client to more efficient, be pro-active on maintenance and alerts on any issues.
- Agriculture: Imagine measuring temperatures (and humidity, etc) within a greenhouse/warehouse and using that data to be more efficient, save money/resources and gain valuable data over-time that can help with informed business decisions.
- There are tons of other uses for this type of example! Feel free to leave your comments about other use-cases in the comment section!
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!
Using the Wia.io recent walk-through on how to connect mcThings devices to their IoT application (more on this below), you can easily get started with this project. Follow the details within the link above to walk -through. Be sure to setup the configuration in your mcGateway properly so that you are sending the MQTT information to the correct place:
Gateway configServer - api.wia.io Port – 1883
Username - Your Wia Device Secret Key
Password - A blank space character
ClientID - Your Wia Device ID
Class TempLogger
// Device ID in Wia
Const wiaDeviceId As String = "Wia Device ID"
// MQTT topic in Wia
Const wiaTopic As String = "devices/" + wiaDeviceId + "/events/temperature"
Shared Event CheckTemp() RaiseEvent Every 30 Seconds
Dim temp As Float = TempSensor.GetTemp() // Get Temp from sensor
Dim tempString As String = temp.ToString()
// Create temp JSON object - { "temperature" : "23.06" }
Dim tempJson As Json = New Json
tempJson.Add("temperature", tempString)
// Create Wia preferred JSON object - { "data" : {"temperature" : "23.06"}}
Dim wiaPayload As Json = New Json
wiaPayload.Add("data", tempJson)
// Publish to wia MQTT
Lplan.Publish(wiaTopic, wiaPayload.ToListOfByte)
End Event
End Class
Note: You will also need to add the temperature sensor library to the above code. (Check out the code section and be sure to read the walk-through on the link above.)
Viewing the data within Wia.ioNow that you have your mcModule programmed and your mcGateway configured, you can now start to see the incoming temperature information on the Wia dashboard!
Check out the Wia.io website to learn more about what else you can do with your data within their platform!
Join our hub!We would love for you to join the mcThings hub here on Hackster! That way you won't miss all the upcoming cool projects we'll be posting soon!
Thanks for reading!
Comments
Please log in or sign up to comment.