Log In

Machine Learning in Python With Raspberry Pi & Sensors (Level 1)

AI Code Academy
Average rating:
Number of reviews:
In this 10-lesson course, students will write Python programs and create machine learning projects that interact with various electronic modules connected to the Raspberry Pi such as LEDs, IR sensors, servos, and more.

Class Experience

10 lessons//10 Weeks
 Week 1
Lesson 1
Setup and Software
The first lesson is dedicated to ensuring all students have set up their Raspberry Pi OS properly, connecting using VNC, and introducing the desktop, command line, and common applications. Task: Set up and connect to Pi Finish any set-up steps that could not be completed before class and introduce Raspberry Pi. Ensure students can connect to the Raspberry Pi using VNC without issue. Introduce Linux command line basics and the Thonny Python IDE.
 Week 2
Lesson 2
Hardware and Circuit Basics
Students will test the Raspberry Pi GPIO pins, identify all components necessary for this course, and learn the basics of electricity and safe circuit construction. Task: Identify components and learn electronics concepts Ensure students can locate all necessary parts and that GPIO pins are functional before beginning circuit construction lessons. Provide students with an understanding of circuits and electricity with a combination of lesson instruction and short informational videos.
 Week 3
Lesson 3
LED Blink Project
Designed to act as a starter project to introduce proper use of the breadboard, basic hardware components, and programming on the Raspberry Pi. Task: LED Blink Project Students will follow along to construct their first circuit and write python code that turns an LED on and off in a loop.
 Week 4
Lesson 4
Machine Learning
Students learn the basics of machine learning and create their own machine learning models that will predict whether the sentiment of some text is happy or sad. The prediction from this model will be used to control the LED circuit. Task: Machine Learning Setup Students log in to aicode101.com to create their first model, using Python's requests module to interact with the site's API for predictions, and modify the LED_blink code to control the LED based on these predictions.
 Week 5
Lesson 5
Students learn about the active and passive buzzer components and control them using python code. Task: Play a Song The active buzzer circuit is constructed and controlled by reusing some code used to turn on the LED. Then students write code to control the passive buzzer circuit using PWM which enables us to play different songs. Students can add their own song and play it on the buzzer circuit.
 Week 6
Lesson 6
Pulse Width Modulation is discussed in more detail, and students learn the difference between digital and analog signals. Task: Dimmable LED Students write code to brighten and dim an LED in a loop by using PWM.
 Week 7
Lesson 7
Students are introduced to servos and learn their functionality and uses, as well as the differences between servos and motors. Task: Servo Project Students assemble the servo circuit and write code to rotate the servo clockwise and counter-clockwise in a loop using PWM.
 Week 8
Lesson 8
Infrared Motion Sensor
Students are introduced to the infrared sensor and learn how infrared wavelengths can be used in various applications. Students begin using input and output devices in the same project. Task: Motion Detector Project Students assemble the motion detector circuit using the IR sensor and LED and write code that will turn the LED on when motion is detected.
 Week 9
Lesson 9
Ultrasonic Ranging
Students learn the functionality of the ultrasonic sensor and how to use the return time of a sound wave to calculate the distance to a nearby object. Task: Ultrasonic Alarm Students assemble the ultrasonic sensor circuit and write code to get the distance to the nearest object. A buzzer is used to play a tone with a frequency that changes with distance.
 Week 10
Lesson 10
Hygrothermograph with Machine Learning
Students are introduced to the hygrothermograph sensor and begin to see how machine learning can be used to solve real world problems by understanding patterns in data. Task: Hygrothermograph Prediction Project Students create the hygrothermograph circuit, and write python code to get humidity and temperature data. Then, using data collected from the sensor, they create a machine learning model which can predict the sensor’s environment and test it using ice or steam.
  • Students in our Raspberry Pi course delve into computing, mastering Python for controlling electronic modules and exploring machine learning applications across eight guided projects.
  • From setting up the Raspberry Pi to crafting circuits and programming in Python, they create smart electronic systems integrating machine learning models with input and output devices like LEDs, IR sensors, and servos.
2 - 4 hours per week outside of class
Frequency: 1-2 throughout the class
Feedback: available upon request
Details: Projects are not mandatory but we strongly encourage students to complete them
Frequency: available upon request
 1 file available upon enrollment
Prerequisites: Python experience (10 hours at least) required Materials: students need to purchase the following items: 1, Raspberry Pi Kit from: https://a.co/d/fHRuqCH or https://www.canakit.com/raspberry-pi-4-extreme-aluminum-case-kit.html 2, AICode101 Starter Toolbox for Raspberry Pi 4 B 3 B+ ($59) https://www.illum.ai/products/aicode101-starter-toolbox-for-raspberry-pi.html 3, If your computer doesn't have a SDHC card port, you also need to purchase an adapter https://www.amazon.com/Vanja-Adapter-Portable-Memory-Reader/dp/B00W02VHM6
Dear Parents,

Thank you for your interest in our Machine Learning in Python With Raspberry Pi & Sensors program. In this online live course, students will program in Python to control various electronic modules that connect to Raspberry Pi including LEDs,  buzzers, servos, ultrasonic sensors, IR sensors, and more using machine learning models. This program is for intermediate to advanced students who had at least 10 hours of Python experience and are new to programming on the Raspberry Pi. This class requires a lot of hands-on experience, and can be quite challenge to some young students. It may also require some involvement from parents, particularly when setting up the Raspberry Pi operating system. Some students are able to complete the setup independently, while others may need assistance with these steps. Please communicate with your learner before enrolling in this class. To prepare, please purchase the hardware listed in the Materials section and Learner Supply List one week before the first class to allow time for shipping. 

For our lessons, students will need to install our prepared Raspberry Pi OS image which has been specifically configured for our courses. It contains the necessary files and settings, and has been tested thoroughly with every lesson to ensure everyone can be successful with the projects. Our environment also features a new simplified headless setup method which allows you to enter WiFi settings directly on your Raspberry Pi from any device. We require students to use VNC Viewer to access the Raspberry Pi desktop so that instructors are able to assist with programming. If students prefer to use a separate monitor and keyboard, they may do so in addition to connecting through VNC. To get started, please watch the setup video. 

All required software is available on Windows or Mac - No Chromebooks. Please see technical requirements in Sources for more details.

Important notes:
As per Outschool Policy: For the safety of all students, all cameras must be on during the entire class duration, or at least for the first few minutes of the class session in certain circumstances. Please mute your audio (keep video enabled) during the class session.

For those that have never used Outschool before, please follow this link for some awesome preparation before our first class:
To join the class, please login to your Outschool account and click the scheduled session to get into the classroom, where you click “Join live meeting” to join the zoom classroom. There is no zoom link needed.

If you have any questions/concerns please feel free to reach out through us on Outschool. We are beyond excited to have this opportunity to go on this amazing coding adventure with you all. Please come prepared and ready to learn for our first class, see you soon!

Best regards,
AI Code Academy
Technical Requirements:

PC (Windows 10) or Mac (macOS 10.13)  with at least a 2GHz processor and 2GB of RAM (4GB of RAM is recommended).

No Chromebooks!!!

Broadband internet with at least 1.8Mbps download and 900Kbps upload speeds. Please make sure to remove your firewall if any

Webcam - Either external or built-in (many laptops have an integrated camera).

Microphone and Speakers - We recommend headphones with an integrated microphone 
Joined April, 2020
Teacher expertise and credentials
Project-based, STEM Coding + AI Programs + Mathematics

Early registration, Sibling and Multi-Course Bundle discounts Available!

The list of our summer camps can be found in this file:... 
Group Class


for 10 classes
1x per week, 10 weeks
60 min

Completed by 163 learners
Live video meetings
Ages: 11-16
5-8 learners per class

SafetyPrivacyCA PrivacyLearner PrivacyTerms
Get The App
Download on the App StoreGet it on Google Play
© 2024 Outschool