Showing posts with label robot. Show all posts
Showing posts with label robot. Show all posts

Saturday, April 7, 2012

Introducing Sandy Lloyd (and project( Mayhem))...

This is Sandy Lloyd's first post on Electronomous so give him a warm welcome! I've been chatting with Sandy on G+ for a few months now and he's definitely got the maker's spirit. Currently residing in Cocoa Beach, Florida, he's keen to fill you all in on his latest project.
- Adam.

As long as I can remember I have been fascinated with robotics and tech.

I have always dreamed of building a robot. You know, the big Mech kind. The kind ya see in the movies. You know - climb in and battle til' the death (of the bot).

Well, over the years my dreams got more and more "realistic" until I arrived here, where I am now. This was before I knew about Arduino, or the entire DIY robotics scene. About two years ago I found out that there were people that actually got to build their own robots.

Unfortunately, things happened and I sort of lost interest. About three or four months ago I was reading an article about this little gizmo called an Arduino. It was a microcontroller that helped you learn programming and helped you figure out how to build your own circuits.

I thought to myself, "That is exactly what I want to do."

With a little research I found sparkfun.com, and pololu.com. At their websites I saw that there were a plethora of MCUs (MicroController Units), LED's (Light Emitting Diodes) and every sensor you could think of - so I placed an order.
Not fully understanding what I was getting into I ordered:

  • a Pololu Baby Orangutan
  • an AVRISP II programmer
  • a Shiftbrite
  • a couple of push buttons, and
  • a geared motor

At that point I didn't know just how complicated programming could be. I messed around with it for about a month, maybe a bit longer. But I quickly realized that I had jumped in too far. So, I went back to sparkfun.com and ordered an Arduino Uno R3, some resistors and a couple of other things. That was the ticket - just what I needed. Within days I had written my first bit of code and I was hooked.

Now that I am armed with a much more robust arsenal of parts, an Arduino, a tad bit more knowledge and some very intelligent friends (both of whom are authors on this blog) I am off to build my first "real" robot!

First things first - I am going to post some pictures of some my parts for the robot. The robot, as of yet, has no name. So lets get to some pictures. 

Large 1 watt LED's
The smaller LED in the middle is a
RGB LED
http://arduino.cc/
Arduino Uno R3

On/Off switch, two bumper
 switches, Piezo speaker

Accelerometer
QTR-1RC Reflectance
 Sensor



Wheels And Servo horns
Servos
Solar Panels, LDR , and a Thermistor 



Starting at the very top from left to right we have:

  • Arduino Uno R3, the brains of my bot.
  • Two, large 1 watt ultra bright LED's, they are the head lights. A RGB (Red, Green, Blue) LED, for status indication.
  • Snap action switches for tactile feedback so my bot knows when it has ran into something, an On/Off switch for killing power from the batteries, and a piezo speaker for alerting me if it has fallen over or someone has picked it up.
  • QTR-1RC sensors for edge detection and line following. so when I am letting it drive around on the table it wont drive or back over the ledge.
  • Accelerometer it detects motion on three different axis, it will set off the piezo speaker in case it falls over or the kids pick it up.
  • Wheels and servo horns for mounting the wheels to the servos.
  • Servos for spinning the wheels, that small Servo is for a Sharp infrared proximity sensor (not pictured).
  • Last but not least is a Thermistor for temperature sensing, a LDR (Light Dependent Resistor) for finding the brightest part of a room when the batteries get low, and Solar Panels for charging the batteries.
Those parts are all for the build. There are more parts but I'm not nearly as organized as I should be for a build of this magnitude. Remember, this is my first actual robot build. I will post more pictures of the actual build once I get to that point. Right now I am cutting brackets for the servos and stuff like that. I really do not have a design, this is all coming from my head. After all parts are cut I will update everyone.


Wednesday, March 7, 2012

First look at WRPC with ABE



This is a pre-pre-pre alpha look at the basics of communication between WRPC and ABE. Spot the bug at the end of the clip :)

Friday, February 17, 2012

Wireless Reprogrammable PS2 Controller (Part I)

Awesome Sauce Wixel & Arduino/Atmega Based PlayStation 2 Project Controller

pic1m
pic9s pic10s pic11s

The Reason

