Search/

Request a free quote

Downloads

micro:bit setup for the bench link

We typically respond within one business day.

A BBC micro:bit V2 with the Dreiym firmware gives the simulator three inputs on its large pads, so crocodile clips are enough to start. With an edge connector breakout it also has one DC output and two relay outputs.

Safety first

Low voltage only: batteries or a bench supply of 12 V or less. Never connect anything from these guides to mains (wall outlet) wiring, or to equipment that anyone depends on for safety.

  • These pins take 0 to 3.3 V and are not 5 V tolerant. A higher voltage on a pin can destroy the board.
  • For anything above the pin voltage, use a divider, and check its output with a meter before you connect the board.
  • Join the board ground to the circuit ground first, then connect the inputs.
  • Relay modules: low voltage loads only, within the rating printed on the module.
  • Unplug the USB cable before you change the wiring.

Parts

  • A BBC micro:bit V2 (it has a speaker and a touch logo; the V1 has too little memory for this program)
  • A USB cable that carries data
  • Crocodile clip leads
  • A multimeter
  • For the output and the relays: an edge connector breakout board for the micro:bit, a breadboard, a 10 kΩ resistor and a 10 µF capacitor
  • For each input above 3.3 V: a 30 kΩ and a 10 kΩ resistor

Load the program

  1. Download main.py from this page.
  2. Open the micro:bit Python® Editor at python.microbit.org in Chrome or Edge, choose Open and pick main.py.
  3. Connect the micro:bit with the USB cable, choose Send to micro:bit and follow the steps on the screen.
  4. When the program runs, the display shows the letter D.
  5. Close the editor tab before you connect from the simulator, so the simulator can use the port.

Without the editor connection: choose Save in the editor to get a .hex file, then copy it onto the MICROBIT drive.

To skip the program, hold button A while the micro:bit starts. The display shows a dash.

  • main.py 18 KB

    micro:bit V2 firmware (MicroPython for micro:bit). Open it in the micro:bit Python® Editor.

    SHA-256 8b9d23ed0fe02dda38f0ebca286c2cfd05bd813faf520594b4c6f63ef7b7bf50

Wiring

  • Input IN0: pad 0
  • Input IN1: pad 1
  • Input IN2: pad 2
  • GND pad: joined to the circuit ground
  • PWM output: pin 8 on the edge connector
  • Relay K1: pin 12. Relay K2: pin 16 (edge connector)
  • Self test: a jumper from the output point (top of the 10 µF capacitor) to pad 0

The output is a PWM pin turned into a steady voltage by a 10 kΩ resistor and a 10 µF capacitor: pin, then the resistor, then the capacitor to ground. The output point is the top of the capacitor. It gives a DC level only and can supply very little current.

The inputs read relative to the micro:bit supply. On USB power that is about 3.3 V; on batteries it is lower, so calibrate again when you change the supply.

Do not use the 3V pad to power other circuits from these guides: keep the micro:bit and the circuit on separate supplies with the grounds joined.

Measuring more than the pin voltage: a divider

  1. Use two resistors: 30 kΩ from the circuit point to the input pin, and 10 kΩ from the input pin to ground. The pin then sees one quarter of the voltage.
  2. With 30 kΩ and 10 kΩ, up to 12 V at the circuit point gives up to 3 V at the pin.
  3. Before you connect the pin, measure the middle point with a meter at the highest voltage your circuit makes. It must stay below the pin limit.
  4. In the Bench panel, type 4 in the Divider box of that input, so the readings show the voltage at the circuit point.
  5. Keep the circuit itself at 12 V or less, divider or not.

Connect from the circuit simulator

  1. Open the circuit simulator in Chrome, Edge or Firefox on a computer.
  2. Build or open your circuit and run the simulation.
  3. Open Bench, read the safety note and tick the box.
  4. Choose USB cable, then pick the board in the list the browser shows.
  5. For each input, choose the point of the circuit it measures and, if you use a divider, its ratio. If the simulation expects more than the input can read, the panel says so before you wire it.
  6. Calibrate each input once: ground first, then a steady voltage you have measured with a meter.
  7. The Live tab shows measured and simulated values side by side, with the difference.

If it does not connect

  • The board is not in the list: try another USB cable (some carry power only) and another USB port.
  • Only one program can use the port at a time. Close Thonny, the Arduino Serial Monitor or the micro:bit editor tab first.
  • The device did not answer: unplug it, plug it back in and connect again. Check that the Dreiym program is on the board.
  • Safari cannot open USB serial devices. Use Chrome, Edge or Firefox, or the PC bridge with its serial plugin.

More bench guides

Get your project started

We typically respond within one business day.

Request a free quoteor call (866) 621-6920

Newsletter

Engineering notes from Dreiym

New articles on power systems, corrosion and forensic engineering, by email when we publish. Free account included: keep your calculator work, reports and exports in one place.

Latest article: DC Arc Flash in Battery, UPS and PV Systems: How the Hazard Is Assessed

One email per new article. Unsubscribe in one click.

You are subscribed: new articles come to you by email.

Manage in My account