İçeriğe Geç

Projeler

#23 Trash Tech Project With micro:bit

Tarafından 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

Önceki Gönderi
Sıradaki Gönderi

Abone olduğun için teşekkürler!

Bu e-posta kaydedildi!

Görünümü satın alın
Seçenekleri Seçin

Picobricks
Özel güncellemeler için kaydolun, yeni gelenler ve yalnızca içeriden öğrenenler için indirimler

Seçeneği Düzenle

Stok Bildirimi

Karşılaştır

Ürün Stok KoduDeğerlendirmeAçıklama Kategori Uygunluk Ürün Tipi Diğer Detaylar
this is just a warning
Giriş Yap
Alışveriş Sepeti
0 Ürünler
Same Day Shipping No Extra Costs
Easy Returns Guarantee Return with Ease
Secure Checkout Secure Payment