Probably other and better options out there, but since I could not find them in time for my recent grateful task of sorting through a school’s box of classroom-battered micro:bits, I am happy to share my own little hardware test suite used for this job:
It features 11 different hardware tests for frequently used inputs and outputs on the micro:bit.
Tested mainly on the micro:bit V1, but should also work on the V2, albeit lacking tests for the new microphone, touch logo and capacative touch on the V2.
To open the test programs directly in the editor, copy and paste the following link into your browser’s address bar:
https://makecode.microbit.org/---multi#pub:https://github.com/Vegz78/microbit_test_testunit:|:pub:https://github.com/Vegz78/microbit_test_receiver
Instructions
Requires one or more micro:bits to be tested (“test unit”) in conjunction with one single (“receiver”) for testing radio bidirectionally and displaying measurements from the test unit’s LEDs when tested as light sensors.
The number of the LED always lit on the test unit’s dipslay, corresponds to the numbered test in the list below.
To move up between tests, hold down the A button on the test unit micro:bit and push the B button, and vice versa to move down. You can jump directly to test 11 from 1 by going up and vice versa.
NB!: Simultaneous pushing of buttons in the MakeCode editor’s simulator does not work yet. Therefore, to cycle between the various tests in the simulator, instead manually change the variable testNumber
to a number between 0 and 10.
The 11 various tests
- Buttons: The test unit displays arrows when buttons are pressed (A button = left arrow, B button = right arrow, A+B buttons = up arrow)
- Display: Cycles between lighting all LED in the test unit’s display, and showing the test number (2)
- Radio: Pushing the A or B button on the test unit transmits and shows an OK symbol on the receiver’s display, while pushing the A or B button on the receiver transmits and shows an OK symbol on the test unit’s display
- Light sensors: The receiver displays the intensity of the light measured from the test unit’s LEDs
- Compass: The test unit displays the points measured by the compass, after first asking for calibration. If the compass has been calibrated already, press the B button to cancel calibration. If not, calibration starts regardless, or press the A button to force calibration
- Accelerometer: The test unit displays arrows corresponding to the direction of its tilt, as well as an OK symbol when shaking or applying G forces
- Thermometer: The test unit displays measured temperatures as a scale of 0 to 25 LEDs lit, corresponding to an intervall between 15 and 40 degress celsius
- Pins 0-2: The test unit displays the number of the pin chosen resistively (e.g. keep your right finger on the GND whilie selecting pin 0, 1 and 2 with your left finger)
- Audio out: The test unit plays audio (requires a speaker, preferably an active speaker, connected between pin 0 and GND)
- Analog input signal: The test unit displays applied voltage over pins 0, 1 or 2 (+) and GND (-) of between 0 and 3V as a scale of 0 to 25 LEDs lit (e.g. a 1.5V battery or directly fromo the 3V pin)
- Anolog output signal: The test unit applies voltage to pins 0, 1 and 2, which can be verified for instance by connecting a LED or multimeter between any of these pins (+) and GND (-)
Other useful resources when testing
- Overview of the various error codes:
- How to sometimes fix the dreaded Maintenance Mode (e.g. re-flashing firmware):