Ok, so I was at my girlfriend’s family’s place on some recent holiday and I was being asked to show off what my robot ABE could do. I did the fully automated things by turning him on and doing a few little pre-programmed responsive actions (covering his “eyes”, covering both IR sensors etc1) but I quickly realised that in order to show off his full bag of tricks, I would have to send him a few commands (or at least requests). At the time, the only way to do that was to take my other Wixel unit, plug it into my computer and send it some serial love. I had no computer setup there, nor my other Wixel.

The Design

At first I had intended to add two interrupt buttons to ABE and I even studied Schmitt circuitry to that end. Then, I had a better idea - I would add an infrared remote to him. While I was looking into that option, I had the best idea yet. Why should I waste even more power on extra components when ABE already has inbuilt wireless comms via the Wixel? Why don’t I just build a Wixel-enabled remote control?

The Better Design

To begin with, I ordered an LCD from Little Bird Electronics along with a few other parts for various new ideas. I had intended to use some old contact pads I had laying around for the buttons but I couldn’t come up with a design that I liked. It had to be light, portable and I had to want to use it.

After a bit of pondering, I remembered that I had an extra PS2 controller in a box doing nothing except tangling my other cabling up. Surely someone had already thought of this before? Google time!

PS2 Plus Arduino?

Feasiblity Study

I looked around for an Arduino library to communicate with a PS2 controller and I found it right here. Thanks to Bill Porter, I had my answer. Not only was it possible but much of the work and testing was already done. Music to my ears, and a BIG thanks to Bill.

What I wanted

I wanted a compact, portable replacement for communicating with my robot via the Serial Monitor. This was my general requirements list:

It must…

  1. be compact and portable… (duh)
  2. allow multiple user inputs to the robot
  3. allow human-readable output from the robot
  4. look professional and slick so I will want to play with it (oooh shiny!)
  5. not interfere with the ability to wirelessly reprogram ABE

What I ended up making

I ended up making a comfortable, portable replacement for communicating with any of my projects that include a Wixel

It…

  1. is pretty compact and portable (at least hand-held) and is fairly light
  2. allows multiple user input to the robot via:
    • 10 digital buttons (all with changed, down and up event notifications)
    • 4 analog pressure-sensitive buttons
    • 2 biaxial analog stick controllers (with two additional digital buttons underneath them)
    • a microprocessor-driven LCD-Menu interface (that I’m writing AFTER this post)
  3. allows 32 5x8 pixel backlit LCD characters over 2 lines for human-readable output and interaction
  4. looks professional (the Sony part… my bit looks nice enough :)
  5. allows pass-through reprogramming of ABE when the controller is plugged into a USB port using the standard Arduino IDE

Sweet - I’ve totally decimated my requirements list (that’s a good thing)!

Oh, and as an added “I wonder if I can….” bonus, I’ve also managed to design it in such a way that if ABE is plugged into the computer USB port, the controller itself can be wirelessly reprogrammed (without having to remove the chip). Woot!

What does that mean?

Well, it means I can remote control ABE and any other project that I’m making that includes a Wixel.

It means I can make stand-alone programs for the controller (and I have a few sneaky projects in mind) and its 2.4GHz transceiver (Wixel) - I could even theoretically reprogram ABE in-the-field.

It means - I’ve made myself a new toy to play with. :)

pic14m pic6m

The LCD Bracket

To make a slick-looking controller, you’ve got to have slick-looking curves. Because I still have a fair bit of the stuff and because it’s durable, mouldable (if you’re really careful with a blowtorch or hot air machine) and strong, I decided on using more perspex. I wanted the bracket to tilt the LCD screen slightly towards the user (me) for good visibility and comfort. I also wanted not to mess up the beautiful aesthetics of Sony’s controller.

I scribbled up the design (above) on my whiteboard one afternoon and measured it carefully onto a piece a day or so later. To cut it, I used a fine-grade hacksaw and to sculpt it, I used a pocket blowtorch (very carefully) and a padded vice. I beveled the edges afterwards with some hand-files and wet-and-dry.

Bracket Parts List
  • 3mm x 6mm (M3) Screws
  • 10mm Hex Spacers
  • 90mm x 3mm x 120mm Sheet of Perspex

