Skip to content

Projects

#23 Trash Tech Project With micro:bit

by PicoBricks Team 13 Jun 2025

The Trash Tech Kit is an educational robotics programming kit designed to gain environmental awareness in children.

The Trash Tech is a fun kit that allows you to assemble the wooden pieces, sensors, and PicoBricks modules included in the set as specified in the installation guide. The goal of the project is to create an electronic trash bin that opens its lid by detecting objects using the HC-SR04 distance sensor located at its front.

In this project, we detect the distance of our hand using the HCSR04 distance sensor and move the servo motor connected to the motor driver to the desired angle. This way, the lid of the trash bin opens.

Connection Diagram:

You can prepare this project by breaking the PicoBricks modules at suitable points.



Project Images:


Setup Steps of The Project


MakeCode Code of The Project


Python Code of The Project:

#Trash Tech Project
from microbit import *
from picobricks import *

# Function Initialization
motor = motordriver()

display.show(Image.HAPPY)
while True:
    distance = measure_distance()
    if distance<9 and distance>1:
        display.show(Image.YES)
        motor.servo(1,90)
        sleep(2000)
        motor.servo(1,180)
        sleep(200)
    else:
        motor.servo(1,180)
        display.show(Image.HAPPY)
    sleep(200)

MicroBlocks Code of The Project

Prev Post
Next Post

Thanks for subscribing!

This email has been registered!

Shop the look
Choose Options

Picobricks
Sign Up for exclusive updates, new arrivals & insider only discounts

Edit Option

Back In Stock Notification

Compare

Product SKURatingDescription Collection Availability Product Type Other Details
this is just a warning
Login
Shopping Cart
0 items
Same Day Shipping No Extra Costs
Easy Returns Guarantee Return with Ease
Secure Checkout Secure Payment