CSC231 Lab 4
Back to CSC231 Weekly Schedule
CSC 231 Lab # 4
© D. Thiebaut, 2008
You will find information on how to setup the Arduino software on a Mac and on a Linux box [[CSC231 Links and Resources | here]. These represent the step I took to install the software on my machines. I didn't document installing under Windows as the Web has very good coverage of these steps.
- Boot your PC with the Ubuntu LiveCD which you will have received.
- Select the "start Ubuntu without modifying computer" option
- Wait a minute or so until everything is loaded
- Click on Applications at the top of the screen, and select Accessories and then Terminal
- In the terminal window, type the following lines:
sudo su cd /root cd arduino-0010 ./arduino
- Note: This is the way to start the Arduino IDE for our labs. If you go directly to the /root folder with Ubuntu's explorer, you will find the Arduino, but you won't start it as root, so it won't be able to save files in the folder where it is installed. This results from the way I customized the Ubuntu LiveCD, installing Arduino as root, in the /root directory...
- When faced with a window asking you how you want to run the GUI, select Run
- You should get a window with blue bars and menus. That's the Arduino IDE.
- Connect the USB cable to the computer, and the Arduino to the USB cable
- In the Tools menu of the IDE, select Board and make sure Diecimila is selected (that's the chip on your Arduino stamp)
- In the Tools menu, select Serial Port and make sure the /dev/ttyUSBxxx is selected. (xxx can be 0, 1, 2... )
- Connect your Memory stick to the computer. It may take a few seconds, and sometimes close to a minute for the USB icon to pop up on the Desktop. The path to your USB key will be something like /media/disk-1.
Follow the very nice tutorial pages created by Limor, a young talented engineer/geek/programmer:
(Note: Limor's examples uses an older version of the IDE than ours. A few screen shots might have tiny differences with what you will see on your screen.)
- Lesson 1: Skip the first part, and go to the Open Blink Sketch Section.
- Lesson 2. Do the whole lesson. Save the sketch to the Desktop when you need to modify it. Do the exercises at the end (and turn the lights off for Exercise 3!)
- Lesson 4. Do the whole lesson, and stop when you get to the Pythagorean party section. Just for kicks, check the section labeled Introduction to types, part 2, do you recognize anything? :-)
When you are done, drag the sketches you have created on your Desktop to your memory stick.
You can find more lessons and information on Limot's tutorial page: http://ladyada.net/learn/arduino/ :
- Go to the Student Wiki-Page portal for the class: http://tango.csc.smith.edu/classwiki/index.php/CSC231_Page
- Study the "A quick tutorial on the basic elements of a wiki page", and look at its code by editing it (don't modify anything)
- Create a new page starting with the 231a-xx link you will find on the portal page.
- If you feel confortable having your name and/or picture on the wiki page, add it/them. Remember that these pages are linked to my Smith Web sites, available to Web spiders and bots, and accessible (for reading) to anybody on the Web.
- Define several sections:
- A project section
- A project ideas subsection
- A demos and examples section
- A resource section, where you will collect links to sites you discover, and which contain good/useful/interesting information relating to this project.
- Any other sections, subsections, pictures, description you feel will enhance the information and navigation on your project page.
- A project section
- In the resource section, create links to the tutorials/lessons you just went through
- In the demos and examples section, copy/paste the code of the sketches you have created In the Arduino part of the lab.
- Add a picture of the Decemilia Arduino to your page (be efficient; don't upload a picture if it already exists in this mediawiki site!!!)
The lab report is the wiki page you just created, plus a list of project ideas in a special section you will create for this purpose.
The report is due a week after the lab, next Friday
I would like you to do some research and think of ideas of simple projects you can build around the Arduino. The idea is to use the input/output ports of the Arduino chip and write an assembly language program that will monitor the inputs and control the outputs so that your project "does something interesting." :-)
You should also contact one person (not your instructor) about ideas of projects. We have many people on the Smith and Hampshire campuses doing research and in need of gadget for various projects (control, measurement, music, lighting, etc.) and part of your assignment is to locate one such person and get some ideas of something that they could use that would work with a few switches, leds, displays, and possibly servo motors. You are not forced to implement anything that this person would need. At this point all we want to gather is ideas!
The limitation, and the challenge, is that you cannot spend more than $20 on external parts! (the funds will come from the CS department)
Here are some ideas of mine, that can get you started.
- Connect the Arduino to an infra-red LED and write a program that will make the arduino send the same patterns of ON/OFF signals to the LED as remote controls do for TVs, and stereo systems. The project could be to design an intelligent remote control that could turn on and setup different stereo components of a home-theater system.
- Wire up a thermistor (resistor that changes resistance with temperature) to the Arduino and create a temperature sensor. The assembly program could be used to create a graph of the variation of temperatures over time.
- Wire up an LCD display to the Arduino and display information in real time on the parameters of some experiment.
- Use infrared diodes and infrared receivers to make two Arduinos communicate with each other over an infrared link.
- Using the above communication system or something based on Bluetooth (see the Arduino Playground for more info) to create a project where the Arduino is powered by a battery and controls a model electric car, and the assembly program in the PC communicates over a wireless link with the Arduino to send it left, right, forward, backward, or stop commands.
Look at the many projects described in the Arduino Playground page for further ideas that can be developed into something interesting.
Finally, as you browse the Web for ideas and information on the Arduino, add your discoveries to the Help/Resource section of the class wiki page (http://tango.csc.smith.edu/classwiki/index.php/CSC231_Page).