Augmented vision

The story behind the…vision.

Like thousands being born without 3d vision, I want to experience distance. I thought I have a hearing aid so why not a seeing aid?

What would it look like if I were to make a device that allowed me, or the user, to experience visual information in a new way? Distance and heat seemed to be likely candidates. Safe from oncoming objects and fires or heat sources like machinery. I thought an infrared heat sensor is accurate enough and an ultrasonic distance sensor that would be relevant at a personal body distance of about 5 feet.

The components

-Arduino, Lilypad micro controller

-Arduino, battery holder. 1.5v to 5v, with surge protector circuit

-Lilypad, Tri-light (RGB led)

-Lilypad, green LED

-Ultrasonic sensor

-Infrared, heat sensor

Putting it together

I began by using the wiring guides I found on the following web sites to solder it together. I didn’t proto-board it or alligator clips as I was confident in my soldering skills and wiring map to go for it! (cocky bastard!)

www.electrojoystick.com/#24EF8D This was the tutorial and sample code for the Maxbotix Sonar LV EZ1 ultrasonic device. I found the sample in out sensor code and used the tutorials on the blog and meetings to get it working and map out the flashing to be appropriate to the distance it represented.

This code worked perfectly on its own to start with:

/*

AnalogReadSerial

Reads an analog input on pin 0, prints the result to the serial monitor.

Attach the center pin of a potentiometer to pin A0, and the outside pins to +5V and ground.

 

This example code is in the public domain.

*/

int LEDdelay;

 

 

// the setup routine runs once when you press reset:

void setup() {

// initialize serial communication at 9600 bits per second:

Serial.begin(9600);

pinMode(10, OUTPUT);

 

 

}

 

// the loop routine runs over and over again forever:

void loop() {

// read the input on analog pin 0:

int sensorValue = analogRead(A3);

// print out the value you read:

Serial.println(sensorValue);

LEDdelay = map(sensorValue, 10, 380, 50, 500);

 

digitalWrite(10, HIGH);

delay(LEDdelay);

digitalWrite(10, LOW);

delay(LEDdelay);

 

 

delay(1);        // delay in between reads for stability

}

 

bildr.org/2011/02/mlx906#246CA2 This site got me wired in no time for the thermal sensor. The little infrared device is accurate to .02 degrees F! So if it mattered you can have a wicked degree of accuracy. These are commonly used in cars for the size and reliability and robotics. It is a very nice non-contact sensor indeed.

This site was a wealth of information but it leaves out the very important detail of pin association. In a nutshell, one must wire it according to the convention provided due to the internal components of the microcontroller. I had them wired on different pins and couldn’t get a reading. Thanks to Kate for getting me on track! I would have never figured that out. This was the only hardware hurdle I had. Once re-soldered it worked instantly.

Bellow is the code from the site.

#include <i2cmaster.h>

 

 

void setup(){

Serial.begin(9600);

i2c_init(); //Initialise the i2c bus

PORTC = (1 << PORTC4) | (1 << PORTC5);//enable pullups

}

 

void loop(){

int dev = 0x5A<<1;

int data_low = 0;

int data_high = 0;

int pec = 0;

 

i2c_start_wait(dev+I2C_WRITE);

i2c_write(0x07);

 

// read

i2c_rep_start(dev+I2C_READ);

data_low = i2c_readAck(); //Read 1 byte and then send ack

data_high = i2c_readAck(); //Read 1 byte and then send ack

pec = i2c_readNak();

i2c_stop();

 

//This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps

double tempFactor = 0.02; // 0.02 degrees per LSB (measurement resolution of the MLX90614)

double tempData = 0x0000; // zero out the data

int frac; // data past the decimal point

 

// This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte.

tempData = (double)(((data_high & 0x007F) << 8) + data_low);

tempData = (tempData * tempFactor)-0.01;

 

float celcius = tempData – 273.15;

float fahrenheit = (celcius*1.8) + 32;

 

Serial.print(“Celcius: “);

Serial.println(celcius);

 

Serial.print(“Fahrenheit: “);

Serial.println(fahrenheit);

 

delay(1000); // wait a second before printing again

}

 

The merging of the codes

That is a movie title for sure! I struggled quite a bit with tutorials and the like online and found they all had one thing in common, that they make assumptions as to the level of your knowledge going into this and that you have some basics… I do not. I had never been exposed to this before and was way out of my comfort zone. I understood the basics of code modifying, setup and loop (sort of) but anything I did with regards to following the wickedly confusing amount of information about coding didn’t work out and only lead to frustration and distain for the process. I had two functioning codes but couldn’t for the life of me figure out how to merge them.

