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.