Sei sulla pagina 1di 129

GETTING STARTED

ARDUINO SOFTWARE
(WINDOWS)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4.1 Get an ARDUINO UNO / UNO
compatible board and USB cable

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4.2 Download and install the
Arduino Software (IDE)
• https://www.arduino.cc/en/Main/Software
• You can choose between the Installer (.exe) and the Zip packages.
• We suggest you use the first one that installs directly everything
you need to use the Arduino Software (IDE), including the drivers.
• With the Zip package you need to install the drivers manually.
• For those attend this course, please find the Arduino Software
inside the Software folder. You don’t need to download this
software.

• When the download finishes, proceed with the installation and


please allow the driver installation process.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4.3 Install the board drivers
• UNO compatible board user (used in this
module)
– You may have to install extra drivers for CH340.
– For those attend this course, please find this
driver inside the Software folder. You only need
to double click on the driver file and then
Windows will finish up the driver installation
from there

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4.4 Connect the board
• The USB connection with the PC is necessary to
program the board and not just to power it up.
• The Uno and Mega automatically draw power from
either the USB or an external power supply.
• Connect the board to your computer using the USB
cable. The power LED should go on.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4.5 Launch the Arduino Software (IDE)

• Double-click the Arduino icon (arduino.exe)


created by the installation process. (Note: if
the Arduino Software loads in the wrong
language, you can change it in the preferences
dialog. See the Arduino Software (IDE) page
for details.)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4.6 Open the blink example
• File > Examples >01.Basics > Blink

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4.7 Select your board

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4.8 Select your serial port
• Select the serial device of the board from the
Tools | Serial Port menu.
• This is likely to be COM3 or higher (COM1 and
COM2 are usually reserved for hardware serial
ports).

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4.9 Upload the program
• click the "Upload" button in the environment.
• Wait a few seconds - you should see the RX
and TX leds on the board flashing.
• If the upload is successful, the message "Done
uploading." will appear in the status bar.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Congratulation!!!

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
PART 2
Visual-based
Programming Language
(Covers Ardublock only)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3.2 Ardublock
• http://blog.ardublock.com/
• ArduBlock is a programming environment
designed to make “physical computing with
Arduino as easy as drag-and-drop.” Instead of
writing code, worrying about syntax, and
(mis)placing semicolons, ArduBlock allows you
to visually program with an snapped-together
list of code blocks.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Using Ardublock
• The ArduBlock window is split into two halves.
1. On the left there are “bins”, which store every possible
block you can add to your sketch.
2. The blank, gray slate to the right of that is where you
“draw” your sketch. To add a block to your sketch, simply
drag it from the bin into the blank, gray area

• To begin, every ArduBlock sketch requires a Program


block, which you can find in the “Control” bin. The
Program block defines the setup and loop functions
that every Arduino program requires.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
• From there, you can drag more Blocks over,
snapping them into either the loop or setup
sections.
• Try making a blink program.
– The set digital pin blocks, which effect a digital
output (analogous to Arduino’s digitalWrite
function), are found under the “Pins” bin. The
delay milliseconds block, found under “Control”,
is analogous to a delay Arduino function.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
• Then click Upload to Arduino to send your
drawing off to your Arduino board. You can
ALT+TAB back over to the Arduino window to
check your code upload status

After you’ve successfully uploaded your first


sketch, continue to play around and explore the
contents of the other bins!

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
ArduBlock Tips & Tricks
• You can clone blocks, or groups of blocks, by right
clicking and selecting “Clone”. Everything from the block
you right-clicked to the bottom of that “group” will be
copied and pasted into the top-left corner of the window.
This is a huge timesaver for bigger drawings.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
• You can temporarily remove code from your
sketch by dragging it out of the entirety of the
“Program” block. Anything not connected to
the main Program block will be ignored when
your code is compiled. This is a great
debugging tool – you can remove a block of
code from program execution, while not
actually deleting it, much like commenting out
code.
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
• Finally, if you peek back over at the Arduino
window, after you’ve uploaded an ArduBlock
drawing, you may notice something different.
To create your code, the ArduBlock program
simply parses your blocks and spits the
equivalent Arduino code over into the
Arduino window.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Comparison

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
• This becomes a great learning tool if you’re
interested in transitioning from graphical
programming to text 
• References:
– ArduBlock Homepage
– ArduBlock GitHub Repository (Open Source!)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
CHAPTER 4
GETTING STARTED
ARDUBLOCK

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Introduction
• ArduBlock is something of an “add-on” to Arduino, so it
requires that you have the Arduino IDE installed.
• The benefit of that, though, is – because Arduino is
multi-platform – ArduBlock works on Windows, Mac,
or Linux. Plus, having Arduino already present makes
the transition from visual programming to text
programming easier, when the inevitability
approaches.
• Installing ArduBlock can be a little tricky – there’s no
installer, just a Java file that needs to be stored in a
very specific location. Follow the following steps:

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1st Step: Download and Install Arduino (if you
haven’t already)

• Ardublock is an extension of the default


Arduino IDE, so you’ll need to have Arduino
installed on your computer to run it. Check
out our getting started Arduino in previous
chapter for help with that.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2nd: Open Program Files (x86) in Local Disk (C)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3rd: Open Arduino folder

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4th: Open tools folder

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5th: Create new folder named as
ArduBlockTool

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
6th: Create new folder named as tool

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
7th: Copy ardublock-all-201610.jar from
ARDU 1001 (Your Training Module) > 3_Software >
Graphical_based Programming > Ardublock

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
8th: Paste ardublock-all-201610.jar to
Program Files (x86) > Arduino > tools > ArduBlockTool > tool.
After paste you can close this folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
9th: Open Arduino IDE by clicking
its icon in Desktop

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
10th: Click Tools> ArduBlock

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
11th: Congratulation. Now you can
start play with ArduBlock 

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
CHAPTER 5
TUTORIAL

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Standard Pembelajaran (RBT)
Menyatakan maksud
Menjelaskan bahagian-
mikropengawal Menghasilkan lakaran
bahagian yang terdapat
(microcontroller) dan reka bentuk litar
dalam mikropengawal
Pemprosesmikro elektronik.
(microcontroller).
(microprocessor).

SEPATUTNYA SEBELUM SIMULASI

Membuat
Menulis pengaturcaraan
penyambungan litar Membina litar simulasi
mudah berdasarkan
input dan litar output yang berfungsi dengan
penyambungan litar
kepada mikropengawal perisian khas.
input dan litar output.
(microcontroller).

Mencadangkan
Membuat pengujian dan
penambahbaikan ke atas
penilaian kefungsian litar
reka bentuk litar
elektronik.
elektronik.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Sepatutnya… Standard Pembelajaran
Menyatakan maksud
Menjelaskan bahagian-
mikropengawal Menghasilkan lakaran
bahagian yang terdapat
(microcontroller) dan reka bentuk litar
dalam mikropengawal
Pemprosesmikro elektronik.
(microcontroller).
(microprocessor).

Membuat
Menulis pengaturcaraan
penyambungan litar Membina litar simulasi
mudah berdasarkan
input dan litar output yang berfungsi dengan
penyambungan litar
kepada mikropengawal perisian khas.
input dan litar output.
(microcontroller).

Mencadangkan
Membuat pengujian dan
penambahbaikan ke atas
penilaian kefungsian litar
reka bentuk litar
elektronik.
elektronik.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
TUTORIAL 1
BLINK
(10~15 minutes)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Introduction
• Digital output: it blinks an LED.
• Active HIGH
• delay function

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1. Circuit Schematic

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (Ardublock)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (C Language)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3. Simulation with SimulIDE 0.0.4

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1st: Open SimulIDE 0.0.4

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2nd: Construct circuit. Save your simulation file (.simu) in
Document folder (Advice: Create new folder name as Blink in
Document before save). Must be in Document > Blink folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3rd: Get .hex file from Arduino
IDE

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4th: Copy .hex files in the Arduino
code folder

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5th: Paste the .hex files into the same folder
in Documents with .simu file

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
6th: Right click on UNO board to Load
firmware (.hex). Then, click Load firmware

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
7th: Select any .hex in target
folder in Documents

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
8th: Click Power Circuit (red
button) for simulation

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
9th: Analyze the result. Congratulation. 

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4. Hardware Connection

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5. Result
• Upload the program and analyze the
response.
• Check the video of result in 4_Tutorial>
5_Result folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
TUTORIAL 2
Push Button & LED
(10~15 minutes)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Introduction
• Input  Output
• Single Input Single Output (SISO)
• Digital input: Active HIGH
• Digital output: Active HIGH
• if….else structure

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1. Circuit Schematic

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (Ardublock)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (C Language)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3. Simulation with SimulIDE 0.0.4
• Follow the same procedures. Refer
3_Simulation folder inside Tutorial.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4. Hardware Connection

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5. Result
• Upload the program and analyze the
response.
• Check the video of result in 4_Tutorial>
5_Result folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
TUTORIAL 3
Traffic Light
(10~15 minutes)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
• Controlling multiple DIGITAL OUTPUTS

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1. Circuit Schematic

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (Ardublock)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (C Language)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3. Simulation with SimulIDE 0.0.4
• Follow the same procedures. Refer
3_Simulation folder inside Tutorial.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4. Hardware Connection

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5. Result
• Upload the program and analyze the
response.
• Check the video of result in 4_Tutorial>
5_Result folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
TUTORIAL 4
Potentiometer
(Analog Read Serial)
(10~15 minutes)
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Introduction
• Analog Input
– Potentiometer: provides a varying amount of resistance
when its shaft is turned.
– By passing voltage through a potentiometer and into an
analog input on your Arduino, it is possible to measure the
amount of resistance produced by a potentiometer (or pot
for short) as an analog value.

• Serial Communication??? (google)


– Monitor the state of your potentiometer after establishing
serial communication between your Arduino and your
computer.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1. Circuit Schematic

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (Ardublock)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (C Language)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3. Simulation with SimulIDE 0.0.4
• Follow the same procedures. Refer
3_Simulation folder inside Tutorial.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4. Hardware Connection

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5. Result
• Upload the program and analyze the
response.
• Check the video of result in 4_Tutorial>
5_Result folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
TUTORIAL 5
Potentiometer & LED
(Delay)
(10~15 minutes)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Introduction
• Analog Input  Digital Output
• Serial communication: monitor (compulsory)
• Analog value will be stored as a value in
delay()
– To control the rate at which the built-in LED on pin
13 blinks.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1. Circuit Schematic

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (Ardublock)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (C Language)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3. Simulation with SimulIDE 0.0.4
• Follow the same procedures. Refer
3_Simulation folder inside Tutorial.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4. Hardware Connection

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5. Result
• Upload the program and analyze the
response.
• Check the video of result in 4_Tutorial>
5_Result folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
TUTORIAL 6
Potentiometer & LED
(Controlling Brightness)
(20 minutes)
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Introduction
• Analog Input  PWM
• Serial communication: monitor (compulsory)
• PWM will be used to fade an LED
• Analog value (0-1023) produced by
potentiometer will be map to PWM value (0-
255).

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1. Circuit Schematic

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (Ardublock)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (C Language)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3. Simulation with SimulIDE 0.0.4
• Follow the same procedures. Refer
3_Simulation folder inside Tutorial.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4. Hardware Connection

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5. Result
• Upload the program and analyze the
response.
• Check the video of result in 4_Tutorial>
5_Result folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
TUTORIAL 7
RGB LED (Common Anode)
(20~25 minutes)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Recall…

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1. Circuit Schematic

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (Ardublock)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (C Language)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3. Simulation with SimulIDE 0.0.4
• Follow the same procedures. Refer
3_Simulation folder inside Tutorial.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4. Hardware Connection

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5. Result
• Upload the program and analyze the
response.
• Check the video of result in 4_Tutorial>
5_Result folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
TUTORIAL 8
Knock (Piezo)
(20 minutes)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Introduction
• Analog input  Serial Communication  Digital
Output

• How to use a Piezo element to detect vibration


• A piezo is an electronic device that generates a voltage
when it's physically deformed by a vibration, sound
wave, or mechanical strain.
• Similarly, when you put a voltage across a piezo, it
vibrates and creates a tone.
• Piezos can be used both to play tones and to detect
tones.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1. Circuit Schematic

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (Ardublock)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (C Language)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3. Simulation with SimulIDE 0.0.4
• Follow the same procedures. Refer
3_Simulation folder inside Tutorial.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4. Hardware Connection

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5. Result
• Upload the program and analyze the
response.
• Check the video of result in 4_Tutorial>
5_Result folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
TUTORIAL 9
LDR (Photocell)
Automatic Night Light
System
(30 minutes)
www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
Introduction
• Automatic Night Lamp System
• Analog Input  Digital Output
• In the dark, a photoresistor can have a resistance as high as
several megohms (MΩ), while in the light, a photoresistor
can have a resistance as low as a few hundred ohms.
• Serial communication: monitor & to check the threshold
value in order to TURN ON LED (compulsory)
• In this example, photocell values are read in through an
'Analog In' pin. The values are then used to control the
TURN ON of an LED.

• e.g. If 8pm (dark), then TURN ON lamp.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
1. Circuit Schematic

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (Ardublock)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
2. Programming (C Language)

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
3. Simulation with SimulIDE 0.0.4
• Follow the same procedures. Refer
3_Simulation folder inside Tutorial.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
4. Hardware Connection

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
5. Result
• Upload the program and analyze the
response.
• Check the video of result in 4_Tutorial>
5_Result folder.

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics
THANK YOU!!!!
Like: facebook.com/drabot.robotics
Tel: +6011-10880900
training@drabot.com
www.drabot.com

“Now, everyone can learn robotics”


“Learn how to be a developer, rather than a user!”

www.drabot.com Robotic Systems Enterprise - Arduino Drabot Community - Expert in Aerial Robotics

Potrebbero piacerti anche