I met with a classmate for an hour and we hammered it out. Borxu showed me how setup creates the conditions for the loop to happen. We transferred the commands and tried out samples along the way till it worked right. I assigned the appropriate pins and values to the sensors and the resulting merged code is bellow. It works like a charm! (I knew it would)

#include <i2cmaster.h>

 

int redPin = 9;                   // R petal on RGB LED module connected to digital pin 9

int greenPin = 10;     // G petal on RGB LED module connected to digital pin 10

int bluePin = 6;         // B petal on RGB LED module connected to digital pin 6

int distancePin = 11;   // flashlight pin

 

int LEDdelay;           // Delay for the distance light

 

void setup(){

Serial.begin(9600);

 

i2c_init(); //Initialise the i2c bus

PORTC = (1 << PORTC4) | (1 << PORTC5);//enable pullups

pinMode(redPin, OUTPUT);        // sets the redPin to be an output

pinMode(greenPin, OUTPUT);    // sets the greenPin to be an output

pinMode(bluePin, OUTPUT);      // sets the bluePin to be an output

pinMode(distancePin, OUTPUT); // sets the distancePin to be an output

}

 

 

void loop(){

 

// *** START IR Temperature Sensor Function ***

 

int dev = 0x5A<<1;

int data_low = 0;

int data_high = 0;

int pec = 0;

 

i2c_start_wait(dev+I2C_WRITE);

i2c_write(0x07);

 

// read

i2c_rep_start(dev+I2C_READ);

data_low = i2c_readAck(); //Read 1 byte and then send ack

data_high = i2c_readAck(); //Read 1 byte and then send ack

pec = i2c_readNak();

i2c_stop();

 

//This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps

double tempFactor = 0.02; // 0.02 degrees per LSB (measurement resolution of the MLX90614)

double tempData = 0x0000; // zero out the data

int frac; // data past the decimal point

 

// This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte.

tempData = (double)(((data_high & 0x007F) << 8) + data_low);

tempData = (tempData * tempFactor)-0.01;

 

float celcius = tempData – 273.15;

float fahrenheit = (celcius*1.8) + 32;

 

Serial.print(“Celcius: “);

Serial.println(celcius);

 

Serial.print(“Fahrenheit: “);

Serial.println(fahrenheit);

 

//  delay(1000); // wait a second before printing again

 

// *** END IR Temperature Sensor Function ***

 

// *** START Temperature Threshold Function ***

 

if (fahrenheit > 80) {

 

color(255, 0, 0);          // turn the RGB LED red

//          delay(1000);           // delay for 1 second

} else {

//          color(0,255, 0);       // turn the RGB LED green

//          delay(1000);           // delay for 1 second

color(0, 0, 255);          // turn the RGB LED blue

//          delay(1000);           // delay for 1 second

}

 

 

// *** START Distance Function ***

 

// read the input on analog pin 0:

int sensorValue = analogRead(A3);

// print out the value you read:

Serial.println(sensorValue);

LEDdelay = map(sensorValue, 10, 380, 100, 1000);

 

digitalWrite(distancePin, HIGH);

delay(LEDdelay);

digitalWrite(distancePin, LOW);

delay(LEDdelay);

 

 

delay(1);        // delay in between reads for stability

 

// *** END Distance Function ***

 

}

 

 

void color (unsigned char red, unsigned char green, unsigned char blue)     // the color generating function

{

analogWrite(redPin, 255-red);

analogWrite(bluePin, 255-blue);

analogWrite(greenPin, 255-green);

}

 

// *** END Temperature Threshold Function ***

 

Wearing the device

There are two considerations for this section, first being the personal aspects and the second being the social ramifications of wearing a Borg-like device.

I am personally comfortable wearing the device as my vision allows for it. I found others who looked through the device found the light to be too bright and distracting. The light can be further defused but more importantly what happens is something the military has coined “helmet fire.” Essentially helicopter pilots who use a wearable computer screen with inflight information being broadcast in one eye and real world vision in the other get confused easily in the heat of combat with the brains ability to process two images at once and can briefly shut down causing the helicopter to crash. It is a real problem. My limited vision lends me well to this technology but the signals need to be very deliberate hence the choice and sequence of colours listed bellow.

Blue light is connected to the thermal sensor and is on when a temperature of 80f or lower is detected. The blue light turns red when above 80f is detected. I used this number, as room temperature won’t set it off. It loves the stove and after some time you can map out the heat in the air with it! It will pick up a hot cup of coffee or body heat at close range of 2-3 feet.

