I bought some parts over at Adafruit to build some ThingSpeak and CheerLights projects. If you know me, I am always attracted to multicolored lights and even more so around the holidays. Adafruit has simplified the way to work with LED matrix panels by offering a new device called the Adafruit Matrix Portal. The Matrix Portal connects to any HUB-75 compatible LED display and gives you Wi-Fi control, USB-C power, an accelerometer, and a processor to help you create animations and graphics. With all of these options, you can build anything from an On-Air sign to a kinetic sand toy.
LED panels are really bright without a diffuser. You can buy a diffuser to enhance the look of the display… if you remember to buy one. I found an 8×10 clear document frame stand at my house and remembered that I have Rust-Oleum Frosted Glass Spray Paint the I used for my arcade cabinet project. I sprayed on three coats of the frosted glass spray while allowing for each coat to dry for about 15 minutes.
As an added bonus, the document frame also doubled as a stand for the Matric Portal display. The frosted glass enhancement turned out really well and greatly enhances the look of the LEDs.
Take a look at what Adafruit’s LED Sand demo looks like behind the diffused acrylic stand.
I have a lot of favorite times of the year. I get excited about the holidays, weekends, evenings, and days. I am usually filling each day with something new and/or pushing a project further along. One of my favorite events is the Bay Area Maker Faire. Imagine over 120,000 makers, hackers, builders, engineers, and students putting on the world’s biggest show-and-tell? You will see things that spark new ideas and you will see giant robotic giraffes.
You never know who you are going to run into. I was so happy to meet one of the first users of ThingSpeak! This is Andy Leer of Leer Media. Andy was introduced to my IoT projects back in 2008 at Hack Pittsburgh! He was instrumental in me being able to kickstart my startup and help support my growing community. Andy provided meeting space for my IoT Meetup in Pittsburgh.
A couple of the Mythbusters also showed up at the Bay Area Maker Faire. I got to talk about MathWorks software with both Adam Savage and Grant Imahara. Grant remembers using MATLAB quite a bit in his education and later his engineering projects.
I have been getting ready for this year’s Bay Area Maker Faire. Stop by the MathWorks booth to see our latest hardware projects and demos. We have giveaways and info on the latest products. See you soon at the Maker Faire!
It’s that time again. That time when people all across the world synchronize their lights together with CheerLights! People have built amazing CheerLights displays. I have seen everything from color-changing shoes to snowmen… and trees.
Here’s a quick introduction to the CheerLights project for those who are new to the project. Imagine 1000’s of multicolored lights all around the world synchronized to one color. When one of the lights turns red, they all turn red. To control CheerLights, send a tweet to @cheerlights or include “cheerlights” somewhere in your message with the name of a color. This will cause a chain reaction and all of the CheerLights displays and apps will change their color to red.
ThingSpeak MQTT Service
CheersLights is powered by ThingSpeak IoT. And, this year, I am happy to introduce real-time CheerLights updates using ThingSpeak’s new MQTT service. Using the MQTT service by ThingSpeak, your CheerLights change instantly. ThingSpeak has posted an example that gets a Particle Photon connected to CheerLights using MQTT. The Subscribe to Channel Updates Using Particle Photon Client example shows you how to use a Particle Photon Wi-Fi board to subscribe to channel updates from the CheerLights channel. The program displays the color read from the channel on the built-in LED on the Photon board. You can subscribe to the channel feed or directly to the color field on the CheerLights channel.
Once you learn how to use the MQTT service from ThingSpeak, you can easily adapt it to your IoT project. This is a great way to have real-time control of a device or real-time monitoring of sensors.
If you want to follow the project and see what others are building, visit CheerLights.com or follow on Twitter.
I am working on a project that uses the Arduino MKR1000 with ThingSpeak. While working on my code, I uploaded a bad sketch to the MKR1000. Every time that the board powers up, it starts running my bad code over and over and appears to be stuck in an infinite loop. I tried pressing the reset button, unplugging the USB cable, reboot my computer, reinstalling drivers, and unplugging the USB cable (for good measure). Nothing made the board responsive again. I found a forum post talking about the bootloader. The user mentioned that quickly pressing the reset button twice put the device into a good state by loading the bootloader. Success!
Want to see/hear how far the closest Uber is from you? All you have to do is press a button on an AWS IoT connected device. I created this project to allow anyone to have access to Uber even without a smartphone and for those with different capabilities.
For the third holiday season in a row, the CheerLights project is gearing up. The idea behind CheerLights is to show that we are all connected by synchronizing the color of lights around the world. Christmas lights are a staple around the holidays and with Internet-connected lights, the color of your lights matches the color of everyone else’s lights.
It has been a real treat watching this project evolve as more and more people add lights… and other things. Things like Android and iPhone apps that check the latest color of CheerLights, an old Commodore 64, and Christmas trees.
To control the lights around the world, send a Tweet mentioning @CheerLights and a color. The command is processed by ThingSpeak platform and distributed to all of the lights listening to the CheerLights API.
@CheerLights I am dreaming of a White Christmas
Another powerful aspect of the CheerLights project is that is shows off what is possible with the emerging Internet of Things. With a single message sent via a social network like Twitter, 1000’s of objects around the world are in sync with each other. Lights are connected by many types of controllers, such as Arduino, ioBridge, Philips, and the Raspberry Pi. This project is only possible through the Internet and the coordination of developers around the world.
If you have been following my projects for the last 12 years, you probably figured out that I must have a master plan. And this plan involves connecting things to the Internet that may or may not turn against us in the future. Way back in 2001, my partners and I released FuzzBox – this technology allowed for artificial intelligence to be distributed to devices via the Web. Our thoughts were if the decision making could be made on the Internet the devices themselves could focus on their task vs. trying to be a super device on their own. This was way early on and the ideas were premature, but it started a series of events and failures that led to even more projects involving devices linked together over the web. I guess this is now called, “The Internet of Things”.
Something that has emerged over the years is social networking. I have been fascinated by the idea of collective intelligence. It’s fun to follow a football game on Twitter or on Facebook’s live stream. You get to see the take other’s have on the same event that you are experiencing. If the Steelers score, you can feel it reverberate through social networks. These networks only work if there is lots of participation by many people. I have heard that people have predicted STD outbreaks from Twitter status updates, food poisoning sources, and even where earthquakes have taken place. This is fascinating to me.
The results are two-fold: you can learn from this data and that we are all connected. Enter in, CheerLights – CheerLights is my combination of distributed devices with social networking. This project that involves connecting multicolored lights to other people’s lights and allow Twitter keywords control them all. If someone tweets, “@cheerlights let’s go green” – every light connected to the project would change to green. To me this is a physical representation of a social network trending topic. It’s a way to share a moment in that moment. Just like with social networking, CheerLights requires scale to be very interesting. If you check out CheerLights.com, you will see how to build a set of lights that are linked together with other people’s lights via Twitter. I have examples using things from ioBridge, Arduino, and Digi. Please let me know if you decide to build something and connect it to CheerLights.
We are all connected. That’s my purpose for building all of this technology. Nothing else matters.
Last weekend was the Pittsburgh Perl Workshop hosted by Carnegie Mellon University in Pittsburgh, PA. I gave a talk on the Internet of Things and building apps using the Perl programming language as the connective tissue between devices and web applications. I covered the basics on how you interface devices to the real-world. I also hosted a Hardware Hackathon and got to discuss hardware, connecting things, and Perl. I introduced everyone to my remixed theory of innovation. Just get out there and copy a well documented project, learn by transforming some part of the project, and combine it with other ideas. This is the only way innovation has ever happened… Thanks for the awesome time at PPW!
Here are my slides from the 2011 Pittsburgh Perl Workshop:
Over last summer, I got the GamePack from Liquidware which includes a touch screen display, joystick, microcontroller, and battery pack. With this kit you can make a GameBoy from scratch. With some blood, sweat, and tears, I was able to re-create some games like Asteroids and Tetris.
The touch screen is called the TouchShield Slide which is a 320×240 OLED and resistive touch screen. The screen also has a microcontroller that is Arduino compatible and expands your program space. Since the screen is really a microcontroller in disguise, it can be used for many types of projects. Overall I am very happy with the screen, but I realized I didn’t know how to use it very well. I set out to learn and develop a protocol / reusable library that allows the screen to talk to a microcontroller and vice-verse. So I wanted to take a moment and explain what I learned – maybe you can get going faster than I did.
My goal is to be able to display data on the screen that has been received from another device. The data requested would be initiated by a touch on the screen. The protocol has to be consistent and reliable, while being flexible enough to be the basis for future projects.
I found quite a few libraries and resources on liquidware.com. I also discovered quite a few important things through my trial and error. My biggest frustration was with programming and figuring out the IDE. Here are some tips.
Program the screen and Arduino separately – make sure the IDE has the proper device selected
To put the screen in program mode, press the switch beside the power connector – it’s in program mode when the LED on the backside is red
TouchShield Slide Serial
Serial data sent and received by the TouchShield Slide uses the hardware serial lines.
To setup the serial connection, place this line in your setup code block:
Now you can read and write to and from the serial buffer. To read in a whole string, use a byte array to store bytes from the serial buffer when serial data is available. To write to the serial buffer, simply use serial print.
On the Arduino side, you have to use some form of Software Serial that sends and receives data on Pins 2/3. I have found that the Adafruit SoftSerial Library, “AFSoftSerial.h”, works the best. It seems to be reliable and produce consistent results when talking to the TouchShield Slide. Reading and writing from a software serial buffer is about the same as a hardware one with this library.
To use software serial, follow these steps:
Include the “AFSoftSerial.h” library in your Arduino code header space
I took a moment to put together all of the things that I learned into a quick demo project. This project displays a random number on the screen. The random number is being generated by an Arduino, sent via serial, and requested by a touch of the TouchShield Slide.
Random Number from Arduino Displayed after Detecting a Touch…
Visit Liquidware’s App Store to download the source code and library for this demo project.
I took the leap and bought an Arduino from LiquidWare. Arduino is an open-source microcontroller that has a processor, some digital I/O pins, and analog inputs. You can create little standalone programs that monitor inputs, control LEDs, and pretty much anything that you dream up. My favorite projects are ones that involve the Internet. A microcontroller is rather simple by itself, but what if it could use the web to get answers, send an email, maybe update my Twitter status? That means there is an unlimited number of projects ahead – Microcontrollers collaborating in cyberspace. The missing link for the web part is the ioBridge IO-204. I know you are no stranger to the IO-204, but for those of you who have not heard. The IO-204 sits on my network and relays data from its channels to ioBridge.com servers and back into my network. It allows for remote control and monitoring without network configuration and programming. One of the expansion boards is a two-way serial board that accepts serial strings and connects them to APIs of web services that ioBridge interfaces to and sends back responses. For instance, I can send the commands, “[[[calc|9*9]]]” and this returns 81. OK, maybe not impressive on the surface, but that result came from Google Calculator. Anything Google Calculator can solve, your microcontroller has access to those results. For more examples, visit the Serial Web Services API on the wiki.
Message Center Project
I wanted to combine these two worlds with a sample project – maybe it will inspire you to come up with something better, spark some ideas that you have. I have my Arduino measuring my outside temperature here in Pittsburgh, which is an analog input scaled to Fahrenheit. At any moment I can press a button and get the temperature on the LCD screen – no Internet required. Since I have been planning a work trip to Atlanta, I also wanted to compare my temperature with hot-lanta’s. So, my project solves that. Using the “weather command”, I am able to get the weather anywhere in the world by zip code or city name.
I added a few more things to the message center. With another button, I can get Google’s current stock price. My strike price was $405, so I have been watching it closely. If it gets below $405, I get an automatic email from my message center. The stock quote comes from the Yahoo Financials API.
I have one more button that emails me a secret message when it’s pressed. I put this in here for when my mom comes into my room from when I am on the road. It’s aptly labeled, do not press. Next time, I will hook it to a light sensor in the basement to catch her when she turns on my lights. I am sure you all have the same issues with your mom.
The Arduino requires some c-like programming and I wanted to include the sketch for you to steal and use for your projects. You will see how I send the serial commands from the Arduino to the IO-204 using the UART serial connection (pins 0/1) and receive and parse the incoming results. I use a SoftwareSerial port for the LCD results. The pushbuttons are software debounced and use pull-up resistors for solid digital connections. The LED’s linked to each button use a 330-ohm resistor to protect them. I was aided by the Arduino Inputs tutorial on Ladyada.net, Debounce Tutorial, and the ioBridge Wiki / Forum. Please let me know if you have any questions, maybe I can help. I have learned a lot about handling strings on the Arduino.
// // Message Center using Arduino and the ioBridge IO-204 // // An open-souce Shadowlord Project // www.IamShadowlord.com
It’s simple, but I hacked together a power supply for the Arduino, which gets power from USB or a coaxial input from a transformer. I wanted to only run one brick, wall wart, so I hacked a USB cable. There are 4 wires in the USB cable (from pinouts.ru):
The IO-204 has a regulated 5VDC and ground (up to 1A – 4A total draw depending on supply) on each channel, so using a terminal strip, I connected the VCC and GND to a cut in half USB cable.