Wednesday, January 16, 2013

Johnny's First Program

Made with:

Johnny's First Program doesn't do much(as far as programs go), but what it does do is important. First, it gives Johnny5 a name (with a colored prompt) and it gives the user a name that it then stores into memory. It also displays the current date and time and asks the users questions.

Right now, it only has two questions (your name, and how you are doing), but as I update my software, I'll continue to add features to this program.


Johnny Gets A Third Motor

In the Movie, Johnny has a really cool multi-tool hand that he uses for all sorts of useful tools. I figured little johnny could use something like this to make him appear more true to form and to be able to do more useful things.

Johnny's Third Arm (Not a Machine Gun)

This motor will be either used by the M-Shield or hooked up to the arduino or pi directly through PWM using boolean expressions to control a software switch connected up to a regulated 9v battery. This allows less control of the motor directly, as the functions available would only allow the motor to turn on and off. If you look at the above picture, you may notice that the motor is mounted to the third hand (of the third hand) which allows for realistic articulation of the arm that hold the motor. This will add to the realism of the project and be better to re-create the actual motions of the real Johnny 5.
 
For kicks and giggles, here's another pic of Johnny.
 

Johnny holding his tread motors as they are JB Welded.

One fun thing about this project so far, is how useful johnny has actually been in his construction. He likes holding things as they are dried, and does all of his own holding of sodder wires.
 
I Look Mah-va-lous!!!!
 
 
He doesn't know how to actually solder (yet). 


Tuesday, January 15, 2013

Motor Building

 Motor with bearing (removed from wheel) JB welding together


So Johnny 5 needed some tank treads to get him moving. For this, I googled tank treads and got this instructable.

Terminator Wheels


Johnny 5 uses terminator abec 3 wheels loaded with BBS and then jb welded.
I used some old bike chain that I cleaned up to fit around the wheel.

Cleaning dirty chains can be a dangerous process. Safety first! 


To clean the chains I dipped the chains in wd-40 for two days, agitaging the solution whenever possible. Then I wiped off excess rust with a paper towel, then placed the chains into a glass jar where I covered it with carb cleaner and left outside for 2 nice days.

Finally, I took the drill with a dremel brush to the links after securing the chain to the table using hammer clamps. it's possible to use a wirewheel on this as well, like you would clean a chainsaw chain, but the dremel bit was far less dangerous, so I could be more exact when poslishing the newely restored chains.

Motor being JB welded using Johnny5's skeleton and some paint caps.



More work will continue on this tomorrow as I attempt to find some locking washers and wing nuts to attach a 1\8 PVC  half then expoxied and covered in rubber that was salvaged from an old sign found at the junkyard.

I'm using rubber to help protect against wear to my floors and to provide grip. 

Monday, January 14, 2013

Johnny Talks to The Web

****N.O.V.A******
===============
Hello From Johnny5
===============
****S.A.I.N.T.*****
 
The First thing Johnny 5's Mind has to do is be able to communicate with the outside world. So I set forth the quest by hooking up the Raspberry Pi to the Internet. Now, this was by no means an easy task, as I have only wireless in my office and by default, the Pi didn't accept my wlan0 device on debian. Sure, I could have hooked it up in the room with the router, but there is no TV in there, and therefore no way for me to easily use that as a viable development system for the robotic mind.
 
Instead, I use a bridged network to bunny hop the connection to the interweb. Now, there are many ways you can do this. One is buying an adapter, the other is more cost-effiecient and involves a little knowledge of networking. Don't worry though, it's pretty painless if you attempt it.
 
 
Basically, if you have a laptop with a wireless card and an Ethernet port, it can be done. I'm using Windows, so all I had to do is go into the control panel, network and sharing center, then click both my wireless card (or Badass Antenna with wifi adapter in my case) and the wired eth0 connection and hit "Bridge Connections" in Windows 8. After a little electrical software switch, the cable is rocking on Pi.
 
This also serves a dual purpose, as when using more advanced interfaces like puTTY or FTP or something, it makes it super simple to transfer stuff to my laptop.
 
Since the Pi's already fired up, the next step is to start installing software, so you can actually do something beyond playing python games.
 
