Microbit Project: Basketball score counter

1 48180 Easy
projectImage
*Created by Mark Ng
HARDWARE LIST
1 IR sensor
1 micro:bit
1 micro:mate(breakout board)
1 Gravity: Digital Speaker Module
1 Dupont cables
1 Basketball hoop
2 M4 20mm screws with nuts for mounting micro:bit
projectImage

Ā 

How does it work?

Ā 

Distance adjustmentĀ 
Ā 

**CounterclockwiseĀ 

decreases distance

Ā **Clockwise increases distanceĀ 

Ā 

Ā When this IR detects an obstacle within range it will send an output low.Ā 

Move your hand towards the IR LEDs. As you move near them, the IR receiver detects blockage and the obstacle LED will be lighted up.

Ā We are making a basketball score counter. When the loop detects a ball passing through, one count will be added to the score and a melody will be played.Ā 

If you want to reset the score, press button A
Ā 

Connecti

Ā 

ons

Ā 

IR sensor Micro: mateĀ 

GND Pin 1 BlackĀ 

VCC Pin 8 Red(5V)Ā 

OUT Pin 1 BlueĀ 

Ā 

Digital SpeakerĀ 

Black Pin 0Ā BlackĀ 

Red Pin 0 RedĀ 

Green Pin 0 Blue

projectImage

1. I used scraped acrylic and secured it using 2 screws and nuts and drilled 2 5mm holes.

2. Adjust the distance and test the range. Bend the ir at 90 degrees.

3. Slot the IR into the 2 holes (side view).

4. The back view of the IR sensor.

projectImage

The M4 screws are used to replace the existing screws used in the micro: mate. As the screws are longer, we can mount the micro: bit and micro: mate onto the board.

The code

projectImage

Even though the specifications state that it can operate from 3v to 5v, you will find that the 3v from the micro: bit will not be able to drive this IR sensor.

After programming, remember to connect the micro USB connector to Vin of the micro: mate and switch the selector switch to 5V.

.

License
All Rights
Reserved
licensBg
1