Arduino vs Raspberry Pi

difference between arduino and raspberry pi
Ever since the Raspberry Pi was announced, it has been a topic of much debate online.Starting from profoundly diverse naming plans- masculine Italian name vs sweet fruit pie- Arduino and Raspberry Pi boards are significantly different in a lot of things. For one Arduino is an Open Source single-board micro-controller,  while Raspberry Pi is a single-board computer.

Ask any electronics enthusiastic and he will tell you why it is preferable to get the Arduino if this is your first time venturing into the world of embedded systems.On the other hand, if you have already dipped your toes in this field you could go ahead with the Raspberry Pi.

The table compares the two boards. It should help you make a good decision if you are new to this field.

Arduino
Raspberry Pi
Extremely simple to get working.
Less simpler to get working
A typical embedded system with easy-to-develop software.
Fully fledged computer running Linux.
Support is available virtually everywhere.
Limited support is available at present but should increase over time.
Perfect for controlling hardware(robotics).
Features an extremely powerful GPU and can handle HD content.
Umpteen, different  kits and shield’s are available.
Very few kits are available presently.
Low power consumption(<0.5 W), capable of even running micro amps with very low clock.
Power consumption(~3.5 W) is comparatively higher than Arduino.

Verdict: While the Raspberry Pi is a great high-performance option, Arduino is a good general-purpose board.
Read More »

Using GPIO on Raspberry Pi to blink an LED

One of the few things that separates the Pi from other SBC (Single Board Computer)  is the ability to use the GPIO (General Purpose Input/Output) pins which can be set as HIGH or LOW to control any external devices. All you need is a female to male jumper wire to get started. Here I have used a HDD IDE connector to get the job done.

In this post pin 9 is used for GND and pin 11 for GPIO17. The LED was connected using a 470 ohm register in series with pin 9 and 11 to limit the current.

GPIO of raspberry pi
Software Implementation:-

The fastest way to get started is to use python which comes pre-installed with all images. Download the RPi.GPIO library and copy the gz tar ball to the RPi wheezy raspbian. Open the terminal and navigate to the extracted folder containing the RPi.GPIO library. Then type:  $ sudo python setup.py install to install the module. Imp: As the OS is multitasking  and not Real-time unlike Arduino there may be jitters depending on CPU priority.

Based on the library I have written a simple code to turn ON and turn OFF the LED after a delay of 1 sec (1000ms) each.The LED blinks 50 times.
import RPi.GPIO as GPIO
import time
# blinking function
def blink(pin):
        GPIO.output(pin,GPIO.HIGH)
        time.sleep(1)
        GPIO.output(pin,GPIO.LOW)
        time.sleep(1)
        return
# to use Raspberry Pi board pin numbers
GPIO.setmode(GPIO.BOARD)
# set up GPIO output channel
GPIO.setup(11, GPIO.OUT)
# blink GPIO17 50 times
for i in range(0,50):
        blink(11)
GPIO.cleanup() 

led blinking with raspberry pi           
Read More »