Saturday, April 16, 2011

Baby steps in electronics

My first self-designed circuit - though it's a bit of a stretch to call it that. I've got 12v coming into the near side of the breadboard from a NiMH battery (and I am a bad engineer for using the same colour wire for live and ground there, oops). That's being shunted through an adjustable switching regulator to provide 7.2v on the power rails on the far side.

The reason for this is I've gotten the superstructure off my new RC tank, removed the built-in RC controller and am getting close to testing it out with the motor controllers I used in the old tank. I need 12V because basically all the electronics I intend to put on the rover (Fit-PC2, Kinect, Arbotix and AX-12 servos) want that; however, unlike my old tank which ran on 9.6v and could tolerate 12, this one is based on 7.2v.

I could shunt 12v into the motor controllers (they'll take up to about that much) and rely on PWM to bring the effective voltage down to something the motor can handle without burning up - but I'm a programmer, and therefore I trust hardware more than my software, during development at least. This way there's no way I can mess up and explode my motors, and as a side effect I imagine the regulator will prevent too much EMI getting back and messing with the PC.

Saturday, April 9, 2011

Fitting a touchscreen to the EeePC 701

I have an old netbook I acquired second-hand as a robot controller a couple of years ago - it's an EEE PC 701. I thought it might be a cool hack to fit a touchscreen to it, so I ordered a cheap resistive one from DealExtreme. A week and a half long boat trip from China later, it arrived last week.

Picture of what I got

It consists of a small USB hub with display controller (bottom of the picture) and what amounts to a glass plate with a ribbon connector.

Installing it turned out not to be all that much hassle - you have to remove six screws from the front of the LCD casing and pop the bezel off. This takes a little bit of effort with some sort of flat blunt tool, in my case a dinner knife -

Case reveals its secrets

then I slipped the touch panel in there and used sticky tape to secure it to the screen. It's hard to get good pictures, unfortunately, since I didn't take the bezel completely off.

Seated touchpanel

I unplugged the camera up at the top (it's horrible and I never use it), put that connector into the hub/controller's in port, put the ribbon connector into the display's connector, and that was it (let a veil be discreetly drawn over my first attempt, where I failed to distinguish 'USB IN' and 'USB 3' on the circuit board). The controller is tucked under the left speaker grille; it causes a slight bulge when the bezel is screwed back on, but I gather this is normal.

After some unsuccessful attempts with the Kubuntu 10.04 I had installed to get it to properly recognise the touchscreen, I decided to embrace the bleeding edge of technology and install Kubuntu 11.04 Beta - the world of touchscreen input advances swiftly in Linux these days. Unfortunately my display connector was mis-soldered (not an uncommon problem apparently) resulting in inversion of the X axis, but this proved easy to solve temporarily by messing around with the xinput command-line program. A bit more challenging was calibrating the thing - this is an eGalax USB-HID touchscreen, which the standard tslib/ts_calibrate stuff doesn't seem to want to talk to. I managed to hunt down this program, however, which did the trick nicely - it calibrated my screen, altered the running server's parameters on the fly, and gave me a configuration snippet to put in /etc/X11/xorg.conf.d which worked just fine. Why it's not in Kubuntu's apt repository yet I'm not sure, it's pretty useful.

I also gave android-x86 Gingerbread a go from a live USB stick, just to see what would happen, but it didn't recognise the touchscreen at all. That might be something I have a go at fixing down the line, but I figured I'd done enough for now.

Still to do with this netbook, at some point, is taking the bottom half apart so I can try reseating the display connector; my screen sometimes goes all white and flickery, especially if there's a lot of black onscreen, which googling seems to indicate is a hardware problem. Also still to do is figuring out if I want to make and attach some kind of stylus holder.