Saturday, March 29, 2014

A Simple Introduction to Arduino


Arduino is a important simple platform to do many things from blinking an led to running a robot and more on. First we going to see different Arduino boards available in the market. There a number of boards available but among them some of them are most famous. Eg : Arduino Uno, Arduino Fio, Arduino Mega. Choosing a Arduino board depends on  what you are going to do with that. So deciding which board is suitable for your needs makes you save your money.

Arduino Fio Xbee Side
Arduino Fio
First we look what are the things a typical Arduino board has :
  • A Micro controller
  • An Oscillator
  • A power suppply
  • A programming interface
  • A Xbee shield
Though there are some other things. I do not want to confuse you if you are new to this. Among all of this Micro controller is the main part we have to look more deeply. Actually what is micro controlller?. Micro controller is not actually a processor but it contains processor. We just can call it as a small computer. Actually a Micro controller has its own processor, RAM, programmable ROM, I/O ports with in that. We will go further into I/O ports. I/O ports actually belongs to the micro processor inside the micro controller. We will look a simple diagram to understand the I/O ports.

Now we can easily look what a port means. In the picture you can see Blue, Red, and Green colored grouped pins of the processor. We do not want to look at register level explanation of ports for the introduction to arduino as we hav to go alot to look. okay so this ports only a grouping of pins of a micro controller if we say easily. There are three kind of pins in a microcontroller. Analog, Digital, and PWM  ( Pulse Width Modulation) pins are those three.

What is a Digital Pin?
Well, A Digital pin is as the name implies you can give or get digital values such as HIGH (1) or LOW(0). A high means 5V r 3.3V which depends n the board and your upply voltage and you settings. A LOW is zero volt. Further these pins can be configured as input or out put according to you needs. if you want to get voltage from the micro controller you have to configure as output and vice versa.

What is a PWM pin?
It is similar to digital pin but one advantage is you also can configure it as analog pins.
What is an analog Pin?

Simply saying we can give only give readings to these pins. We can not take outputs from them. That means you can only consider them as input pins not output pins like Digital or PWM pins.

Mapping of Pin values to the voltage.?
Say you have a minimum voltage say 0V and maximum voltage say 5V . We take the voltage difference whic is 5V here. So this difference is mapped here with 1024 normally in arduino processors. So now you can simply calculate he voltag eqaul to the value given by the pin and vice versa. Simple mango sum :). Here I want to point out another pin which is called as AREF ( Analog Reference). This mapping is done with how we configure this AREF. It is programming part so we will look that in under another title.

What else you need to play with arduino?
All with hardware nothing is possible. We need to configure this pins and we have to somehow tell the processor to do this and do that. So we have to program the micro controller or say Arduino. To program we need a programming interface or editor. For Arduino, Arduino itslf offfers their own Arduino IDE.Here is the link yu an dowload and install with no fear.

http://arduino.cc/en/Main/Software#.UxyQefmSySo

The programming is similar to C syntax. If you want to write the program in C/C++ eclipse editor, It is also possible. You need to do some configuration. but that is beyond our purpose here.

What else you need?
Say We have written program but how to transfer that to arduino or microcontroller. For some Arduino boards we do  not need a UART. But boards like Fio needs a UART to transfer the program.You can upload the program using UART by clicking the upload button in the arduino IDE. Even if the program compiled and uploaded successfully, The arduino will respond only if your logic and hardware configuration is correct.


How to select a arduino board?
  • How many I/O pins you need. 
  • Do you need Bee modules in your project
  • Do you need to go for wearable products
  • Do you need solar cells to be connected ( Energy harvesting projects)

Say if you are not working with Xbee, Just consider a arduino board which does not have Xbee socket buit in with that board.

Done. If time allows, Will update further.






No comments: