Three Arduino projects for beginners

what’s Arduino:

Arduino is a single-board microcontroller which is considered as the integrated platform easier to use. This is a free material technology (Open source) associated with a programming language and integrated development platform (IDE). To support additional functions (Wi-Fi, Ethernet, XBEE, motor control, etc.), various extensions known by the name Arduino kit can be connected to the Arduino. This technology was designed to foster learning in the field of electronics. This low-cost prototyping platform is widely used for creating objects and interactive environments. Since its availability, both students and professionals have developed particularly useful projects.

The Arduino uses a free hardware and software technology (Open source) to interact with the environment. This product can be used on independent objects or be connected to a computer, for example to a Raspberry Pi to process the data and act accordingly. The Arduino can be connected to switches, sensors, motors , LED screens, etc. to control a wide range of applications. The Arduino can be programmed to operate according to specific requirements. Thanks to the integrated development environment (IDE) Arduino microcontroller can be programmed in one of the supported languages. Arduino programs, known as the “sketches” can be copied to the Arduino microcontroller, which then executes the program instructions. For some complex projects, maps and Arduino batteries can be placed in sealed boxes with cable glands for Ethernet cable to safely perform the connections with the sensor platforms.

The Arduino IDE must be downloaded to your PC if you want to use it to design programs. Simply connect the Arduino board to the PC via USB cable to download the sketches. Here are some basic projects perfectly suited to beginners.

1. successive Lighting lamps:

arduino-LED

This is a simple project that requires only a small modification of the Arduino board. The necessary components include an Arduino board, a test platform, eight LED lamps 3 V and connecting cables. To begin, simply place side by side the LED lamps on the test plate. The test platform is supplied with electricity by the Arduino. Follow the diagram below to properly establish connections.

montage-arduino-led-chenille-schema-electrique

Once the connections, simply copy the following code into the Arduino software

boolean t = true;
int i = 12;
void setup ()
{
pinMode (12, OUTPUT);
pinMode (11, OUTPUT);
pinMode (10, OUTPUT);
pinMode (9, OUTPUT);
pinMode (8, OUTPUT);
pinMode (7, OUTPUT);
pinMode (6, OUTPUT);
pinMode (5, OUTPUT);
pinMode (4, OUTPUT); }
void loop ()
{
digitalWrite (i, HIGH);
delay (50);
digitalWrite (i, LOW);
if (t == true)
{
i = i – 1;
} else
{
i = i + 1;
}
if (i <5)
{
i = 6;
t = false;
}
if (i> 12)
{
i = 11;
t = true;
}
}

The Arduino can then be connected to the computer to download the program. The Arduino restarts and you can watch the lights successively-ignited on the test plate.


2. A temperature measurement based on Arduino:

montage-arduino-thermometre-404

This is a simple project involving the use of a thermistor and an LCD screen to control and display the temperature.The necessary components include a black and white 2×16 LCD “, an Arduino board, a thermistor, a variable resistor and a 10K resistor. The thermistor is connected to analog pin of the Arduino. The connections to the LCD screen can be performed according to the diagrams below:

montage-arduino-thermometre-branchement-640

montage-arduino-thermometre-branchement-carte-640

The following code can be placed in the Arduino software and downloaded to operate the temperature measurement device.

 #include 
 #include 
 LiquidCrystal LCD (12, 11, 5, 4, 3, 2);
 Double Thermister (int RawADC)
 {
   Double Temp;
   Temp = log (((10240000 / RawADC) - 10000));
   Temp = 1 / (0.001129148 + (0.000234125 * Temp) + (0.0000000876741 * Temp * Temp * Temp));
   Temp = Temp - 273.15;  // Convert Kelvin Celsius
   return temp;
 }
 void setup ()
 {
   lcd.begin (16.2);
   lcd.clear ();
   Serial.begin (115200);
 }
 void loop ()
 {
   Serial.println (int (Thermister (analogRead (0))));  // Display Fahrenheit
   lcd.print (int (Thermister (analogRead (0))));
   lcd.print ( "degress C");
   delay (100);
   lcd.clear ();
 } 

3. Speaker based on the Arduino:

montage-arduino-note-musique-500

The Arduino can be used to produce sound using a piezoelectric speaker. The sound is generated by sending a square wave at a frequency appropriate to the piezoelectric speaker. The circuit is very simple: just plug the piezoelectric speaker to pin number 9 and at the base of the Arduino.

The following code may be used:

 speakerPin int = 9;
 int length = 15;  // The number of notes
 Notes char [] = "ccggaagffeeddc";  // Space = rest
 beats int [] = {1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 4};
 int tempo = 300;
 Playtone void (int tone, int duration)
 {
   for (long i = 0; i <* 1000L duration; i + = Tone * 2)
   {
     digitalWrite (speakerPin, HIGH);
     delayMicroseconds (tone);
     digitalWrite (speakerPin, LOW);
     delayMicroseconds (tone);
   }
 }
 void playNote (char rating, int duration)
 {
   char names [] = { 'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C'};
   int tones [] = {1915, 1700, 1519, 1432, 1275, 1136, 1014, 956};

   // Play the tone corresponding to the note name
   for (int i = 0; i <8; i ++) {
     if (names [i] == note) {
       Playtone (tones [i], duration);
     }
   }
 }
 void setup ()
 {
   pinMode (speakerPin, OUTPUT);
 }
 void loop ()
 {
   for (int i = 0; i <length; i ++)
   {
     if (notes [i] == '')
     {
       delay (beats [i] * tempo);  // rest
     }
     else
     {
       playNote (notes [i] beats [i] * tempo);
     }
     // Break between notes
     delay (tempo / 2); 
   }
 } 

(Visited 57 times, 1 visits today)

Post Author: gyoby

Leave a Reply

Your email address will not be published. Required fields are marked *