# Seeeduino Nano

The microcontroller craze seems to never die down, and it's a good thing, too, because the products from companies like Arduino and Seeed consistently succeeds where the mobile market consistently fails: users get open software *and hardware*, a portable form factor, and a wide choice of vendors and products that are built to last.
Among the best of the open hardware and software vendors is [Seeed](http://seeedstudio.com), the self-proclaimed IoT Hardware Enabler.
I started seeing the Seeed logo on several projects, so I contacted them about what interesting things they're doing.
In response, they kindly sent me one of their latest products: the Seeeduino Nano, along with a sample sensor to get me started.
I spent a few days with it, and already I'm working on a project to improve my home garden, and thinking of several others for home automation.
Far from just another Arduino-like product, the [Seeeduino Nano](http://wiki.seeedstudio.com/Seeeduino-Nano/) solves several problems, and here's how.

## What do I do with this?

The most common problem I hear from people ultimately underwhelmed by the Raspberry Pi, Arduino, or similar, is that they excitedly got a board, stepped through its tutorial, and then realised they didn't know what to do with it.
As computer users, we're not used to purpose-driven devices.
You get a computer-like device, and you use it for many purposes, so it feels strange to get a computing device and build it into a project.
It can also be a little overwhelming to get a microcontroller.
It's full of potential, but it's also just a microcontroller.
It can be intimidating to figure out what kind of project to start with a device that apparently is capable of anything.

Seeed has a line of input and output peripherals (they call it **Grove**), which are easy to connect and which provide you an easy way to modularly build projects based on what kind of information you want to process.
There's nothing special about the Grove modules compared to sensors or servos you can get for any other device, but Seeed makes what can sometimes seem to be overwhelming choices a lot more navigable.
And better yet, Seeed provides libraries for each Grove module, so you'll never buy a part for your project only to find that you don't know how to make your controller recognize it.

Because Seeed sent me a temperature and humidity sensor, my potential projects, at least in the short term, became highly focused.
I knew I'd be designing either a thermometer and humidity detector for my home, or else a moisture monitor for some of my favourite plants.
Since seeing the other Grove modules available, I've come up with several more projects, too.

## Clean connectors

What makes the Grove modules especially nice is that they're based around I2C connectors.
That means you can turn this:

![Cables and pins and alligator clips](rpi-mess.jpg)

into this:

![The Seeeduino Nano with a Grove module connected](seeeduino-nano.jpg)

Of course, you can also solve that problem with any number of attachments for a Pi or Arduino or whatever product you happen to own, but the Seeed and Grove are built for one another, so if you're embarking on a new project this is an easy way to keep things under control from the start.

## Small footprint

The Seeeduino Nano is small.
It's just 18mm by 43mm (that's about an inch and a half by an inch), and yet it has 8 analogue pins, 14 digital, and features the ATmega328P 8-bit AVR microcontroller.
If your project has space issues, this is a great option.

![The Seeeduino Nano](seeeduino-Nano-wiki.jpg)

The sensors tend to be small, too.
Size varies depending on what you purchase, but they're generally designed to save space.

![The Grove temperature and humidity pro (left) and a US quarter (right)](tempAndHumid.jpg)

## Setup

Getting started with the Seeeduino Nano was as easy as getting started with an Arduino.
That's not always the case with Arduino-like products, because some of them just assume you know the components they're built from.
You might get a microcontroller, download the Arduino IDE, and discover that the product you purchased isn't an option in the **Board** menu, leaving you to guess which Arduino board yours is equivalent to.
Seeed leaves nothing to chance and provides board definitions for all of their products.
You have to import them yourself, because they don't ship with the Arduino IDE, but the Seeed wiki provides instructions on how to do that through the IDE's **Board Manager** interface.

After you've imported the board definition, you can either start with the ritual flashing of the Blink code onto your device, or just code in the Arduino IDE as usual.
There are intructions on the Seeed wiki for that, too.

## Code

In addition to board definitions, Seeed provides sample code for each Grove module so you know how to send data to the module or gather data from it.
In my case, I was using the Temperature and Humidity Pro sensor, which requires the [DHT library](https://github.com/Seeed-Studio/Grove_Temperature_And_Humidity_Sensor/releases).
The library, along with a ``DHTtester`` project, is provided by Seeed, and instructions on how to install it are on their wiki.

The only thing Seeed doesn't provide is the name of the correct input pin for the Grove module.
The example code, written by [LadyAda](https://www.adafruit.com), uses the first analogue pin (A0), but on the Seeeduino Nano the Grove attaches to what turns out to be A5.
This is difficult to tell by looking at it, because the Grove physically attaches to the I2C plug, with no indication of what pin it's actually connected to.
However, the Seeed is open source, so you can either look at the specs for the board or you can just do what these kinds of gadgets beg you to do: experiment!

In the end, the basic code to get information from the Grove humidity and temperature sensor is about 20 lines of code (25 if you build in sanity checks, as LadyAda's code does).

```
// public domain code by ladyada
#include "DHT.h"
#define DHTPIN A5
#define DHTTYPE DHT22

DHT dht(DHTPIN, DHTTYPE);

void setup() {
 Serial.begin(9600);
 dht.begin(); }

void loop() {
 float h = dht.readHumidity();
 float t = dht.readTemperature();
 Serial.print("Humidity: ");
 Serial.print(h);
 Serial.print(" %\t");
 Serial.print("Temperature: ");
 Serial.print(t);
 Serial.println(" *C"); }
```


## Open source everything

The Seeeduino is open source, from the [downloadable Eagle file](https://github.com/SeeedDocument/Seeeduino-Nano/raw/master/res/Seeeduino%20nano.zip) to the [software](https://github.com/Seeed-Studio) that helps you drive it.
It's a dream platform for new users who feel overwhelmed by confusing and disparate choices, or for experienced makers who have moved on from a prototype and are ready to build a neatly organized and cleanly wired project.
If you've got a budding inventor in your life, let Seeed help seed their projects.