Introduction: Controlling an RGB LED With Color Detector Camera

This instructable shows how to control an RGB led using an arduino board and 1Sheeld.

The key feature being the colour is selected by detecting the color with your android phone camera, the RGB value is processed and sent to the audrino which then outputs that same value.

Feel free to ask any questions in the comments and I'll answer them as best i can.

Video below shows the final result:

Step 1: What You Need

Hardware:

Arduino Uno or Mega.

1sheeld

1 x RGB LED.

4 x Connection Wires.

1 x Breadboard.

3 x 220 Ohms Resistors.

Software:

1- The Arduino IDE which you can download here
2- Get the 1sheeld Arduino library and the phone app here

PS: make sure to go through the 1sheeld intro tutorial here and how to use 1sheeld with different Arduino boards here (i will be using Arduino Mega for the rest of the tutorial)

Step 2: Wiring and Setup

1.mount the 1sheeld on the Arduino board

2.Make sure the power switch shown above is turned to 5V (for Arduino UNO users) if you're using another Arduino board check here

3.Connect the X3 220 ohms resistors as shown.

4.Connect the long leg of the RGB to the GND

then connect the Red Leg to pin9, Green Leg to pin10 and Blue Leg to pin11.

Step 3: Software

  • Simply, the code reads the values of your phone's Camera then sends them to the RGB.
  • Upload the attached code and lets move to the next step.
  • Use your 1Sheeld Mobile App (Color Detector Shield) to scan any color you want.

PS: make sure the 1sheeld is in upload mode as seen in the image above.

Step 4: Putting It All Together

  1. After connecting all components as shown.
  2. Connect the Arduino to your laptop and make sure the code is uploaded.
  3. Switch the 1Sheeld back to operating mode.
  4. Open your 1Sheeld app and connect your phone to your 1Sheeld board. (Check 1Sheeld tutorial here if you haven't already).
  5. Select Color Detector Shield, and press on the multiple shields icon at the top right of the app.
  6. Now, hold your phone, then scan the color of any object and watch your RGB.
  7. Finally, feel free to ask any questions in the comments and I'll answer them as best i can.