Home โ€บ Module 1
โšก Module 01 ยท Intermediate

Smart Grid & IoT

โœจ PAN'S RULE: If it's not chaotic, it's not magic! โœจ

What if your night light could send you a secret message when it turns on? That's the first step to building a Smart Grid! We'll learn how everyday things can talk to the internet, and why that's so cool for our planet.

โš ๏ธ SAFETY DIRECTIVE: We only work with safe 5V USB power or AA/AAA batteries. NEVER plug homemade electronics into a wall outlet or mess with mains electricity. Keep the magic safely low-voltage!
๐Ÿ’ก

Smart Grid IoT Sensors Overview

Have you ever wondered how the power company knows when the electricity goes out at your house? They use a Smart Grid! A Smart Grid uses IoT (Internet of Things) Sensors to send information over the internet.

๐Ÿ’ก Pan's Pro Tip!

"IoT" just means regular objects (like a lightbulb or a thermometer) that are connected to the WiFi! If it can talk to the internet, it's an IoT device.

Why do we need Smart Grids? โšก

Old power grids just sent electricity one way: from the power plant to your house. A Smart Grid talks back! If a tree falls on a power line, the sensors instantly text the power company and say, "Help! No power here!" It saves tons of time. This two-way communication is called 'bi-directional flow', and it's what makes the grid 'smart'. Plus, by understanding exactly where power is needed, a smart grid helps us use renewable energy like solar and wind power more efficiently, which is great for the planet! ๐ŸŒ

Old Grid vs. Smart Grid โšก

Click the broken power line in each city to see what happens!

Oldsville

Tomorrow Town

Quick Quiz! ๐Ÿง 

What does "IoT" stand for?

Internet of Trees
Internet of Things
Internal Operating Thermostat

Challenge: Build a 'Power On' Sensor!

Time to stop talking and start building! Let's make a simple sensor that sends a signal, just like a real smart grid device.

What You'll Need:

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง Parent Corner

No micro:bit at home? No problem! The MakeCode editor has a fantastic free simulator, so your child can build and test their code right in the browser. If you decide to buy one, a "micro:bit Go" kit is a great starting point and is available from stores like Adafruit or SparkFun.

The Goal:

We'll use a micro:bit to create a simple sensor. When you press a button (simulating power turning on), it will display an icon to show a "power on" signal!

Let's Build!

  1. Open the micro:bit MakeCode Editor in a new tab. It's a colorful drag-and-drop code editor.
  2. In the Input block category (it's pink!), find the `on button A pressed` block and drag it into your workspace.
  3. Go to the Basic category (blue) and find the `show icon` block.
  4. Drag the `show icon` block and drop it right inside the `on button A pressed` block. It should snap into place!
  5. Click the little heart on the `show icon` block and change it to something that looks like power... maybe a checkmark or a diamond!
  6. Test it! On the left side of the screen, you'll see a virtual micro:bit. Click the 'A' button on it. Did your icon appear? You just built a sensor! Awesome job!

๐Ÿš€ Level Up: Make it a REAL IoT Sensor

Ready for a real challenge? Let's send your sensor data to the cloud! This requires a WiFi-enabled board like a Raspberry Pi Pico W or an ESP32. We can use a free service called Adafruit IO to create a dashboard that shows when your sensor is on or off, from anywhere in the world.

Your Mission:

  1. Set up a free Adafruit IO account (with a parent's help!).
  2. Create a new "Feed" called 'power-status'.
  3. Use this MicroPython code snippet on your Pico W to send a '1' to your feed when you press the onboard button.
# IMPORTANT: Ask a parent to help you with this part!
# Replace the placeholders with your real WiFi
# and Adafruit IO details.

# 1. Your WiFi Network
WIFI_SSID = "Your WiFi Name"
WIFI_PASS = "Your WiFi Password"

# 2. Your Adafruit IO Details
AIO_USER = "Your_AIO_Username"
AIO_KEY = "Your_AIO_Key"
AIO_POWER_FEED = "Your_AIO_Username/feeds/power-status"

# (The rest of the code to connect and send data would go here!)
# This is a peek at how real IoT engineers talk to the internet!
          

๐Ÿ›ก๏ธ Safety Check: Getting a device online involves WiFi passwords. Always work with a parent on this step to keep your home network secure. Never share your passwords or API keys online!

๐Ÿ“š Learn More

โ† Previous