The green LED flashes according to distance so the closer the object the quicker the flashing, simple enough but effective.

Socially wearing the device is another story. Of course here at OCAD-U it I easily accepted and met with great curiosity and fanfare but in public people don’t understand what it is. Hearing aids are well accepted for their sleek, tight form factor so that I am sure is a huge part of why people are uncomfortable with it. I have been asked most of all if the device is recording them. It has no camera or the capability to record any of the incoming information. But just like a hearing aid it provides what is missing and gives the wearer new information in a usable way.

Further development

For the visually impaired the uses are obvious but for the completely blind new outputs could be used like a hat with vibration motors in key locations. For the fully sighted individual this could act as a real time safety device in hazardous areas of work like monitoring air conditions or detecting land mines. A tighter form factor would make this more user friendly and acceptable. Batteries could be integrated, rechargeable and be made smaller, components could be better mapped out and tightened up, wires and traces could be strategically embedded and hidden and waterproofing the device would be greatly beneficial. The IR sensor can see through rain but the ultra sonic wont like driving rain, too much interference.

Closing remarks

This was a very challenging and personal project for me. The narrative has been a lifetime in the making and the skill set I learned to assemble and code the device is stronger than ever before. The seeing aid is more than the sum of its parts. The abilities it gives me makes my vision more complete but also acts as a window into our very complex social behaviors and notions of personal space. This is an ongoing experiment and has only begun with the creation of the device. I wish I did record for the best things it will see are the reactions of the people it encounters as I wear it but it will never know them.

 

The TTC Shirt

Concept

For those of you who don’t have smart phones, are you sick of waiting for the TTC not knowing when the next bus or streetcar will come? If there was a way for other people of letting you know would you be interested? The TTC shirt solves this problem by broadcasting when the next TTC vehicle will arrive at a specific stop. Much like the Next Vehicle Arrival Information boards in the subways and at some TTC stops, the TTC Shirt will provide that information except it will be worn by someone. There is no way the TTC will be able to install these boards at every bus or streetcar stop, so why not engage the community in helping solve this problem? People can make their own shirts by following instructions or they can buy a patch with the LED’s and sew it onto their own piece of clothing. If many people start wearing this shirt, we’ll be able to get this information to more people without costing the TTC a dime.

 

Circuit

The first thing I started off with was designing the circuit. I decided to layout the circuit in layers. I also wanted to make the shirt modular so instead of sewing the LED’s directly onto a shirt I decided to make it a patch with a smaller removable patch for the Arduino, bluetooth and battery power supply. That way the entire patch is washable and you can put it on different pieces of clothing. Here are the components:

15 x super bright LilyPad LEDs
conductive thread
1 x Arduino mini pro (5V)
1 x LilyPad Lithium power charger (5V output)
1 x bluetooth mate silver
1 x 3.7V 800mAH Lithium Ion battery
17 x snap buttons
black cloth

Overall Circuit:

Circuit diagram showing all components

Small Removable Patch Circuit:

Circuit diagram showing top and bottom side of small removable patch with Arduino, bluetooth module and power supply

Main Patch Circuit:

Top layer (side up) of main patch - LED's

Top layer (side down) of main patch - ground connections

Bottom layer (side down) of main patch - signal connections

 

 

 

 

 

 

 

 

 

 

 

 

Process

