0
0
IOT Protocolsdevops~15 mins

JSON for human-readable data in IOT Protocols - Mini Project: Build & Apply

Choose your learning style9 modes available
JSON for human-readable data
📖 Scenario: You are working with IoT devices that send data in JSON format. You want to create a simple JSON object to represent sensor readings in a way that is easy for humans to read and understand.
🎯 Goal: Create a JSON object that holds sensor data with clear keys and values. Then add a configuration setting for the sensor type, extract the temperature readings, and finally display the temperature data.
📋 What You'll Learn
Create a JSON object named sensor_data with exact keys and values
Add a variable sensor_type with the exact string value
Extract temperature readings into a list named temperatures
Print the temperatures list exactly as shown
💡 Why This Matters
🌍 Real World
IoT devices often send data in JSON format. Understanding how to create and read JSON data helps you work with these devices and their data easily.
💼 Career
Many DevOps and IoT jobs require handling JSON data for monitoring and managing devices. This project builds foundational skills for those tasks.
Progress0 / 4 steps
1
Create the initial JSON data
Create a dictionary called sensor_data with these exact entries: "device": "sensor_01", "readings": [22.5, 23.0, 22.8], "unit": "Celsius"
IOT Protocols
Need a hint?

Use curly braces to create a dictionary. The readings value is a list of numbers.

2
Add sensor type configuration
Add a variable called sensor_type and set it to the string "temperature"
IOT Protocols
Need a hint?

Use an equals sign to assign the string value to sensor_type.

3
Extract temperature readings
Create a list called temperatures that contains the values from sensor_data["readings"]
IOT Protocols
Need a hint?

Use square brackets to access the readings key in sensor_data.

4
Display the temperature readings
Write a print statement to display the temperatures list exactly as it is
IOT Protocols
Need a hint?

Use print() with the variable temperatures inside the parentheses.