Monthly Archives: September 2013

Slides from “Getting started with Arduino” Workshop

Today, I conducted a small hands-on workshop in Arduino at work. We had a bunch of Arduinos and kits available and everyone was able to try it out themselves.

Slides

I have uploaded the slides I used for my talk to my slideshare account. You can download the slides or view them below. You can also checkout my other presentations and slides from my talks page.

Demo code

During the workshop, I showed a couple of demos, explaining different ways by which we can control Arduino. The source code and the circuits are available in my github account.

Arduino Makefile hits v1.0.0

After several months of development, I am proud to announce v1.0.0 of Arduino Makefile.

What is Arduino Makefile?

It is a set of makefiles for Arduino, that allows you to compile and flash code into Arduinos and also communicate with it through Serial all using the makefile, without opening up the Arduino IDE. This is really useful, if you want to use your favourite IDE for coding Arduino or want to automate stuff from command line.

The project was started by Martin Oldfield and I started maintaining it from May 2013.

New features

The major feature that was added in this release is the support for Digilent ChipKIT boards. In addition to this, the following features were also added to this release.

  • Support for “Micro” Arduinos
  • Improve avrdude and avrdude.conf path auto detection
  • Remove dependency on external Perl scripts
  • Support for alternate Arduino cores like ATtiny or Alternate Core
  • Autodetect baudrate from .ino/.pde files
  • Allow building with Arduino core, without a .ino/.pde file

In addition to the above features, there were also lot of bug fixes. You can see the complete list of changes in the release notes.

Download

You can download the latest code from github and then follow the instructions to set it up.

The debian package arduino-mk is not updated to v1.0.0 yet. Will post an update once it is updated as well.

Contributors

This release would not have been possible without the help from lot of contributors. Following is the list of contributors in no particular order.

You can also find more details about their contribution from the release notes.

Difference between Raspberry Pi and Arduino

The first question people ask me these days when I talk about either Raspberry Pi or Arduino is what is the difference between them. This was one of the prominent question that people asked me during my recent PyCon talk and Maker Party presentation.

Even though both Raspberry Pi and Arduino are created to solve different problems, there is a slight overlap and people get confused on which one to choose for their projects.

Instead of answering people individually, I thought I would rather write a blog post so that I can point people to it when ever the question arises again.

Raspberry Pi

Raspberry Pi

Source: http://learn.adafruit.com/assets/2846

As most of you would know, Raspberry Pi is a full-fledged credit card sized computer with 512 MB RAM and 700 MHz micro processor. It can run a full Linux based operating system and has hardware support for SPI, I2C and Serial.

Pros

The following are some of the main advantages of Raspberry Pi

  • Entire Linux software stack is available
  • It is very easy to connect to internet
  • Can be programmed using variety of programming languages

Cons

The following are some of the main limitations of Raspberry Pi

  • Accessing hardware is not real-time. If the CPU is busy, then interfacing with hardware can be delayed
  • No built-in Analog to Digital converter available
  • Does not have enough power to drive inductive loads
  • The hardware design is not open source. Even though it is not a big deal, for some people it might a deal breaker

When to use (and not use) Raspberry Pi

If you project has very limited hardware interaction but is slightly complex on the software side or need to be connected to internet then you should just go with Raspberry Pi. Also if you want to program using variety of programming languages (not limited to C/C++), then you should choose Raspberry Pi.

On the other hand, if you project requires a lot of hardware interaction and need to read data from lot of sensors or need to control lot of devices, then Raspberry Pi may not be best choice.

Arduino

Arduino

Source: http://learn.adafruit.com/assets/3199

Arduino is a collection of three things. A hardware prototype platform, Arduino language and IDE & libraries. The board is based on 8-bit AVR microcontroller. It has built-in hardware support for SPI, I2C and Serial.

Pros

The following are some of the main advantages of Arduino.

  • Very easy to get started
  • Very easy to extend it and has tons of user contributed shields and libraries. Shields are available to do pretty much anything
  • Can be used to for real-time applications
  • Everything (both hardware, software and IDE) are open source
  • Not much programming knowledge needed to do basic stuff

Cons

The following are some of the main limitations of Arduino.

  • Not very powerful when compared with Raspberry Pi (Micro processor vs Micro controller)
  • You need to program using either Arduino or C/C++ (or assembly if you really want to)
  • Connecting to internet is slightly difficult (you have shields and libraries, but is not straight forward), but not impossible. I have in fact used Arduino with YQL and JSON parsing as well.

When to use (and not use) Arduino

If you project requires you to interact with lot of or complex external hardware, then you should consider using Arduino.

On the other hand, if your project requires lot you to write complex software or requires entire software stacks or protocols, then Arduino may not be the best options.

In Short

In short, this is the summary

Feature Raspberry Pi Arduino
Processor Speed 700 MHz 16 MHz
Programming Language No limit Arduno, C/C++
Real-time Hardware No real-time In real-time
Analog to Digital Convertor No Yes
Hardware Design Closed source Open source
Internet Connection Very easy Not easy, but doable

Best of both worlds

If you project requires both software and hardware equally, then you can also use both Arduino and Raspberry Pi together in your project and get the best of both worlds.

Arduino and Raspberry Pii

Source: http://learn.adafruit.com/assets/2846 and http://learn.adafruit.com/assets/3199

If you feel, I missed out any important points, then feel free to leave a comment below or ping me in Twitter and I will add them to the list.

Getting started with electronics at Maker Party

Mozilla India is conducting a Maker Party today at Jaaga and I going to conducting a workshop there.

Maker Party

‘Maker Party: Bangalore 2013’ is a Mozilla Hive India initiative in an attempt to map and empower a community of educators and creative people who share a passion to innovate, evolve and change the learning landscape.

The event has a simple format like science fair, where facilitators are sharing something exciting, teach something new in a engaging way. This event is a platform to connect diverse organizations and encourage connected learning.

What I am going to be doing

Since we are expecting a couple of school kids, I am planning to conduct a workshop explaining how people can get started with electronics.

I am planning to showcase both Arduino and Raspberry Pi and tell them how easy it is to get started. For Raspberry Pi, I am going to show the demos that I created for my recent PyCon talk as well.

I am personally really excited since this is the first time I am going to be interacting with kids and teach them some electronics, which I hoped someone did for me when I was kid 🙂

Update

Here is the photo and blog post from Mozilla India.

Control Raspberry Pi GPIO pins from Python

Today, I gave a talk in PyCon India, 2013 about using Python to control the GPIO pins in Raspberry Pi.

About PyCon India, 2013

PyCon is an annual conference that happens in India for the Python programming language.

Following is the actual quote from PyCon website.

PyCon India, the premier conference in India on using and developing the Python programming language is conducted annually by the Python developer community and it attracts the best Python programmers from across the country and abroad

Slides

I have uploaded the slides I used for my talk to my slideshare account. You can download the slides or view them below. You can also checkout my other presentations and slides from my talks page.

Video

You can also checkout the entire session in the following video.

Demo

During the presentation, I gave a couple of demos, showing how to access and control the GPIO pins of Raspberry Pi from Python.

I created the following custom PCB to make it easy for me to show the demo, instead of wiring everything using breadboard.

raspberry-pi

The source code and the circuits are available in my github account.

By the way, in addition to showing the demos, I actually presented the entire presentation (including the slides) from Raspberry Pi itself 😉