Purpose:
To continue the process of getting to know our Arduino's a next step (there are a host of different strategies out there) is to learn how to use the serial monitor in the Arduino IDE. What we have done so far is learn how to write some basic code, upload it onto the Arduino, and set it loose. Once it's set in 'motion' the code runs without any interaction with us. This is sort of like a computer with no keyboard or monitor. The serial monitor is one way to interact with your Arduino while it's executing whatever the current program is.
At the same time it is shortly going to become apparent, if it hasn't already, that you are going to want to run things which are beyond the power limits of the Arduino. To do that you will need an external power supply and some understanding of how it works. In addition you will need so simple adapters to have access to that power. This will give us an opportunity to get some soldering experience and harness fabrication experience.
Procedure:
1) Start with one of your Blinky sketches that is controlling a single LED. I suppose you could also use your RGB sketch if you wanted. Don't use the Clay Shirky's CrossFade sketch for this first step. Use this tutorial as a guide to insert the serial monitor setup and commands so that the LED is turned on or off by your input from the serial monitor. Here is the Adafruit Serial Monitor page for added insight. Explore what happens if the baud rate is mismatched.
2) Then go to the Clay Shirky CrossFade sketch [on the resource page if you don't already have it] and edit it to turn on the DEBUG option and set the loopCount to 20. Track through the sketch so you understand how the DEBUG works. Then modify the sketch so it asks you if you want the DEBUG turned on and what to set the loopCount to. Check out the print() command documentation sheet for some interesting insights.
Meanwhile.....
3) Hacking in the engineering/maker community has a different meaning than it does in popular culture. The orginal meaing of the term is to repurpose an item of technology for your own needs which don't match the original intention of the object. A classic exampleis using a VHS video player to make an automatic cat feeder. One of the objects we all need as we start playing with Arduinos and controlling objects of interest is a power supply. ATX power supplies live inside almost every object you but. Many are in self contained packages adn some even have off/on switches. Here are a couple of links to formal ATC power supply hacks that give you a sense of how far this can go. Here's a Make Magazine hack and here's a Hackaday hack. Read the warnings and disclaimers linked in the Hackaday post -- you will be affirming that you have done so and accept liability for any electronic explorations you attempt on your own!
4) We're not going to get nearly so complicated for now. Here's the problem. If you plug the power supply it it won't start and will typically seem dead. The issue is that the power supply has a detection system built in and won't start unless it see's some load between the 5V (green) and ground (black) pins. We will discuss various ways to provide a load so the power supply will turn on. Before we do so you need to show me that you have calculated the resistance that I can use that draws no more that 250 mW of power across 5V. This power calculation is the first of many you will need to make.
5) Then we will build (by soldering) a wire adapter for the ATC power connector. You will take two pieces of wiring harness, strip back 5 mm of insulation, twist the braided wires together (why are the wires braided and not solid?) and 'tin' this end. Check, on an unpowered power supply that it fits snugly into the connector. Then strip the other end of the wire(s) and solder a wire with a bread board pin to the other end. There are a couple of wire splicing tutorials on the resource page. Before soldering the ends together be sure you slide an appropriate piece of shrink tube over the wires. You will appreciate by the end of this why 'third hands' are so helpful in the electronics lab. After completing the solder joint reposition the shrink tube (wait until solder joint has cooled!!) and apply heat gun for safe and finished project.
- LAB Deliverables:
1) Demo: Demonstrate that you can turn your LED off and on from the serial monitor.
2) Demo: Demonstrate that you can turn the DEBUG option on or off and set the loopCount from the serial monitor.
3) Document/Turnitin: Show your calculation for the resistance that leads to 250 mW power consumption across a 5V drop.
4) Demo: Demonstrate that you can turn on an ATX style power supply using the information from step 3.
5) Demo: Show your instructor that your wire harness fits the ATX power connector and your breadboard and meets quality expectations.
This link provides a central location for documents and links specifically relevant to this lab.
More general resources for this course and the lab are accessible from the Web Resources page.