Learning electronics circuits, hardware and software can be difficult for beginners. But with the help of Arduino open source hardware and IDE(Integrated Development Environment) tool you can learn these with ease. In fact Arduino is designed and developed exactly to make these things easy to learn.
This is the first blog post to introduce you the series of arduino projects we will post.
What you learn?
Beginning with basics such as creating LED blinking circuit, writing arduino programs to blink LED, you will learn various electronics circuits related to robotics. Such as controlling motion, LCDs for robotics, GPS for robotics, object detection for robotics, alarm system, add GSM technology to arduino, instrumentation and adding blutooth feature to your arduino.
For the projects you can either use Arduino UNO or Arduino Duemilanove. These are as shown below.
Moreover you will need other tools and modules according to the project that you will learn. What you will need will be instructed in that tutorial project.
In this first part of the introduction you will learn how to wire a basic LED blinking circuit and the program that blinks the LED.
For simple testing such as LED blinking, you can simply add a LED positive side to the digital pin 13(either in Arduino UNO or Duemilanove) and the negative side to the ground. Example is shown below.
In order to write program code you need to install Arduino IDE into your PC which can be downloaded for free(https://www.arduino.cc/en/M
ain/Software). Once you have installed it, plug the USB B to your Arduino and the USB A on the other side to your PC. Then you must select the correct board that you are using and also set the correct COM port. These must be done via the Tools menu in the toolbar.
Writing the program
All that is left to do is to write the program code into the sketch. The following is code.
const int LEDdelay = 100; // delay time
pinMode(13, OUTPUT); // makes pin 13 an output
digitalWrite(13, HIGH); // this writes a high bit to pin 13
delay(LEDdelay); // delay 100ms
The program code will turn on and off LED connected to pin 13 with interval of 100ms. First we have a constant integer called LEDdelay equal to 100. This constant will be used in the delay() function later. This delay() function is inbuilt function which accepts integer as its input argument. With 100 as input argument, the delay() function will create a delay of 100ms.
Within the void setup() function we have set up the digital pin 13 as an output pin using the pinMode() function.
The main program starts with the void loop() function. This is similar to the while() loop in other C programs. Inside it we first send HIGH signal to the pin 13 using digitalWrite(13, HIGH), then use the delay() function to create a delay of 100ms, then we send a LOW signal to the same pin using digitalWrite(13,LOW). Again we create a delay of 100ms using delay(LEDdelay).
This is the simplest program you can imagine to write for a microcontroller. This is often called hello program in microcontroller programming.
The next step is to compile and upload the code into the Arduino. For this you have to click the arrow button on the toolbar.
Once done, you should see the LED blinking on your Arduino.
In the arduino project part you will learn motor control for robotics application.