Chapter 3. Data Simulation

Is it real or fake?

A matter of perception.

Do I act or not?

Processing data from sensors and sending commands to actuators are important capabilities of an end-to-end IoT system. Sensors and actuators, as you’ll soon see, are truly the “edge of the edge,” serving as the final interface between the physical and logical worlds.

Sensing and actuation capabilities introduce a conundrum, however: there are myriad types of hardware that support this type of functionality, each with its own set of interface requirements. To mitigate this, and to stay within the realm of programming in support of our initial use case, this chapter will focus on using data simulation and hardware emulation to provide the “physical world” interface needed to program the IoT.

What You’ll Learn in This Chapter

This chapter focuses on measuring and (to a lesser degree) modeling the data you generate as part of a simple sensor and actuator simulation environment you’ll build for the CDA. The generated data will represent a small handful of environmental sensors, and you’ll learn how to process simple threshold crossings to trigger simulated actuation events.

As a reminder, this chapter and Chapter 4 focus exclusively on the CDA, so all of the code will be written in ...

Get Programming the Internet of Things now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.