Lang MeiRishabh Berlia
Published © LGPL

iNFormµ Wearable Stage One

Our goal is to create a wearable wristband which can notify the user through vibrator and RGB LED when user's personal belonging is losing.

IntermediateWork in progress16 hours2,294
iNFormµ Wearable Stage One

Things used in this project

Hardware components

Lilypad Simblee BLE Board - RFD77101
SparkFun Lilypad Simblee BLE Board - RFD77101
×1
SparkFun Triple Axis Accelerometer Breakout - ADXL335
SparkFun Triple Axis Accelerometer Breakout - ADXL335
×1
SparkFun Polymer Lithium Ion Battery - 850mAh
×1
RGB Diffused Common Cathode
RGB Diffused Common Cathode
×1
SparkFun Vibration motor
×1

Software apps and online services

nRF MCP
Download it on Apple Store

Hand tools and fabrication machines

SparkFun LilyPad FTDI Basic Breakout - 5V

Story

Read more

Code

Code Example to control the Vibrator and RGB, using accelerometer values.

Arduino
int redPin = 9; //The RGB Red pin goes to pin 9 on the Lilypad
 int greenPin = 11; //The RGB green pin goes to pin 9 on the Lilypad
 int bluePin = 12; //The RGB blue pin goes to pin 9 on the Lilypad
 int vib = 15; //The vibrator signal pin goes to pin 15
const int xPin = 3; //On the Simblee Lilypad Pins 3,5,6 can be used as Analog pins as well.
 const int yPin = 5;
 const int zPin = 6;
//#define COMMON_ANODE //If your LED is a common anode, uncomment the #define
void setup() {
 // put your setup code here, to run once:
 pinMode(vib, OUTPUT);
 pinMode(redPin, OUTPUT);
 pinMode(greenPin, OUTPUT);
 pinMode(bluePin, OUTPUT);
 Serial.begin(9600);
 }
void loop() {
 // put your main code here, to run repeatedly:
//read the analog values from the accelerometer
 int xRead = analogRead(xPin);
 int yRead = analogRead(yPin);
 int zRead = analogRead(zPin);
if(xRead >= 550)
 setColor(0, 255, 0); // Green
 else if (yRead >=550)
 setColor(255, 0, 0); // Red
 else
 { setColor(0, 0, 255); // Blue
 digitalWrite(15, HIGH); // turn the Vibrator on (HIGH is the voltage level)
 delay(1000); // wait for a second
 digitalWrite(15, LOW); // turn the Vibrator off by making the voltage LOW
 delay(1000); }
}
//Function to set the color of your RGB.
 void setColor(int red, int green, int blue)
 {
 #ifdef COMMON_ANODE
 red = 255  red;
 green = 255  green;
 blue = 255  blue;
 #endif
 analogWrite(redPin, red);
 analogWrite(greenPin, green);
 analogWrite(bluePin, blue);
 }

Credits

Lang Mei

Lang Mei

1 project • 5 followers
Rishabh Berlia

Rishabh Berlia

1 project • 5 followers

Comments