Internship Report Based On Arduino
Internship Report Based On Arduino
IUT DE CACHANT
University PARIS SUD
From June 2 to July 15
GEORGES DAHER
Georges DAHER
Bs Mechatronics Engineering
Georges Daher 1
THANKS
I would like to thank Professor Souhil first and foremost.
MEGHERBI, Director of the IUT of Cachan, University of Paris Sud,
France has accepted them as interns within
the university.
Georges Daher 2
IUT OF CACHAN
Created in 1966 following the Decree of January 7, 1966 establishing the University Institutes of
Technology, the IUT of Cachan has always maintained an essential characteristic: it offers some
industrial specialties focused on Electrical Engineering and Industrial Computer Science and Engineering
Mechanics and Production.
By staying true to this choice, the IUT of Cachan has managed to adapt to the evolution of technology and to
business demands. The list of current specialties at the IUT shows it:
The IUT has also been able to adapt its courses and teaching methods to the demands of the audience.
concerned. It now offers full-time training courses, with a final internship (status
student) or through an apprenticeship (apprentice status), distance learning, training
continue throughout life with validation of acquired experience and adapted alternation to the
situation of interns.
The diplomas prepared at the IUT are part of the European framework of Bachelor Master Doctorate (LMD)
of Universities, either at the L level: DUT (bachelor +2) and Professional License (bachelor +3), or at the level
Engineer diploma prepared through apprenticeship in partnership with IFIPS (program)
engineer of the UPS
To accomplish the tasks assigned to it, the IUT is structured into 3 departments.
of education with multidisciplinary educational teams:
These departments are supported by a set of shared services. In total, there are more than 160.
full-time staff of the National Education who are dedicated to the success of
about 1100 students and trainees attend the IUT of Cachan every year.
Georges Daher 3
FOR MORE INFORMATION
01.41.24.11.00
IUT of Cachan
9 Avenue de la Division Leclerc
94230 Cachan
-------------------------------------------------------------------------------------------------------------------------------
CRIIP
The CRIIP is a Research and Industrial Engineering Center or
Educational. It has the status of a resource center, was created in
November 2000, brings together and validates the various research actions and
industrial or educational collaborations carried out by the three
départements de l’IUT de Cachan: GEII1, GEII2 et GMP.
The CRIIP works on projects in collaboration with partners.
industrial. These allow students of the IUT to get involved
directly, within the framework of tutored projects and execution work,
in the development and realization of industrial and technological projects.
The CRIIP thus provides the necessary logistics for each project.
The three departments GE1, GE2, and GMP are divided into four activities:
Georges Daher 4
Summary
THANKS
THE IUT OF CACHAN AND THE CRIIP
SUMMARY
INTRODUCTION
PRESENTATION OF PROJECTS
GENERAL CONCLUSION
End
Georges Daher 5
B. AUTONOMOUS ROBOT
Georges Daher 6
Arduino introduction
What is Arduino?
In a few words:
Active community.
The 'philosophy'
The idea is to use the Arduino board as a macro-component in applications.
of
Electronic prototyping. The designer just needs to develop interfaces and
Program the macro-component to create its application!
Georges Daher 7
The advantages
Cheap!
Clear and simple programming environment.
•Multiplatform: runs on Windows, Macintosh, and Linux.
Many libraries available with various functions
implemented.
Open source and extensible software and hardware.
Numerous tips, tutorials, and examples online (forums, personal website
etc...)
Existence of 'shield': these are cards
additional
who connect to the Arduino module to increase possibilities
as by
example: color graphic display, Ethernet interface, GPS, etc...
Georges Daher 8
Due to its ease of use, Arduino is used in many
applications like
industrial and embedded electronics, modeling, home automation but
also in some
different fields such as contemporary art or performance!
Georges Daher 9
Characteristics of the Arduino Uno board:
Microcontroller: ATmega328
Internal power supply voltage = 5V
Power supply voltage (recommended) = 7 to 12V, limits = 6 to 20V
Digital I/O: 14 including 6 PWM outputs
Entrées analogiques = 6
Max current per I/O pins = 40 mA
Max current on 3.3V output = 50mA
32 KB Flash memory of which 0.5 KB is used by the bootloader
SRAM Memory 2 KB
1 KB EEPROM memory
Clock frequency = 16 MHz
Dimensions = 68.6mm x 53.3mm
Georges Daher 10
The 'shields'
There are many shields that are sometimes translated in the documentation as
«boucliers ». Personnellement, le terme « extension » me paraitrait plus approprié. Un
"Shield" Arduino is a small board that connects to an Arduino board to
enhance its functionalities. Some examples of 'shields':
Graphic display
Ethernet and SD card
GPS
Prototyping board (labdec type)
etc...
Louis
Georges Daher 11
Development of a project
Development on Arduino is very simple:
•we code the application: The Arduino language is based on the languages
C/C++, with some
functions and specific libraries for Arduino (input/output management).
We connect the Arduino board to the PC and transfer the program to the board.
We can use the circuit!
The programming software for Arduino modules is an application
Cross-platform Java
(working on all operating systems), serving as a code editor and
of
compiler, and which can transfer the firmware (and the program) through
of the connection
series (RS232, Bluetooth or USB depending on the module).
The software is very easy to use, there are very good tutorials available.
very well made
with even explanations in French. Very many examples are
provided.
The example files are really well documented and allow for
code things
very complicated without too much effort. The provided libraries allow
to use some
very simple complex components in just a few very clear lines
(display or
liaison SPI etc..).
Georges Daher 12
Links
The Arduino site:http://www.arduino.cc
Translate into French (partially):http://www.arduino.cc/fr
Georges Daher 13
2) Technical Specifications
The contest rules state that the robot must traverse the diagonal of a
square track of 8m by 8m, the robot heads towards its destination
of a compass located on it.
The track will also be sprinkled with obstacles, so the robot will have to avoid them.
then reach its destination.
Georges Daher 14
3) THE COMPONENTS OF THE ROBOT
Georges Daher 15
The chopper (dual h- bridge)
Georges Daher 16
The compass (CMPS10)
Presentation
The I2C interface is the interface that must be used to connect it to the board.
Arduino.
Georges daher 17
4) THE PROGRAMS AND TESTS PERFORMED
4.1) POSITION SENSOR TEST
The position sensor is an infrared sensor that detects
the existence and the distance of an object.
Georges Daher 18
Georges Daher 19
4.2) ENGINE TESTS
In order to operate the 2 motors (changing their
directions and their speeds) we need a chopper 4
quadrants.
Georges Daher 20
Georges Daher 21
4.3) COMPASS TEST
Georges daher 22
PROGRAMME
void setup() {
Serial.begin(9600);
Wire.begin(); // Connect to I2C
}
void loop(){
byte byteHigh, byteLow, fine; // byteHigh/byteLow store high and low bytes of
the bearing
fine stores decimal place of bearing
char pitch, roll; // Stores pitch and roll (signed values)
int bearing; // Full bearing
delay(500);
}
Georges Daher 23
void print_data(int bearing, int fine, int pitch, int roll) {
// Print data to Serial Monitor window
Serial.print("Bearing=");
Serial.print(bearing, DEC);
Serial.print(".");
Serial.print(fine, DEC);
Pitch=
Serial.print(pitch, DEC);
Roll=
Serial.print(roll, DEC);
Serial.println("");
}
Georges Daher 24
4.4) TEST " SQUARE "
Dans ce test le robot doit faire un carre grâce à la boussole !!!!
Georges Daher 25
The connections:
Georges Daher 26
CODE "PROGRAM"
#include <Wire.h> Use I2C library
#define ADDRESS 0x60 // Address of CMPS10
int E1=6;
int M1=7;
int E2=5;
int M2=4;
float speedLeft=(245/2); pass 255 because there is a difference between
float speedRight=(255/2); // les deux moteurs >>
int x = LOW;
int direc;
unsigned long timerA; We initialize the timer
void setup(){
Serial.begin(9600); //serial to simulate on the screen
Wire.begin(); // Connect to I2C
pinMode(M1, OUTPUT);
pinMode(M2, OUTPUT);
}
void loop(){
digitalWrite(M1, HIGH);
digitalWrite(M2, HIGH);
analogWrite(E1, speedRight);
analogWrite(E2, speedLeft);
George Daher 27
if(x==HIGH)
if(millis()-timerA >= 2000) every 2 seconds adds 90 degrees
direction=direction+90;
if(direc > 360)
{ direc= direc-360;}
timerA=millis(); Reset the timer again
} reset the timer
}
else
{ timerA=millis(); //set the timer
Georges Daher 28
bearing = ((byteHigh<<8) + byteLow) / 10; // Calculate full bearing
fine = ((byteHigh<<8) + byteLow) % 10; Calculate bearing decimal
print_data(bearing, fine, pitch, roll); // Print data
if(x == LOW)
//delay(500);
direc = bearing;
x = HIGH;
}
if(diff > 0) {
keep the right wheel spinning,
Change the speed of the left wheel
speedLeft = ((245-diff)/2);
speedRight = (255/2);
} else {
keep the right left spinning,
// change the speed of the left wheel
speedLeft = (245/2);
Georges Daher 29
speedRight = ((255+diff)/2);
}
}
void print_data(int bearing, int fine, int pitch, int roll) {
// Print data to Serial Monitor window for the simulation
Serial.print("Bearing="); print the bearing
Serial.print(bearing, DEC);
Serial.print(".");
Serial.print(fine, DEC);
Pitch=
Serial.print(pitch, DEC);
Roll=
Serial.print(roll, DEC);
Serial.println("");
Georges Daher 30
Problems and solutions:
Georges Daher 31
THE FINAL TEST
We now need to join the programs (test) to have
The final program.
Georges Daher 32
THE PROGRAM
//georges daher
The engine values are not accurate.
void setup(){
Serial.begin(9600);
Wire.begin(); Connect to I2C
pinMode(M1, OUTPUT);
setPinMode(M2, OUTPUT);
}
void loop()
{
digitalWrite(M1, HIGH);
digitalWrite(M2, HIGH);
analogWrite(E1, speedRight);
analogWrite(E2, speedLeft);
int s1=analogRead(sens1);
int s2=analogRead(sens2);
int s3=analogRead(sens3);
Georges Daher 33
byte byteHigh, byteLow, fine; // byteHigh/byteLow store high and low bytes of
the bearing
fine stores decimal place of bearing
char pitch, roll; // Stores pitch and roll (signed values)
int bearing; // Full bearing
Wire.beginTransmission(ADDRESS); // begin communication with CMPS09
Wire.write(2); // Start read
Wire.endTransmission();
Wire.requestFrom(ADDRESS, 4); // Request 4 bytes from CMPS10
while(Wire.available() < 4); // Wait for the bytes to arrive
byteHigh = Wire.read(); // Store values
byteLow = Wire.read();
pitch = Wire.read();
roll = Wire.read();
bearing = ((byteHigh<<8) + byteLow) / 10; // Calculate full bearing
fine = ((byteHigh<<8) + byteLow) % 10; // Calculate bearing decimal
print_data(bearing, fine, pitch, roll); // Print data
if(x== LOW)
//delay(500);
direc = bearing;
x = HIGH;
}
int diff = bearing - direc;
modify degrees
if(diff > 180)
diff = -360 + diff;
else if(diff < -180)
diff = 360 + diff;
if(diff > 0) {
keep the right wheel spinning,
change the speed of the left wheel
Georges Daher 34
speedLeft = (245-diff);
speedRight = (255);
}
Otherwise
{
keep the right left spinning,
change the speed of the left wheel
speedLeft = (245);
speedRight = (255+diff);
}
else if (s1 > 100 && s2 < s3)
{
// analogWrite(E1, 0);
// analogWrite(E2, 255);
speedLeft=255;
speedRight=0;
Georges Daher 35
delay(300);
speedLeft=0;
speedRight=255;
delay(200);
Pitch=
Serial.print(pitch, DEC);
Georges Daher 36
Roll=
Serial.print(roll, DEC);
Serial.println("");
Serial.print("direc=");
Serial.print(direction, DEC);
Serial.println("");
speedLeft=
Serial.print(speedLeft, DEC);
Serial.println("");
Serial.print("speedRight=");
Serial.print(speedRight, DEC);
Serial.println("");
}
Georges Daher 37
Conclusion: of the autonomous robot
The autonomous robot allowed me to understand well what is happening and
how to manage problems.
But one of the proposals is to use servomotors (more precisely
and precise) To avoid wasting time on trying out (on a dc
motor and without encoder
Georges Daher 38
Conclusion
In conclusion, from a professional point of view, this internship
brought me experience regarding the uncertainties that I
can meet, from adaptation to new ones
materials.
From a more personal perspective, traveling has made me
brought much whether through the discovery of a
culture, but also by the lifestyle of the French who
different from that of a Lebanese. This experience I
considered very positive, it taught me to
navigate in professional life and even
personal, in the life of a responsible man, I have
learned a lot of things through people and our
responsible here, and improve many others like
communication methods and time management.
In conclusion, this internship has been very beneficial from the point of view of
Georges Daher 39