Saturday, November 19, 2016

Week 3 - Circuits Getting More Complex

This week’s project was to create 2 circuits, then combine them in some way to make one working circuit. I chose to start with circuit 4’s chasing lights option and have the 8 yellow LEDs chase up to the RGB which would then light up in sequence and after the 8 yellow LEDs and turn back off in reverse order followed by the 8 yellow LEDs. It was a success, except that for some reason the green portion of the RGB wasn’t very easy to see and none of the RGB elements would light up very brightly.

The following are shots of my codes from all 3 circuits. I have also attached PDF files of each code. The screenshots only show a small portion of the code, so I decided to include the files for reference purposes.






Here is a picture of each of the circuits as they were built on the Arduino breadboard. They are in order: Circuit 3, Circuit 4, Challenge circuit.





The schematics (following the same order) are pictured below:





And, finally, the video, demonstrating each of the circuits in action.



This project was a great challenge to me. It reminded of several things that I had not originally recalled about combining code. As many of you have probably figured out, it is not as simple as simple tacking one set of code onto another set. You have to take each section (declarations, routines, etc.) and put the code from each of those sections into the proper portion of the code you are adding on to, as well as ensuring that all variables are properly defined, not in conflict, proper pins/ports are addressed, and so on. It didn’t take me long to remember that lesson that was such a thorny issue to work through last time. In fact, if I remember correctly, I gave up on combining the code sections last time and just wrote a whole new set of code for this project. It was at that point that I realized exactly how things are laid out within the code itself.


Where would you find things like these circuits in the real world? The RGB circuit can be found in status lights on many different pieces of equipment. For example, my cordless Weedeater has status lights on the charger to indicate the condition of the battery. If the charge is between 90 and 100%, the LED lights up green. If it is 60-89%, it lights up orange. If it is below 50%, it lights up red. This is the same sort of circuit but with different inputs that determine which color element lights up. I have seen similar lights on cardboard presses to indicate when it is in operation, in error state, or safe to open the door. The chasing LEDs are found in Christmas lights, lights around dance floors, and directional lights such as the emergency beacons on police vehicles and ambulances. Oh yeah, I just remembered a common chasing LED setup: the brake lights on many modern motorcycles and some cars use LEDs that chase around the edge of the enclosure for higher visibility than the standard steady-burning lights provide. Watch the video below for a sample of these type of brake lights.


No comments:

Post a Comment