pic7m pic8m

After I’d drilled all the bracket holes, I also drilled holes in the PS2 controller’s lower shell. I had to be extremely careful to keep my M3 screwheads away from the interior circuitry but there was enough clearance for them to co-exist peacefully. Holes in the perspex were threaded using an M3 tap tool, so no extra nuts were needed (keeps the minimalist aesthetic).

pic2m

PS2 Controller Wiring

The wire pinout provided at Bill’s site was a little different from the one I had, but it was noted that the colours were succeptable to frequent change.

pic3m

Bill’s Site Pin/Wire layout:
  1. Brown = data
  2. Orange = command out
  3. Grey = dualshock power
  4. Black = ground
  5. Red = power
  6. Yellow = attention
  7. Blue = clock
  8. White = ?
  9. Green = ack
My Pin/Wire layout:
  1. Brown = data
  2. Orange = command out
  3. Purple = dualshock power
  4. Black, Grey (both) = ground
  5. Pink = power
  6. Yellow = attention
  7. Blue = clock
  8. N/C (shield and bare wire also both N/C)
  9. Green = ack

pic4m

PS2 + Arduino

In order to link up the PS2 controller to the Arduino, I needed Bill Porter’s library called PS2X.

Download PS2X from Github

Once I had wired it all up as explained in the very top of the code (see the breadboard diagram below for the cheatsheet), I turned it on but it didn’t seem to work straight away.

Not to worry!

Bill has an absolutely brilliant section on his site that’s dedicated to troubleshooting the library. What a guy!

Bill’s Brilliant Troubleshooting Guide

It turned out that all I needed was a single resistor to act as a pullup for the controller. Simple as that.

pic5m

PS2 + Arduino + LCD

After I’d linked up the controller to the Arduino (and yes, mucked about with it for a good half-hour), I added in the LCD. This was probably the easiest part. The wiring is only 4 pins (power, ground, SCL, SDA) and the sample code in the DFRobot-provided library gave me all I needed to find-and-replace all of the Serial.print calls in Bill’s demo with lcd.print.

Download the DFRobot LCD Library for Arduino from DFRobot

…more fiddling and mucking about ensued…

pic12m

PS2 + Arduino + LCD + Wixel

For the home stretch (a few days later - I’m a busy guy), I added the Wixel into the mix. The following links came very much in handy:

For this part, (ABE has a Wixel Shield) I wanted the circuit to function similarly to the Wixel Shield. That way, I would be able to program both ABE and the controller remotely and still allow full communication between the two (without buying or powering more hardware). What followed was a simple (remember, this is version 1.0) design that was mostly voltage dividers2 and pullup resistors.

pic13

The Circuit

I’m going to write this in point form so that it reads simply. It’s not that complex a circuit, though. Here’s how it works:

  1. The Arduino powers everything from its 5V pin
  2. All grounds are connected (as they should be)
  3. The PS2 controller pins (shown on board left to right, pin1 to pin8) connect to Arduino digital pins, power and ground
    (pins 3 and 8 are not connected)
  4. The LCD pins connect to the I2C bus (SCL,SDA), power and ground
  5. The Wixel takes its power directly from the Arduino 5V pin (it has its own regulator)
  6. Arduino Transmission (TX) lines are voltage-divided down to about 3.3V for the Wixel’s RX inputs
  7. The Wixel Transmission (TX) lines are connected directly to the Arduino (because 3.3V is still considered HIGH by 5V logic)
  8. Various pullup resistors were required to keep the Arduino/Wixel logic in certain states at certain times (especially during program-loading)
  9. The single transistor is part of a quick on-board digital inverter (NOT gate). When the Wixel wants to reset the Arduino (when programming), it sets P0_0 to HIGH. However, to reset the Arduino, the RESET pin has to be pulled LOW. This is a very simplified version of the connection shown on the Wixel Shield schematic (but it works well).

N.B. I can’t remember if I put the right resistance values into Fritzing before I generated the breadboard graphic.

