How to order Contact us Distributors Reviews
Register / Login

Select currency

If you'd like to view estimated pricing in other currencies then please select a currency below below.

GBP USD EUR JPY AUD NOK CHF NZD CAD

Please note:

  • Currency conversions are estimates and for information only
  • Your order will be billed in GBP
  • All prices exclude VAT / other local sales taxes
  • Shipping calculated during checkout


Relay for micro:bit

by Monk Makes
An image of Relay for micro:bit An image of Relay for micro:bit An image of Relay for micro:bit

The MonkMakes Relay for micro:bit is a solid-state (no moving parts) relay that allows an output of a micro:bit to turn things on and off.

A micro:bit can turn an LED on and off directly, but anything more powerful requires something like a relay or a transistor. Using a transistor to switch something on and off requires a shared ground connection with the micro:bit and a knowledge electronics that you or your students may not be ready for. The MonkMakes Relay for micro:bit is much easier to use, acting like a simple micro:bit controlled switch.

This relay can be used to switch low voltage devices such as light bulbs, a motor, a small heating element or even a string of 12V LED lighting. The voltage needs to be kept under 16V, but the relay will automatically protect itself against too much current.

FEATURES

  • Solid-sate relay (up to 2 Amps)
  • Active LED indicator
  • Resettable ‘polyfuse’ to protect against over-current
  • Compatible with micro:bit v1 and v2!

Getting Started

Connecting your micro:bit

The Relay requires just two connections to the micro:bit. One to GND (ground) and one to whatever pin is to be used to control the relay’s switching action.

When attaching the alligator clips to the micro:bit, make sure that the clips are perpendicular to the board so that they are not touching any of the neighbouring connectors on the micro:Bit edge connector.

Here’s an example of how you could wire up a MonkMakes Relay for micro:bit to turn an old fashioned light bulb on and off.

HEX File

The quickest way to try out your relay is to DOWNLOAD THIS HEX FILE >and then copy it onto your micro:bit. The program will turn the relay on and off once a second.

JavaScript Blocks Editor

Set the controlling pin to 1 and the relay contacts will close, set it to 0 and the contacts will open again. Its as simple as that. So, to make your relay turn on and off once a second, open the Blocks Editor, add a forever block and then the digital write blocks from the pins category and the pauses from the basic category.

You can also click on the image of the blocks below to open up the Blocks Editor on this project.

MicroPython

Paste the following code into the Python window and then Download the file and copy it onto your your micro:bit.

from microbit import *

while True:
pin0.write_digital(True)
sleep(500)
pin0.write_digital(False)
sleep(500)

Analog Outputs

The latest MonkMakes Relay for micro:bit can do more than just switch things on and off. It can also be used with micro:bit analog outputs. Look closely at your Relay for micro:bit and is it has the version number v1ev (under the word ‘Board’) then it can be used with the ‘analog write’ block in the blocks editor or the ‘write_analog’ function in MicroPython. If your board has the version number v1e then it is not suitable for use with analog outputs – sorry you were unlucky to get one of the small batch of first boards to be sold.

The output of the Relay for micro:bit is not linear at low PWM and high PWM values as the following chart illustrates.

The y-axis shows the current in mA for a test load resistor supplied from a constant voltage source. The x-axis is the analog write value (0 to 1023). As you can see, there is a dead zone up to a analog output value of about 100, followed by a relatively good linear region right up to about 1000, after which the output effectively becomes ‘on’.

The tests were carried out at the default PWM frequency of 50Hz for the micro:bit. Lower frequency PWM is expected to produce more linear results.

Reviews

User photos

The MonkMakes Relay for micro:bit is a solid-state (no moving parts) relay that allows an output of a micro:bit to turn things on and off.

MNK00061

You must register for an account and be logged in to view pricing or place an order on the Pimoroni Wholesale store.

If you represent a school or university, a business, or reseller of Maker products then you can sign up for a wholesale account.

If you already have an account you can login to your account here.

Alternatively the easiest way to get your hands on the products we offer is to order them directly from our customer facing online store.

SKU
MNK00061
EAN
0682698569962
Brand
Monk Makes
Stock available
0 units
Backorder not allowed on this product
Weight
9g

Video introduction

Guides & tutorials

Search

 

Region

Your search returned no results.

Subscribe

We'll keep you up to date with new product launches!

The good ship

We've been sailing the Maker seas offering our wares since 2012.

  • read about our history
  • what our customers say
  • find a local distributor
  • contact our business team

We manufacture all of our products locally at our workshop in Sheffield, UK

Under one roof

Pimoroni are your one-stop shop for bulk and education purchasing of Raspberry Pi, Pimoroni, micro:bit, Adafruit, Sparkfun, and many other brands.

If you have any questions about what we offer then drop us a line.

Pimoroni Ltd

Unit 1, Parkway Business Park,
Parkway Drive,
Sheffield,
S9 4WN,
United Kingdom

Registered in England and Wales:
Company №: 07510759
VAT Reg №: GB 140 8707 21