Relay module with TinkerPie
A switch the board controls. For active-low modules, on = false.
| Type | Outputs and actuators |
|---|---|
| Connect to | any accessory pin |
| Gives | switches a lamp, fan or pump |
| Simulator | Yes: a control appears under the simulated board |
How it works
A relay is a switch moved by an electromagnet. The small signal from the board energises the coil, which pulls a metal contact and switches a separate circuit, such as a pump or a fan. The two circuits stay electrically apart.
How to wire it
Signal pin to S1-S4 or P10-P13. Motors, pumps and lamps always go through the relay or a driver module, never straight to a pin.
Code
In blocks: Accessories category in TinkerPie Studio. As code:
// JavaScript
outputs.relay(Pin.S1, true)
// Arduino C++
outputs::relay(Pin::S1, true) Good to know
- Many modules are "active low": they switch on when the pin is off (false).
- You can hear a click when it switches.
- In TinkerPie projects, use relays only with low-voltage batteries and USB devices, never mains (230 V).
Projects with the Relay module
Similar modules
- LED module
- Traffic light module
- Laser module
- Active buzzer module
- DC fan / motor module (with transistor)
- 16-channel servo driver PCA9685
More projects to try
Questions
Can I try the Relay module without buying one?
Yes. In TinkerPie Studio the simulator shows a control for it under the board, so you can test your program before you build it.
Can I switch a home lamp with the relay?
Not in our projects. Mains electricity (230 V) is dangerous. Use the relay with low-voltage pumps, fans and LED strips, and let qualified adults handle mains wiring.