My son Devin has to do a monthly science project at his school. He decided early on that he wanted to keep a webpage dedicated to these projects. Around the time he first started creating his web page, I introduced him to Code Academy. Code Academy is a website devoted to learning programming, web page construction, and other computer skills that are used widely in academic, business, and creative pursuits. I had just finished the JavaScript tutorial and thought that Devin might get a kick out of it. At age 8, Devin found it a little daunting, but managed to learn enough about formatting, variables, and if/else statements to create his first silly text-based game. I'm very proud of him. Perhaps after some time spent with the Code Monster at Crunchzilla, a more kid-friendly coding site, he'll by able to add some graphics.
1 Comment
Additional Parts:
Time to Complete: 15 minutes ![]() In this project, we get to use the random number generator in the Arduino library to simulate rolling a die at the push of a button. Again, this project is very simple. Some care needs to be taken to make sure to wire the LEDs in the correct direction and to place them in the proper configuration for a die. There is a little bit annoying wiring between the legs of LEDs, but with minimal concentration, the desired pattern is easily achieved. The program associated with this project is more complicated than most of the other ones before, with the Morse code translators being the exceptions. The appropriate LED pattern needs to be associated with its corresponding number. This involves keeping track of which LED is attached to which pin. It helps to write it down. The next step is to simulate the rolling of a die by creating a cascade of numbers. In this case, a random number is called to determine the length of the roll (arbitrarily chosen to be between 14 and 24 numbers). Then, the corresponding number of random values between 1 and 6 are generated and flashed in sequence until the final number is shown. Pressing the button starts the first roll and each subsequent roll. The video is, of course, below. Something like this could be a fun substitution in a family game night. I won't take this one apart until the kids have had a chance to play with it for a few minutes. Keeping with the theme of proceeding with the project for which I already have the parts, the next project will probably be the USB temperature logger. I am not sure if I have a the rotary encoder needed for the second traffic light project. Additional Parts:
Time to Complete: 15 minutes ![]() The purpose of this project is to make a seizure-inducing strobe light. The frequency of the flashes is controlled by the linear potentiometer (pot). The set up of this project is nearly identical to the High-Brightness Morse Code Translator with the exception being the new blue pot. Turing the knob on the blue pot changes the value of the resistance between the middle pin and the pin on either side. This gives a variable input signal to be read by the Arduino through one of the analog inputs. The strobe light program take the value of the input from the variable resistor and translates it into a delay time for turning on and off the LED. A video is below. These LEDs are insanely bright. For the purpose of learning as much about the Arduino and connecting new components, I will skip the next two projects for now and will continue with the LED dice. Additional Parts:
Time to complete: 15 minutes ![]() This project introduces the push-to-make (ptm) switch (Actually, the ptm switch was introduced in the last experiment when creating the shield for the high-brightness LED. However, since I did not create the shield for the last project, this is my first encounter with the pmt switch.) and uses it to interrupt a program that makes three LEDs blink like UK-style traffic lights. In UK traffic lights, the order is red, red+yellow, green, yellow, and then back to red. This program would be easy enough to adapt to a US-style light system. In fact, it took about 30 seconds to make the changes to show my children. A picture of the circuit is to the right. Since I did not have a plethora of colors available in my LED collection, I had use an orange LED instead of a yellow one of similar brightness to the red and green LEDs. I could have tried to increase the brightness of the orange LED by pairing it with a smaller resistor, but honestly, until the project become more difficult, proof of completion is all I'm looking for. The code for this program is very simple. there is one loop that goes through the light states with a 1000 ms delay after each state. After the delay, the program checks to make sure that the button is pressed before going into the next state. This project is a nice introduction to adding switches to a simple circuit. Below is a video of the completed project. Additional Parts:
Time to Complete: 15 minutes ![]() This project is a continuation of the Morse Code Translator project. Here, we are replacing the standar 1/4 Watt LED with a high-intensity 1 Watt LED. These are so bright that it is possible to damage your retina by staring directly into the center for a prolonged period of time. This introduces a new electronic component, the power transistor needed to switch on and off the new powerful LED, and talks about how to turn this project into an Arduino shield. The code for this project is the same as the code for the last one. Again, there is a picture of the circuitry on the left. An Arduino shield is an object that can be plugged directly into the Arduino as a single finished unit. Several are readily available for purchase including shields for giving the Arduino wireless communication, an ethernet port, or the ability to store and play mp3 files. I will not be creating the shield for this project because I have not purchased the blank protoshield kit onto which the electronic components are soldered. For an example as simple this, purchasing the protoshield kit would be a bit wasteful. As with the last projects, this one was very simple to complete. I had to strip some wires to twist around the leads of the LED since I didn't feel like soldering them. It might be time for me to buy a soldering iron. A video of the completed project is below. Additional Parts:
Time to Complete: 15 minutes ![]() The Morse Code Translator is a continuation of the S.O.S. Flasher project I wrote about last week. As the title implies, the goal is to convert a text string into the appropriate Mosre code LED flashes. I have added a buzzer (6 VDC) I found at Radio Shack to the circuit as well to give it an audible signal as well. A photo of this simple setup is to the right. The buzzer is put in parallel with the resistor-LED combo. I tested the buzzer with the S.O.S. project that was still loaded into the board from last week--the Arduino keeps the previous program until a new one is uploaded.). It is plenty obnoxious, perfect for a Morse Code signal. Since the circuitry is no different than the last project, the goal of this one is to build on the concepts of strings and arrays introduced in the last project. This project also introduces the concept of communicating between the computer and the Arduino via the USB interface in ways other than uploading programs. I will be sending messages from my computer to the Arduino to be translated into the appropriate Morse code flashes according to the program stores onboard. This is done via the serial monitor in the Arduino program. The program is written by created separate arrays for the letters and for the numerals. The letter array looks like char* letters[ ]={ ".--" , "-..." , etc. }, with the numerals having a similar structure. Then, the dots and dashes have to be defined in terms of lengths of time to turn on the LED. Spaces between letters and words have to be defined as well. For added fun, add the spaces for sentences and the other special characters that can be used with Morse Code. Below, I show a video of the working final project for the typical programing example. The next project is the High-Brightness Morse Code Translator for those foggy nights, when you're out at sea. Additional Parts:
Time to Complete: 15 minutes ![]() The purpose of this project is to program the Arduino to flash S.O.S. on repeat. This is a very simple project with the objective of being an introduction to programming in C in the Arduino environment with little to no knowledge of electronics. The Arduino Uno has a built-in LED on the board connected at Pin 13, but for this example we use a different analog output pin for sake of having to plug something into the board. Needless to say, assembling the circuit is trivial, but I'll provide a picture anyway for fun. The S.O.S. program is also fairly easy to implement. The project first has you write out the code in a very long-handed fashion. That is: turn light on, wait, turn light off, wait, etc. for the entire S.O.S. process of three dots three dashes, the dots. So in this way, we tell the pin to alternate from going from HIGH (5V) to LOW (0V). Since the above code is tedious, the book introduces the concept of functions by having the user create a simple flash function that turns on and then off the LED for the number of milliseconds given in the argument. The original code collapses by about a factor of two after implementing the flash function. I have included a short video of the final product. The S.O.S. project is a simple introduction to programming and functions for someone who has had little or no programming experience. Since it involves a bare minimum of extra circuitry, the user is able to focus on the writing the program without having to worry about the load on the board.
The next project is a logical extension of this one. The Arduino will be used to translate a string of input text into Morse code LED flashes. This will be slightly more involved since it means that the Morse code alphabet will need to be define in the code, but it should also be very straight-forward. ![]() For Christmas this year, my brother bought me an Arduino Uno and a nefarious-sounding project book. This was not a random gift. I have had the Arduino bug for more than a year, around the time I bought my brother an Arduino development kit for Christmas. I had stumbled upon (possibly through StumbleUpon) several interesting Arduino-controlled projects including the fantastic Daft Punk-style helmet. Many more amazing projects can be found online. Here are some cool lists from Instructables and Hack n Mod. I supposed I should explain what an Arduino board is. The Arduino Uno is just one of many Arduino boards. In general, Arduino boards are open-source prototyping boards that allow inputs from practically any sensor that can be attached to it. Using the C programming language, the microcontroller can be programmed from the computer. The board can be connected directly to the computer via USB, programmed, and then disconnected to run on its own. It can run on its own or interface with other devices and/or programs, making for endless creative possibilities. ![]() My brother had the foresight and kindness to offer me some accessories. You can see everything in the above photo. The bottom shows the Arduino Uno and a little breadboard. The Arduino Uno kit came with the colored wires, a 9V adapter, and a USB cable. My brother threw in a pack of resistors, various capacitors, a pair of potentiometers, some LEDs, shift registers, and some other miscellaneous components. The project book I received is called 30 Arduino Projects for the Evil Genius, which is not nearly as trouble-making as it sounds. The thirty projects include:
The first project has already been completed and was not exciting. I changed a number in the sample LED flashing program and watched a light on the board blink at a different speed. Having programmed in FORTRAN, C++, Java, and some Python made picking up the Arduino language (C) pretty simple. I would recommending have some programming knowledge before starting an Arduino project, but the books will also walk you through the basics. I plan on working my way through all thirty projects. Though I do not expect to achieve world domination by Project 30, I think I should have a handle on what I think I might really want to do with my Arduino Uno. I see a guitar effects pedal in the future. I plan on documenting the projects here as I finish them. The next Arduino Report will begin with the second project. |