Eben Kouao
Published © GPL3+

DIY Arduino Turn Signal Bike Safety Vest

Cars have turn signals, why not bikes? LightVest is an Arduino turn signal bike safety vest designed to be a wearable tech for cyclists.

IntermediateFull instructions provided6 hours7,706
DIY Arduino Turn Signal Bike Safety Vest

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×2
JLCPCB Customized PCB
JLCPCB Customized PCB
×1
NeoPixel Ring: WS2812 5050 RGB LED
Adafruit NeoPixel Ring: WS2812 5050 RGB LED
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×2
Inertial Measurement Unit (IMU) (6 deg of freedom)
Inertial Measurement Unit (IMU) (6 deg of freedom)
×1
Rechargeable Battery, 4.8 V
Rechargeable Battery, 4.8 V
×2
Jumper wires (generic)
Jumper wires (generic)
×1
Breadboard (generic)
Breadboard (generic)
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

LightVest Remote 3D Print - Bottom

LightVest Remote 3D Print - Top

(Find more on the PCB version on the Git Repo)

LightVest Remote 3D Print - Buttons

Schematics

LighVest Open Source Schematics - Remote

LightVest Remote Schematics

LighVest Open Source Schematics - Vest

LightVest Wearable LED Strip Schematic

Code

Code snippet #1

Plain text
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif

#define LED_BACK    5
#define LED_LEFT    4
#define LED_RIGHT   6

// How many NeoPixels are attached to the Arduino?
#define LED_COUNT 52 // Define the number of LEDs in the strip

char state = 0; // Changes value from ASCII to char
int light_delay = 50; //How long to keep the LED on for (ms)

Code snippet #3

Plain text
void setup() {
  // These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
  // Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif
  // END of Trinket-specific code.

  strip_back.begin();           // INITIALIZE NeoPixel strip_back object (REQUIRED)
  strip_back.show();            // Turn OFF all pixels ASAP
  strip_back.setBrightness(150); // Set BRIGHTNESS to about 1/5 (max = 255)

  strip_left.begin();           // INITIALIZE NeoPixel strip_back object (REQUIRED)
  strip_left.show();            // Turn OFF all pixels ASAP
  strip_left.setBrightness(150); // Set BRIGHTNESS to about 1/5 (max = 255)

  strip_right.begin();           // INITIALIZE NeoPixel strip_back object (REQUIRED)
  strip_right.show();            // Turn OFF all pixels ASAP
  strip_right.setBrightness(150); // Set BRIGHTNESS to about 1/5 (max = 255)

  Serial.begin(9600);
  delay(1000);
}

Code snippet #4

Plain text
// loop() function -- runs repeatedly

void loop() {

  if (Serial.available() > 0) { // Checks whether data is comming from the serial port

    state = Serial.read(); // Reads the data from the serial port
    Serial.print(state); // Prints out the value sent

    //Indcate Left
    if (state == 'L') {
      leftBlink();
      delay(light_delay);
    }

    //Indicate Right
    if (state == 'R') {
      rightBlink();
      delay(light_delay);
    }
  }

}

Github

https://github.com/EbenKouao/lightvest-led-bike-suit

Credits

Eben Kouao

Eben Kouao

5 projects • 62 followers
I like to build stuff.

Comments