Home โ€บ Smart Grids & Microgrids
โšก Module 05 ยท Advanced

Smart Grids & Microgrids

What if your whole city was powered by the sun and wind, like a giant, super-smart toy? That's a Smart Grid! ๐Ÿ™๏ธโšก Today, you're going to be the boss of the power company. Let's write the secret rules that tell the electricity where to go, making sure the lights always stay on, even on a cloudy day!

๐Ÿ›ก๏ธ SAFETY CHECK: AI ETHICS AI in conservation is powerful, but we have to be careful. What if an AI misidentifies an animal, causing a false alarm? Or what if location data for a rare animal falls into the wrong hands? Real conservation tech has safeguards to protect this precious data. Always think about how the tools you build can be used safely!
โšก

The Grid Gets a Brain

An old power grid is like a single light switch for the whole city. It's either on or off! ๐Ÿ’ง A Smart Grid is way cooler. It's like having thousands of smart sprinklers that know exactly which gardens are thirsty. It uses sunshine โ˜€๏ธ and wind ๐ŸŒฌ๏ธ to send power where it's needed, and saves the leftovers in giant batteries for later. The "smart" part comes from two things: sensors giving real-time data, and an AI brain making super-fast decisions.

๐ŸŽฎ Your First Command!

It's a bright sunny day and the city needs power! Drag the best power source to the city to keep the lights on!

Okay, you can't *really* drag it, but click the right button to make the right choice!

๐Ÿ›ฐ๏ธ Deep Dive: Your House is Now a Power Plant!

The coolest part of a smart grid is decentralization. Instead of one giant power plant, thousands of homes with solar panels can share energy. Your turn, Grid Boss: What's the biggest advantage of having 1,000 small home batteries instead of one single, giant battery for the whole city?

Reveal a Hint

It's tougher! If the one giant battery fails, the whole city goes dark. But if one home battery goes offline, the other 999 can pick up the slack. This is called resilience! It's a superpower for modern tech.

โญ BEGINNER CHALLENGE

Be the Grid Boss!

It's a windy night and the city needs power! What do you do? Click the best option.

๐Ÿ’ป ADVANCED CHALLENGE

Code the Microgrid Brain

Your mission is to complete the microgrid's AI brain! The code already handles sunny days. You need to add logic for other conditions and prepare for emergencies.

1
Handle Windy Days: Add an elif weather == "windy": block. It should return something like "ACTION: USE wind; CHARGE battery;"
2
Handle Nighttime: Add another elif time_of_day == "night": block. At night, we must use our stored power. The action should be "ACTION: USE battery;".
3
๐Ÿ† Expert Goal: Add Fault Tolerance! Real systems must handle failure. Modify your "nighttime" logic. What if the battery is critically low (e.g., battery_level < 10)? Return a critical alert like "ACTION: CONSERVE POWER; ALERT: Battery critical!"

๐Ÿ’ป Microgrid Control Function

Simulation idle. Set your conditions and write your code!
๐Ÿš€ Bridge to Physical Computing: Real Code

The Python you wrote is a simulation. On a real device like a Raspberry Pi Pico, the code would look like this. Notice how we read from a real sensor instead of just using a variable!

# This is real MicroPython code!
from machine import Pin, ADC
import time

light_sensor = ADC(Pin(26)) # Sensor is on pin 26
led = Pin(15, Pin.OUT)      # LED is on pin 15

while True:
    light_value = light_sensor.read_u16()
    
    # If light value is low, it's "dark"
    if light_value < 10000:
        print("It's dark! Turning on light.")
        led.on()
    else:
        print("It's bright! Turning off light.")
        led.off()
        
    time.sleep(1)
            

This code reads a real photoresistor (light sensor) and turns an LED on or off. You just bridged the gap from simulation to the real world!

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง Parent Corner & Project Hub

Is your teen ready for the next step? The principles of sensors and logic in this module are the foundation of physical computing. An Arduino or Raspberry Pi Pico starter kit is a fantastic, safe (low-voltage) way to experiment with these concepts in the real world. They can build anything from a smart plant-watering system to custom LED animations, turning abstract code into tangible results.

๐Ÿš€ Your First Physical Project: Get an Arduino starter kit and build a "smart light" sensor. Use a photoresistor to measure "sunlight" and write code to turn an LED (your city's light) on when it gets dark. You've just built the core sensor for a real-world smart grid!

๐Ÿ›ก๏ธ Safety Reminder: We only work with safe 5V USB power or AA/AAA batteries in our projects. Always keep the magic safely low-voltage and have a parent supervise when building circuits!

๐Ÿ“š Learn More