Know How...

Sep 7th 2017

Know How... 342

IR Basics Part 2

Use relays to turn groups of devices on and off using an IR remote control.

Although the show is no longer in production, you can enjoy episodes from the TWiT Archives.
Category: Help & How To

Triggered!
Last week we showed how you could build and program a simple Arduino-powered IR code reader and use it to trigger certain events when the proper code was received.

Demo 1

  1. Show IR code being received
  2. Show Case Statement that triggers an event when IR code is received
  3. Show LEDs being triggered when the IR code is received

But we only triggered 5volt LEDs... what if we wanted to trigger something BIGGER?

Relays!

  • A relay is a switch that is toggled electrically
    • It gives us the ability to turn on and off a circuit with a different circuit
      •  So a 120AC circuit could toggle a 12V DC circuit
      •  A 5V circuit could toggle a 24V circuit

There are several different TYPES of Relays

  • Electromagnetic (the most popular)
  • Optomechanical (Much like EM, but the circuits are COMPLETELY isolated from each other)
  • Solid State (No moving parts. All switching is done in a semiconductor)

We're going to be using electromagnetic Relays

  • In the most basic version: a switch is toggled between "on" and "off" by an electromagnetic that physically moves the switch between the two positions

8-Relay Package

https://www.amazon.com/gp/product/B01NBUDHPB/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1​

The important part is that we can use a 5-volt circuit to toggle a circuit up to 30v (or 120v AC)

IR0_Relays

Demo 2:

  • Single Relay that is toggled by ASCII case statements

IR1_Relays

Demo 3:

  • 8-Relay Board that is toggled by ASCII case statements

Now we know that we can trigger the relays with the keyboard... next up we're going to add an IR receiver and trigger them with an IR remote control.

IR2_IR_Triggered_Relays

Demo 4:

  • 8-Relay Board that is toggled by IR code case statements

All Code for this episode is found at:
https://www.dropbox.com/s/20xonebuc7eh7is/KH342_IR2.zip?dl=0

Connect with us!

Thanks to CacheFly for the bandwidth for this show.