Void Setup( )
WELCOME
Planning :
● General introduction
● Components(h-bridge,relais,
ultrason,bluetooth,ir,...)
● General idea about µC
● Arduino Programming: General
Structure
INTRODUCTION
ROBOTICS ?
Robotics is the set of techniques
allowing the design and production
of automatic machines or robots
A robot is an assembling mechatronic device
(mechanical, electronic and computer) designed to
perform tasks automatically.
Notre robot
Le robot est composé de 3 parties :
Système de
contrôle
(Arduino) Système
mécanique
Capteurs et
actionneurs
Components
H-bridge
Control the motors direction
and speed
Breadboard
To test your circuit
or connections
InfraRed Sensor
Diode
Phototransistor
To detect whether the line is black or white
Servo motor
Turn with a
certain angle
Ultrasonic Sensor
determine the
distance to a certain
object
Hc-05
Enable bluetooth
communication
N20
Encoder motor
Microcontroller
What’s the difference between a
microcontroller and microprocessor?
Main Differences:
Note:MicroController includes a MicroProcessor
Microcontroller: Microprocessor:
•A microcontroller is a compact integrated •A microprocessor is the central processing unit
circuit that includes a processor core, memory (CPU) of a computer or a larger system. It typically
(both RAM and ROM or Flash), input/output consists of the CPU core, an instruction set, and
peripherals (such as timers, counters, GPIO registers. Unlike microcontrollers, microprocessors
pins), and often other features like often lack built-in peripherals.
communication interfaces (UART, SPI, I2C). •Microprocessors are used in general-purpose
•Microcontrollers are designed to be computing applications. They require external
embedded into specific systems or devices to components such as memory (RAM and ROM),
control their operation. They are often used in input/output devices, and other peripherals to
applications where they perform dedicated function as a complete system.
functions.
Micro Processors
Qualcomm ARM
AMD processor Intel processor Processor
Snapdragon
Micro Controllers
ESP32 F1(blue pille) L4 nucleo
Up to 240MHz STM32
Up to 480MHz
Arduino Uno
Up to 16MHz
What do we need to program a
Microcontroller ?
● µC
● Programmer
● IDE (Integrated Development Environment)
- Compiler
- Text Editor
● Basic circuit building skills
Arduino
µP digital signal
HIGH
5V digitalWrite(pin,HIGH);
ON OFF digitalWrite(pin,LOW);
HIGH LOW digitalWrite(pin,1);
digitalWrite(pin,0);
1 0 LOW
0V x=digitalRead(pin);
Used in A0-A5
and “~ Pins”
Arduino
AnalogRead(pin);
Not Used in Arduino
AnalogWrite(pin,0-255);
Important: Arduino does not utilize a DAC (Digital-to-Analog Converter). Instead, it
employs PWM (Pulse Width Modulation) for tasks requiring analog output.
What is a PWM
signal?
time for a Quiz!!
Arduino Code
CODE
Arduino IDE
(Integrated
Development
Environment)
3 Parts Are involved
Before void setup:
declaration of variables /
libraries
Void Setup :
Void Loop : infinite loop
Activités
Activités
practice 1:
print “association robotique ensi” in the serial monitor.
practice 2:
Use the serial monitor to plot a sinus function.
practice 3:
write a program that reads from serial monitor a nombre and verify if
it’s 1 so it prints “Good job Geek” otherwise it prints “nah wrong”
Activités
practice 4:
Faire clignoter une LED pendant une période de 2s
practice 5:
Utiliser la commande analogWrite() pour contrôler la luminosité d’une LED.
practice 6:
Utiliser un bouton pour contrôler une LED.
practice 7:
Utiliser un potentiometre pour contrôler une LED en utilisant analogWrite().
time for a
Challenge!!
Challenge
Tâche : Afficher des nombres binaires sur un octet sur 8
LED en utilisant Arduino avec l'entrée depuis le Serial
Monitor.
Si le nombre entré est > a 255 allumer tous les LEDs.
Si le nombre entré est < a 0 éteindre tous les LEDs.
NB: Notre but est de stimuler votre créativité et votre intérêt pour les projets Arduino.
N'hésitez pas à explorer d'autres fonctions, ajouter des détails personnels et trouver de
l'inspiration dans des projets similaires. Nous prendrons en compte tout ajout ou effort
supplémentaire que vous ferez.
thank you for your
time