so in LX, type: #sudo apt-get install arduino
 
this will install arduino off the hub because we're going to be needing it to serial/power the arduino and control the motors and 2 servos in autonomous mode, as well as reading from the analog sensors on J5.
 
once that is done, (it does take a while because it installs some java), it's ready to code.
 
I was looking at some other ways of doing this, like using the GIPO with a Gertboard to directly link to the arduino and if you want to know more about that, take a look at this link. but after a quick pin count, I realized that it wasn't a solution that I could use for this experiment due to battery balancing.
 
Now, that Arduino was setup, I proceeded to install Apache PHP and MySQL to handle all of the web stuff that johnny was going to write to following the tutorial found here.
 
Now, Johnny was ready to talk to the web.
 
I think changed his background picture to this picture made by ScooterAK022 on deviant art because I thought it looked awesome.
 
 
Creative Commons Credit: Gerrit Dalman 
 


Friday, January 11, 2013

Putting It Together: Part 1

 
Little Johnny has got to have some juice to get his wheels turning. There ain't no 3V-5V mini-motors here. Little Johnny needs to haul some tread.

 
 
Through much research about electricity, Ohms Law, Resistor Tables, Coils, Starters, 12V systems, and how much this stuff was going to cost. I decided to go with the cheapest solution possible. Office Spacing Shit.
 
I had a couple of old printers laying around, and after harvesting some IC2's, wire, connectors, scanner bars, pulleys, springs, gears, spindles, rubber, grommets and desoldering some Voltage Regs, heat sinks and capacitors, I finally got to the motors.

This accomplished two things, it got motors for J5, and a whole bunch of parts that he could use. The best part? Free. I like free.

Now, before you go taking a screwdriver and a butterknife to your printer, make sure that it's broken (hopefully not the motors) because there is no coming back once you open Pandora's box.

The motors pictured above are 27V stepper motors and Johnson 12V and a couple others thrown in. I also found a motor with an encoder attached to an linefollower on a convienent breakout board with 3 pin Molex's (not pictured) that I plan on using for future experiments.

For Motor Controlling and Drivers I went with the MShield piggybacking on UnoR3. The reason for this was cost. I checked out lots of other controllers and hope to one day use the Orangutan X2 to power future projects. I also plan on using a Pro to Servo Board combo for controlled autonomous drone flight but I still have to figure out how I'm going to handle CV (Computer Vision) on the Drone but I may go with Android 2.3 via Wifi for that.

With Mshield, you get 2 Servos and I was running short on PWM's on Uno because of BTSlave(Bluetooth for connecting to voice controller). So this would work, but only if I wanted his head to Servo Sweep and maybe have one arm work or something, So I needed more servos, but didn't want to suck anymore juice out of the R3. So I went to the Pi.

Pi kinda sucks for controlling servos right out of the box, but if you add the break out, you get 16 servos. Problem solved. I don't have pictures of the servos yet because I don't have the board, or the servos yet because of money. So look for more on this in future posts.

Another great thing about Pi? cheap, USB Hosting, Wifi, An OS, Webserver, and some cool boards for future use.

Johnny's 4 Arms Holding his Head for Welding


For servos, I'm thinking about using either 12g Standard, or 9g Mini or a combination of the two to control J5 and using push rods for articulation to keep the servos out of sight for a more lifelike look.
There are other Johnny 5's on the internet that look like a bunch of servos with a J5 head on top, and that's not really what I'm going for, even though, that robot is pretty cool.

Even though I have some stepper motors and really want to use them, I'm not; because they take up too many inputs, (moreeeeee input) and interfere with BTSlave. So, instead I'm going with two straight DC's to spin the custom treads.

To Power the Mshield and motors, I'm using a 7.2 NIMH HCB because I happen to have a charger sitting around from some of my RC stuff. Uno is piggybacked from the Pi (running Occidentialist 0.2) via the USB HOST and will be powered by a 3300mah 5V LiPo that's on the Adafruit's Website found via this link.



This is one of the most expensive parts of the project, as batteries alone cost a whopping $80 dollars.

