Keep the lines of communication open by building your own infrared transmitter

An engineer in a red room

(Image credit: Future)

The idea of being in a remote location, unable to communicate with civilization, is foreign to most people. With cell phones, Wi-Fi, and radio readily available to us, we hardly think about how difficult it would be to communicate over long distances without them. But that could be a reality for members of the United States Space Force in the future. 

What do you do when your ability to communicate is hindered? In the second episode of the Space Force STEM Challenge, we show you how to build a Morse code infrared (IR) transmitter, an incredibly simple, low-cost tool that doesn't require a cell signal or Wi-Fi to keep you in touch. 

What you need:

You'll need two of the following to send and receive messages with a friend:

  • Raspberry Pi single-board computer with Raspberry Pi OS installed 
  • An IR LED 
  • An IR photodiode 
  • 100K resistor 
  • A small display to read communications

Finally, maybe grab a guide to Morse code. You can use other encodings, but Morse code is simple to program and widely understood, making it ideal for use in emergency communications. We've implemented translation into the software, so you don't technically need a guide, but we think you'd like having it… 

Visit this link for the Python script to send Morse Code messages. (Image credit: Future)

We've got a step-by-step breakdown of instructions, info about installing the OS on your Raspberry Pi, and the script we built right here. We're using Python for the programming language. There are a ton of resources online to help you translate alphanumeric characters into Morse and back again. You can download the script we used here, but if you're looking for an additional challenge, try writing your own.

We'll start by attaching the LED and photodiode to the general purpose input/output (GPIO) pins of our Raspberry Pi. The script we're providing takes short messages, encodes them, and blinks the infrared LED appropriately. With IR communication, we can talk to someone over pretty far distances, but we need to have a clear line of sight and be in an area with no other sources of infrared. Strong sunlight might interfere, so this is best used at night.

Our completed IR communication device. Type a message and send! (Image credit: Future)

At this point, we simply type what we want to say and hit enter. The code we're using is constantly checking the state of the receiver, looking for pulses that translate to valid Morse code. If it sees any, they appear on our screen. When we type, the code will temporarily stop listening in order to transmit our message.

Mission Complete

Now you've got your own IR communicator that you can use with a friend. Projects like this don't just teach you how to make cool gadgets — they show you a way to think around corners. Each obstacle has a solution, and your job, whether you're stuck in a place where communication isn't possible or just faced with a problem that seems insurmountable, is to find a way to the other side.

Join our Space Forums to keep talking space on the latest missions, night sky and more! And if you have a news tip, correction or comment, let us know at: community@space.com.

Jacob York
Editor, Branded Content

Jacob York is a Branded Content Editor and Writer for Future, focusing on the Games and Tech verticals. Jacob's previous writing experience encompasses everything from award winning plays to websites about tree removal services. The tree removal website also won an award.


A native of Fairdealing, Kentucky, Jacob has made Atlanta, Georgia his home for much of his adulthood. In his spare time, he enjoys learning how to bake, spending time at a theme park with his wife, and doing "product research" by diving into a video game. A creative through and through, Jacob would like to take a moment to remind you to support your local Equity hiring theatre.