Professional Documents
Culture Documents
Intro Micro Controller
Intro Micro Controller
by
Irfan Khalid
Contents
Hardware project (Without Coding)
Basic Introduction
Basic Project
Power Supply Circuit
Charging Circuit
AC to DC Convertor
DC to AC Convertor
implementation of ohm's law etc.
Simulation Software
Hardware Project using macro controller (Coding included )
Basic Intro
Basic Project
Arduino based distance sensor
Traffic Lights System
Bottle Filling
Automatic Pet Watering System etc.
IDE for Macro controller (software)
Simulation
List of Components
Switchs etc
Breadboard
Bus Strip
Terminal Strip
Gab Here
LED
DC Power Supply
Connecting Wires
Basic Circuit
Micro Controller
Micro Controller
Arduino
Arduino Structure
Program Structure
Example
Experiment #1
Blink an LED using Arduino
Components/Apparatus:
• Ardnino Uno
• Resistance
• LED
• Connecting wire
• PC(IDE)
• Battery
• Communication Cable (USB Cable)
Circuit Diagram:
Code:
void setup()
{
pinMode(13, OUTPUT);
}
void loop()
{
digitalWrite(13, HIGH);
delay(1000); // Wait for 1000 millisecond(s)
digitalWrite(13, LOW);
delay(1000); // Wait for 1000 millisecond(s)
}
Experiment #2
LED Control by using Bush Button
Components/Apparatus:
• Ardnino Uno
• Resistance
• LED
• Connecting wire
• PC(IDE)
• Battery
• Switch
• Communication Cable (USB Cable)
ON /OFF LED using Switch
Code:
int buttonState = 0;
void setup()
{
pinMode(2, INPUT);
pinMode(13, OUTPUT);
}
void loop()
{
// read the state of the pushbutton value
buttonState = digitalRead(2);
// check if pushbutton is pressed. if it is, the
// buttonState is HIGH
if (buttonState == HIGH) {
// turn LED on
digitalWrite(13, HIGH);
}
else
{
// turn LED off
digitalWrite(13, LOW);
}
How to use meters in circuit diagram?
(A, V, R)
•Thank you for
your attention