Nodebotics
I was very fortunate to have attended this year's CSSConf and JSCONF2014 in sunny Amelia Island, Florida. Not only did I get to meet some old pals from Las Vegas, but I got to meet A LOT of really cool new friends as well. I have to admit though, I really can't wait for JSCONF2015.
My only disappointment was not getting my NodeBot working in time for the soccer tournament. I had grand designs for it and everything. I now understand why they call it hardware. Well because It's just so gosh darn hard! My background is in Web Development and UX Design. But this robotics stuff was intriguing and I wanted to learn more about it. Plus, I couldn't leave my poor nodebot, whom I'd later rename Sickbot, sad and disassembled. I had to build him!!
This article won't go through all of the details on how to do it, there are tons of instructional tutorials on what to do. My intent is to share with you a few ups and downs that I encountered while making Sickbot. However, if you are interested in replicating this project here are the items you will need.
Hardware includes
1 fabulous laser cut wooden nodebot kit made by Makenai's Pawel.
Two continuous servos
1 Spark Core or Arduino
1 Micro USB cable
1 breadboard
Jumper cables
1 quad-AA batter holder (mine came with a power switch, great for quick shut down and testing)
4 AA batteries
Software Includes
Johnny-Five framework written by one wickedly smart guy => Rick Waldron
Spark Core's firmware (You can build this with their UI and an App, but I'm not even going there.)
Nodejs
This is a Spark Core, made by some folks in Minneapolis. In short, this tiny bit of technology allows me to write programs in javascript on a node server. I can push programs to the hardware via Spark Cloud computing. The advantage of this is that it will leave Sickbot fully operational without being connected to anything but it's own circuits. Check out Spark Core's old kickstarter campaign to see other projects.
The image shown below is of my fully assembled Sickbot along with a Spark Core "Breathing Cyan", indicative of a successful WiFi sync (along with all appropriate software installed via Nodejs).
I'd recommend that if you are new to hardware development, familiarize yourself with basic circuit wiring. There are tons of videos online to help you avoid doing things like plugging an LED into your breadboard without a resistor between it and your power source! When you read about it, you will know why that's a bad idea.
The image below captures that amazing feeling I get when my code starts working the way I planned for it! Of course, I was doubly excited that my Sickbot was slowly starting to come to life! This was the first time I got both wheels hooked up and running solely on a battery source. (Previously, it had been powered by a USB cable connected to my computer.)
After taking this image I realized that I needed to separate the wheels and create two distinct objects in js to represent the wheels in real life. This meant that I needed to hook the wheels to two separate PWM pins. PWM pins are the nodes on your hardware that allows transfer of instructions from your code to the physical device. (Read up on this excellent guide that my friend, Susan directed me to so that I could get a great visual of how this is all connected.)
Later on, I realized that half of my pins (A0, A1 and A5) were not working at all. After pouring over the code in the Johnny-Five repo I decided it was time to reach out to the pros. Rick and David (with Spark) helped me realize that I had been using an old version of Johnny-Five. This specific problem had been addressed and fixed shortly after I downloaded the code. Bummer! Lesson here, don't use old code, and sign up for Github notifications so that you can be informed on the latest updates.
Once both wheels were spinning independently on different PWMs, I realized that I still needed to tell them how to behave. Such as, if I click the right arrow, go right, if I click left...well you get the picture. Eventually, I would like to control Sickbot from my phone but for now I had to do this from computer. Which means I needed to enable a keypress event in javascript.
I'm a newb to the inner workings of Nodejs and couldn't figure out why I couldn't access the keypress module. The error kept glaring at me from my console as I tried feverishly for a few hours to debug it.
After getting within 2 seconds of switching the framework completely, I finally found and article that helped me to realize there was a specific keypress package that I should have installed from Johnny-five that would enable this functionality. Shortly, after that was installed along with a few minor modifications to my sickbot.js file, at around 2 a.m. I had a very cute and completely wireless Sickbot spinning happily in circles on my floor.
This project was so exciting that I immediately signed up for December 6th's RobotsConf2014.
I could not have done this without the excellent guidance from two really really cool people thanks Susan and Pawel see you in December!










