Saturday, June 25, 2016

Pi Manipulator Build - Part 1

Here's the latest thing I've built: (screen not entirely tucked in yet...)

I'm into wearable technology, now.

Base specs for the machine are:

  • Raspberry Pi Zero - 1Ghz ARM processor, 512Mb of RAM
  • 8Gb SD card with Raspbian Jessie
  • WiFi 802.11n adapter
  • MPU6040 accellerometer/gryo inertial sensor
  • 1/5" PAL/NTSC LCD television, 240x180 pixels
  • Turnigy Nanotech 950mAh 1-cell LiPo
  • Polulu 5v step-up voltage converter/regulator.
  • 2 old mouse buttons
The MPU6040 sensor is used by my 'gyromouse' driver, which means the manipulator has a fully functional X11 GUI interface. I can run most linux apps, (that don't require large screens or shift-click combos) and even use the 'Florence' on-screen keyboard if I need to tap out a few characters. (yes, it's painfully slow.)

The screen is just resting on top.
Once I push it in, I'm not sure it's coming back out.


What makes the device actually useful is that it's a full Linux machine, with a WiFi connection. That makes any nearby PC that can run SSH or VNC into a handy keyboard, mouse and 'big' screen. Or even a remote PC - once the manipulator is on the network, it doesn't matter where it is, or you are. It acts very much like a 'cloud server' which just happens to be located on your wrist.

What I _can_ easily do is pre-create the equivalent of desktop shortcuts that run shell scripts or any arbitrary action you can do on a linux machine. The ultimate programmable remote control - that can also show you progress and logfiles.

Why do I need such a thing? Well, personally, I've found that doing digital astronomy is a pain in the ass if you have to keep running between the telescope and PC. Especially if one is inside the house. Or you're in the field, literally.

The main person who will get to use it is a unix security expert, for whom having a wifi-scanning wrist strap (running Kismet) is a useful work tool.

Neither application requires a lot of user interaction - just enough to navigate a few menus and click a 'start' button or two - but they're apps which have a lot of status displays it's handy to keep an eye on.

The build proceeded in very careful steps. I'd actually developed the software in advance on my Pi A+, so when the Zero and other hardware pieces arrived, I was basically ready to go. It only took a couple of hours to hook up the primary components and give everything a whirl.

The parts on arrival.

It's always good to check your parts individually if you can, so I test-fired up the Pi with my prepared OS on a standard monitor/keyboard setup, despite the ridiculous relative size of the connectors and cables. All fine.

HDMI cable with an end-cap made of computer

After that, I spent a good hour or two just staring at all the pieces, physically and mentally stacking them in various ways, and trying to plan how they were all going to fit together.

Jenga!

The RCA connector for the LCD module's video input was far too big, and even the 4-pin "low profile" socket is comparatively large.

80-year old socket technology.

So the first thing was to pop off that connector and direct-solder to the Pi's video output. I also de-cased the WiFi adaptor and direct soldered that to the Zero as well.

Naked WiFi dongle.

Almost like they expected us to do this kind of thing.


Then time for another test, to make sure the LCD module was working.

First LCD test

Perfect. By this time it was getting late and so I wound down by wiring up the Polulu voltage converter to a handy LiPo and testing that out. I hadn't used a Polulu before, but I'm impressed. Quality little component. Get some.

Not actually sure of the capacity of this battery. About 600mAh?

I didn't want to plug an untested power converter it into my shiny new machine, so I tried it first on an old Arduino board that's seen it's share of action.

Your bravery is appreciated.

And to finish the night, the first un-tethered boot of the machine:

First boot from battery. All systems go. Power stable for 63 minutes.
A good first day. I slept well.

The next day, I added the MPU6040 inertial sensor and a single membrane button I pulled from an old remote control. I put some heatshrink tubing around various easy-to-short components like the WiFi adapter, and then very carefully folded up all the boards into a neat little package.

Now it's looking more like a... um... thing.

Another boot to make sure it's all still working, and if gyromouse has started up properly. Which it had.  It took longer to find an on-screen keyboard that worked properly. "matchbox-keyboard" is the one you'll see mentioned, but it was chewing up my CPU because of a known bug, and I switched to "Florence" instead. Which has different issues, but nevermind.

Taking "hunt and peck" to a new level, but the GUI is useable.
Now that I had a mouse-equivalent and an on-screen keyboard, I could finally run a few apps. Like the web browser.

Doing a google search

Or kismet:
Detecting nearby Wifi devices...

Or even Minecraft.


At this point I was feeling pretty satisfied with myself. I spent the next day or two tuning gyromouse, setting up the desktop and generally getting everything nice.

It's this point where I started to realize just how much power the LCD module was consuming. Not actually the screen, so much as the video decoder chip that drives it. The module specs say "120mA at 5V" and really means it. I suspect most of that goes through the decoder, which in normal operation gets almost too hot to touch.

The LCD power consumption will be important later, because addressing it has become the one remaining issue in the build, though not for the reason you probably think.

Apart from that, everything was going well. Really well. (too well?) All the computer hardware and software was working, and all I  needed to do now was fit it into some kind of case. I had just the thing in mind, and was checking the mailbox every day in anticipation.

Then it arrived! My Official Doctor Who Vortex Manipulator! Batteries Included! I've just got to scoop out the old insides, and put my hardware in its place.

'cause if you're gonna build a computer into a wrist-strap,
why not do it with some style?

Yes, I'm a fan, but I also appreciate the thought that went into this particular prop: Capn' Jacks' personal device. Half wallet, phone, keys, and watch. So sensible an idea that no-one gives it a second thought. Well of course future advanced humans strap their mobiles to their wrists on cool beat-up leather bands. Why wouldn't you?

Why don't we?

But then it became obvious - it wasn't going to fit. At least, not the toy version. The real prop is about 50% bigger and probably would have worked nicely. But an accurate replica is also about twenty times more expensive, and I'd never have been able to bring myself to damage it.

The original toy also has one working button,
which activates a blue light! Wow!
At this point, I had a long, long think. And a talk to my friends about leather-work. Basically, I had two choices: try to fit the manipulator into the toy, or get a new custom wrist-strap specially for the project.

I chose both.

Eventually I'll get a custom wrist-strap built - already made inquiries. I'll have to build  a hard case to hold the components too. (Or use an Altoids gum tin, perhaps, since that seems the right size.) But in order to figure out the issues, I decided to go ahead and try to stuff everything into the toy anyway. I didn't have any real use for it otherwise, and I figured I'd learn a few things that would be useful in building the "real" manipulator.

And I expected to fail. The Pi Zero is slightly bigger than the strap is wide. I didn't expect it to fit. It shouldn't have fit. But somehow it did.

Bigger on the inside?

Next time, I'll show you how I managed it. Also, how I snapped the SD card containing the entire OS in the process, I'll sum up where I've got to, and the few problems left, and what's next, It's a rollercoaster.




11 comments:

  1. Replies
    1. Build it again, only this time in a case that actually fits, so the SD-card isn't hanging out waiting to be snapped at the first bump. I've learned I really need a keyboard-substitute as well as a mouse-substitute, so that's the next tricky thing.

      "When I first came here, this was all swamp. Everyone said I was daft to build a castle on a swamp, but I built in all the same, just to show them. It sank into the swamp. So I built a second one! That sank into the swamp. So I built a third! That burned down, fell over, then sank into the swamp. But the fourth one stayed up. And that's what you're going to get, Lad."

      Delete
  2. Nice work! Could you make an tutorial and the source code available to this gryo mouse? Really love that project and would like to build it myself :)!
    Thanks a lot!

    ReplyDelete
    Replies
    1. I'd definitely second this. Be interested to hear how you did it.

      Delete
    2. I'm writing up an article about it now... hopefully all will be revealed there, including source code.

      Delete
  3. Outstanding work, sir!
    My Zero has just arrived ready to replace the Xperia Z3 Mini I've currently got on my wrist. Been 4 years, before this it was a Galaxy S3 Mini, and before that a Nokia E7, all on beat up black leather straps with magnetic latches.
    Speaking from experience, not everyone likes being called Robot Boy and Hello Mr Bond. I can live with Hey Iron Man, lol.

    Mostly now I get asked where I got it, and could I make them one. Be careful what you wish for. :)

    ReplyDelete
  4. When will you publish next video??

    ReplyDelete

  5. People will be making a good investment if they are buying this foremost watch brand.
    MasterChrono watch which again is a collection of Masterpiece watches is prepared of smooth stainless steel and it has eye-catching classic alligator wrist strap and spectacular sapphire accent.
    More in fo: wrist straps

    ReplyDelete
  6. Hey, I recently decided to make my own smartwatch, decided what to do, and found it had been done already! Thanks for paving the way! I recently found out about Mycroft, but haven't been able to set it up on my computer yet. Do you think it could work as a valid mode of input? I think it would be very exciting if that worked, especially if you're into home automation. And what about solar power? There are many cell phone chargers on eBay with some solar charging built in, and some small solar panels here and there, that might help a bit with battery life if you're not covering it up. Just some ideas I want to test out possibly when my Pi Zero arrives, and coming from someone who has done very little in electronics so far.

    ReplyDelete
  7. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.
    -------------------------------------------------------------------
    Civil engineering outsourcing services | hoa lan ho diep | Civil engineering services | Outsource Structural Drafting Services | Outsource CAD drafting services

    ReplyDelete
  8. Can you please post the software?!

    ReplyDelete