Uncategorized

Mixology Bot: Talking to Arduino

Since my last post I’ve been doing a lot of work on the linux command line on the raspberry pi.
I hope my notes are complete. Let me know if I missed something?

Several people have suggested using the GPIO pins on the RPI to talk to the Arduino. Personally? This is a terrible solution to a non-problem. The RPI runs at a different voltage from the Arduino, which means you need a third thing in between to “translate” between each voltage or you fry the RPI. No thank you! I’m connected to the Arduino over the USB hub.

[code]sudo apt-get install picocom arduino python-serial python3-serial[/code]
In one line I install about 175mb of stuff on the SD card, all of it tools.

Then I used python easy setup to install inotools, linux command line tools that make it easy to compile and upload sketches.

I would not have known about inotools if it weren’t for kline and the other kind members of Freenode IRC #arduino channel. Linux is a bottomless pit of mystery and my only saving grace is that I know how to is ask questions politely.

Now that I’ve got intools installed uploading a script is a breeze.

[code]ino build
ino upload
ino serial[/code]

That last line lets me see any serial messages coming back from the Arduino. That’s how I know it’s working, even though my pi is at the other end of the lab.

Next up I’ll open a persistent two-way connection and send commands from the RPI to the Arduino when a button is clicked on an RPI web page. this should be interesting – I’ve never written a mini server before!

Uncategorized

Mixology Bot: First Steps

While I wait for the laser cutter I’ve been planning for the future. I’ve got my next five new robots mapped out and since I’ve got the time I’ve started on the first one, a drink mixing robot called MixologyBot. Version one will only do spirits. Version two will add sodas and syrups. Version three builds on the technology of several other robots I have in the pipeline.

I used my sketchbook to draw out several versions of the robot. I’m basing my design heavily on the the Inebriator. Check out this video of their latest in action.

Their assembly is complex, heavy, hard to ship, and gets electronics near the liquids. Also their interface is u-g-l-y. …but those are my only complaints! Their method of moving the drink under the bottles is brilliant and I’m copying the heck out of it. They also have a special nozzle that only dispenses 0.5oz each time it is pressed, making it easy for a robot to measure out drinks. Perfect! I love it.

I spent a couple hours letting my fingers do the walking, calling up local bar supply companies. Only one had 1oz nozzles in stock, the rest offered to order them in at 4x the price. No, thanks!

Once I secured the nozzles and the electronics I started to create a prototype frame from cardboard. Here’s my first draft.

drink mixing robot v1 frame, side

drink mixing robot v1 frame, end

I also got a Raspberry Pi for the first time. I’ve attended RPI night at the VHS, met the original designer, and watched my friends buy them…but until now I didn’t see a point. I’m finally warming to RPI. I’ve installed the NOOBS image and built a LAMP stack so that my robot can offer up a web page. That’s right – you’ll be able to order your drinks from your phone, or plug in a keyboard & mouse to set up the machine as a POS system. I can just imagine some enterprising person combining this with a Square account to take payments on the same phone they use to place orders. So portable!

raspberry pi

I used the “sudo apt-get install apache2 mysql-server php5 php5-mysql” command to get the default stack running. It took me longer to get the powered USB hub for the mouse and keyboard than it did to build a web server!

Here’s one of my favorite parts: You tell the robot which alcohol you loaded. Then the robot uses it’s cocktail database and automatically offers only the valid combinations. It knows how to make a gin & tonic but it won’t offer if there’s no gin.

I’ve already got a few marketing ideas planned. When you order a mixing robot the packing insulation will be cocktail napkins with marginallyclever.com written on them. There will also be a spot on every robot where you are encouraged to draw the pub sign for your machine. By customizing them and registering them on the official website (coming soon) you’ll be able to protect your investment and we promote each other at the same time. This will also be the first robot I make that can automatically update itself when there’s a software upgrade or more drinks are added to the database. If you’re one of the many people who offered to help with a Kickstarter, I’m sure your brain is now boiling with stretch goal possibilities.

Now that I’ve talked about my strengths and opportunities, let’s look at where I’m going to have to work.

If I’ve got any concern right now it’s cleanliness. Anyone who’s seen my office or how I operate knows that I have to stay extremely well organized and that means clean, clean, clean. I want the drink robot to follow the same philosophy – make the minimum mess and be easy to sanitize. I’ve planned all the expensive electronics to be far from the liquids and the bottom is so spills don’t pool in the machine. I don’t have a cable running in the middle of my drink machine like the Inebriator, either.

I’m very ignorant about mixology. I’d like to build a database of drinks that can be expanded on later, maybe even crowdsourced. Are you savvy to the bevvy? Are you mayor of SQL town? Take a look at what I’ve got. These are my tables so far.

[code]
mysql> describe ingredients;
+————-+——————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+————-+——————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(64) | YES | | NULL | |
| description | text | YES | | NULL | |
| loaded_now | enum(‘Yes’,’No’) | NO | | No | |
| pos_x | int(10) unsigned | NO | | 0 | |
| pos_y | int(10) unsigned | NO | | 0 | |
+————-+——————+——+—–+———+—————-+

mysql> describe drinks;
+—————+——————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+—————+——————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| name | varchar(64) | NO | | NULL | |
| description | text | YES | | NULL | |
| glass_size_oz | float | NO | | 0 | |
+—————+——————+——+—–+———+—————-+

mysql> describe drink_ingredients;
+—————+——————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+—————+——————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| drink_id | int(10) unsigned | NO | | NULL | |
| ingredient_id | int(10) unsigned | NO | | NULL | |
| qty_oz | float | NO | | 0 | |
| pour_order | int(11) | NO | | 0 | |
+—————+——————+——+—–+———+—————-+

mysql> describe loaded_ingredients;
+—————+——————+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+—————+——————+——+—–+———+—————-+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| ingredient_id | int(10) unsigned | YES | | NULL | |
| pos_x | int(10) unsigned | NO | | 0 | |
| pos_y | int(10) unsigned | NO | | 0 | |
+—————+——————+——+—–+———+—————-+
[/code]

If you have any comments, ideas, or you rage at my lack of foreign keys, comment below! I’m looking to partner with people to make this the best Marginally Clever robot yet. If you feel you can contribute, drop me a line.

Uncategorized

New Vending Machine at VHS

Our new location is great but it’s a little far from food sources and it doesn’t have an easy way to buy much needed electronics like arduinos, and rasberry pi. So I took a chance and bought a vending machine. The next challenge is to make it accept bills or paypal so that it’s easy to buy $20 items without a half a pound of loose change.

Uncategorized

Laser cutter update + bonus crab robot

I just got off the phone with Louie over at ECULLINE who sent me a “pre-alert”, whatever that means. Apparently the PRAGUE EXPRESS arriving from Quingdao on friday takes *three days* to unload. My machine will be in a bonded warehouse somewhere in vancouver until I clear customs by brokering everything myself. Apparently there’s no way to file the customs paperwork before it arrives, like UPS can do. In fact, I’m told if I show up early to try and expedite things they will fine me. For what? Being in a hurry? I don’t know. Best case scenario is that I can get my stuff “unlocked” by Tuesday and set up in my shop by Friday.

Here’s the irony: now that I’ve paid for the laser cutter and made room for the laser cutter I’ve got access to the machine I was *originally using* …again. I ain’t even mad. This morning I shipped more kits in one day than I ever have before. They greeted me with open arms at the post office and affectionate cries of “Hello, stranger!” Felt good, man. Felt good.

SO: in theory I now have a backup machine and a primary machine so I can cut parts and test new designs really fast. I’ve also got two 3D printers and a number of friends with them so all my manufacturing problems should – again, in theory – be behind me. As long as I don’t screw those up I can consider that challenge solved and I’m on to the next level: making sure the parts I don’t make are in stock the moment I need them.

BEGIN RANT

Long time readers will know how much fun this is: my web store does not understand that a kit is a collection of parts. When I sell a kit I have to manually adjust all my inventory. I I could accurately track how fast inventory was selling then I could write a program to order material on time for me. If my store understood that kits are made of parts then it would only offer as many kits as I can make. What’s that, we sold our last part X? Every affected kit would instantly display a lead time equal to the delivery time for part X.

END RANT

Spending the minimum possible time in supplying parts means I can spend more time meeting customers, providing support, and developing my next robots.

Ok, that was pretty dry. Time for something completely different.

This is my first robot, a crab that walks. It is still the most popular youtube video I’ve ever made by a couple orders of magnitude. I made the robot start to finish in 6 weeks.

The only unique feature when it came out was that it was the only open source robot of it’s kind. That meant you could tinker with the brain and make it do different things without having to re-teach it how to walk.