Project: Camera Lighting – Prototyping

Here, I’m going to step through the prototyping process of getting this to work.

Step 1:  The Power

I like to set up the power component of my projects first, since if that doesn’t work, I’m not going anywhere.

Using PCBs with breadboards without soldering isn’t all that friendly, but you can make it work temporarily.  I’ve found that plugging breadboard wire through the holes and into a piece of female header works fairly well, if you prop the header under the board at an angle that presses the sides of the wire against the sides of the holes.  Not ideal, but workable in a temporary sort of way.  If I was doing a more complicated prototype, I’d just solder in some hookup wire.

Parts:

  • 4 short breadboard wires

  • Adafruit Powerboost 1000C

  • Female Header piece

  • Li-Poly battery (1200 mah here, I’ll probably use a 2000 mah battery in the final project)

IMG_20170322_222747

 

Here, hook up the wires to 5V, VCC, EN, and GND.  EN is the enable pin for the board.  If you short it with the switch that he will be hooking up soon, then it shuts the whole board down, giving you an effective power switch, since all of your power will be running through here.  The 5V pin is running to the power rail on the breadboard in the next step, and will go straight to VCC on the Arduino Pro in the final product.IMG_20170322_222900

 

Finally, connect the battery.

IMG_20170322_222912

 

Step 2:  Connect the Kill-Switch

Attach the 5V to the power rail on the breadboard, and bring VCC, EN, and GND across and connect them however your switch pinout works.  Use whatever kind of switch you want to, here.  Basically, when you connect GND to EN, then the board shuts down.

IMG_20170322_223023

 

Connect VCC, EN, and GND to your switch, and go ahead and jumper the GND connection to the ground rail of the board.  Run 5V to the voltage rail on your breadboard.IMG_20170322_223224

 

Step 3:  Hook up the LEDs

Hook up some LEDs.  I hook them up alternating, so that the 1st and 2nd column share a row on the breadboard, which means that they are inserted oppositely.  That’s just my thing, set yours up however, but it’s important to know that for the next step.IMG_20170322_223408

 

Jumper all of your ground columns to the ground rail.  You’ll notice that the voltage pins go off to the side.  This is where I’ll connect the  Arduino here in a minute.  IMG_20170322_223526

 

At this point, I usually test my LEDs by connecting a jumper on the same row to the voltage rail for a second, just to make sure they light up!IMG_20170322_223537

 

Step 4:  Hook up the Potentiometer and the Arduino

Here is the basis for the potentiometer install.  Power and Ground to the rails on the breadboard.  The yellow wire goes to the Arduino (in this case, pin 10), and will control (eventually) the brightness of the LEDs.IMG_20170322_223622

 

Here’s the potentiometer installed (basic 10k) and you’ll also notice a white wire connected from the Arduino (Pin 9) to the same row as the LEDs.  This is where we control the voltage to them.IMG_20170322_223716

 

Code:

int potPin = 10;  // This is the pin we will use for the potentiometer
int ledPin = 9;   // This is the pin for the LEDs

int val;          // This will be our actual variable that we use to pass values
                  // from the potentiometer to the LEDs

void setup()
{
  val = 0;        // Initialize val to zero.  Probably not necessary, but habit.
}

void loop()
{
  val = analogRead(potPin);         // Get the value of the potentiometer
  val = map(val, 0, 1023, 0, 254);  // Map the value of the potentiometer to a
                                    // range that the LEDs can make use of

  analogWrite(val, ledPin);         // Set the brightness of the LEDs

  delay(100);                       // Habit to keep from Serial collision if I
                                    // need to debug.  Not noticeable.
}

 

Fritzing Diagram:

CameraLight_Fritzing

Advertisements

4 thoughts on “Project: Camera Lighting – Prototyping”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s