element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino Projects
  • Products
  • Arduino
  • Arduino Projects
  • More
  • Cancel
Arduino Projects
Blog Arduino LightBox
  • Blog
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino Projects to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: feiticeir0
  • Date Created: 3 Feb 2021 4:32 PM Date Created
  • Views 2922 views
  • Likes 8 likes
  • Comments 6 comments
  • lightbox
  • arduino light box
  • ambient light
  • arduino ambient light
  • arduino projects for beginners
  • arduino
Related
Recommended

Arduino LightBox

feiticeir0
feiticeir0
3 Feb 2021

Hi all

This is a project that I've build a time ago to have some ambient light in photos I've taken of some projects that I did to display in Arduino day in my town.

Using 4 potentiometers you can change the LED color and brightness .

 

imageimage

 

Materials needed

  • Arduino - I've used a Micro Pro
  • 4x 10k potentiometer
  • 1x Adafruit Neopixel stick - or compatible
  • 1x 18650 battery
  • 1x 18650 battery holder
  • Toggle Switch ON-OFF
  • DC-DC Mini Step Up Power Module 1-5v to 5v boost converter
  • image

 

image

3D printed case

image

 

Assembly

 

Following the schematics, the assembly is very simple.

Wire the toggle switch to the battery and to the step-up .

image

Insert the battery holder next to the wall - there is a separator to keep the holder in place.

image

Wire all the potentiometers and the Neopixel strip

image

image

Everything wired

imageimage

 

Let it be light

image

 

Use 4 M2.5x7 screws to close the LID

image

image

image

imageimage

 

Code

Here's the Arduino code for it. It's very straightforward and it uses the FastLed library.

 

#include <FastLED.h>


#define NUM_LEDS 8

#define DATA_PIN 9

CRGB leds[NUM_LEDS];

const int redPin = A3;
const int greenPin = A2;
const int bluePin = A1;
const int brightPin = A0;

// variable for storing the potentiometer value
int redValue = 0;
int greenValue = 0;
int blueValue = 0;
int brightValue = 255; //1.0 ???

//store old values
int oldRedValue = 0;
int oldGreenValue = 0;
int oldBlueValue = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  Serial.println();
  
  //LEDS
  FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
  
  //show leds
  fill_solid (leds, NUM_LEDS, CRGB(0, 0, 0));
  FastLED.show();
}


void loop() {
  // put your main code here, to run repeatedly:
  //Read colors to send
  redValue = map(analogRead (redPin),0, 1023, 0, 255);
  greenValue = map(analogRead (greenPin), 0, 1023, 0, 255);
  blueValue = map(analogRead (bluePin), 0, 1023, 0, 255); 
  brightValue = map(analogRead (brightPin), 0, 4095, 0, 255);
  /*Serial.print("R: ");
  Serial.println(redValue);
  Serial.print("G: ");
  Serial.println(greenValue);
  Serial.print("B: ");
  Serial.println(blueValue); */
  FastLED.setBrightness(brightValue);
  fill_solid (leds, NUM_LEDS, CRGB(redValue, greenValue, blueValue));
  FastLED.show();   
}

 

Hope you like it !

Files are attached

Thingiverse thing

Attachments:
Arduino_lightbox.zip
  • Sign in to reply

Top Comments

  • DAB
    DAB over 4 years ago +2
    Nice project. It was fun seeing you use analog inputs, they are clearly an under used feature of an Arduino application. DAB
  • neilk
    neilk over 4 years ago +2
    Very nice project neil
  • genebren
    genebren over 4 years ago +1
    Nice project! Always fun and rewarding to build something that works.
  • feiticeir0
    feiticeir0 over 4 years ago in reply to neilk

    Thank you !

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • neilk
    neilk over 4 years ago

    Very nice project

     

    neil

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • feiticeir0
    feiticeir0 over 4 years ago in reply to DAB

    Thank you.

    Yes they are.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • feiticeir0
    feiticeir0 over 4 years ago in reply to genebren

    Thank you.

    I always like when s project works has intended.   

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 4 years ago

    Nice project.

     

    It was fun seeing you use analog inputs, they are clearly an under used feature of an Arduino application.

     

    DAB

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube