CCR - Coffee Cup Robot

 January 2013

What happens when you see an old stainless steel heated coffee mug and a bottle of Pierre Cardin cologne bottle top?  You build a robot out of it of course!

Kind of a silly story

We were throwing out these old ‘warming’ coffee cups, the kind you plug the car adapter into to keep the coffee warm, because they were falling apart. The inside stainless cup was coming out of the outside plastic part. Before tossing it I had to pull it apart and see how it works of course and I set the inside stainless part on the counter upside down and noticed - hmm.. that looks like an old time robot body. I know only the LMR folks will have any understanding of that but the cup and it’s companion went into the “someday pile” a month or so ago.

Coming Together

Out of sight but never out of mind (seem nothing is out of my mind anymore) I kept thinking about the old cup and what to do with it. In the meantime I had ordered some various gear motors, wheels, CPU’s etc to have on hand for projects and kept wondering how to power the Coffee Cup Robot. After checking a few options out I realized I could use two of the 90 degree drive motors back to back and with some Pololu wheels it would fit into the base of the coffee cup. Drive needs solved.

Next I realized the round Radio Shack boards actually fit in the coffee cup rather nicely so I thought that would be a good board for the CPU, etc. I then built a BX/ZX24 based round circuit board and H-Bridge driver for the bot but later replaced it with a Baby Orangutan that had sense arrived as it is a cleaner install, had the motor drivers built in, and takes up less overall space - which is at a premium when working inside a coffee cup. Going with the Baby Orangutan also offered the ability to use a higher voltage battery and small battery setup and a small step up/down regulator. A couple 18650 batteries provide the power and are mounted in the back side of the robot to keep a rear weight bias.

I originally played with the idea and tested some code to try to balance the bot up with a QRB1114 sensor but quickly found the sensor is VERY non-linear and keeping it upright wouldn’t really be worth the effort - especially since it sits so low anyhow. The final solution are a couple ‘sliders’ front and rear that are tweaked to keep the robot upright. They allow enough for moving over smooth surfaces and keep it from tipping front or backwards in most cases.

Where’s the Head?

Looking at the thing from the outside I knew it needed something to make it look more like a robot. One morning while getting ready for work I looked over at my Pierre Cardin bottle of cologne and noticed how the top looked like a old robot head... yeah I know, “imagination”. But hey, I pulled it off the bottle and stuck up on top of the cup and it looked perfect. Actually it looked a little evil with the chrome and red line running around it. First I was thinking of adding some square LEDs around the red rim or something like that but the more I looked at it the more I noticed a bit of resemblance to Bender from Futurama - or maybe “Benderette” I guess. 

With that idea and an HC-SR04 that needed to be put somewhere on the bot I grabbed some scrap aluminium cut it to width and length and wrapped up the sender/receiver to give it a “Bender” look. I also realized I could easily mount the SR04 in the red groove some after a bit of modification the ultrasonic was ready to go. 

It was hard to get it in there but I managed to mount a 9g servo in the top (bottom?) of the cup and glued a servo horn to the cologne head and presto a rotatable head with a sonar sensor was done. 

Make Noise

I like sound on my builds anymore as it seems to bring them more to life and give them some character so a speaker was needed... right where the mouth should be in my opinion. I did have to drill a hole in the cup to get it to look ok but it seems to have worked out. 

Let There be Light - err LEDs

I really wanted/needed some type of light indicator on the bot but really didn’t want to stick LEDs on the outside or drill more holes to make it happen. I like the minimalist appearance of him right now. Finally I remembered I had a nice little bright blue LED board left over from the Possessed Mouse project. It’s a board with four micro bright blue LEDs with resistors, etc already built on the board. I had to sit down with the board and figure the connections out but once i did it was easy with a Vcc connector and four connectors that are grounded to light up each LED. I still didn’t want to stick that on the outside of the bot so I tried sticking it inside and am quite happy with the blue glow they provide. I can turn 1, 2, 3 or 4 of them on at once to provide brightness levels. It rather fits the low profile and ‘wheel less’ feeling the robot has.

Wrapping it all up

With base setup, batteries attached, CPU setup, sonar there, head moving, switch installed, and some skids setup for keeping it all upright I realized I had to continuously pull the base out of the body to reprogram it … and it takes a LOT of reprogramming for me to make the code work. So I was looking at how to extend the programming header to somewhere, anywhere, when I saw that the little tiny Radio Shack round boards fit nicely in the top of the cologne cap. So I soldered up a header, extension and hooked it up. Now I can just “pop the top” and plug in the programmer without having to take it all apart.

What does it do?

Not much honestly. Currently there are two active modes - “roammode” and “waitmode”. The robot starts up in waitmode where he begins scanning with sonar for what’s around him. If he doesn’t see anything get close enough in about 10 seconds he stops scanning for 10 seconds and then restarts the “bored” timer. 

However, based on the simple turning/avoid code in the main loop, if he sees something at a certain range he will turn slight or move towards it. If something gets too close then the avoid routine kicks off and he backs up and turns away. The scanning kicks back in anytime he sees something close enough.

If you “get in his face” by covering up the sonar unit, he changes modes from wait to roam. In roam mode he just wanders around avoiding objects and turning away from things he sees on each side of him. Once again, if you get in his face... OR he gets up against something that is right in his face he switches back to wait mode and scans.

These simple characteristics can create some interesting actions as he moves around things, or get switched into wait mode up against a wall and then sees the wall again on scan and goes back into roam mode.

The Future

Obviously there is a lot more coding that can be done to make it more interactive and/or more “smart”. Here are some of the things on the todo list:

  1. Tune up the sonar so it can be used as an edge detector. I.e. there is a sweet spot that is OK, not too close, not too far. If we are out of that range, maybe over an averaged period, then avoid.
  2. Randomize modes - I’d like to add a bit of random features allowing mode changes on the fly.
  3. Add LDR sensors - Not sure where to put them as the head is pretty full but a pair of LDRs can be used for light seeking and avoiding which should work on a wheeled bot like this.
  4. Add more sounds and songs - just need to do some more coding to make this work.
  5. Auto-distance tuning - I would like for him to lower his sensitivity to objects if he keeps finding things close by as if the environment is tight he never really settles down. If he will auto-tune himself he could get comfortable on my desk, etc.
Thanks for Reading... -Stephen