As I’ve mentioned in previous posts (like the slideshow here), I want to build a teleoperated mining robot. Since I’m somewhat short of both cash and experience, I have to start small.
One key part of the system will be to create an interface to control the robot via computer. And to do that, I have to first be able to control anything, anything at all, by computer.
Hence, the following project.
First I wrote a program — or ‘sketch’ as it is called — in the Processing computer language. Here’s what the sketch window looks like on the computer screen:
You take your mouse cursor and click on a square. The color of the square goes from dim to bright. At the same time, an LED of the same color lights up. Click the square again, and it goes dim and the LED goes off.
The whole circuit looks a little like this:
The laptop runs a Processing sketch, which produces the screen image of colored squares, which the user then clicks with the mouse. The Processing sketch reads the clicks and converts them into one byte commands which are then sent over the USB cable to the Arduino.
The Arduino has its own sketch which reads the commands from the USB cable and interprets them to turn the respective LEDs on and off.
Although the USB cable can send data back from the Arduino to the computer, I’m not using that capability here.
Here’s the physical layout in my elaborately equipped and tidy laboratory:
And here’s a closeup of the Arduino and the poor suffering breadboard:
BTW, the LEDs and the jumpers came from the Getting Started with Arduino kit. I’m not sure if this breadboard or the one in the background came with the kit.
Anyway, here’s the raw video:
Although not shown in the video, I can turn on more than one LED at a time, but I’m not sure that’s good for the Arduino. Haven’t burned it out yet, though!
The next step in the project is to interface the Arduino with a remote controlled toy ‘stunt’ vehicle, which coincidently has four on/off inputs. My nephew (to whom I’m assigning the designation Engineer One) needs to come over and we’re going to take it slow because I don’t want to burn out the Arduino. Which as surely as rain falls and the sun rises . . . .
BTW, I notice the diodes I downloaded from Google Sketchup 3D Warehouse look really nice, but lack a couple package details that are typically found in real-world diodes and helpfully explain to newbie electronics hobbyists (such as moi) which side is which. Hence I modified like so:
Just remember to connect ‘flatter’ and ‘shorter’ toward ground, and you too can be confident that your circuit will burn out for some other reason.