Skip to main content

Raspberry Pi bot progress

I've been chipping away at my Raspberry Pi/Arduino bot here and there so I decided it was time for an update.

Basic Controls

I've added more general functionality, such as turning left & right. That was easy with Firmata by setting a pin to a mode such as Digital Input or PWM and setting it Low. For example
this.firmata.digitalWrite( this.right.forward.pin, this.firmata.LOW);
would turn the stop the right wheel from moving forward.

Mobile-first UI

Once I got the new controls wired into Socket.io, I improved the interface. I forked a neat little project called virtualjoystick.js /by +Jerome Etienne. It is a canvas joystick library that supports touch on mobile (with a mouse fallback.) The primary directions are mapped to their respective socket.io method calls. Therefore, I can drive the bot directly from my android phone's mobile browser. While it doesn't show much, here's a screenshot:

Easy remote access with localtunnel

When building an internet-enabled device, you need to a way to get to it through the internet (duh.) Using an internal IP works when you're on the same network. When outside the network, you need a proxy of some kind. Localtunnel is "the easiest way to share localhost web servers to the rest of the world." There's a great port for Node.js that I got working in minutes.

Simple app for accessing multiple devices

I could get the local IP & localtunnel url and write it to std.out but that's not useful from my phone or laptop. I wrote a simple App Engine app I'm calling DHD that logs devices and their addresses. Here's another mildly-useful screenshot:
It basically takes a POST and stores it App Engine's NoSQL db. Nothing too fancy, really. I imagine that addressing is a common problem for networked/internet-connected devices (I wonder how other projects like Electric Imp deal with it?) I may open source the code when it becomes more sophisticated, seeing as other internet-connected device projects might need something like a DHD.

Next Steps

Software

I plan on writing an init.d script that uses Forever to fire up the bot code whenever the machine starts & always keep it running. I also would like a shell script that tries to join open networks when nothing else is found.

Hardware

I picked up that Rover 5 from +SparkFun Electronics as well as a sweet accelerometer, gyro & compass unit from +Pololu Robotics and Electronics. Between having more motors, optical encoders and the IMU might mean I need to upgrade to an Arduino Mega. No biggie.

I still have a pipe dream to do some OpenCV/SimpleCV tracking or use an obsolete CMUcam I have lying around. We'll see.

Hopefully I'll have some more fun updates the next time I decide to blog.

Cheers,

Popular posts from this blog

My weekend project: an Arduino, Raspberry Pi & Node.js robot

Yes I know, I'll get more buzzwords when I my JavaScript creates Cloud Synergy - but after I Pivot.




I've been spending my wee few hours a week designing, tinkering and finally building my little robotics platform. I've had ideas brewing for a while but haven't had enough time outside of work to start hacking.

It all started when I first saw Rick Waldron's Johnny Five framework for Node.js.
Sensors are asynchronous, so, ya, a node.js robot framework makes sense. A few months later I started sketching designs, reading up on firmata and buying my arduino & Pi.

Before the what & why, here's the basic BOM:
1 Arduino Uno R3 running firmata1 original Raspberry Pi with Raspbian, Node.js & 4gb of storage1 Magicians chassis1 SN754410NE Quad Half H-Bridge to drive the motors1 dual-output mobile battery backA custom mount for the Pi & some custom USB cabling for power Why Raspberry Pi The main controller is a Rpi. It turns 2 small motors by delegating instru…

A Maker's Equipment List

I've been building up a nice supply of tools and components so I decided it is high-time to build a small workspace in my tiny SF apartment. There were things I knew I still needed but wrestled with some tough choices (like which Oscilloscope to buy.) I wanted either a nice Wishlist on Amazon or at least a great list to start my journey. I found a few decent starting points in the form of video & blogs:
How to set up an electronics lab/workshop at homeSo You Want to Build ElectronicsHow to equip your EE lab The first link is actually a transcription from +EEVblog /by +Dave Jones (EEVblog is an awesome blog and YouTube channel, you should subscribe.) The second blog /by +Kenneth Finnegan covers more of the components side.

What I couldn't find is a complete compiled list with links to purchase. So I made one! I put together a simple Amazon Affiliate store called Maker Workbench Equipment List. I merged what I thought made sense and added a bunch of items I think any good Mak…

The factory, not just R&D, can be on a desktop

3D printing is certainly a hot topic and it hasn't even hit its stride. The machines are getting smaller, more accurate & cheaper. We're seeing less toy/protoypes and more "real products" - even a life-size robot!

But to make a final product, you need more than just the frame. New Startups are entering the arena to enable a Maker to complete the entire product development lifecycle in their own workshop.
Circuit Board Prototyping

The folks at AgiC sourced special conductive tape that only conducts in the Z-axis so soldering a SMT is literally just placing it on paper.
Milling

The mill can cut out tons of materials from copperclad for more permanent circuit boards to metals.
Pick & Place
I saw an more updated version of the machine and I was surprised how impressive it was (and no idea how expensive a real P&P cost!)
Is it ready yet for my apartment? Not quite. These startups are just getting off the ground. Furthermore, if you were to buy all of them it w…