Monitoring the outside world with a webcam and motion

Picture of mouse leaving his little home - a hole in the ground.

Caught on camera!

Well… I saw a suspicious hole in the ground and wondered if it was occupied. I put a small stick across it and in the morning it was gone. Something must have been living in the hole! One way to find out would be with Motion and a cheap webcam. I don’t have the official Raspberry Pi camera, or the NoIR version, but I hoped the white LEDs built into my camera might not frighten the critter into hiding. I suppose if someone shone a spotlight at my front door all night I’d find an exit elsewhere…

I set up Apache on the Raspberry Pi to give Motion somewhere to put the files so that I could access them and see them remotely. I haven’t got a web browser that supports Motion’s video stream so that wasn’t too helpful. However, by taking the laptop outside and pressing refresh (f5) on the browser, I was able to focus the lens on the webcam.

All the settings for Motion were done through the web interface on port 8080. I had to enable this first in /etc/motion/motion.conf as I didn’t want to do it locally. Snapshots were enabled for every 10 seconds along with 5 frames of pre and post roll video.

Last night at 9:50 (ish) the hole dweller was revealed. A troll, an orc? No… it’s a little mouse.


Raspberry Pi Arcade Machine

Overall view of the Arcade Machine.

Overall view of the Arcade Machine.

Something I’ve been wanting to do for a while… and something that seemed to interest the students – A Raspberry Pi Arcade Machine!

It’s pretty straightforward but the end result could prove to be rather good. We needed the following:

  • Case – some Melamine-faced chipboard left over from a lab refit
  • Push-to-make switches – the more the merrier
  • Some switch bezels – cut on the CNC router
  • An audio amplifier (built from a kit) with two 8Ω loudspeakers
  • Speaker bezels – converted from the Raspberry Pi logo and cut on the router
  • Raspberry Pi, second-hand LCD monitor, HDMI-VGA adapter.
  • Software: Stella Atari Emulator, Scratch, Python and PyGame.
  • Python and uinput to handle switches and turn them into keypresses.

Continue reading