Build Kodi / OSMC Infrared Receiver and Reset Hat for Raspberry Pi

by jeff.cartwright.562 in Circuits > Raspberry Pi

3539 Views, 34 Favorites, 0 Comments

Build Kodi / OSMC Infrared Receiver and Reset Hat for Raspberry Pi

OSMC Hat on RPi.jpg

Build a Kodi / OSMC IR Receiver and Reset hat for the Raspberry Pi 3

From across a room, I would like to:

  • Control Kodi / OSMC running on a Raspberry Pi with a remote control
  • See if the Raspberry Pi is powered on

Also, I would like my family to be able to reset the Raspberry Pi without damaging the system.

I am not an expert in electronics, soldering or prototyping. I found this project to be moderately difficult. Soldering is my weak spot. As a shortcut, you can buy the Energenie Infrared Add-on Board.

This project assumes you have a Raspberry Pi 3 properly configured and running Kodi on OSMC.

Gather Parts

Most of the parts are sold in bulk. So, you will end up with a lot more spare parts than you need.

Parts:

  • Rugged Metal Push Button with Blue LED Adafruit $4.95
  • Perf Board Fry's $12.99 - lots of boards can be made from this
  • GPIO Header for Raspberry Pi 2x20 Female Header pin header Adafruit $1.50
  • 22 AWG single/solid core wire Fry's $4.99 for each different color
  • Breakaway header pins Adafruit $4.95
  • 330 Ohm Resistor (I used 3x 110 Ohm resistors) Fry's $3.99
  • IR (Infrared) Receiver Sensor - TSOP38238 Adafruit $1.95, cheaper in packs of 25
  • 4x Female connector wires (the other ends doesn't matter because it is going to be cut off) Fry's $3.99
  • Logitech Harmony 650 Amazon $48.88

Reusable parts:

  • Needle nose pliers
  • Very pointed tweezers
  • Soldering iron
  • Tip Cleaner
  • Solder, well not reusable, but a lot comes in one coil
  • Small piece of masonite
  • Xacto knife or box-cutter
  • Optional - Medical scissors - short blade ~3/8 inches long, very sharp, strong metal - it can cut just about anything. I am not sure where I got it. I use it to trim away excess leads and to cut solder pieces to manageable lengths
  • Optional - Canvas stretcher
  • Solder fan - don't breathe in solder fumes
  • Steel right angle

Breadboard the Devices

ring led and reset schematic.png

Prior to building the board, you might want to see how the components work. These instructables provide a breadboard view of how the final soldered board will work.

Power Indicator and Reset button

Rugged Metal Push Button with Blue LED - Adafruit $4.95

This instructable shows how to breadboard a reset button with a power indicator.

Infrared Receiver

This instructable provides shows how to breadboard an infrared receiver.

Cut the Perf Board to Size

perf board.jpg

Cut a piece from a perf board to 1-1/4 inches by 1-3/4 inches.

Put perf board on a solid flat surface. I use a small sheet of 1/8 inch thick masonite as a backer board. The masonite provides a straight edge for the right angle.

Use a steel right-angle as a straight edge and to ensure a square cut.

Scoring:

  • Score the perf board twice using Xacto knife - looking edge on the score should go about halfway through the perf board
  • Score down the centers of one line of holes
  • Use the right angle to ensure a straight line
  • To keep the edges square, score all sides before breaking any pieces off

Snapping off the excess:

  • Using a canvas stretcher align the scored edge with the stretcher's edge.
  • Snap off the cut by bending away from the scored side.
    • I use a canvas stretcher because I have one
    • You can also flip the board over, line up an edge of the right-angle with the score, and bend up and it should break cleanly
  • If the excess doesn't break cleanly, then carefully clean up the edges with the Xacto knife.

Prototype Board

ring led and reset schematic.png
how to twist wires.jpg
underside of OSMC HAT.jpg

For my home, I am only going to make 3 of these boards (maybe a maximum of 7). So, these are prototypes and not printed circuit boards.

Parts:

  • Perf Board from the previous step
  • 2x20 pin header
  • 22AWG single/solid core wire works great for breadboards. This is the same as the diameter of a typical resistor lead. I didn't have any 0.6mm wire, so being lazy I cut the leads off some resistors and slid coatings from breadboard wires over the resistor leads.
  • Push button with Ring LED
  • 2x header pins - bend at a 90 degree angle
  • 330 Ohm Resistor (I used 3x 110 Ohm resistors)
  • IR (Infrared) Receiver Sensor - TSOP38238 Adafruit $1.95, cheaper in packs of 25
  • 4x Female connector wires (the other ends doesn't matter because it is going to be cut off)

Run the wires

Instructable on prototyping on a perf board.

Put the components' pins through the perf board holes. Bend the leads slightly out to keep the components in place. Most of the leads will be trimmed away

For each wire:

  • I use a breakaway pin to create a loop on one end of the wire by wrapping it one time around the pin.
    • Trim excess wire from the loop and flatten with a needle nose pliers (see image).
  • Slip the wire around a post and crimp so it stays in place.
  • You don't want any shorts, where a wire is touching another wire or post. Use insulated wire
  • Run wire to the other end point and wrap around post and crimp in place.

Run wires as shown in the diagram. Connector wires will be added later. From Raspberry Pi:

  • 3.3v header pin to + on IR receiver
  • Ground to ground on IR receiver (middle pin)
  • GPIO18 to 3rd pin on IR receiver
  • Ground through 330 Ohm Resistor to a pin post
    • Later add a Female connector wire from the post to the - terminal on Ring LED
  • GPIO24 to a pin post
    • Later add a Female connector wire from the post to the + terminal on ring LED
  • Female connector wire from Run pin to C1
  • Female connector wire from other Run pin to NO1

Strip 2mm off the end of each wire make into a loop and crimp to the appropriate pin.

Solder components and wires on the perf board

Instructable on soldering.

Ensure the soldering iron tip is clean.

Touch soldering iron to one pin, count to 3, touch the solder and remove the solder and then the soldering iron

Not all the pins on the header need to be soldered, just enough to make it stable

Trim off the excess leads

Solder breakaway pins to Run holes on Raspberry Pi

Instructable showing how to add Run pins to Raspberry Pi

Solder connector wires to Rugged Metal Push Button with Blue LED

Leave 2 inches of extra length in the female connector wires

For each female connector wire, cut off one end and strip 1/4 inch from the end. Solder one wire to the - and the other wire to the + terminal. And, solder one wire to C1 and the other to NO1 terminal

Wrap soldered connections on Push button in electrical tape

Attach the connector wires to the appropriate Posts or Headers

  • Female connector wire from ground post on perf board to "-" terminal on Ring LED
  • Female connector wire from GPIO Pin 24 on perf board to "+" terminal on ring LED
  • Female connector wire from Run pin on Raspberry Pi to C1
  • Female connector wire from Run pin on Raspberry Pi to NO1

Trim any excess leads

Put the Hat to To Work

Shutdown (sudo shutdown -h 0) and power off the Raspberry Pi.

Attach the hat to the Raspberry Pi. Be sure the header and pins are properly aligned, otherwise, you might destroy the Raspberry Pi. Apply power to Raspberry Pi

I use a Harmony Logitech 650 with the Raspberry Pi running Kodi/OSMC set up to be controlled via a Silver Apple Remote. In the MyHarmony program, to control the Raspberry Pi, I use:

  • Activity: Broadcast TV - Watch TV renamed to Broadcast TV
  • Device: TV, whatever you have
  • Device: Apple TV
  • Rename the device to: Raspberry Pi
  • Manufacturer: Apple
  • Model: A1378

In Kodi, under My OSMC, set the remote to the Apple Silver remote

In Kodi, under Pi Config, Hardware Support, enable gpio_out_pin 17

Instructable showing how to get the Ring LED and Reset buttons to work