Zum Inhalt springen

Projekte

#23 Trash Tech Project With micro:bit

von 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

Vorheriger Beitrag
Nächster Beitrag

Danke fürs Abonnieren!

Diese E-Mail wurde registriert!

Shoppen Sie den Look
Wählen Sie Optionen

Picobricks
Melden Sie sich für exklusive Updates an, Neuankömmlinge und Insider-Rabatte

Bearbeitungsoption

Benachrichtigung wieder auf Lager

Vergleichen

Produkt ArtikelnummerBewertungBeschreibung Sammlung Verfügbarkeit Produktart Andere Details
this is just a warning
Anmeldung
Einkaufswagen
0 Artikel
Same Day Shipping No Extra Costs
Easy Returns Guarantee Return with Ease
Secure Checkout Secure Payment