Stay tuned for the next post. I’ll add a schematic with values and details of the next steps, and if required, I’ll post some more explanation about the inverter, pullup resistors and logic conversion. By then, I should have some code to post too.


  • ABE is (at the time of writing) programmed to start in different "modes" depending on the condition of some of his sensors at time of startup. If an object of greater than 31°C is less than 10cm away from his sonar sensors (i.e. a human hand over his eyes), he will start up in standby mode. If both of his IR sensors detect obstacles on startup, he will start to sing a tune.

  • The Wixel runs at 3.3V whereas the Arduino runs at 5V. I bought a logic converter for the job but it was actually simpler to construct the circuit from basic components as I have.

  • Monday, February 6, 2012

    ABE

    In the beginning (of 2012), there was ABE…

    Earlier this year, I brought to life a small, cutish robotic creation called ABE. ABE stands for Autonomous Base Explorer (or something like that). It’s a working title. Here are some pictures of ABE with indications of what his parts are and what he (yes, he) can do. I’ll add more detail later (perhaps).

    Chips & Boards Servo Motors Sensors & Outputs Power & Stability

    Robot Definition Statement

    A mobile, terrestrial, wirelessly programmable and interactive, human-interactive expandable robot prototype with multiple sensory inputs and feedback devices, capable of self-navigation and autonomous task completion. (bloated, I know)

    Current Working Title

    ABE = Autonomous Base/Building Explorer

    What Can He Do?

    ABE can do quite a number of things. Based on the Arduino UNO, he has a highly flexible programmable microprocessor. Apart from that, there’s the other sensors and capabilities. Here’s a short list:

    He Can…

    1. Measure distance from himself to an object in centimeters using sonar
      • Measurements are in centimeters
      • The sonar sensor (SRF05) is mounted in the pan and tilt sensor array
      • The beam pattern is shown here:
        Beam Pattern
      • Sensor supplier’s information
    2. Measure the temperature in a 90 degree field of view
      • Operating ambient temperature is between -40 and 85 degrees Celcius
      • Measurement temperatures range from -70 to 382.2 degrees Celcius
      • Measurement resolution is 0.02 degrees Celcius
      • Measurement accuracy is +/- 0.5 degrees Celcius at Room Temperature
      • It is immune to IR & Sunlight
      • The Infrared Temperature sensor is mounted in the pan and tilt sensor array
      • Sensor Datasheet
    3. Detect obstacles using front left and right mounted IR proximity sensors
      • Measurements are only the existence or not of an obstacle
      • Sensors are angled to allow approximately 7cm forward detection and enough sidewards detection to allow approximately 1-2cm clearence for the wheels.
    4. Pan and tilt the sonar and temperature sensor
      • The pan range is approximately 180 degrees, with 90 degrees being full forward
      • The tilt range is less than 180 degrees, with 45 degrees being level, 120 degrees being up and rear facing and a minimum tilt of about 10-20 degrees
    5. Indicate the direction of sensing for sonar and temperature using a low power laser
      • The laser is mounted on the pan and tilt array to allow him to indicate the direction of the sonar and temperature sensor
      • The laser can be turned on and off
    6. Play simple tunes using the front-mounted piezo
      • Currently, he plays Edna’s theme from The Day Of The Tentacle by LucasArts
      • Of course, this is most useful for human feedback
    7. Sense knock patterns on the front of the bot using the piezo
      • This is untested but completely plausible (it would require the piezo also be connected to an analog input as it is not currently so connected)
    8. Convey information to humans using a green 7-segment display
      • Currently, this is used to show the current mode of the robot, it being programmed for multiple modes of use. Future plans are to have a debounced microswitch mode button on the bot itself
    9. Move itself around using two continuous rotation servos and a third caster contact point
      • Wheels are rubber
      • Caster is ¾" plastic ballbearing caster, located at the bot’s rear
    10. Operate without being connected to any non-mobile power source
      • On-board batteries are 9v and 6v (latter for the servo power)
    11. Communicate with a computer or other electronic device by means of a Wixel wireless serial link
      • Presently, this is used to provide feedback to the developer and to provide instruction to the robot
      • Future plans are to change the interface to use PHP and serproxy instead of the standard Arduino IDE serial monitor
    12. Be completely reprogrammed at any time over-the-air using the Wixel wireless serial link
      • This is limited by the range of the pair of Wixels, which is about 12 meters
      • The Wixels themselves must first be programmed when connected locally (only needed to be done once)
      • Programming may be battery intensive