Skip to content

interactionresearchstudio/Guide-WirelessLED

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

ZeroOneTwo Shortcuts

Wirelessly control an LED across the room with no networking required

Author: Interaction Research Studio

Introduction

This guide is inspired by Light Touch, a device that allows you to exchange coloured lights with another person over the internet. It's part of Yo-Yo Machines, a collection of devices that we developed for people to make at home and use them to communicate with each other to keep in touch with friends and family. Learn more about Light Touch and Yo-Yo Machines here.

In this guide, we'll make a simpler version of Light Touch. We will be able to control an LED across the room (or maybe in the room next door if you're lucky) and send morse-like messages between two devices. Instead of using the internet, we'll use ESP-Now, a wireless communication protocol that is super easy to set up, since it doesn't require a Wi-Fi router or any networking.

Outcome

Materials

Here's what you need to follow this guide:

  • 2 x ESP32 Dev boards
  • 2 x 5mm LEDs (any colour will do)
  • 2 x female to female jumper wires
  • 1 x female to male jumper wire
  • A small piece of aluminium foil

Materials

Prerequisites

You should have a working installation of Arduino IDE on a Windows, Mac or Linux computer. You should also install the Silabs CP210x driver so that your computer can communicate with the ESP32 board via USB.

Steps

1. Wire up LED

Step 1 Use two female-to-female wires to connect the LED directly to the ESP32 board. The long leg of the LED (positive side) should connect to D4, and the short leg (negative side) should connect to GND.

2. Add capacitive touch button

Step 2 Connect the female-to-male wire to pin D4 on the ESP32 board. Poke the pointy side of the wire into a ball of aluminium foil.

3. Repeat for second device

Step 3 Repeat steps 1 and 2 for the second ESP32 board.

4. Setup Arduino IDE

In order to use the ESP32 board on the Arduino IDE, you have to install it with the Boards Manager. Here's how to set up the arduino IDE:

  1. Open a new sketch
  2. Copy the code from this repository and paste it in your sketch
  3. Open your Arduino IDE settings / preferences window
  4. Under Additional Boards Manager URLs, add this link, and click ok https://espressif.github.io/arduino-esp32/package_esp32_index.json
  5. Open the Boards Manager from Tools > Board > Boards Manager
  6. Search for esp32
  7. Install esp32 by Espressif Systems

Step 4.1 Step 5.1

Now your Arduino IDE is ready to talk to your ESP32 boards!

5. Upload code

When you're ready to upload the code, click on the Board Selector field on the top left of your IDE and select ESP32 Dev Module as your board. Select the serial port that your board is connected to. On mac, this is normally /dev/cu.SLAB_USBtoUART, and on Windows it's one of the COM ports listed.

Step 5.1

Click the Upload button and wait for your board to be flashed with the firmware. Repeat this for the second ESP32 board! Easiest way is to unplug the board and plug in the second one, so you don't have to select the serial port again.

Step 5.2

6. Test

Step 6 Go ahead and power up both boards by plugging them into a USB port. It doesn't have to be the same USB source!

Touch the capacitive button on one device, and you should see the LED light up on the other board. And vice versa!

7. What to do next

This is a basic setup that can get you really far with wireless communications! Here are some things to try next:

  • Experiment with how far the devices can be from one another. Does it work across the room? Does it work between walls?
  • Add more devices in the network by uploading the same code to them. Now multiple people can flash LEDs!
  • Change the LED with a different output, for example a servo motor or a larger LED strip.

If you enjoyed this kind of wireless communication, you could have a go at building a Yo-Yo machine yourself!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages