You are on page 1of 25

1/25

TABLE OF CONTENTS

INTRODUCTION

PAGE

What is CT UNO?

List of Cytron Uno Starter Kit

Download Arduino IDE

Install CT UNO Drivers

LESSONS

PAGE

LED Blinking

11

RGB LED

12

Create Melody with Piezo

13

7 Segment Display

14

Serial Display on Computer

15

Push Button as Digital Input

16

Potentiometer as Analog Input

17

Light Dependant Resistor

18

Temperature Sensor

19

PROJECTS

PAGE

Interactive Traffic Light

20

Temperature Alarm

22

Light Theremin

24

2/25

What is CT UNO?

CT UNO is the Cytron version of Arduino Uno. In other words, it is Arduino Uno
compatible with improvements. The CT UNO combines the simplicity of the UNOs
Optiboot bootloader (which loads program faster), the stability of the FTDI and the
R3shieldcompatibilityofthelatestArduinoUnoR3.

CTUNOFeatures:
SMDATmega328microcontrollerwithOptiboot(UNO)Bootloader.
USBProgrammingFacilitatedbytheUbiquitousFTDIFT231X(morestable).
Inputvoltage:DC715V.
1A(maximum)5Vvoltageregulator.
500mA(maximum)3.3Vvoltageregulator.
05Voutputswith3.3Vcompatibleinputs.
14DigitalI/OPins(6PWMoutputs).
6AnalogInputs.
ISP6pinHeader.
32kFlashMemory.
16MHzClockSpeed.
R3ShieldCompatible.
TX,RX,Power,pin13LEDsaremovedtoedge.
UtilizeUSBMicroBsocket.

3/25

List of Cytron Uno Starter Kit

BelowisthelistofcomponentswhichareincludedinCytronUnoStarterKit.

Component

Quantity

CTUNOBoard.

Breadboard(Small).

MaletoMaleJumper(65pcs).

LED3mmYellow.

LED3mmGreen.

LED3mmRed.

LED5mmRGB.

LEDSuperBright5mmBlue.

LEDSuperBright5mmRed.

10

LEDSuperBright5mmGreen.

11

Resistor0.25W5%(220).

10

12

Resistor0.25W5%(10K).

13

FingerAdjustPreset(5K).

14

7SegmentDisplay0.5inchCommonCathode.

15

6x6x1PushButton2Pins.

16

LightDependentResistor(LDR).

17

PiezoTransducer.

18

TemperatureSensorLM35(Celsius).

19

USBMicroBTypeCable.

4/25

Download Arduino IDE

CTUNOrequiresArduinosoftwaretorun.Youcandownloadthesoftwarefrom
Arduinowebsite(http://arduino.cc/en/Main/Software)anditisfreetouse.

5/25

ArduinoIDEiscompatiblewithWindows,MacOSXandalsoLinux.Youjustneedto
choosetheappropriateoperatingsysteminstallationpackageforyourcomputer.

*Note:IfyouareaWindowsuser,itisrecommendedthatyouchooseWindows
ZIPfile(fornonadministratorinstall).

Afterthedownloadiscomplete,extracttoyourcomputerandyouwillgetafolder
namedarduino1.0.6(thecurrentversionis1.0.6).

Inthearduino1.0.6folder,youshouldhaveallthefollowingfoldersandfiles.To
openit,doubleclickonarduino(witharduinosymbol)executionfile.

6/25

ThisisthelayoutofArduinoIDE.

Labelanddescription:

Label

Description

Label

Description

MenuBar

CodeArea

ButtonBar

StatusBar

SerialMonitor

IDEOutput

SketchName

BoardNameandCOMNumber

7/25

Buttonbardescription:

Verify

Compilesandapprovesyourcode.Itwilldetect
errorsinsyntax(e.g.missingsemicolonor
parentheses).

Upload

SendsyourcodetotheCTUNO.Whenyouclickit,
youshouldseethelightsonyourboardblinkrapidly.

New
Sketch

Thisbuttonopensupanewcodewindowtab.

Open

Thisbuttonwillletyouopenanexistingsketch.

Save

Thissavesthecurrentlyactivesketch.

Serial
Monitor

OpenSerialMonitor.

8/25

Install CT UNO Drivers

ConnectCTUNOboardtoyourcomputer.OpenDeviceManagerandlookunder

Ports(COM&LPT)itshouldberecognizedasUSBSerialPort(COMx).Ifyougetan
unrecognizeddevice,pleasedownloadthelatestFTDIdriverfromFTDIwebsitehere
(http://www.ftdichip.com/Drivers/VCP.htm).Chooseyourappropriateoperating
systeminstallation.Afterthedownloadiscomplete,proceedwithinstallation.

Ifitdoesnotworkthefirsttime,trytoreinstall.Afterasuccessfulinstallation,your
CTUNOshouldberecognizedasUSBSerialPortwithCOMportnumber,e.g.USB
SerialPort(COM3).

9/25

SelectBoard:

SelectSerialPort:

10/25

Lesson 1: LED Blinking

Introduction:
LEDisalightemittingdiode.Itwilllightupwhenapropervoltageisappliedin
coreectdirection.

Hardwareconnection(Fritzingview):

Arduinocode:
void setup()
{
pinMode(3, OUTPUT);
}
void loop()
{
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(3, LOW);
delay(1000);
}

Results:
RedLEDwillblinkat0.5Hz.1secondlightupand1secondturnoff.

11/25

Lesson 2: RGB LED

Introduction:
RGBLEDisared,green,blueLED.Itisacombinationof3colorsinasingleLED.

Hardwareconnection(Fritzingview):

Arduinocode:
void setup()
{
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);
}
void loop()
{
// Blue light
analogWrite(9, 0);
analogWrite(10, 255);
analogWrite(11, 255);
delay(1000);
// Green light
analogWrite(9, 255);
analogWrite(10, 0);
analogWrite(11, 255);
delay(1000);
// Red light
analogWrite(9, 255);
analogWrite(10, 255);
analogWrite(11, 0);
delay(1000);
}

Results:
Threecolors(blue,greenandred)willlightup.Itwillchangecolorevery1second.

12/25

Lesson 3: Create Melody with Piezo

Introduction:
Piezobuzzercanproducedifferentnotesbycontrollingvoltagefrequency.

Hardwareconnection(Fritzingview):

Arduinocode:
*OpentoneMelodyexample(FileExamples02.DigitaltoneMelody).
#include "pitches.h"
int melody[] = {
NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4};
int noteDurations[] = {
4, 8, 8, 4, 4, 4, 4, 4};
void setup()
{
for(int thisNote = 0; thisNote < 8; thisNote++)
{
int noteDuration = 1000 / noteDurations[thisNote];
tone(8, melody[thisNote], noteDuration);
int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);
noTone(8);
}
}
void loop()
{
}

Results:

Piezobuzzergeneratesamelody.

13/25

Lesson 4: 7 Segment Display

Introduction:
7segmentdisplayisanarrangementofLEDsthatabletodisplaydecimalnumbers.

Hardwareconnection(Fritzingview):

Arduinocode:
int sevenSegment[5][8] = {
{HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, LOW, LOW}, // 0
{LOW, HIGH, HIGH, LOW, LOW, LOW, LOW, LOW}, // 1
{HIGH, HIGH, LOW, HIGH, HIGH, LOW, HIGH, LOW}, // 2
{HIGH, HIGH, HIGH, HIGH, LOW, LOW, HIGH, LOW}, // 3
{LOW, HIGH, HIGH, LOW, LOW, HIGH, HIGH, LOW}, // 4
};
int pin, number;
void setup()
{
for(pin = 2; pin < 10; pin++)
pinMode(pin, OUTPUT);
}
void loop()
{
for(number = 0; number < 5; number++) {
for(pin = 0; pin < 8; pin++)
digitalWrite(pin+2, sevenSegment[number][pin]);
delay(1000);
}
}

Results:
7segmentwilldisplayaloopingcounterfrom0to4.

14/25

Lesson 5: Serial Display on Computer

Introduction:
Serialdisplaycandisplaynumbersandcharacters(basedonASCIIdata)onthe
ArduinoSerialMonitor.

Hardwareconnection(Fritzingview):

Arduinocode:
*OpenASCIITableexample(FileExamples04.CommunicationASCIITable).
int thisByte = 33;
void setup()
{
Serial.begin(9600);
Serial.println("ASCII Table ~ Character Map");
}
void loop()
{
Serial.write(thisByte);
Serial.print(", dec: ");
Serial.print(thisByte);
Serial.print(", hex: ");
Serial.print(thisByte, HEX);
Serial.print(", oct: ");
Serial.print(thisByte, OCT);
Serial.print(", bin: ");
Serial.println(thisByte, BIN);
if(thisByte == 126) while(true) continue;
thisByte++;
}

Results:

ASCIIdatawillbedisplayedonArduinoSerialMonitor(needtoopentheArduino
SerialMonitor).

15/25

Lesson 6: Push Button as Digital Input