Here's a current break down so far of Johnny 5, Pricewise:
1. Arms (2X Third Hands @ Harbor Freight for 2.99 a piece) = $6.00
2. RaspberyPi (via Element14 (Shipping Included in Price)=$ 45
3. Arduino Uno R3(via Amazon)=$20
4. Mshield(via Amazon)= $20
5. BTSlave(via SeeeeedStudios)=$23
6. Motors=Free
7. Batteries=$80
8. Sensors=$20
9. Tank Treads=Free
10. Servo board = $15
11. Servos= ?

So without Servos the grand total is $229.

I estimate total price of the this project to be just under $300 making J5 not only Green but Good for Wallet.

What does $300 dollars get you now-a-days?
In the end, Johnny 5 will have the following features and capabilities:
Voice Control via Bluetooth.
Internet Site for Sensor Data including the following types of data:
  • Temp
  • Light
  • Email Notifications
  • Image and Video
  • Twitter Notifications
  • Event Notifications
Full Articulation
Voice
Sound Effects from the movie in response to commands issued via Voice.
Light Effects
Remote Security Monitoring
Autonomous Mode

I hope to add other improvements to this project as my knowledge of the inner workings of some of the more complex systems becomes greater.

Currently it's setup to work with android, Linux and windows. I plan on running an android 2.3 device as the robots screen and placing a giant red arcade button on the bottom to more mimic the actual johnny 5 robot. The Android will still be able to run all the apps that are available for 2.3 and I'm planning on using OpenCV for image processing and handling (but it's a really long book, and I'm only about half way through it).

Hey Laser Lips! You're Momma was a SnowBlower!!!


OpenCV is a computer vision software that is intergreted into the ROS operating system. ROS stands for Robotic Operating Sytem, and is pretty much the system that most industrial robotic systems use. They also use OpenCV in 3D printing which is pretty interesting, but not what Johnny 5 is going to do with it. If you need more input about OpenCv, click here.

The Following Coding Techniques and Skills are used in Johnny 5 (thus far):
  1. C
  2. Ruby
  3. SQL
  4. Apache
  5. HTML5
  6. CSS3
  7. JS
  8. Java
  9. Python
  10. Debian
  11. Android 2.3, 4.0
  12. puTTY
There's more, but that's all I can name off the top of my head. Basically what happens is that all the sensors are read in C, sent to Serial, and interpreted by the computer into python. The 2 servos on the Mshield can be controlled by Bluetooth but are instead sent to the pi to be controlled by the OS. The Pi based servos are attached to IC on the pi and are communicated via a relay system that is mostly derived of a ruby rail system to Python. All the motor controls are written in C, and some of the servo code on the Mshield is also in C. but everything else is pretty much python.

After it receives this information, the OS pushes some of the information to java, so it can be sent to the android app and then scripts up the website using Java, JavaScript, HTML5 and CSS3 using the Sickle and Apache servers. puTTY is used to send serial data to another node on the network for backup purposes, or for a loop through to the printer for data analysis. The Pi runs Debian, so that completes the list (thus far).

Johnny 5 is Alive!!!

A few months back, I decided to do a project. A project that would test my skills as a programmer, artist, and scientist.

Build a cool robot.

There are a lot of cool robots out there, The Robonaut, R2-D2, Nao, Mindstorm, Sumo, and Vex, just to name a few. After looking over the basic material, I finally decided on Johnny 5. Why Johnny 5 you may ask? Because Johnny 5 is ALIVE (and many of the parts available already look like him.

After crunching some code, and using some simple engineering logic (the KISS system), I was looking at my Sonar (Ultra-Sonic Distance Sensor), and while it may not be a Parralax PING sensor, I thought it looked remarkably like J5 himself.

A short trip to the hardware store nabbed me some 3rd hands, which I thought already looked like arms (KISS). So Bam, on to the robot they went.

The great thing about third hands is that they have alligators for hands that can actually help you solder the robot. Theortically, you could program J5, to build clones of himself.

So, this got me thinking, what can J5 do, that I could re-create using as little money as possible (because I'm a cheap SOB).

In this blog, I'll be posting links, resources, and ideas about Johnny 5 to help me create a mini version of the world famous Robot. If you have something you would like to share, post a comment anywhere on this blog, I read these things all the time.