For the first paper prototype please see my previous blog entry (http://blog.ocad.ca/wordpress/gdes3b16-fw201202-01/2012/11/the-ttc-shirt-proposal/). I wanted to use the minimum number of LED’s to create a matrix that would still be legible. I decided on a 5×3 LED matrix and to make sure that it would be legible I did some mock up of numbers:

 

 

 

 

 

 

 

 

 

 

 

 

The next thing I did was layout my fabric for the small removable patch and start sewing on the Arduino and the snap the buttons which would act as connectors to the main patch:

 

 

 

 

 

 

I then took a piece of fabric and screen printed the words “THE NEXT TTC VEHICLE IS IN… MIN”. After that I sewed on the LED’s and the ground connections:

 

 

 

 

 

 

 

 

 

 

 

On another piece of fabric I sewed on the signal connections:

 

 

 

 

 

 

 

 

 

And finally I sewed the two main pieces of fabric together and sewed on velcro strips along the sides and put together the small removable patch as well:

 

 

 

 

 

 

 

 

 

 

 

The final result is this:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Here is a short video of the shirt changing numbers and displaying a text message:

For the shirt to display TTC data, an internet connection is required. For now, I used a bluetooth mate silver to connect the arduino and a laptop wirelessly. I then used Processing to extract the next vehicle arrival information from the internet and then have it sent to the arduino. The entire circuit is powered by a 3.7V Lithium Ion battery.

Improvements

If I had more time, instead of conductive thread, I would have used laser cut conductive fabric. Currently the conductive thread is not reliable and the LED’s are intermittently lighting up. I believe conductive fabric would have produced a more stable connection.

Code

Processing Code:

import controlP5.*;
ControlP5 cP5;
ControlFont ButtonFont;
String StopValue = “6850”;
String TextValue = “HELLO”;
//Textfield StopNumber;

import processing.serial.*;

Serial port;
PImage backgroundImg;
int VehicleWaitTime;
int DelayTimer;
int DelayValue;
int Mode = 0;

final int TTCMode = 0;
final int TextMode = 1;
final int NotifyMode = 2;
final int FlashTime = 500;
boolean TextSent = false;
int lastTime;

float n;

//LED [] LEDsOff = new LED [15];

void setup() {

// set up serial port
PFont font = createFont(“arial”,81,true);
ButtonFont = new ControlFont(createFont(“arial”,60),60);
//ButtonFont.setSmooth(true);
lastTime = millis();
cP5 = new ControlP5(this);

cP5.addTextfield(“StopNumber”)
.setPosition(111,341)
.setSize(768,119)
.setFont(font)
.setFocus(true)
.setColor(color(255,255,255))
.setText(StopValue);
;
/*cP5.addBang(“submit”)
.setPosition(40, 300)
.setSize(280, 40)
.setTriggerEvent(Bang.RELEASE)
.setLabel(“Submit”)
;*/
cP5.addButton(“Submit”)
.setPosition(111,518)
.setSize(239,95)
//.setFont(font)
.setValue(0)
;
cP5.addButton(“Text”)
.setPosition(401, 518)
.setSize(239,95)
.setValue(0)
;

cP5.addButton(“Notify”)
.setPosition(693, 518)
.setSize(239,95)
.setValue(0)
;

cP5.controller(“Submit”).captionLabel().setControlFont(ButtonFont);
cP5.controller(“Submit”).captionLabel().setControlFontSize(60);
cP5.controller(“Text”).captionLabel().setControlFont(ButtonFont);
cP5.controller(“Text”).captionLabel().setControlFontSize(60);
cP5.controller(“Notify”).captionLabel().setControlFont(ButtonFont);
cP5.controller(“Notify”).captionLabel().setControlFontSize(60);

//controlP5.setFocus(true);
//controlP5.setColor(color(255,255,255));

println(“Available serial ports:”);
println(Serial.list());

port = new Serial(this, Serial.list()[6], 115200);

size (1280, 800);
backgroundImg = loadImage(“background.png”);

DelayTimer = millis();
DelayValue = 1000;
//LEDPlace = new LED;
//int k = 0;

}

void draw() {
//imageMode (CORNER);
image(backgroundImg, 0, 0);

if (Mode == TTCMode) {
VehicleWaitTime = CheckWaitTime(StopValue, VehicleWaitTime);

// station ID 6850 is for 501 Queen Westbound at Shaw street
println(“Time: ” + VehicleWaitTime);
println(“Stop Number: ” + StopValue);
if (VehicleWaitTime > 9) {

port.write(” “);
} else {

port.write(VehicleWaitTime);
}
} else if(Mode == TextMode) {
//port.write(“HELLO”);
if (TextSent == true) {
port.write(” “);
port.write(TextValue);
println(“Text mode”);
TextSent = false;
port.write(” “);
}
} else if(Mode == NotifyMode) {
//port.write(” “);
if (millis() – lastTime >= FlashTime) {
port.write(TextValue);
println(“Notify mode”);
lastTime = millis();
}
}
//port.write(25);

/*for (int i = 0; i <=14; i ++) {
LEDsOff[i].display();
}*/

}

public void controlEvent(ControlEvent theEvent) {
println(theEvent.getController().getName());

}

public void Submit(int theValue) {

StopValue = cP5.get(Textfield.class, “StopNumber”).getText();
println(“a button event from Submit: “+StopValue);
Mode = TTCMode;
}

public void Text(int theValue) {
TextValue = cP5.get(Textfield.class, “StopNumber”).getText();
println(“a button event from Text: ” + TextValue);
Mode = TextMode;
TextSent = true;
}

public void Notify(int theValue) {
TextValue = “!”;
Mode = NotifyMode;
//TextSent = true;
}

int CheckWaitTime(String StopID, int LastValue) {
// The URL for the XML document

// using XML to get data
String url = “http://webservices.nextbus.com/service/publicXMLFeed?command=predictions&a=ttc&stopId=” + StopID;
XML xml;
int WaitTime = 0;
// Load the XML document
if ((millis() – DelayTimer) < DelayValue) {
xml = loadXML(url);
//XML NextVehicle = xml.getChild(“predictions”).getChild(“direction”).getChild(“prediction”);
XML[] NextVehicle = xml.getChildren(“predictions”);

for (int i = 0; i <= NextVehicle.length-1; i++) {
String NoPrediction = NextVehicle[i].getString(“dirTitleBecauseNoPredictions”);
print(“Counter: ” + i + ” “);
println(“XML String: ” + NoPrediction);
if (NoPrediction == null) {
XML NextVehicle2 = NextVehicle[i].getChild(“direction”).getChild(“prediction”);
WaitTime = NextVehicle2.getInt(“minutes”);
}
//WaitTime = 10;
}

//println(NextVehicle[1].getContent());

//XML NextVehicle2 = NextVehicle[1].getChild(“direction”).getChild(“prediction”);
//println(NextVehicles);

//XML Vehicles [];
//NumberOfCars = NextVehicles.getChildCount();
//Vehicles = NextVehicles.getChildren();
//println(Vehicles);

return WaitTime;
} else {
DelayTimer = millis();
WaitTime = LastValue;
return WaitTime;

}
}
//maps numbers to data

Arduino Code:

//Pin Numbers
const int LED0 = A1;
const int LED1 = A2;
const int LED2 = 2;
const int LED3 = 13;
const int LED4 = A0;
const int LED5 = 3;
const int LED6 = 11;
const int LED7 = 12;
const int LED8 = 4;
const int LED9 = 9;
const int LED10 = 10;
const int LED11 = 5;
const int LED12 = 7;
const int LED13 = 8;
const int LED14 = 6;
const int VibePin = A3;

unsigned long StartTimer;
unsigned long EndTimer;
unsigned long PresentTime;
int DelayValue;

boolean Changed = false;
byte PreviousCommand = 0;

void setup() {

Serial.begin(115200);
//set up pins
for (int i = LED2; i <= LED7; i++) {
pinMode(i, OUTPUT);
LEDOff(i);
}

pinMode (LED0, OUTPUT);
LEDOff(LED0);
pinMode (LED1, OUTPUT);
LEDOff(LED1);
pinMode (LED4, OUTPUT);
LEDOff(LED4);
pinMode (VibePin, OUTPUT);
LEDOff(VibePin);

DelayValue = 500;
}

void loop() {

byte Number;
if (Serial.available()) {
Number = Serial.read();
if (Number >=0 && Number <= 32) {
if (Number != PreviousCommand) {
DisplayOff(true);
}
DisplayNumber(Number);
} else if (Number == 33) {
DisplayNumber(Number);
} else {
DisplayNumber(Number);
delay(500);
DisplayOff(true);
}
}
//DisplayNumber(35);
}
void LEDOn (int PinNumber) {
digitalWrite(PinNumber, HIGH);
}

void LEDOff (int PinNumber) {
digitalWrite(PinNumber, LOW);
}

void DisplayOff (boolean Delay) {
LEDOff(LED0);
LEDOff(LED1);
LEDOff(LED2);
LEDOff(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOff(LED6);
LEDOff(LED7);
LEDOff(LED8);
LEDOff(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOff(LED12);
LEDOff(LED13);
LEDOff(LED14);
if (Delay == true) {
delay(200);
}
}

void Row1On() {
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);
}

void Row1Off() {
LEDOff(LED12);
LEDOff(LED13);
LEDOff(LED14);
}

void Row2On() {
LEDOn(LED9);
LEDOn(LED10);
LEDOn(LED11);
}

void Row2Off() {
LEDOff(LED9);
LEDOff(LED10);
LEDOff(LED11);
}
void Row3On() {
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
}

void Row3Off() {
LEDOff(LED6);
LEDOff(LED7);
LEDOff(LED8);
}

void Row4On() {
LEDOn(LED3);
LEDOn(LED4);
LEDOn(LED5);
}

void Row4Off() {
LEDOff(LED3);
LEDOff(LED4);
LEDOff(LED5);
}

void Row5On() {
LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
}

void Row5Off() {
LEDOff(LED0);
LEDOff(LED1);
LEDOff(LED2);
}

void FlashPattern() {
DisplayOff(false);
Row1On();
delay(15);
Row2On();
delay(15);
Row3On();
delay(15);
Row4On();
delay(15);
Row5On();
delay(15);
Row5Off();
delay(15);
Row4Off();
delay(15);
Row3Off();
delay(15);
Row2Off();
delay(15);
Row1Off();
delay(15);
}

void DisplayNumber (byte Number) {
//DisplayOff();
switch (Number) {
case 0:

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);
//StartTimer = millis();
//Serial.println(“Start:” + StartTimer);
//EndTimer = StartTimer + DelayValue;
//Serial.println(“End:” + EndTimer);
//Serial.println(“present: ” + millis());
//println(StartTimer);
//if ((StartTimer + DelayValue) < millis()) {
//Serial.println(“Vibe On”);
LEDOn(VibePin);
//} else {
//Serial.println(“Vibe Off”);
// LEDOff(VibePin);
//}
PreviousCommand = 0;
break;

case 1:

LEDOff(LED0);
LEDOn(LED1);
LEDOff(LED2);
LEDOff(LED3);
LEDOn(LED4);
LEDOff(LED5);
LEDOff(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOff(LED9);
LEDOn(LED10);
LEDOff(LED11);
LEDOff(LED12);
LEDOn(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 1;
break;

case 2:

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOff(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 2;
break;

case 3:

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOff(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOff(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 3;

break;
case 4:

LEDOn(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOff(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOff(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 4;
break;
case 5:
LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOff(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 5;
break;
case 6:

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 6;
break;
case 7:

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOff(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOff(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOff(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOff(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 7;
break;
case 8:
LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 8;
break;
case 9:

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOff(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOff(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 9;
break;

case 65: //A

LEDOff(LED0);
LEDOn(LED1);
LEDOff(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 65;
break;
case 66: //B

LEDOn(LED0);
LEDOn(LED1);
LEDOff(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 66;
break;
case 67: //C

LEDOff(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOff(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOff(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 67;
break;
case 68: //D

LEDOn(LED0);
LEDOn(LED1);
LEDOff(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 68;
break;
case 69: //E

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 69;
break;
case 70: //F

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOff(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 70;
break;
case 71: //G

LEDOff(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOff(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 71;
break;
case 72: //H

LEDOn(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 72;
break;
case 73: //I

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOff(LED3);
LEDOn(LED4);
LEDOff(LED5);
LEDOff(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOff(LED9);
LEDOn(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 73;
break;
case 74: //J

LEDOff(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOff(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOff(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOff(LED12);
LEDOn(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 74;
break;
case 75: //K

LEDOn(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 75;
break;
case 76: //L

LEDOn(LED0);
LEDOff(LED1);
LEDOff(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOff(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 76;
break;
case 77: //M

LEDOn(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOn(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 77;
break;
case 78: //N

LEDOn(LED0);
LEDOn(LED1);
LEDOff(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 78;
break;
case 79: //O

LEDOff(LED0);
LEDOn(LED1);
LEDOff(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOff(LED12);
LEDOn(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 79;
break;
case 80: //P

LEDOn(LED0);
LEDOn(LED1);
LEDOff(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOff(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 80;
break;
case 81: //Q

LEDOff(LED0);
LEDOn(LED1);
LEDOff(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOn(LED10);
LEDOff(LED11);
LEDOff(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 81;
break;
case 82: //R

LEDOn(LED0);
LEDOn(LED1);
LEDOff(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 82;
break;
case 83: //S

LEDOff(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOn(LED6);
LEDOn(LED7);
LEDOn(LED8);
LEDOff(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 83;
break;
case 84: //T

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOff(LED3);
LEDOn(LED4);
LEDOff(LED5);
LEDOff(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOff(LED9);
LEDOn(LED10);
LEDOff(LED11);
LEDOff(LED12);
LEDOn(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 84;
break;
case 85: //U

LEDOn(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 85;
break;
case 86: //V

LEDOn(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOn(LED11);
LEDOff(LED12);
LEDOn(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 86;
break;
case 87: //W

LEDOn(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOn(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOn(LED6);
LEDOff(LED7);
LEDOn(LED8);
LEDOn(LED9);
LEDOn(LED10);
LEDOn(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 87;
break;
case 88://X

LEDOn(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOff(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOff(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOff(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOff(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 88;
break;
case 89://Y

LEDOn(LED0);
LEDOff(LED1);
LEDOn(LED2);
LEDOff(LED3);
LEDOn(LED4);
LEDOff(LED5);
LEDOff(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOff(LED9);
LEDOn(LED10);
LEDOff(LED11);
LEDOff(LED12);
LEDOn(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 89;
break;
case 90://Z

LEDOn(LED0);
LEDOn(LED1);
LEDOn(LED2);
LEDOff(LED3);
LEDOff(LED4);
LEDOn(LED5);
LEDOff(LED6);
LEDOn(LED7);
LEDOff(LED8);
LEDOn(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOn(LED12);
LEDOn(LED13);
LEDOn(LED14);

LEDOff(VibePin);
PreviousCommand = 90;
break;
case 32://space

LEDOff(LED0);
LEDOff(LED1);
LEDOff(LED2);
LEDOff(LED3);
LEDOff(LED4);
LEDOff(LED5);
LEDOff(LED6);
LEDOff(LED7);
LEDOff(LED8);
LEDOff(LED9);
LEDOff(LED10);
LEDOff(LED11);
LEDOff(LED12);
LEDOff(LED13);
LEDOff(LED14);

LEDOff(VibePin);
PreviousCommand = 32;
delay(500);
break;
case 33://”!”

FlashPattern();
PreviousCommand = 32;
//delay(500);
break;

if (Number != 33) {
delay (1000);
}

}
}

Wearables & Rapid Prototyping

Laser Cutting

3D Printing

On Thingiverse

Projects

 

Breathalyzer Microphone tutorial

http://www.instructables.com/id/Breathalyzer-Microphone/

A very fun project that utilize microphone and Arduino.

Safety Jacket

Sexual abuse and rape are serious issues that are quite common around the world. Many cases go unreported because the victims feel like the police cannot help them. In fact, in 8% of rape cases, the attacker is unidentified. For my project, I wanted to create a safety jacket for women that not only helps to scare off the attacker as a preventative measure, but also helps capture evidence of the incident if the crime was so unfortunate to have happened. Such a dreadful experience often affects the victim psychologically, making it hard for the victim to repeat or remember what happened. So, this jacket will act as a way for authorities to understand the situation, allowing them to be able to take action as soon as possible and prevent the attacker from hurting anyone else.

To achieve this, I want to experiment with other outputs besides LEDS, which I have used for my first two projects. I want to experiment with using a zipper as one of the inputs and a camera as one of the outputs. Other parts will include: conductive thread, LED, Lilypad simple, Resistors, and batteries. It’s quite ambitious for someone who has little experience with codes or any of the parts I want to use, so I’m hoping that things will go as planned.

But what is the plan?

Week 1 – research and experiment with the technology (camera) and circuit (zippers and resistors)

Week 2 – begin prototyping (sketches of final design, find materials or existing jacket that I could use)

Week 3 – final design (make the jacket and test it, make changes)

UPDATED! With this project, I wanted to experiment with two things – cameras and zippers; however, I realized that in order to get the camera to function, there are many components I would need to purchase and the price will add up. So, I’ve decided to dedicate my time towards experimenting with zippers and adding more features to the jacket (as you can see with my updated parts list).

Parts – Zipper, Conductive Thread, LED, Pull Switch, Light Sensor, Speaker, Lilypad Simple, Resistors, Batteries

Imagined wearable

My project is a jacket that has signals and lights on the back. This is useful when you are riding your bike at night time and drivers can’t see you. Also the jacket would have right and left signals because some bikes don’t have them. It is a very simple project but should already be available by now!

light yourself up

Concept

During last year’s winter I was hit by a car while walking in the dark. So for this project, I wanted to add LED lights to the back of the wool hat so it can be used as a safety device as well as maintain it’s aesthetic view.

Components

  • LilyPad LED White x 3
  • LilyPad Arduino Board Simple
  • Lilypad Light Sensor
  • Conductive Thread
  • 3 AAA Battery

Circuit diagram

 Codes

Originally I was planning to insert a Lilypad buzz sensor to the product so it will give out a buzz signal to the users when the light is on.However; I found it really difficult combining the two sensors together. Therefore, instead of having two sensors together, i chose to insert the light sensor only. I first applied the set of codes provided by the Arduino tutorial, this set of codes allows me to turn the LED lights on and off but this is not what i desired. In order to have different brightness levels, adjustment was made and it is shown below:

int ledPin = 9; // LED is connected to digital pin 9
int led2Pin = 10; // LED is connected to digital pin 10
int led3Pin = 11; // LED is connected to digital pin 11
int led4Pin = 6; // LED is connected to digital pin 6
int led5Pin = 5; // LED is connected to digital pin 5

int sensorPin = A2; // light sensor is connected to analog pin 2
int sensorValue; // variable to store the value coming from the sensor

void setup()
{
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output
pinMode(sensorPin, INPUT); // sets the ledpin to be an input
Serial.begin(9600); //initialize the serial port

}

void loop() // run over and over again
{
sensorValue = analogRead(sensorPin); // read the value from the sensor
analogWrite(ledPin, abs(sensorValue/4-255)); // 0=255, 255=0
analogWrite(led2Pin, abs(sensorValue/4-255)); // 0=255, 255=0
analogWrite(led3Pin, abs(sensorValue/4-255)); // 0=255, 255=0
analogWrite(led4Pin, abs(sensorValue/4-255)); // 0=255, 255=0
analogWrite(led5Pin, abs(sensorValue/4-255)); // 0=255, 255=0
Serial.println(sensorValue); // send that value to the computer
delay(100); // delay for 1/10 of a second
}

 

 

Another set of codes were made in order to get the best result and it’s shown below:

int ledPin = 5; // LED connected to digital pin 13
int ledPin1 = 6;
int ledPin2 = 9;
int ledPin3 = 10;
int ledPin4 = 11;

int sensorPin = A2; // light sensor is connected to analog pin 0
int sensorValue = 0; // variable to store the value coming from the sensor
int sensorFrequency = 100; // number of milliseconds between sensor readings

int lightThreshold1 = 10; // threshold below which light turns on
int lightThreshold2 = 500; // threshold below which light turns OFF

void setup()
{
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output

pinMode(ledPin1, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin2, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin3, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin4, OUTPUT); // sets the ledPin to be an output

Serial.begin(9600); //initialize the serial port

}

void loop() // run over and over again
{
sensorValue = analogRead(sensorPin); // read the value from the sensor
Serial.println(sensorValue); // send that value to the computer

/* Turn on the LEDs if the light sensor drops below threshold */
if (sensorValue <= lightThreshold1){
analogWrite(ledPin, 255); // turn the LED on

analogWrite(ledPin1, 255); // turn the LED on
analogWrite(ledPin2, 255); // turn the LED on
analogWrite(ledPin3, 255); // turn the LED on
analogWrite(ledPin4, 255); // turn the LED on
}
else if (sensorValue > lightThreshold2) // turn the LEDs off
{
analogWrite(ledPin, 0); // turn the LED off
analogWrite(ledPin1, 0); // turn the LED off
analogWrite(ledPin2, 0); // turn the LED off
analogWrite(ledPin3, 0); // turn the LED off
analogWrite(ledPin4, 0); // turn the LED off
}
else {
analogWrite(ledPin, 10);
analogWrite(ledPin1, 10);
analogWrite(ledPin2, 10);
analogWrite(ledPin3, 10);
analogWrite(ledPin4, 10);
}

/* Delay for defined delay period */
delay(sensorFrequency);
}

Detail of the final project:

                                        Right Pouch for the Lilypad Simple                                                                       Left pouch for the battery

  

Back view of the hat with the LED lights attached                                                                            Brightest at night/ dark ares                                                                                                     Dimmer with room light

                                     Fully off under the light/sun

 

 

Responsive Wearable

CODE:

int ledPin = 11; // LED connected to digital pin 13
int ledPin1 = 10;
int ledPin2 = 9;
int ledPin3 = 6;
int ledPin4 = 5;

int sensorPin = A2; // light sensor is connected to analog pin 0
int sensorValue = A2; // variable to store the value coming from the sensor
int sensorFrequency = 100; // number of milliseconds between sensor readings

int lightThreshold = 10; // threshold below which light turns on

void setup()
{
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output

pinMode(ledPin1, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin2, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin3, OUTPUT); // sets the ledPin to be an output
pinMode(ledPin4, OUTPUT); // sets the ledPin to be an output

Serial.begin(9600); //initialize the serial port

}

void loop() // run over and over again
{
sensorValue = analogRead(sensorPin); // read the value from the sensor
Serial.println(sensorValue); // send that value to the computer

/* Turn on the LEDs if the light sensor drops below threshold */
if (sensorValue <= lightThreshold){
digitalWrite(ledPin, HIGH); // turn the LED on

digitalWrite(ledPin1, HIGH); // turn the LED on
digitalWrite(ledPin2, HIGH); // turn the LED on
digitalWrite(ledPin3, HIGH); // turn the LED on
digitalWrite(ledPin4, HIGH); // turn the LED on
}
else // turn the LEDs off
{
digitalWrite(ledPin, LOW); // turn the LED off

digitalWrite(ledPin1, LOW); // turn the LED off
digitalWrite(ledPin2, LOW); // turn the LED off
digitalWrite(ledPin3, LOW); // turn the LED off
digitalWrite(ledPin4, LOW); // turn the LED off
}

/* Delay for defined delay period */
delay(sensorFrequency);
}