Introduction:
Pushbuttoncanactasadigitalinputdevice.CTUNOisabletosense2statesfor
digitalinput,i.e.HIGHandLOW.

Hardwareconnection(Fritzingview):

Arduinocode:
*OpenButtonexample(FileExamples02.DigitalButton).
const int buttonPin = 2;
const int ledPin = 13;
int buttonState = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop()
{
buttonState = digitalRead(buttonPin);
if(buttonState == LOW) // Push button is pressed
digitalWrite(ledPin, HIGH);
else digitalWrite(ledPin, LOW);
}

Results:
Whenpushbuttonispressed,LEDonCTUNOwillturnon.Whenpushbuttonis
released,LEDwillturnoff.

16/25

Lesson 7: Potentiometer as Analog Input

Introduction:
Potentiometercanbeananaloginputdevice.CTUNOisabletosense1024
(10bits)differentstatesfromanaloginput.

Hardwareconnection(Fritzingview):

Arduinocode:
*OpenAnalogInputexample(FileExamples03.AnalogAnalogInput).
int sensorPin = A0;
int ledPin = 13;
int sensorValue = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
sensorValue = analogRead(sensorPin);
digitalWrite(ledPin, HIGH);
delay(sensorValue);
digitalWrite(ledPin, LOW);
delay(sensorValue);
}

Results:
Whenthepotentiometersvaluechanges,itwillaffecttheLEDblinkingspeed.

17/25

Lesson 8: Light Dependent Resistor

Introduction:
LDR(LightDependentResistor)isasensorthatcangenerateadifferentresistance
valuebasedontheamountoflightintensityitreceives.

Hardwareconnection(Fritzingview):

Arduinocode:
int sensorPin = A0;
int ledPin = 13;
int sensorValue = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
sensorValue = analogRead(sensorPin);
if(sensorValue > 900)
digitalWrite(ledPin, HIGH);
else
digitalWrite(ledPin, LOW);
}

Results:
Whenitisdark,theLEDonCTUNOwilllightup.

18/25

Lesson 9: Temperature Sensor

Introduction:
Temperaturesensorcanbeusedtomeasuresurroundingtemperature.Itwill
produceavoltageproportionaltotemperature(C).

Hardwareconnection(Fritzingview):

Arduinocode:
int sensorPin = A0;
int sensorValue = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
sensorValue = analogRead(sensorPin);
Serial.print("ADC: ");
Serial.print(sensorValue);
Serial.print(" Temperature: ");
Serial.print(sensorValue * 0.488); // Convert ADC to celcius
Serial.write(186); // ASCII degree symbol
Serial.println("C");
delay(100);
}

Results:

ADCandtemperaturevaluedisplaysonArduinoSerialMonitor(needtoopen
ArduinoSerialMonitor).

19/25

Project 1: Interactive Traffic Light

Introduction:
InteractiveTrafficLightisacombinationofstandardtrafficlightforvehiclesand
trafficlightforpedestrian.

Thisprojectappliesknowledgeoutcomefrom:
1. Lesson 1: LED Blinking
2. Lesson 6: Push Button as Digital Input

Hardwareconnection(Fritzingview):

Arduinocode:
const int greenLedVehicle = 5;
const int yellowLedVehicle = 6;
const int redLedVehicle = 7;
const int greenLedPedestrian = 3;
const int redLedPedestrian = 4;
const int pushButton = 2;
void setup()
{
pinMode(greenLedVehicle, OUTPUT);
pinMode(yellowLedVehicle, OUTPUT);
pinMode(redLedVehicle, OUTPUT);
pinMode(greenLedPedestrian, OUTPUT);
pinMode(redLedPedestrian, OUTPUT);
pinMode(pushButton, INPUT);

digitalWrite(greenLedVehicle, HIGH);
digitalWrite(redLedPedestrian, HIGH);

20/25

void loop()
{
if(digitalRead(pushButton) == LOW)
{
digitalWrite(greenLedVehicle, LOW);
digitalWrite(yellowLedVehicle, HIGH);
delay(2000);
digitalWrite(yellowLedVehicle, LOW);
digitalWrite(redLedVehicle, HIGH);
delay(1000);
digitalWrite(redLedPedestrian, LOW);
digitalWrite(greenLedPedestrian, HIGH);
delay(5000);
digitalWrite(greenLedPedestrian, LOW);
digitalWrite(redLedPedestrian, HIGH);
delay(1000);
digitalWrite(redLedVehicle, LOW);
digitalWrite(greenLedVehicle, HIGH);
}
}

Results:

Atstart/normalcondition,greenLED(vehicle)andredLED(pedestrian)willlightup.
Whenpushbuttonispressed,greenLED(vehicle)willturnoffandyellowLED
(vehicle)willturnonfor2seconds.Afterthat,yellowLED(vehicle)willturnoffand
redLED(vehicle)willlightup.After1second,whenitistimeforpedestriansto
crosstheroad,greenLED(pedestrian)willturnonfor5seconds.Then,greenLED
(pedestrian)willturnoffandredLED(pedestrian)willturnon.After1second,itwill
bebacktonormalcondition.

21/25

Project 2: Temperature Alarm

Introduction:
TemperatureAlarmisasecurityprojectwhereitwillsensethesurrounding
temperature.Ifthetemperatureexceedsacertainvalue,thebuzzerwillsoundand
LEDwillblink.

Thisprojectappliesknowledgeoutcomefrom:
1. Lesson 1: LED Blinking
2. Lesson 3: Create Melody with Piezo
3. Lesson 9: Temperature Sensor

Hardwareconnection(Fritzingview):

Arduinocode:
*OpentoneMelodyexample(FileExamples02.DigitaltoneMelody).Replaceexisting
codeintoneMelodywithcodebelow.
#include "pitches.h"
const int ledPin = 2;
const int piezoPin = 3;
const int sensorPin = A0;
int celsius = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
pinMode(piezoPin, OUTPUT);
pinMode(sensorPin, INPUT);
}

