1 of 32

CODE FOR CLIMATE

2 of 32

Introduction - climate tech

Discussion

What environmental or energy issues concern you the most?

Do you have any ideas or solutions?

How can computational thinking help solve problems?

3 of 32

Conservation through automation

4 of 32

Introducing Micro:bits

5 of 32

Computational thinking - Inputs & outputs

6 of 32

What can a Micro:bit do?

What can a Micro:bit sense? (INPUT)

How can a Micro:bit respond? (OUTPUT)

  • Buttons pressed
  • Shake
  • Pin (conductivity)
  • Light level
  • Compass heading
  • Temperature
  • Humidity
  • Acceleration
  • Bluetooth
  • V2 (Sound level & Logo pressed)
  • Light LEDs
    • Words, symbols, graph, arrow
  • Pin (conductivity)
    • Stop/start various attachments (lights, water pump, motor)
  • Bluetooth
  • Sounds/music (w speaker or V2)

BRAINSTORM!

What could you build to increase efficiency through automation?

7 of 32

Advanced Agriculture

8 of 32

Automated Farming

Benefits of these technologies:

  • Make it easier to grow plants without soil
  • Indoor farming utilizes less water w “mist”
  • Not weather dependent - can grow all year
  • Less need for natural sunlight
  • Soil erosion and nutrient runoff is eliminated
  • Controlled environment eliminates the need for pesticides which hurt our pollinators

There are 3 main indoor farming technologies

  1. Hydroponics
  2. Aquaponics
  3. Aeroponics

9 of 32

Open Make Code

Let’s Code → MakeCode editor → New Project → Name → Create

10 of 32

Code your Micro:bit

11 of 32

Download/pair

As your program downloads, the yellow light flashes. When it’s solid, your code will run.

STEPS:

  1. Plug in Micro:bit
  2. Click
    1. download
    2. pair now
    3. next
    4. next
    5. Select your device
    6. connect
    7. done
  3. Click download

12 of 32

Download/pair (the old way)

As your program downloads, the yellow light flashes. When it’s solid, your code will run.

Download directly to the micro:bit or drag it over.

1

2

3

Show in folder

(on a PC you can download directly)

13 of 32

+ Extensions → Search “CLIMATE” → Land Action → Voilà!

Add InskSmith Blocks

14 of 32

Once you have this done, download it to your Micro:bit!

Code water pump w button A

15 of 32

Explanation of code: When button A is pressed, the umbrella will be displayed for 4 seconds while the pump is on. The screen will clear when the pump turns off.

The show icon block will help to troubleshoot - if the pump doesn’t turn on when the button is pressed, but the icon appears, we can at least confirm that the code inside the button A block is being executed.

Code water pump w button A

16 of 32

Plug in here

Switch on

Build your system

Put your Micro:bit in the base facing this way

17 of 32

Add enough water in the cup to cover the pump

Make sure the tube is IN the cup!

18 of 32

Double-check wiring!

(0)

This is very important!

Does it work?

Good - now build the rest!

19 of 32

20 of 32

Code automated water pump

21 of 32

Once you have this done, download it to your Micro:bit

22 of 32

Download & test

TIPS:

  • Try it first with the water sensor on the table
  • Does it work?
  • Try putting the water sensor in the water
  • Does it work?

23 of 32

24 of 32

Debugging

It doesn't work!

  • A Micro;bit is only as good as the code! Go through it carefully and even restart from scratch if you have to.
  • Think like a machine. Take it one step at a time and test out each step separately as you go
  • Collaboration is key! Ask a classmate for help.
  • When it doubt, look it up online!

25 of 32

Need more help?

Enrolment codes are found inside the kits

26 of 32

Extension - Solar power!

Did you know?

  • You can make any Micro:bit solar powered!
  • Solar energy is a renewable and sustainable resource!

Can you think of any other solar powered devices?

27 of 32

Alternative Version

Find this version on the BGSD Micro:bit site under Science 7

28 of 32

Reflection

BGSD Students got to talk to astronaut David Saint Jacques LIVE from the ISS thanks to coding with LTS Living Space!

  • Why is it important to utilize automation?
  • How does this help us reduce energy use?
  • If you could build ANYTHING to help with energy or the environment, what would it be?

29 of 32

30 of 32

31 of 32

Double-check wiring!

(0)

This is very important!

The Final Code

32 of 32

Prizes!