Proximity-sensing Hat and EagLED

Difficulty
Moderate
Steps
12

Besides the on-board LEDs, button and light sensor, the EagLED is also compatible with a wide range of external components.

In this guide, we will build an assistive device for the blind, specifically a proximity-sensing hat. When coming close to an obstacle, the Lilypad Vibe board will give a little vibration near the ear, to prevent any accidental collisions from happening. We'll be using the EagLED, Lilypad Vibe board, Sharp Infrared Distance Sensor and conductive thread. 

Complete this guide to create a proximity-sensing hat with the EagLED!

The parts

For this guide, you'll need:

  • EagLED - Little bird E-Textile Snappable board
    • The EagLED is our E-textile wearable development board that makes this all possible! We'll be using the main board.
  • Lilypad Vibe Board
    • This will be used to send a little vibration to the user's ear when an obstacle is within range
  • 1200mah LiPo battery
  • Sharp Infrared distance sensor GP2Y0A41SK0F 4-30CM
    • In order to measure the distance from an obstacle, we'll use an Infrared Light Distance Sensor. It emits a beam of infrared light which will reflect off an object, the distance from the obstacle is then calculated by using triangulation of the beam of light; This reflected beam reaches the light detector in the sensor, which outputs an analog signal that is dependent on the distance between sensor and object.
  •  Alligator test leads - 10 pack  
    • This will only be used in the prototyping process
  • Conductive Thread and a sewing needle
    • We'll then sew the components onto a hat using conductive thread.
  • Soldering iron and solder
  • A hat of your choice and some cloth

Step 1  Snap out the Main board

First, carefully remove the main board from the EagLED.

Step 2  Attach alligator clip to 3.3V

  • Next, use one red alligator clip and connect it to '3.3V' on the EagLED main board.

Step 3  Attach alligator clip to ground

  • Then connect a black alligator clip to 'GND' on the EagLED main board.

Step 4  Attach another alligator clip to GND

  • Connect another black alligator clip to 'GND' on the EagLED main board.

Step 5  Attach alligator clip to #9

  • Now connect a yellow alligator clip to '#9' on the EagLED.

Step 6  Attach alligator clip to #10

  • Connect a green alligator clip to '#10' on the EagLED.

Step 7  Attach alligator clips to distance sensor

  • Connect the yellow alligator clip to the yellow wire of the distance sensor. 
  • Connect one of the red alligator clips that is connected to 3.3V to the red wire of the distance sensor. 
  • Likewise, connect one of the black alligator clips that's connected to GND on the EagLED, to the black wire on the distance sensor.

Step 8  Connect alligator clips to Lilypad Vibe board

  • Attach the second green alligator clip connected to Pin 10 on the EagLED to Lilypad vibe board's '+' pad.
  • Attach the other black alligator clip connected to GND on the EagLED to '-' on the Lilypad vibe board.

Step 9  Arduino code for proximity-sensing hat


              /* Code for proximity-sensing hat using the EagLED */

int sensorPin = A9;                 // light sensor is connected to analog pin 0
int sensorValue;                 // variable to store the value coming from the sensor
int vibePin = 10;
int threshold = 200;

void setup()
{
  pinMode(vibePin, OUTPUT);
  pinMode(sensorPin, INPUT);
  Serial.begin(9600);                 //initialize the serial port
}

void loop()                         // run over and over again
{
  sensorValue = analogRead(sensorPin);    // read the value from the sensor

  if (sensorValue > threshold) {                // read sensor value and do the below when the sensor is triggered

    digitalWrite(vibePin, HIGH);

    delay(50);
  }

  else {
    
    digitalWrite(vibePin, LOW);

    delay(50);
  }

  Serial.println(sensorValue); // send the sensor value to the computer

  delay (100);
}

            
  • Adjust the threshold value as required.
  • Click the 'Verify' button in the Arduino IDE
  • Click on the 'Upload' button

Step 10  Sew the components together with conductive thread

  • Cut a long piece of conductive thread and thread the needle carefully, then tie a knot at the end.
  • You are now ready too connect the components together.

First, we'll connect the LilyPad Vibe board to the EagLED.

  • One line of stitching will connect the LilyPad Vibe board's '+' to '#10' on the EagLED. Finish your first line of stitching by tying a finishing knot on the sew tab. Trim any excess thread as required.
  • Next, stitch another line to connect '-' on the LilyPad Vibe board's '-' to 'GND' no the EagLED. Do the same as before and create a finishing knot on the sew tab.

We'll next create a little pouch to hold the 1200mah LiPo battery. So go ahead and stitch a little pouch shape with some cloth.

Finally, it's time to connect up the IR distance sensor. For this, we'll solder the wires on the IR distance sensor directly to the EagLED. Then sew the IR distance sensor onto the hat with regular thread.

  • Yellow wire to '#9' on EagLED
  • Red wire to '3.3V' on EagLED
  • Black wire to 'GND' on EagLED
  • Stitch the IR sensor onto the hat using the two mounting holes.

With the LiPo battery connected via the JST cable, turn the power switch on the EagLED. You're ready to use it!

Complete build

  • Once complete, your proximity-sensing hat may look like this!