Controlling an LED using proximity sensing and the Touch Board

Our partners over at Bare Conductive have released a great tutorial teaching you how to fade an LED with proximity and the Touch Board which we thought we'd share with you!

In addition to touch, the Touch Board can also detect proximity. With the proximity function of the board you can trigger an MP3 from distance, or you can fade an LED on and off by approaching the sensor with your hand. In this tutorial we’re going to show you how to fade an LED on with proximity and the Touch Board, creating a dimmer effect.

 

Materials
To begin you will need:

  • Touch Board
  • Printed Sensors
  • Headers
  • LED
  • Jumper Wires
  • 270Ω Resistor
  • Crocodile Clip
All_Required_Parts

 

 

Step 1
Set-up the Touch Board

 First, you need to set up your Touch Board.

You then need to upload the “Prox_LED” code. Select the sketch from the Sketchbook and hit upload.

Board_Setup

 

Step 2
Approach electrode E0

When you now approach E0 with your finger, you should see that the LED marked with an “L” on the Touch Board fades on and off.

 

 

Step 3
Using 5mm LEDs

 You can also use 5mm LEDs with the Touch Board.

Connect an LED to pin 13, but don’t forget to include a resistor! When you now turn the Touch Board back on and approach E0 with your finger, the LED will fade on and off.

 

Step 4
Add Printed Sensors

 Just approaching an electrode with a finger can be a bit tricky as it’s quite small. You can make it easier by increasing the sensor size using a Printed Sensor. Simply attach a Printed Sensor to electrode E0, by using some crocodile clips. When you now turn the board back on and approach the sensor with your hand, the LED will fade on and off more smoothly.

 

 

Step 5
Adjusting volume with proximity

 We have a similar code “prox_volume”, which will allow you to adjust the volume when you approach E0. Simply upload this sketch to your Touch Board and play a track by touching an electrode from E1 to E11. If you now approach E0, this will decrease the volume.

 

 

Step 6
Troubleshooting

That’s all there is to know about how to fade an LED on with proximity and the Touch Board! We’d love to see your creations so feel free to share them with us! 

Previous article Eat the Dots with BBC micro:bit!
Next article How To Build IoT Sensors Using Python

Check out our latest products...

Teensy Usb Cable Micro-B To Standard-B Panel Mount Adaptor - Cables And Adapters
Lamp:bit - Street Light For Bbc Micro:bit - Micro:bit

LAMP:bit - Street Light for BBC micro:bit

£4.99 inc VAT
£4.16 ex VAT
Klaw Kit - Servo Powered Gripper - Robot

Klaw Kit - Servo Powered Gripper

£6.60 inc VAT
£5.50 ex VAT
Sparkfun Pro Nrf52840 Mini - Bluetooth Development Board (Dev-15025) - Bluetooth
Adafruit I2S Audio Bonnet For Raspberry Pi - Uda1334A (Id: 4037) - Audio
Lithium Polymer Battery - 400Mah - Batteries

Lithium Polymer Battery - 400mAh

£6.38 inc VAT
£5.32 ex VAT
Shapeoko Touch Probe - Cnc

Shapeoko Touch Probe

£119.99 inc VAT
£99.99 ex VAT
Bare Conductive Electric Paint Circuit Kit - Conductive Ink

Bare Conductive Electric Paint Circuit Kit

£12.00 inc VAT
£10.00 ex VAT