Please enter the email address you used on Kickstarter:


MicroView Learning Kit

10 Relays

Introduction

A relay is basically an electrically controlled mechanical switch. Inside that harmless looking plastic box is an electromagnet that, when it gets a jolt of energy, causes a switch to trip. In this circuit, you’ll learn how to control a relay like a pro – giving your MicroView even more powerful abilities!

Parts

Component Reference Image
330Ω Resistor 330Ω Resistor Diagram
330Ω Resistor 330Ω Resistor Diagram
Diode Diode Diagram
Transistor Transistor Diagram
Relay Relay Diagram
Yellow LED (5mm) Yellow LED (5mm) Diagram
Red LED (5mm) Red LED (5mm) Diagram
Blue Jumper Blue Jumper Diagram
Purple Jumper Purple Jumper Diagram
Black Jumper Black Jumper Diagram
Red Jumper Red Jumper Diagram
Red Jumper Red Jumper Diagram
Red Jumper Red Jumper Diagram
Yellow Jumper Yellow Jumper Diagram
Yellow Jumper Yellow Jumper Diagram
Yellow Jumper Yellow Jumper Diagram
Yellow Jumper Yellow Jumper Diagram
Yellow Jumper Yellow Jumper Diagram

Checkout our breadboard guide and MicroView Pinout for more information.

Breadboard Setup

MicroView Arduino Code

What you should see

You should be able to hear the relay contacts click, and see the two LEDs alternate illuminating at 1-second intervals. If you don't, double-check that you have assembled the circuit correctly, and uploaded the correct sketch to the MicroView. Also, see the troubleshooting tips below.

Code to Note

When we turn on the transistor, which in turn energizes the relay's coil, the relay's switch contacts are closed. This connects the relay's COM pin to the NO (Normally Open) pin. Whatever you've connected using these pins will turn on. (Here we're using LEDs, but this could be almost anything.)

digitalWrite(relayPin, HIGH);

The relay has an additional contact called NC (Normally Closed). The NC pin is connected to the COM pin when the relay is OFF. You can use either pin depending on whether something should be normally on or normally off. You can also use both pins to alternate power to two devices, much like railroad crossing warning lights.

digitalWrite(relayPin, LOW);

Troubleshooting

LEDs Not Lighting

Double-check that you've plugged them in correctly. The longer lead (and non-flat edge of the plastic flange) is the positive lead.

No Clicking Sound

The transistor or coil portion of the circuit isn't quite working. Check the transistor is plugged in the right way.

Not Quite Working

The included relays are designed to be soldered rather than used in a breadboard. As such you may need to press it in to ensure it works (and it may pop out occasionally). When you’re building the circuit be careful not to mix up the temperature sensor and the transistor, they’re almost identical.

Still No Success?

A broken circuit is no fun, send us an e-mail and we will get back to you as soon as we can: help@geekammo.com

Continue on to circuit 11 Soft Potentiometer