Computer Science
Intermediate
120 mins
Teacher/Student led
What you need:
Chromebook/Laptop/PC

Building the Embedded System

In this lesson, you will build a functional embedded system for your forest-themed project. Connect at least one digital and one analogue input, configure an output, implement code for automatic data collection and process simulation (e.g., wildfire risk), and test thoroughly. By the end, your system will meet all 2026 brief requirements, with evidence saved for your report.
Learning Goals Learning Outcomes Teacher Notes

Teacher Class Feed

Load previous activity

    1 - undefined

    By the end you should have:

    • Understand how embedded systems apply to real-world environmental monitoring, preparing you for your final report
    • A working embedded system that fully meets the basic requirements of the 2026 brief
    • At least one digital input and one analogue input connected and reading data
    • At least one primary output (digital or analogue) functioning
    • Your system collecting and storing real environmental data related to your forest theme
    • Your system simulating a real-world process (e.g., canopy cover, drought cycle, wildfire risk)
    • Code that runs automatically after manual start/calibration

    2 - Exact Basic Requirements You Must Meet

    From page 5 of the official brief:

    • Build a functional embedded system that uses at least one digital input and at least one analogue input
    • The system must generate at least one primary output which can be either digital or analogue
    • The system can be started or calibrated manually but should operate automatically once started
    • Use your embedded system to collect and store environmental data that relates to your chosen theme
    • Configure your embedded system to simulate a real-world process related to the theme (e.g., canopy cover, drought cycles, wildfire risk)
    • Run tests to show how the system responds using different inputs or changing environmental data

    3 - Hardware Checklist – Confirm Before Starting

    RequiredYour Hardware
    Main boarde.g., micro:bit v2 / Raspberry Pi Pico / Raspberry Pi
    At least 1 digital inpute.g., rain sensor, smoke detector, PIR motion
    At least 1 analogue inpute.g., soil moisture, temperature (DHT22), light sensor
    At least 1 outpute.g., buzzer, LED, servo, OLED screen
    Storage methode.g., microSD card, internal flash, USB drive

    4 - Core Code Structure You Should Follow

    To meet all of the 2026 SEC basic requirements, organise your code using the structure similar to below. You can adapt it as necessary to your project, board and language, but every part must be present and working.

    1. Import required libraries
      Pseudocode example:
      from machine import Pin, ADC, Timer
      import time, os
    2. Define pins for all inputs and outputs
      Pseudocode example:
      rain_sensor = Pin(15, Pin.IN)
      soil = ADC(Pin(26))
      led = Pin(16, Pin.OUT)
      buzzer = Pin(17, Pin.OUT)
    3. Calibration or manual start routine (runs once)
      Pseudocode example:
      print("Press button to calibrate/start")
      button.wait_for_press()
      print("System starting in 3…2…1…")
    4. Main automatic loop that runs forever
      • Read the digital input
        rain_detected = rain_sensor.value()
      • Read the analogue input(s)
        moisture = soil.read_u16()
        temp = dht22.temperature()
      • Simulate your chosen real-world forest process
        if temp > 30 and moisture < 30000:
            risk = "HIGH"
        else:
           risk = "LOW"
      • Trigger your primary output(s) when conditions are met
        if risk == "HIGH":
            led.value(1)
            buzzer.value(1)
        else:
            led.value(0)
      • Save a timestamp + all sensor readings to your data file
        with open("forest_data.csv", "a") as f:
            f.write(f"{time.ticks_ms()},{temp},{moisture},{risk}\n")
    5. Delay or sleep between readings (e.g., 10–60 seconds)
      Pseudocode example:
      time.sleep(30)   # 30-second gap between readings

    This exact flow is what makes your system fully automatic after manual start, logs real environmental data, and simulates a forest process — ticking every single basic requirement on page 5 of the official brief.

    5 - Practical Building Time

    Follow these stages:

    1. Connect and test each sensor one at a time (print values to screen/serial)
    2. Add data logging (CSV file with timestamp, temperature, moisture, etc.)
    3. Write the simulation logic (e.g., if temperature > 30°C AND moisture < 30% → high risk)
    4. Add your output (buzzer + flashing LED when risk is high)
    5. Test with real changes (blow hot air, wet/dry soil, cover light sensor)
    6. Run for at least 10 minutes and confirm data is being saved correctly

    Save your final code as main.py (or equivalent) in your Artefact folder.

    Unlock the Full Learning Experience

    Get ready to embark on an incredible learning journey! Get access to this lesson and hundreds more in our Digital Skills Curriculum.

    Copyright Notice
    This lesson is copyright of DigitalSkills.org 2017 - 2025. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more