Pages

Thursday, 16 October 2014

It's impossible

When a techie says to you that something is impossible, what he usually means is "I don't know how to do that." There was a good example in "The Apprentice" last night.

The boys team came up with what I thought was a good idea. You have a sweater with a display in front, and a camera. You use the camera to take a picture, which you then show on the display. They decided on that as their "wearable technology" and trotted off to a techie to get it designed. The techie said "It's impossible". And so they went with an idea so terrible that they sold zero.

But here's how it's done, and I know it's possible, because I just did it. First you have to replace the suggestion of an array of LEDs (which wouldn't work) with a cheap, light, low power LCD display.

You start off with a Raspberry Pi (of course) model A, and camera (the Pi Cam would probably be  a good one, but I'm using a cheap webcam-type that gives 640 by 480 resolution) and a small LCD monitor (the one I'm using is five inches, and displays 800 by 480 pixels, but you could use a larger panel. You use a 12 volt battery to power all this - a 4s from Hobbyking would be good. The 1000 mah would weigh about 100 gm and last several hours.

Costs.

Raspberry Pi     £20
Camera            £5
Display          £13
Battery           £6
Voltage reducer   £1

Total £45, plus a cheap grey sweater. So the thing would cost maybe £48 to make, sell it to the retailer for £80, they'd offer it for £150. Would you pay £150 for something like that? It would certainly get you noticed in the night club! "Smile for the camera" and then you're dancing with the girl whose picture you're wearing.

Now the software. You install Linux on the Pi then streamer and ImageMagick. To capture the picture:

streamer -c /dev/video0 -s640x480 -q -o picture.jpg

and you just keep looping that.

To display the picture is a bit more complex. You have to use the framebuffer device. First you set it up in /boot/config.txt



framebuffer_width=800
framebuffer_height=480



Now we have to convert the 640 by 480 picture, to 800 by 480

convert picture.jpg -resize 800x480! picture.jpg

Then we convert the jpg to framebuffer format:

ffmpeg  -i picture.jpg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 picture.fb

Then we send it to the framebuffer:

cp garden.fb /dev/fb0

And there it is! Add a push-button to tell the system to display a new picture.

So I wrapped all this up in a perl program (you could use any language that lets you run other programs) and I now have a continuously updating view of my front garden, which switches to a display showing the outside temperature, the time and the number of messages I've had from my server monitoring system.

Would anyone like to be my apprentice?

4 comments:

  1. The "tech company" they were sent to was obviously sh*te.

    PS. You're hired !:)

    ReplyDelete
  2. Hmm not sure about the sales pitch given the way I dance

    ReplyDelete
  3. Dancing is not a requirement.

    ReplyDelete
  4. Actually, you can be my apprentice, I have £250,000 to start you off in you new business venture. What is it by the way?

    ReplyDelete