inhabitat:kaunas:day04
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| inhabitat:kaunas:day04 [2026/05/29 07:10] – [Starter Code] harley.lara | inhabitat:kaunas:day04 [2026/05/29 08:45] (current) – harley.lara | ||
|---|---|---|---|
| Line 163: | Line 163: | ||
| Your final code should include: | Your final code should include: | ||
| - | * DS18B20 initialization | + | |
| - | * Temperature reading in degrees Celsius | + | * Temperature reading in degrees Celsius |
| - | * Basic error handling for invalid sensor readings | + | * Basic error handling for invalid sensor readings |
| - | * LED control based on a temperature threshold | + | * LED control based on a temperature threshold |
| - | * WiFi connection | + | * WiFi connection |
| - | * MQTT broker connection | + | * MQTT broker connection |
| - | * MQTT publishing | + | * MQTT publishing |
| - | * Clear Serial Monitor output | + | * Clear Serial Monitor output |
| - | * Basic comments explaining the main sections | + | * Basic comments explaining the main sections |
| --- | --- | ||
| Line 179: | Line 179: | ||
| ===== Hardware ===== | ===== Hardware ===== | ||
| - | * ESP32 development board | + | The is the list of component that you need in order to complete this evaluation: |
| - | * DS18B20 temperature sensor | + | |
| - | * 4.7kΩ pull-up resistor | + | * DS18B20 temperature sensor |
| - | * Breadboard and jumper wires | + | * 4.7kΩ pull-up resistor |
| - | * LED | + | * Breadboard and jumper wires |
| - | * Current-limiting resistor for LED | + | * LED (use the built-in LED) |
| - | * USB cable | + | * 220Ω current-limiting resistor for LED |
| - | * Computer with Arduino IDE or equivalent editor | + | * USB cable |
| + | * Computer with PlatformIO | ||
| ===== Software and Services ===== | ===== Software and Services ===== | ||
| - | * Arduino IDE | + | |
| - | * Required | + | * Required libraries, later on this page, you will be instructed to install them: |
| - | + | * OneWire | |
| - | | + | * DallasTemperature |
| - | * DallasTemperature | + | * PubSubClient |
| - | * PubSubClient | + | * WiFi library for ESP32, which is already included |
| - | * WiFi library for ESP32 | + | * MQTT broker |
| - | * MQTT broker | + | * Node-RED |
| - | * Node-RED | + | * InfluxDB |
| - | * InfluxDB | + | * Grafana |
| - | * Grafana | + | |
| - | + | ||
| - | --- | + | |
| ====== Practical Milestones, Requirements, | ====== Practical Milestones, Requirements, | ||
| Line 210: | Line 208: | ||
| Each milestone should be demonstrated before moving to the next layer of the IoT stack. | Each milestone should be demonstrated before moving to the next layer of the IoT stack. | ||
| - | The first milestone focuses only on the physical construction of the circuit. Students should not start debugging code before the sensor, | + | The first milestone focuses only on the physical construction of the circuit. Students should not start debugging code before the sensor, |
| - | + | ||
| - | --- | + | |
| ===== Milestone 1: Physical Breadboard Connection of the DS18B20 and ESP32 ===== | ===== Milestone 1: Physical Breadboard Connection of the DS18B20 and ESP32 ===== | ||
| ==== Required Behavior ==== | ==== Required Behavior ==== | ||
| + | {{ : | ||
| - | The student must physically connect the **DS18B20 temperature sensor** to the **ESP32** using the breadboard. | ||
| - | The circuit | + | 1. The student |
| - | The student | + | 2. The circuit |
| At this stage, the focus is only on correct physical wiring. | At this stage, the focus is only on correct physical wiring. | ||
| Line 230: | Line 225: | ||
| ==== Required Deliverables ==== | ==== Required Deliverables ==== | ||
| - | The student or group must show: | + | You must show: |
| - | * ESP32 placed or connected correctly to the breadboard | + | |
| - | * DS18B20 connected to the ESP32 | + | * DS18B20 connected to the ESP32 |
| - | * DS18B20 VCC connected to the correct voltage line | + | * DS18B20 VCC connected to the correct voltage line |
| - | * DS18B20 GND connected to ground | + | * DS18B20 GND connected to ground |
| - | * DS18B20 data pin connected to the selected ESP32 GPIO pin | + | * DS18B20 data pin connected to the selected ESP32 GPIO pin |
| - | * 4.7kΩ pull-up resistor connected between VCC and the DS18B20 data line | + | * 4.7kΩ pull-up resistor connected between VCC and the DS18B20 data line |
| - | * LED connected to an ESP32 GPIO pin | + | * LED connected to an ESP32 GPIO pin |
| - | * LED current-limiting resistor connected correctly | + | * LED current-limiting resistor connected correctly |
| - | * Shared ground between all components | + | * Shared ground between all components |
| - | * Wiring that follows the provided schematic | + | * Wiring that follows the provided schematic |
| ==== Checkpoint Evidence ==== | ==== Checkpoint Evidence ==== | ||
| Line 247: | Line 242: | ||
| The student demonstrates that: | The student demonstrates that: | ||
| - | * They can identify the DS18B20 pins: VCC, GND, and DATA | + | |
| - | * They can identify the ESP32 GPIO pin used for the DS18B20 data line | + | * They can identify the ESP32 GPIO pin used for the DS18B20 data line |
| - | * They can explain the purpose of the 4.7kΩ pull-up resistor | + | * They can explain the purpose of the 4.7kΩ pull-up resistor |
| - | * They can identify the GPIO pin used for the LED | + | * They can identify the GPIO pin used for the LED |
| - | * The breadboard wiring is organized enough to be inspected | + | * The breadboard wiring is organized enough to be inspected |
| - | * The circuit matches the provided schematic before code is uploaded | + | * The circuit matches the provided schematic before code is uploaded |
| ==== Instructor Check ==== | ==== Instructor Check ==== | ||
| Line 258: | Line 253: | ||
| Before the student continues, the instructor should confirm: | Before the student continues, the instructor should confirm: | ||
| - | * No power and ground lines are reversed | + | |
| - | * The DS18B20 data line is not connected directly to VCC or GND | + | * The DS18B20 data line is not connected directly to VCC or GND |
| - | * The pull-up resistor is placed correctly | + | * The pull-up resistor is placed correctly |
| - | * The LED has a current-limiting resistor | + | * The LED has a current-limiting resistor |
| - | * The ESP32, sensor, and LED share a common ground | + | * The ESP32, sensor, and LED share a common ground |
| - | --- | ||
| ===== Milestone 2: DS18B20 Sensor Reading ===== | ===== Milestone 2: DS18B20 Sensor Reading ===== | ||
| Line 284: | Line 279: | ||
| The student or group must show: | The student or group must show: | ||
| - | * Arduino code that initializes the DS18B20 | + | |
| - | * Required DS18B20 libraries included | + | * Required DS18B20 libraries included |
| - | * Correct GPIO pin configured for the DS18B20 data line | + | * Correct GPIO pin configured for the DS18B20 data line |
| - | * Temperature reading requested from the sensor | + | * Temperature reading requested from the sensor |
| - | * Temperature value printed to the Serial Monitor | + | * Temperature value printed to the Serial Monitor |
| - | * Basic handling of invalid or missing sensor readings | + | |
| ==== Checkpoint Evidence ==== | ==== Checkpoint Evidence ==== | ||
| Line 295: | Line 289: | ||
| The student demonstrates that: | The student demonstrates that: | ||
| - | * Temperature values appear in the Serial Monitor | + | |
| - | * The values are realistic | + | * The values are realistic |
| - | * The code uses the same ESP32 GPIO pin as the physical circuit | + | * The code uses the same ESP32 GPIO pin as the physical circuit |
| - | * The student can explain the difference between connecting the sensor and reading the sensor in code | + | * The student can explain the difference between connecting the sensor and reading the sensor in code |
| - | * The student can identify whether a problem is likely caused by wiring or code | + | * The student can identify whether a problem is likely caused by wiring or code |
| - | --- | ||
| ===== Milestone 3: Conditional Logic and LED Control ===== | ===== Milestone 3: Conditional Logic and LED Control ===== | ||
| Line 322: | Line 315: | ||
| The student or group must show: | The student or group must show: | ||
| - | * LED connected to the ESP32 | + | |
| - | * LED GPIO pin correctly defined in the Arduino code | + | * LED GPIO pin correctly defined in the Arduino code |
| - | * Temperature threshold implemented in the Arduino code | + | * Temperature threshold implemented in the Arduino code |
| - | * LED turning on or off according to the condition | + | * LED turning on or off according to the condition |
| - | * Clear explanation of the chosen threshold | + | * Clear explanation of the chosen threshold |
| ==== Checkpoint Evidence ==== | ==== Checkpoint Evidence ==== | ||
| Line 332: | Line 325: | ||
| The student demonstrates that: | The student demonstrates that: | ||
| - | * The LED responds to the temperature condition | + | |
| - | * The condition is based on the DS18B20 reading | + | * The condition is based on the DS18B20 reading |
| - | * The threshold value is visible in the code | + | * The threshold value is visible in the code |
| - | * The student can explain why the LED turns on or off | + | * The student can explain why the LED turns on or off |
| - | * The student can distinguish between a sensor-reading issue and an LED-control issue | + | * The student can distinguish between a sensor-reading issue and an LED-control issue |
| - | --- | ||
| ===== Milestone 4: WiFi Connection and IP Address ===== | ===== Milestone 4: WiFi Connection and IP Address ===== | ||
| Line 359: | Line 351: | ||
| The student or group must show: | The student or group must show: | ||
| - | * WiFi credentials added to the Arduino code | + | |
| - | * ESP32 successfully connected to WiFi | + | * ESP32 successfully connected to WiFi |
| - | * IP address printed in the Serial Monitor | + | * IP address printed in the Serial Monitor |
| - | * Basic connection status messages | + | * Basic connection status messages |
| - | * Code structure that separates WiFi setup from the main loop | + | * Code structure that separates WiFi setup from the main loop |
| ==== Checkpoint Evidence ==== | ==== Checkpoint Evidence ==== | ||
| Line 369: | Line 361: | ||
| The student demonstrates that: | The student demonstrates that: | ||
| - | * The ESP32 receives an IP address | + | |
| - | * The Serial Monitor confirms WiFi connection | + | * The Serial Monitor confirms WiFi connection |
| - | * The student can explain why WiFi is needed before MQTT can work | + | * The student can explain why WiFi is needed before MQTT can work |
| - | * The student can identify whether the ESP32 is connected to the network | + | * The student can identify whether the ESP32 is connected to the network |
| --- | --- | ||
| Line 400: | Line 392: | ||
| The student or group must show: | The student or group must show: | ||
| - | * MQTT broker address configured in the Arduino code | + | |
| - | * MQTT topic configured in the Arduino code | + | * MQTT topic configured in the Arduino code |
| - | * ESP32 connected to the MQTT broker | + | * ESP32 connected to the MQTT broker |
| - | * Temperature values published to MQTT | + | * Temperature values published to MQTT |
| - | * Serial Monitor output showing MQTT publishing activity | + | * Serial Monitor output showing MQTT publishing activity |
| - | * Payload format suitable for Node-RED processing | + | * Payload format suitable for Node-RED processing |
| ==== Checkpoint Evidence ==== | ==== Checkpoint Evidence ==== | ||
| Line 411: | Line 403: | ||
| The student demonstrates that: | The student demonstrates that: | ||
| - | * The ESP32 connects to the MQTT broker | + | |
| - | * Temperature values are published repeatedly | + | * Temperature values are published repeatedly |
| - | * The MQTT topic is clear and unique to the student or group | + | * The MQTT topic is clear and unique to the student or group |
| - | * The MQTT payload contains only the value or a clearly structured value | + | * The MQTT payload contains only the value or a clearly structured value |
| - | * The student can explain the difference between WiFi connection and MQTT connection | + | * The student can explain the difference between WiFi connection and MQTT connection |
| - | --- | ||
| ===== Milestone 6: Node-RED MQTT Subscription and Value Processing ===== | ===== Milestone 6: Node-RED MQTT Subscription and Value Processing ===== | ||
| Line 427: | Line 418: | ||
| The flow must: | The flow must: | ||
| - | * Subscribe to the MQTT topic. | + | |
| - | * Receive the temperature value. | + | * Receive the temperature value. |
| - | * Convert the incoming payload into a number if needed. | + | * Convert the incoming payload into a number if needed. |
| - | * Optionally check that the value is valid. | + | * Optionally check that the value is valid. |
| - | * Prepare the value for writing into InfluxDB. | + | * Prepare the value for writing into InfluxDB. |
| Recommended nodes: | Recommended nodes: | ||
| - | * MQTT input node | + | |
| - | * Debug node | + | * Debug node |
| - | * Function node or Change node for value conversion | + | * Function node or Change node for value conversion |
| - | * InfluxDB output node | + | * InfluxDB output node |
| ==== Required Deliverables ==== | ==== Required Deliverables ==== | ||
| Line 444: | Line 435: | ||
| The student or group must show: | The student or group must show: | ||
| - | * Node-RED MQTT input node subscribed to the correct topic | + | |
| - | * Debug output showing the incoming MQTT payload | + | * Debug output showing the incoming MQTT payload |
| - | * Node-RED logic that converts the payload into a number | + | * Node-RED logic that converts the payload into a number |
| - | * Processed value ready for InfluxDB | + | * Processed value ready for InfluxDB |
| - | * Organized and readable Node-RED flow | + | * Organized and readable Node-RED flow |
| ==== Checkpoint Evidence ==== | ==== Checkpoint Evidence ==== | ||
| Line 454: | Line 445: | ||
| The student demonstrates that: | The student demonstrates that: | ||
| - | * MQTT messages from the ESP32 are visible in Node-RED | + | |
| - | * The payload is converted from a string to a number if necessary | + | * The payload is converted from a string to a number if necessary |
| - | * The debug panel shows the processed value | + | * The debug panel shows the processed value |
| - | * The student can explain the role of each node in the flow | + | * The student can explain the role of each node in the flow |
| - | --- | ||
| - | |||
| - | ===== Milestone 7: InfluxDB Storage ===== | ||
| - | |||
| - | ==== Required Behavior ==== | ||
| - | |||
| - | The processed temperature reading must be stored in InfluxDB. | ||
| - | |||
| - | Suggested measurement name: | ||
| - | |||
| - | < | ||
| - | temperature | ||
| - | </ | ||
| - | |||
| - | Suggested field: | ||
| - | |||
| - | < | ||
| - | value | ||
| - | </ | ||
| - | |||
| - | Optional tags: | ||
| - | |||
| - | < | ||
| - | student | ||
| - | device | ||
| - | location | ||
| - | </ | ||
| - | |||
| - | Example stored data model: | ||
| - | |||
| - | < | ||
| - | measurement: | ||
| - | field: value | ||
| - | tag: device = esp32 | ||
| - | </ | ||
| - | |||
| - | ==== Required Deliverables ==== | ||
| - | |||
| - | The student or group must show: | ||
| - | |||
| - | * Node-RED configured to write to InfluxDB | ||
| - | * Correct InfluxDB database, bucket, or measurement configuration | ||
| - | * Temperature value stored successfully | ||
| - | * Clear measurement and field names | ||
| - | * Data structure suitable for Grafana visualization | ||
| - | |||
| - | ==== Checkpoint Evidence ==== | ||
| - | |||
| - | The student demonstrates that: | ||
| - | |||
| - | * Node-RED sends the processed temperature value to InfluxDB | ||
| - | * InfluxDB receives new data points | ||
| - | * The measurement and field names are identifiable | ||
| - | * The student can explain what data is being stored | ||
| - | |||
| - | --- | ||
| - | ===== Milestone | + | ===== Milestone |
| ==== Required Behavior ==== | ==== Required Behavior ==== | ||
| Line 536: | Line 471: | ||
| The student or group must show: | The student or group must show: | ||
| - | * InfluxDB configured as a Grafana datasource | + | |
| - | * Query that retrieves the temperature data | + | * Query that retrieves the temperature data |
| - | * Dashboard panel displaying temperature over time | + | * Dashboard panel displaying temperature over time |
| - | * Clear panel title | + | * Clear panel title |
| - | * Correct or appropriate unit, such as degrees Celsius | + | * Correct or appropriate unit, such as degrees Celsius |
| ==== Checkpoint Evidence ==== | ==== Checkpoint Evidence ==== | ||
| Line 546: | Line 481: | ||
| The student demonstrates that: | The student demonstrates that: | ||
| - | * Grafana can access the InfluxDB datasource | + | |
| - | * Temperature values appear in a dashboard panel | + | * Temperature values appear in a dashboard panel |
| - | * The graph updates over time | + | * The graph updates over time |
| - | * The student can explain how Grafana receives the data indirectly through InfluxDB | + | * The student can explain how Grafana receives the data indirectly through InfluxDB |
| - | --- | + | ===== Milestone |
| - | + | ||
| - | ===== Milestone | + | |
| ==== Required Behavior ==== | ==== Required Behavior ==== | ||
| Line 569: | Line 502: | ||
| The student or group must explain: | The student or group must explain: | ||
| - | * What the DS18B20 measures | + | |
| - | * How the DS18B20 is physically connected to the ESP32 | + | * How the DS18B20 is physically connected to the ESP32 |
| - | * What the ESP32 does | + | * What the ESP32 does |
| - | * Why WiFi is needed | + | * Why WiFi is needed |
| - | * What MQTT is used for | + | * What MQTT is used for |
| - | * What Node-RED does | + | * What Node-RED does |
| - | * Why the data is stored in InfluxDB | + | * Why the data is stored in InfluxDB |
| - | * What Grafana displays | + | * What Grafana displays |
| ==== Checkpoint Evidence ==== | ==== Checkpoint Evidence ==== | ||
| Line 582: | Line 515: | ||
| The student demonstrates that: | The student demonstrates that: | ||
| - | * They can describe the system from sensor to dashboard | + | |
| - | * They can identify where a problem is happening in the stack | + | * They can identify where a problem is happening in the stack |
| - | * They can distinguish between hardware, firmware, network, MQTT, Node-RED, database, and dashboard issues | + | * They can distinguish between hardware, firmware, network, MQTT, Node-RED, database, and dashboard issues |
| - | * They can explain at least one troubleshooting step they used | + | * They can explain at least one troubleshooting step they used |
| - | + | ||
| - | --- | + | |
inhabitat/kaunas/day04.1780031409.txt.gz · Last modified: 2026/05/29 07:10 by harley.lara