Download presentation
1
MAKE: AN ELECTRONICS WORKSHOP
SAMI Makerspace MAKE: AN ELECTRONICS WORKSHOP
2
Relay board A little electricity can control a LOT of electricity!
3
Why use a relay? PROBLEM: I want to run something like a motor or lamp that needs more voltage/current than an Arduino can supply. SOLUTION: Use a relay! It’s like an electric switch. A little electricity can open/close the switch, which can be connected to a larger source of electricity.
4
How does a relay work? At first, the common (COM) and normally closed (N/C) are connected. A small current flows from A1 to A2 The magnet pulls the switch down, connecting the COM and normally open (N/O). This creates a magnet in the relay.
5
Safely separated from each other
How does a relay work? LARGE current from batteries small current from Arduino Safely separated from each other
6
Your Relay board 2 pins to provide power to all the relays
4 relays in one! Screw terminals to securely hold wires! 4 pins to control the relays Normally Closed (N/C) Common (COM) Normally Open (N/O)
7
Controlling the relays with an arduino
Connect the final 4 pins to 4 digital pins on the Arduino Connect the grounds (GND) Connect the 5V on the Arduino to the VCC on the relay board
8
Programming the arduino
When the digital pins are HIGH (5V), the relays are “off.” Common (COM) is connected to normally-closed (N/C). Your digital pins should be initialized as OUTPUT in the setup() function. When the digital pins are brought LOW, the relay is “on.” Common (COM) will be connected to normally-open (N/O). You will hear a “click.”
9
Example: Blink an LED
10
Blink an LED: The Code Challenges:
Using one relay, have two LEDs alternate between on and off (when one is on, the other is off) Create a more complicated blinking pattern.
11
EXAMPLE: Run a DC motor in two directions
“B” “A” N/C N/O COM COM N/O N/C A = HIGH, B = HIGH : Motor grounded on both sides; no motion. A = HIGH, B = LOW : Electricity flows from left to right; motor spins. A = LOW, B = HIGH : Motor spins in other direction. A = LOW, B = LOW : Motor high on both sides (AVOID)
12
Final warnings! Be careful not to create shorts. Double check all connections before you add any power, ALWAYS! A relay can’t be turned on and off too fast. Avoid switching any faster than twice a second. The coil in a relay can burn out if left on for to long. Always design your circuit so the resting state has no current running through the coil of the relay.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.