Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On IoT Solutions with Blockchain.

You're reading from  Hands-On IoT Solutions with Blockchain.

Product type Book
Published in Jan 2019
Publisher Packt
ISBN-13 9781789132243
Pages 206 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
Maximiliano Santos Maximiliano Santos
Profile icon Maximiliano Santos
Enio Moura Enio Moura
Profile icon Enio Moura
View More author details

Table of Contents (15) Chapters

Title Page
About Packt
Contributors
Preface
1. Understanding IoT and Developing Devices on the IBM Watson IoT Platform 2. Creating Your First IoT Solution 3. Explaining Blockchain Technology and Working with Hyperledger 4. Creating Your Own Blockchain Network 5. Addressing Food Safety - Building around the Blockchain 6. Designing the Solution Architecture 7. Creating Your Blockchain and IoT Solution 8. The IoT, Blockchain, and Industry 4.0 9. Best Practices for Developing Blockchain and IoT Solutions 1. Other Books You May Enjoy Index

Coding the device firmware


Next, we will create a device application (firmware) that reads the sensor data and sends it to the backing application. In the previous chapter, we used Node.js to publish events from a device simulator, and now we're going to use this method to leverage the previous chapter's code. Remember that the objective of this solution is to water a plant whenever the temperature is high or the soil moisture is too low.

The next section shows the code needed in order to create the firmware that reads all the sensor data and publishes events to the IBM Watson IoT Platform.

Measuring soil moisture

The sensor probe used in this project is a resistive sensor, which measures the current that is passed through the probes of the sensor. It has two probes that are physically separated; one probe is attached to a positive end and the other to the GND end. When both probes are connected by a common surface, it will measure the current that is passed through that surface and give us...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}