Changes

Jump to navigation Jump to search
6,678 bytes added ,  4 years ago
Line 106: Line 106:     
=== Route the shelf ===
 
=== Route the shelf ===
Perform the pocket cut 1/8" deep. This requires the initial pocket cut over the entire region, followed by an inside cut to clean up the pocket cut. The system automatically stays slightly off of the line during the pocket cut as the edge is not as clean when large amounts of wood are being removed. Hence, the inside cut to clean.
+
Perform the pocket cut 1/8" deep. This requires the initial pocket cut over the entire region, followed by an inside cut to clean up the pocket cut. The system automatically stays slightly off of the line during the pocket cut as the edge is not as clean when large amounts of wood are being removed. Hence, the inside cut to clean. You will want to offset the cut slightly (1/16"? - need to verify again) to make the insertion of the faceplate easier.
    
=== Route the hole ===
 
=== Route the hole ===
Line 190: Line 190:  
* 4 Legs
 
* 4 Legs
 
* 1 Table
 
* 1 Table
* 2 Extension cylinders
+
* 3 Extension cylinders
    
[[Image:TV_Mood_Lamp_LED_legs.png|x300px]]
 
[[Image:TV_Mood_Lamp_LED_legs.png|x300px]]
Line 202: Line 202:  
== Attach the magnets ==
 
== Attach the magnets ==
   −
Each slice (including the base), will have 8 magnets attached to it (4 on top, 4 on bottom). These magnets are 1/4" diameter x 1/8" deep. Each slice will therefore need a hole drilled 1/8" deep in the center of each corner. The acrylic slices have marks already. It is important that the wood holes line up exactly.  
+
Each slice (including the base), will have 8 magnets attached to it (4 on top, 4 on bottom). These magnets are 1/4" diameter x 1/16" deep. Each slice will therefore need a hole drilled 1/16" deep in the center of each corner. The acrylic slices have marks already. It is important that the wood holes line up exactly. '''Make sure you do not drill all of the way through. It will be very difficult to mount the magnets if the hole does not have a bottom.'''
   −
== Program the Arduino ==
+
== Electronics ==
 +
