Interactive Neopixel Lamp (INL). LED Neopixel + Arduino Uno + Ultrasonic Ping Sensor

An interactive lamp that changes speed based on distance of objects in front of it. This uses the Arduino UNO a 60 LED Adafruit NeoPixel strip and an Ultrasonic Ping Sensor.

This also introduces the concept of functions in programming. The circuit is fairly straight forward as Om has tried to illustrate in this diagram! 🙂

Neopixel INL

Refer to Adafruit’s Neopixel Überguide and the Arduino Ping Sensor examples for detailed how to’s. (Note the ping sensor we used has a two separate pins for input and output rather than just one shown in the Arduino example.).

Here is the code.

#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, 2);

int delaytime=30;
const int pingPin = 7;
const int echoPin = 8;

void setup() {
 strip.begin();
 strip.show();
 pinMode(pingPin, OUTPUT);
 pinMode(echoPin, INPUT);
}

void loop() {

 delaytime=pingyity();
 for(int i=0; i<60; i++){
 strip.setPixelColor(i, 255, 0, 0);
 strip.show();
 delay(delaytime);}

 delaytime=pingyity();
 for(int i=0; i<60; i++){
 strip.setPixelColor(i, 255, 255, 0);
 strip.show();
 delay(delaytime);}

 delaytime=pingyity();
 for(int i=0; i<60; i++){
 strip.setPixelColor(i, 0, 255, 255);
 strip.show();
 delay(delaytime);}

 delaytime=pingyity();
 for(int i=0; i<60; i++){
 strip.setPixelColor(i, 0, 255, 0);
 strip.show();
 delay(delaytime);}

 delaytime=pingyity();
 for(int i=0; i<60; i++){
 strip.setPixelColor(i, 0, 0, 255);
 strip.show();
 delay(delaytime);}

 delaytime=pingyity();
 for(int i=0; i<60; i++){
 strip.setPixelColor(i, 255, 0, 255);
 strip.show();
 delay(delaytime);
 }
}

int pingyity()
{
 //Send ping signal out
 long duration, inches;
 digitalWrite(pingPin, LOW);
 delayMicroseconds(2);
 digitalWrite(pingPin, HIGH);
 delayMicroseconds(5);
 digitalWrite(pingPin, LOW);

 //read ping sensor signal input
 duration = pulseIn(echoPin, HIGH);
 // convert the time into a distance
 inches = duration / 74 / 2;

 //set light delay time based on sensor
 if(inches<=30) return(inches);
 else return(30);
}

7 year old’s guide to getting started with Electronics & Arduino

Kind of fun stuff; maybe other kids might find this interesting. Click on any thumbnail below to zoom in or you can download a pdf file here – Kid’s guide to Electronics & Arduino (pdf).

ps: He wants you to know this guide is a work in progress and will be updated with bit more advanced programs soon.

Adafruit Neopixel LED strip on Spark Core Arduino

Getting start on the Adafruit Neopixel on the Spark Core. This shows a WS2812B 60 LED strip from Adafruit and uses the Neopixel port on Spark Core to run it.

It is quite easy to code thanks to the Adafruit library and a good way to get kids introduced to the for loop.

#include "neopixel/neopixel.h"
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, D2, WS2812B);

void setup() {
    strip.begin();
    strip.show();}

void loop() {
    for(int i=0; i<60; i++){
    strip.setPixelColor(i, 255, 0, 0);
    strip.show();
    delay(5);
    }
    for(int i=0; i<60; i++){
    strip.setPixelColor(i, 255, 255, 0);
    strip.show();
    delay(5);
    }
    for(int i=0; i<60; i++){
    strip.setPixelColor(i, 0, 255, 255);
    strip.show();
    delay(5);
    }
    for(int i=0; i<60; i++){
    strip.setPixelColor(i, 0, 255, 0);
    strip.show();
    delay(5);
    }
    for(int i=0; i<60; i++){
    strip.setPixelColor(i, 0, 0, 255);
    strip.show();
    delay(5);
    }
    for(int i=0; i<60; i++){
    strip.setPixelColor(i, 255, 0, 255);
    strip.show();
    delay(5);
    }
}

2014 Maker Faire – year of the kid maker

Just got back from attending the Maker Faire 2014 in SF Bay Area. This was our 3rd Maker Faire and as in the past years we wished we had more time there.

The 2012 Maker Faire and an article on Popular Science about 12 year old entrepreneur Quin Etnyre sparked my son’s interest in making. So certainly the big highlight of the day was meeting Quin himself in person who was generous with his time and goodies. Be sure to check out his company website qtechknow.com for his kid friendly Arduino products.

Quin

The second highlight was the encounter with Spark Core team at their booth. They were so super awesome in recognizing my son from his last video and showered him with praises, encouragement and goodies (even a new Spark Core!). Plus he got to meet their CEO Zach Supalla who was really nice to offer encouragement and support. Thanks guys – we promise to make some cool projects with the 2 Spark Cores soon.

A few other kits that he was really interested in were:

Except the Phoenard all the others look like good kits for young kids to get started, though he said the Phoneard was the coolest thing he saw at the show. The best part was seeing exhibits from many young makers including these 12 year olds:

…sure feels like year of the kid maker!

Arduino project for Mother’s day

This project uses a LED 8×8 dot matrix for the display, a piezoelectric buzzer for the music and a photo-resistor to play it when you open the box.

I’ve used these examples to put this together:

More details on how to will follow later.

Getting started with IoT for Kids

I’ve added a a new page with some resources on Getting Started with IoT for Kids.

The resources keep evolving, so I’m hoping to keep it updated as and when I come across new and better ones.

Leave a comment with any suggestions on new resources you’ve come across that might be useful.