๐ Comprehensive educational resources for teaching and learning MicroPython and physical computing
๐ View Documentation Website โ
This book contains comprehensive educational resources for learning MicroPython and physical computing with microcontrollers. Designed for students aged 10-18 but suitable for all ages, it provides hands-on programming experiences with real hardware including the Raspberry Pi Pico, the Raspberry Pi Pico W (wireless), the ESP32, sensors, displays, motors, and more.
- ๐ Progressive Learning Path: 9 structured sections from basics to advanced robotics
- ๐ง Hardware-First Approach: All examples tested on real microcontrollers
- ๐ Educational Focus: Extensively documented with troubleshooting guides
- ๐ค AI-Enhanced Learning: Integrated AI prompts for concept explanation
- ๐ Open Source: Free educational resources under Creative Commons license
- Visit the documentation: dmccreary.github.io/learning-micropython
- Get hardware: Raspberry Pi Pico ($4) + breadboard + sensors
- Install Thonny IDE: Free Python development environment
- Start with basics: LED blink, buttons, sensors
- Build progressively: Work through sensors, displays, motors, robots
# Clone the repository
git clone https://github.com/dmccreary/learning-micropython.git
cd learning-micropython
# Install dependencies
pip install -r requirements.txt
# Serve documentation locally
mkdocs serve
# Deploy hardware examples using rshell
./src/unix-scripts/load-libs.sh| Section | Topics | Hardware |
|---|---|---|
| ๐ฐ Introduction | Physical computing, microcontroller basics | - |
| ๐ ๏ธ Getting Started | Board setup, IDE configuration, breadboards | Pico, ESP32 |
| โก Basic Examples | Blink, buttons, potentiometers, PWM | LEDs, switches, motors |
| ๐ Sensors | Temperature, distance, light, gesture, compass | DHT11, HC-SR04, APDS9960 |
| ๐ง Motors & Servos | DC motors, H-bridges, stepper motors, servos | L293D, DRV8833, SG90 |
| ๐บ Displays | OLED, LCD, LED matrices, 7-segment | SSD1306, SH1106, MAX7219 |
| ๐ Sound & Music | Audio generation, music playback, I2S | Buzzers, speakers, DAC |
| ๐ก Wireless | WiFi connectivity, web servers, IoT | ESP32, Pico W |
| ๐ Advanced Labs | Interrupts, multi-core, memory, debugging | - |
- Raspberry Pi Pico/Pico W ($4, 264KB RAM)
- ESP32 (WiFi-enabled alternative)
- Cytron Maker Pi RP2040 ($11, educational board)
- Sensors: Temperature, humidity, distance, light, gesture, compass
- Displays: OLED (I2C/SPI), LCD, LED matrices, 7-segment
- Motors: DC motors, servos, steppers with various drivers
- Audio: Buzzers, speakers, I2S audio devices
- LEDs: NeoPixel strips, matrices, individual LEDs
learning-micropython/
โโโ docs/ # MkDocs documentation source
โ โโโ basics/ # Basic programming examples
โ โโโ sensors/ # Sensor integration guides
โ โโโ displays/ # Display programming
โ โโโ motors/ # Motor control
โ โโโ sound/ # Audio and music
โ โโโ wireless/ # Network programming
โ โโโ advanced-labs/ # Advanced topics
โโโ src/ # MicroPython source code
โ โโโ drivers/ # Hardware driver libraries
โ โโโ sensors/ # Sensor example code
โ โโโ displays/ # Display demos
โ โโโ motors/ # Motor control examples
โ โโโ neopixels/ # LED pattern generators
โ โโโ sound/ # Audio examples
โ โโโ kits/ # Educational kit projects
โโโ requirements.txt # Development dependencies
- ๐ค Maker Pi RP2040 Robot: Complete robot development platform
- ๐ NeoPixel Projects: LED programming and pattern generation
- ๐ต Spectrum Analyzer: Real-time audio visualization
- ๐ป RFID Access Control: Security system projects
- ๐ฎ Game Projects: OLED-based games like Pong
# Serve locally for development
mkdocs serve
# Build static site
mkdocs build
# Deploy to GitHub Pages
mkdocs gh-deploy# Copy driver libraries to Pico
rshell -p /dev/ttyACM0 cp src/drivers/*.py /pico/lib/
# Interactive shell with Pico
rshell -p /dev/ttyACM0
# Alternative: Use mpremote
mpremote connect /dev/ttyACM0 fs lsWe welcome contributions! This project serves students and educators worldwide.
- Fork the repository
- Create a feature branch
- Add educational content (include wiring diagrams and comments)
- Test on real hardware
- Submit a pull request
- All hardware examples must include circuit diagrams
- Code should be extensively commented for educational purposes
- Include troubleshooting sections for common issues
- Progress from simple to complex examples
- Test on actual hardware before submitting
This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
You are free to:
- โ Share โ copy and redistribute the material
- โ Adapt โ remix, transform, and build upon the material
Under these terms:
- ๐ท๏ธ Attribution โ Give appropriate credit and link to license
- ๐ซ NonCommercial โ Not for commercial use
- ๐ ShareAlike โ Distribute contributions under same license
This project builds upon the incredible work of the open source community. We gratefully acknowledge:
- MicroPython - Python for microcontrollers
- MkDocs - Documentation site generator
- Material for MkDocs - Documentation theme
- rshell - MicroPython remote shell
- pyserial - Serial communication
- numpy - Numerical computing
- plotly - Interactive visualization
- SSD1306 OLED Driver - OLED display support
- VL53L0X Time-of-Flight - Distance sensor
- APDS9960 Gesture Sensor - Gesture detection
- HMC5883L Compass - Magnetic compass
- I2S Audio Examples - Audio processing
- NeoPixel Libraries - LED strip control
- vis-network - Interactive network graphs
- PyMdown Extensions - Enhanced markdown
- Jim Tannenbaum - BIPES block programming integration
- Valerie Lockhart - MicroSims inspiration and support
- Carl Boudreau - Rural education outreach
- Arun Batchu - AI integration guidance
- ๐ง Author: Dan McCreary
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ Documentation: learning-micropython.com
If this project helps you teach or learn MicroPython, please consider:
- โญ Starring this repository
- ๐ด Forking and contributing
- ๐ข Sharing with educators and students
- ๐ก Submitting new project ideas
๐ฏ Mission: Making physical computing and robotics accessible to students and educators worldwide through comprehensive, hands-on MicroPython education.