The electronics are all about controlling the red, green, and blue intensities on an RGB LED strip - likely in some sort of fade pattern. Our specific RGB Led strip lights are rated at 12V, therefore, we will use a 12V transformer as an input. We will use an [https://www.arduino.cc/ Arduino] microcontroller. Specifically, the stalwart [https://store.arduino.cc/usa/arduino-uno-rev3 | Arduino UNO Rev3].  We need to add three power transistors to the Arduino to be able to deliver adequate power to the red, green, and blue LEDs of the led strip. Therefore, we will use the [https://www.adafruit.com/product/196 | Proto-Screw Shield] from [https://www.adafruit.com/ | Adafruit].
 +
Our system will be driving 12V led strips directly from the  power transformer input. You should not use a transformer significantly different than 12V. The circuit is shown below as a [https://fritzing.org/home/ fritzing] breadboard diagram (click it to enlarge). You can also download an easier to read [[Media:TV_Mood_Lamp_fritzing.pdf|pdf]] or the original [[Media:TV_Mood_Lamp_fritzing.fzz|fritzing file]].
   −
=== Test the Arduino IDE using standard programs ===
+
=== Assemble the Proto-Screw Shield ===
   −
=== Program the Arduino to read in the A/D values ===
+
Assembly of the shield is straightforward. Directions are given at the [https://learn.adafruit.com/adafruit-proto-screw-shield/intro Adafruit site]. There is no need to connect the LED's and resistors on the proto-shield. We will not be using them, and they will not be visible within our lamp. So, all you really need to assemble are the screw terminals (and the reset buttons is fine as well - doesn't hurt anything to have it, but it is sort of hard to press inside of the lamp).
   −
Verify using the printouts
+
[[Image:TV_Mood_Lamp_fritzing_circuit.png|x500px]]
   −
=== Program the Arduino ===
+
=== Solder together the screw shield circuit ===
   −
== Assemble the electronics ==
+
You will want to use solid-core wire for the point-to-point connections on the board. These will hold their position, and fit easily through the holes in the protoboard. To connect to the screw terminals, use the stranded wire. It is much more flexible and will greatly reduce the risk that you break a wire when inserting or removing the system.
   −
=== Solder together the screw shield ===
+
==== Components ====
   −
=== Solder the transistors onto the shield ===
+
==== Input wires (stranded wires) ====
 +
The Input wires connect the external components to the screw terminals. The input power jack connects from the center terminal (power) to one end of the power switch.  The other end of the power switch connects to the VIN of the Arduino system. The ground of the power jack must be connected to the GND of the Arduino system. The potentiometers should have their "low-side" tied together and then connected to the Arduino GND. They should also have their "high-side" tied together and then connected to the Arduino 5V regulated power. The wiper of each potentiometer should then be connected to A0 and A1 respectively. If hooked up "correctly," when the potentiometer is all the way "on," the wiper should be connected to the "high" side. Now, what constitutes "on" is left up to you. If these are hooked up incorrectly, then the wiper can be inverted in software as a simple fix.
   −
=== Solder the solid-core connecting wires ===
+
==== Output wires (solid-core wires) ====
 +
The output system serves to drive the LED lights and consists of the internal wires on the shield. These lights will be connected to a 4-pin terminal in the center of your board. This terminal has power (white or black wire) and then wires for green, red, and blue signals. The power comes directly from the VIN pin ('''not''' the 5V pin). Each of the green, red, and blue signals is connected to a "low-side" MOSFET switch. The source of the MOSFET's are connected to GND, the drain is connected to the appropriate pin on the 4-pin header, and the gates are connected to pins 3 (green), 10 (red), and 11 (blue).
   −
=== Solder the  
+
When soldering solid core wires onto prototype boards, you generally want to connect them to a component that is also soldered into the board. The easiest way to do this is to put the wire through a hole adjacent to the component lead, and then bend the wire over horizontally so that it is basically touching the lead. To accomplish this you will need to strip the wire a little longer to allow enough wire for the journey. Journey? Sure ... journey.
    +
=== Testing the shield wiring ===
 +
'''BEFORE''' powering anything up, or connecting the shield to the Arduino, use a multimeter to validate that the circuit has been wired properly. Test every connection for continuity. It is also good to check nearby pins to ensure that there are no shorts. After testing every connection, plug the board into the Arduino, and turn the power on. Ensure that the Arduino is getting power (the power led comes on). Use the DMM to test the voltages around the system. Make sure that the power wire at the LED Strip terminal is getting the same voltage that is coming out of the power supply. Make sure that the potentiometers are getting 5V. If all of this is correct, you can proceed. Turn off the power, and remove the shield from the Arduino.
    +
=== Programming  the Arduino ===
 +
There are a lot of resources on the web about how to Arduino. Let's start with the official Arduino Guide page for the [https://www.arduino.cc/en/Guide/ArduinoUno Arduino UNO]. If you are using your own system, install the Arduino IDE. If you are on a school system, bring up the Arduino IDE. You will need to make sure that your Arduino is connected via USB to the computer.
 +
* When you are ready, scroll down the Arduino Guide page to the "Open your first sketch" section and attempt to get your Arduino to blink.
   −
== Create the
+
When this works, it is time to move on and test the proto-shield. '''POWER DOWN THE SYSTEM BY UNPLUGGING THE POWER'''. Insert the proto-shield to the Arduino. Then power the system back up. You should see the "blink" program working. The last program you wrote will always run automatically when the system is reset.
 +
* Open up the AnalogInput Example and use it to test one of your potentiometers. You will need to understand the code to know what you are looking for - but a quick google on the aspects of the code that you don't understand should get you there.
 +
* Change the code to test your other potentiometer.
 +
 
 +
At this point we should test the LED lights (make sure they are plugged in). Prior to the setup function in your code, add in the following lines:<pre>
 +
#define REDPIN (10)
 +
#define GREENPIN (3)
 +
#define BLUEPIN (11)</pre>
 +
And then, in your setup, add in the following:<pre>
 +
  pinMode(REDPIN, OUTPUT);
 +
  pinMode(GREENPIN, OUTPUT);
 +
  pinMode(BLUEPIN, OUTPUT);
 +
  analogWrite(REDPIN, 255);
 +
  analogWrite(GREENPIN, 255);
 +
  analogWrite(BLUEPIN, 255);</pre>
 +
When you run this code, it should turn the LED's all on, which will make a bright white light. Cool.
 +
 
 +
Finally, when all appears to be working, download the [[Media:Mood_Light_Fader_Code.zip|fader code]] and test it. You should have a functioning system now! Congratulations.

Navigation menu