DIY GUY Chris
Published © Apache-2.0

DIY Low-Cost Bluetooth Camera Light

Are you ready to learn how to build a DIY camera light that is controlled through Bluetooth from an Android app? then this Article is for yo

IntermediateFull instructions provided2 days834
DIY Low-Cost Bluetooth Camera Light

Things used in this project

Hardware components

ATmega328
Microchip ATmega328
×1
NeoPixel Ring: WS2812 5050 RGB LED
Adafruit NeoPixel Ring: WS2812 5050 RGB LED
×1
Rechargeable Battery, Lithium Ion
Rechargeable Battery, Lithium Ion
×1
HC-05 Bluetooth Module
HC-05 Bluetooth Module
×1

Software apps and online services

Arduino IDE
Arduino IDE
MIT App Inventor
MIT App Inventor
Circuit Maker
CircuitMaker by Altium Circuit Maker

Hand tools and fabrication machines

Hot Plate, Convection
Hot Plate, Convection
Hot Air Station, Industrial
Hot Air Station, Industrial
3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

CAD files of the housing Backside

CAD files of the housing Frontside

Schematics

Circuit Schematic

Code

Arduino Code

Arduino
You will need to add the Adafruit_Neopixles library to your Arduino IDE
#include <EEPROM.h>
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif
#define PIN            3
#define NUMPIXELS      42

Adafruit_NeoPixel DIY_Camera_Light = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

const int SwitchDetection=0;
const int RedCell=1;
const int GreenCell=2;
const int BlueCell=3;
int Red=0;
int Green=0;
int Blue=0;
int Brightness=50;
int updateLight=1;
char Data=' ';
void setup() 
{
  Serial.begin(9600);
  DIY_Camera_Light.begin(); // This initializes the NeoPixel library.
  DIY_Camera_Light.setBrightness(Brightness);
  switch(EEPROM.read(SwitchDetection))
  {
    case(0):
    {
      EEPROM.write(RedCell,255);
      EEPROM.write(GreenCell,100);
      EEPROM.write(BlueCell,10);
    }break;
    case(1):
    {
      EEPROM.write(RedCell,255);
      EEPROM.write(GreenCell,200);
      EEPROM.write(BlueCell,100);
    }break;
    case(2):
    {
      EEPROM.write(RedCell,255);
      EEPROM.write(GreenCell,120);
      EEPROM.write(BlueCell,50);
    }break;
  }
  EEPROM.write(SwitchDetection,EEPROM.read(SwitchDetection)+1);
  if(EEPROM.read(SwitchDetection)==3)
  EEPROM.write(SwitchDetection,0);
  Red=EEPROM.read(RedCell);
  Green=EEPROM.read(GreenCell);
  Blue=EEPROM.read(BlueCell);
}

void loop() 
{
  while(Serial.available())
  {
    Data=Serial.read();
    if(Data=='r')
    {
      updateLight=1;
      Red=Serial.parseInt();
      continue;
    }
    if(Data=='g')
    {
      Green=Serial.parseInt();
      continue;
    }
    if(Data=='b')
    {
      Blue=Serial.parseInt();
      continue;
    }
    if(Data=='c' || Data=='i')
    {
      for(int i=0; i<NUMPIXELS; i++)
      {
        DIY_Camera_Light.setPixelColor(i,0,0,0);
      }
      DIY_Camera_Light.show();
      delay(50);
      for(int i=0; i<NUMPIXELS; i++)
      {
        DIY_Camera_Light.setPixelColor(i,Red,Green,Blue);
      }
      DIY_Camera_Light.show();
      delay(50);
      for(int i=0; i<NUMPIXELS; i++)
      {
        DIY_Camera_Light.setPixelColor(i,0,0,0);
      }
      DIY_Camera_Light.show();
      delay(50);
      for(int i=0; i<NUMPIXELS; i++)
      {
        DIY_Camera_Light.setPixelColor(i,Red,Green,Blue);
      }
      DIY_Camera_Light.show();
      delay(50);
      continue;
    }
    if(Data=='A')
    {
      Brightness=Serial.parseInt();
      DIY_Camera_Light.setBrightness(Brightness);
      delay(2);
      DIY_Camera_Light.show();
    }
  }
  if(updateLight==1)
  {
    for(int i=0; i<NUMPIXELS; i++)
    {
      DIY_Camera_Light.setPixelColor(i,Red,Green,Blue);
    }
    DIY_Camera_Light.show();
    updateLight=0;
  }
}

Credits

DIY GUY Chris

DIY GUY Chris

51 projects • 340 followers
I'm having fun while making electronics projects, I am an electrical engineer in love with "Do It Yourself" tasks.

Comments