22/25

void loop()
{
celsius = analogRead(sensorPin) * 0.488;
if(celsius > 30) // if temperature > 30 degree celsius
{
digitalWrite(ledPin, HIGH);
tone(piezoPin, NOTE_B4, 500);
delay(500);
digitalWrite(ledPin, LOW);
tone(piezoPin, NOTE_C4, 500);
delay(500);
noTone(piezoPin);
}
}

Results:
Whentemperature(detectedbytemperaturesensorLM35)exceeds30C,buzzer
willsoundandLEDwillblink.Whenthetemperatureislessthan30C,buzzerand
LEDwillturnoff.

23/25

Project 3: Light Theremin

Introduction:
Athereminisaninstrumentthatmakessoundsbasedonthemovementsofa
musicianshandsaroundtheinstrument.ThisprojectwilluseLDRasaninputwhere
theamountoflightintensitywilldeterminethemelodynotes.

Thisprojectappliesknowledgeoutcomefrom:
1. Lesson 3: Create Melody with Piezo
2. Lesson 8: Light Dependent Resistor

Hardwareconnection(Fritzingview):

Arduinocode:
*OpentoneMelodyexample(FileExamples02.DigitaltoneMelody).Replaceexisting
codeintoneMelodywithcodebelow.
#include "pitches.h"
int melody[49] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
NOTE_C2, NOTE_D2, NOTE_E2, NOTE_F2, NOTE_G2, NOTE_A2, NOTE_B2,
NOTE_C3, NOTE_D3, NOTE_E3, NOTE_F3, NOTE_G3, NOTE_A3, NOTE_B3,
NOTE_C4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, NOTE_A4, NOTE_B4,
NOTE_C5, NOTE_D5, NOTE_E5, NOTE_F5, NOTE_G5, NOTE_A5, NOTE_B5,
NOTE_C6, NOTE_D6, NOTE_E6, NOTE_F6, NOTE_G6, NOTE_A6, NOTE_B6
};
int sensorValue = 0;
int sensorLow = 1023;
int sensorHigh = 0;
const int ledPin = 13;

24/25

void setup()
{
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);

// Calibrate for the first five seconds after program runs


while(millis() < 5000)
{
sensorValue = analogRead(A0);
if(sensorValue > sensorHigh)
sensorHigh = sensorValue;
if(sensorValue < sensorLow)
sensorLow = sensorValue;
}
digitalWrite(ledPin, LOW);

void loop()
{
sensorValue = analogRead(A0);
int pitch = map(sensorValue, sensorLow, sensorHigh, 48, 0);
tone(8, melody[pitch], 50);
delay(50);
noTone(8);
delay(150);
}

Note:Tocalibratethesensor,moveyourhandupanddownovertheLDRfor5
secondstochangetheamountoflightthatreachesit.Thecloseryoureplicatethe
motionsyouexpecttousewhileplayingtheinstrument,thebetterthecalibration
willbe.

Results:
After5secondsofcalibration,themelodyplayedbypiezodependsonyourhand
position.ThecloseryourhandistotheLDR,thehigherthenotesthatwillbe
produced.Whenyouwithdrawyourhand,nosoundwillbegenerated.So,enjoythe
melodyyoucreate!

25/25

You might also like