meta data for this page
Pilot IoT Programming Hackathon
Welcome to the pilot IoT Programming Hackathon!
Prerequisites:
Before starting this hackathon, you should have a basic understanding of:
C or Python
Applications/IDE used: Arduino/Thonny
Without further ado, let's get started!!
Phase 1: Getting Familiar with the concepts
Understanding concepts of sustainability, IoT and smart housings: concepts and information link
Phase 2: Building the Keyestudio Smart Home
Now it’s time to get hands-on and assemble your smart home system! 🛠️ In this phase, you’ll connect the components in the Keyestudio IoT Smart Home Kit according to the wiring details provided. This step is for setting up the hardware.
Follow the tutorials provided below to guide you through the process and ensure everything is connected correctly.
Tutorials: External Link
Wiring Details
After installing the components on the boards, you will now need to connect the components with the processor.
Each component has at least three terminals: G (Ground), V (Voltage), S (Signal). The signal wire is the one that transfers the input and output signal in the system, while ground and voltage wires are for power supply.
The following table is a list of which pin on the ESP32 board that you should connect to the signal terminal of the component.
Connection | Component |
IO5 | Servo for Controlling Windows |
IO12 | Yellow LED Module |
IO13 | Servo for Controlling Doors |
IO14 | PIR Motion Sensor |
IO16 | Left Button Module |
IO17 | Temperature and Humidity Sensor |
IO18 | Fan (IN-) |
IO19 | Fan (IN+) |
IO23 | Gas Sensor |
IO25 | Buzzer Sensor |
IO26 | 6812RGB LED |
IO27 | Right Button Module |
IO34 | Steam Sensor |
IIC | RFID Module |
IIC | LCD1602 Display |
Power | Battery Wiring |
Phase 3: Getting Familiar with the Components
Before you start building your smart home system, it’s important to understand what each component does, how to use it, and the role it plays in your system. The resources below will guide you through this process, providing tutorials, sample codes, and tools to make your hackathon smoother.
Components Description
Explore detailed descriptions of each component included in the kit. Learn about their functionality, applications, and how they can bring your smart home ideas to life. View Components Description
This system can be programmed using Arduino or Python, so you can choose the language you’re most comfortable with. To help you get started, refer to the following tutorials:
- Arduino Tutorials: Beginner-friendly guides to programming the ESP32 and other components using Arduino. Includes sample projects and tips for troubleshooting. External Link
- Python (Thonny) Tutorials: Step-by-step instructions for programming the ESP32 using Python and the Thonny IDE. Ideal for those who prefer Python over Arduino. External Link
Additional Resources
To help you get started, here are some additional resources:
- Python Sample Code Files: A collection of ready-to-use Python code files that demonstrate how to work with the components. External Link
- Firmware Installation: Detailed instructions for installing the ESP32 firmware (v1.17) to ensure compatibility with the provided examples and libraries. External Link
- Other Resources (External Link) that include:
- The mobile app for controlling your smart home system.
- Pre-configured libraries for integration with your code.
- Comprehensive tutorials for common tasks and operations.
- Troubleshooting guides to help you solve common issues.
- Essential installation files to set up your development environment.
Phase 4: Brainstorming and presenting the design
For this Hackathon we are offering 2 different themes. Each group should take different themes.
Group 1
Theme: Energy efficient controlling of a smart house
Design an energy-efficient smart house system using Internet of Things (IoT) technologies. The goal is to enhance the energy efficiency of household appliances such as lights, fans, and other electronic devices by integrating IoT components and intelligent systems. You should design a baseline such that the system is not “smart” to compare the energy consumption of the two systems.
For example, a baseline temperature control system could be manual buttons to switch the fan on and off whereas a smart system would be using temperature sensors to control the fan.
Group 2
Theme: Affecting and changing the behaviour of residents of a smart city through smart housing
Design a smart house system which affects the behaviours of residents of a smart city through smart housing using Internet of Things (IoT) technologies. The goal is to influence residents through persuasive or motivational approaches. You should compare the behaviours of people in a certain scenario and evaluate the new behaviours or habits developed after implementing your design.
For example, a baseline behaviour would be a person turning off the fan manually, where after automation they don't need to actively think of turning off the fan which changes their habits.
For presentation, no slides are necessary, just share your idea to everyone :D
Phase 5: Implementing the design
After deciding on your design, it is time to try to implement it using your preferred IDE (Arduino/Thonny) and see if it works on the Smart Home!!
Arduino Sample Project: ArduinoLink
[Optional] Connecting the smart house to Azure IOT Central Applications
The goal of this section is to connect the Keyestudio Smart House model with Azure IoT Central, a cloud-based platform for managing and monitoring IoT devices. This integration will enable participants to:
- Visualize real-time data from the sensors in the smart house.
- Analyze trends and patterns for energy efficiency and behavior monitoring.
- Control the smart house remotely through Azure IoT Central.
- Leverage Azure's powerful features, such as dashboards, alerts, and insights, to create scalable IoT solutions.
Sign Up with Azure for Students Account (Preferred) or Azure Free Trial Account: Azure for Students Account / Azure Free Trial Account
Guidelines to activate the account: Guideline for Azure for Students Account: Link
Guidelines for Azure Free Trial Account: Link
Guidelines to connecting the Smart Home (ESP32-S3) to Azure IoT Central and Create the Dashboard: Link
Phase 6: Evaluating and refining the design
Power Measurements
You can use Power Measurements to see how much energy is used in your design. Try your best to reduce the energy used and remember to document it as well!
The tutorial can be viewed here:Power measurement tutorial with Hard Kernel power meter
Additional Power Measurements
Apart from power measurements that track total energy used in the IoT system, there are other measurements that can be tracked for total energy reduction.
- CPU Load:
- Given that ESP32 microcontroller has a built-in processor, measurements of its cpu load can be calculated during its runtime through the calculating the total time the processor is idle, (active but not processing any tasks) from total runtime.
- ESP32 has a built in function to detect processor state in which it is idle.
- Heap Memory Status:
- ESP32 can also track the state/ status of its heap memory, that is utilized during runtime/ task performance/ computation, by installing ESP-IDF library on the arduino IDE, you can track and record the processor's free heap size and minimum free heap size throughout its runtime.
- Memory space:
- ESP32 can track its available memory during runtime, this is helpful to detect potential memory leaks during runtime.
- FreeRTOS Task Monitoring:
- ESP32 can also track its task during runtime with the FreeRTOS library, that will track task completion during runtime.
- Input and Output Signal tracking:
- ESP32 can also utilize available libraries like ESP32PulseCounter that can track amount of inputs and outputs it processed during task execution.
Behavioral Measurements
Behavioral measurements in the context of smart home systems and energy efficiency focus on how user habits and actions are influenced by the implemented systems. The goal is to evaluate whether the system encourages sustainable behaviors, such as conserving energy or adapting to environmentally friendly habits.
Reference Slides for behavioral Measurements:Slides by Dr. Sanaul Haque
Phase 7: Final presentation and reflection
It is time to present and demo your creation!
You can use this slide as template: Slides Template [Make a copy when you use this slide]
After your presentation, feel free to share your overall reflection during these 2 days. You can share on your learning outcomes, your hardships and experience during this pilot hackathon.
Credits
Click on this link to look at the nerds that prepared this for you :Credits page
Pilot Run Results
Click on this link to view the pilot run results by Sunway University students: View Pilot Results