Computers vs People

System to be controlled
Control: computer (C) or human (H)
Reasons
Traffic lights


Driving a train


Car washing


Drilling a tooth at the dentist


Checking something on the Moon


Doors in a busy supermarket


Keeping a check on the condition of patients in hospital


Filling bottles of lemonade in a factory


CCTV cameras in a city centre


Painting cars on a production line






Task

Useful Link for this task

Your task is to create a newsletter, You can use google docs for this.
You need to include:
  • different sensors and their descriptions
  • write a few paragraphs on the benefits of computer control any why it may and may not be good for humans.

Arduino - Set Up


1. Firstly, you will need to install the Arduino software
http://www.arduino.cc/en/Main/Software

2. Install the driver so that your laptop will recognise the Arduino board.
  • Mac Download the driver Or Windows download this driver
  • Double click the ZIP file do unzip it
  • Open the folder ~/Downloads/CH341SER_MAC
  • Run installer found in that folder
  • If asked to restart, do not restart just yet.
  • This next step is only needed if you are on OS-X Yosemite. For older versions of OS-X you do not need it:
    • Open Terminal Application (it's located in /Application/Utilities) and type this command once you see a prompt:
    • sudo nvram boot-args="kext-dev-mode=1"
    • See this post if you wish to know why we need to run this command. I believe you need to do this because the driver is not signed properly, or is simply too old for Yosemite. Hopefully newer versions won't require this step and will automatically become enabled.

  • Now restart your Mac

Activity 1 - Blinking LED


You will need to wire your Arduino using the image below to guide you. Then copy and paste the code , and upload

blinking lights.png
blinking lights.png


For Code check Edmodo - activity 1


Not Working? (2 things to try)
LED Not Lighting Up?
LEDs will only work in one direction. Try taking it out and twisting it 180 degrees.
(no need to worry, installing it backwards does no permanent harm).
Program Not Uploading
This happens sometimes, the most likely cause is a confused serial port, you can change this in tools>serial port>

SAVE YOUR PROJECT ONCE YOU HAVE COMPLETED IT BEFORE YOU MOVE ON TO THE EXTENSIONS BELOW

Extension 1 - Making it Better - EXPERIMENTING

Changing the pin:
The LED is connected to pin 12 but we can use any of the Arduino's pins. To change it take the wire plugged into pin 12and move it to a pin of your choice (from 0-13) (you can also use analog 0-5 )

Then in the code change the line:
int ledPin = 12; Change to the pin number that you have chosen;
Then upload the sketch: (ctrl-u)

Change the Blink Time:
Unhappy with one second on one second off?

In the code change the lines:

digitalWrite(ledPin, HIGH);
delay(time on); (seconds * 1000)
digitalWrite(ledPin, LOW);
delay(time off); //(seconds * 1000)

Control the Brightness:
Along with digital (on/off) control the Arduino can control some pins in an analog (brightness) fashion. (more details on this in later circuits). To play around with it.

Change the LED to pin 9: (also change the wire)
ledPin = 12; -> int ledPin = 9;Replace the code inside the { }'s of loop() with this:
analogWrite(ledPin, new number);(new number)

any number between 0 and 255. 0

off, 255 = on, in between = different brightness

For Extention Code - Check Edmodo Activity 2



Activity 3 - Simple On/Off Button


arduino_button1.png
arduino_button1.png


For Code - Check Edmodo Activity 3 Simple On/Off Button

For extension - Check Edmodo Activity 4 Button as a Toggle Switch



Activity 5 - 2 Buttons & LED

2button.png
2button.png


For Code - Check Edmodo - Activity 5 2 Button LED



Steeper Motor