Friday, April 15, 2016

The Learning Lab Kit on a Shield for Arduino

Received this Learning Lab Kit on a Shield for Arduino from Programming Electronics Academy today and am very pleased.  This shield

The Learning Lab Kit on a Shield for Arduino is meant to help you save time – it basically pre-populates common circuits for you.

Circuits that you might already have learned quite well – like LED, potentiometer, or push buttons.

Instead of searching your shag carpet for the 220 ohm resistor that dropped last week, you simply use the Basic Electronics Arduino Shield – and it connects everything up for you.  No need to breadboard the circuits out.

So when you sit down for 20-30 minutes to practice coding on Arduino – then you spend the majority of the time getting to try new things, and less time repeating something you already know.




I couldn't wait to play with mine today







Want to save some time learning Arduino?
Join the thousands of awesome people to sign up for our 

Sunday, April 10, 2016

NeoPixel 16 Ring Fun

NeoPixels are fun and amazing.  In my project I connected 4 of the AdaFruit NeoPixel - 16 RGBW Leds together.  What caught my attention and curiosity was that you can control each of these RGBW Leds using just one wire.

This feat is accomplished with a very timing-specific protocol. Since the protocol is very sensitive to timing, it requires a real-time microconroller such as an AVR, Arduino, PIC, mbed, etc. It cannot be used with a Linux-based microcomputer or interpreted microcontroller such as the netduino or Basic Stamp.

How the protocol works can be found in the WS2812 data sheet.  For each RGB Led a stream of 24 bits will be sent, 8 bits for each color.  The value of each bit, 1 or 0, is determined by the timing of the square wave.

A logic 0 is represented by a signal that is high for .35 mircorseconds followed by a low of .8 microseconds

A logic 1 is represented by a signal that is high for .7 microseconds followed by a low for  .6 microseconds

So just in the process of updating a 16 LED RGB ring you will be sending 48 bytes of data, 3 bytes for each leds RGB value. Each byte contains a value of 0-255 indicating the value of intensity for that particular color (Red, Green or Blue).

Looking at the diagram above the transmission starts with D1 receiving the first 24 bits.  After that D1 will pass subsequent bits on to D2.  Once D2 receives it's 24 it starts passing subsequent bits onto D3.  Note that this is different than usual shift register operation.  The passing on will continue until the data line is held low for 50 microseconds.  Holding the data line low for 50 microseconds is a reset code indicating next sequence is for the WS2812 to process.



Generating the timing above is no easy feat and requires some very skilled hand-tuned assembly code that issues data to the LED drivers at a specific rate.  Fortunately, Phil Burgess / Paint Your Dragon, wrote a library for Adafruit that allows us mortals to control these beauties.

Below is the code and a video of my setup.  Codebender allows you to peek into the library files by holding down the CTRL key while clicking on the library header file.  In this case you would hold the CTRL key and click on "Adafruit_NeoPixel.h".  This will open a new tab with the NeoPixel library and related files.  From there look on the left hand side and select the Adafruit_NeoPixel.cpp file to explore and learn more about this awesome library.

Don't be afraid  If you have any questions please feel free to ask.



Want to save some time learning Arduino?
Join the thousands of awesome people to sign up for our 

Friday, April 8, 2016

Logging Environmental Data and Charting it with Google Charts

Today I have been experimenting with the Particle Photon and logging environment data to the internet via the Data.SparkFun.com.   Data.SparkFun.com is a free service for posting, storing, and reading sets of data. It’s powered by Phant, an open-source, Node.js-based tool that can be run on any server or computer.

Once the data data feed has some data  I can start charting it using a number of free services. Following Sparkfuns tutorial I am using Googles Charts to graph live data on my web site. Adding a barometric sensor to this wouldn't be hard and would make for some interesting weather studies.


Sparkfun Tutorial

Graphing Live Data With Google Charts Tutorial

Sample Live Chart, updated every 60 seconds, from my experiment

 I'll have this data logger along with a neopixel demo and other presentations on display at our Programming Electronics with Arduino meetup this Saturday 




Want to save some time learning Arduino?
Join the thousands of awesome people to sign up for our