Category Archives: Raspberry Pi

Rotary volume control for the Raspberry Pi

If you have checked out my previous post, you know I want to create a clock radio powered by the Raspberry Pi with the audio coming out of a JustBoom AMP Zero pHAT.  One of the things that I thought would be quite handy (probably necessary) would be volume control.  Ideally that would be some kind of hardware rotation controller, but looking around online on how one might control the JustBoom amp with a rotary encoder really only brought back results regarding full OS solutions such as Moode Audio.

As it turns out, controlling the volume for the JustBoom when using just Raspbian is actually pretty simple.
Continue reading Rotary volume control for the Raspberry Pi

Did you like this? Share it:

PiZero Clock Radio – Part 1

Long story short; I have a clock radio and it can just about play something from the radio and wake me up in the morning. But if the power goes out it never remembers the time or what any of the radio stations were, and it completely lacks the ability to auto-seek for stations (and I can never remember what the stations numbers are either which is why only one is ever reprogrammed in). As a result, I’ve had it in the back of my mind to build a replacement using my Pi Zero and now that I have a couple extra bits of hardware I thought I’d make a stab at starting the build.

So this is part one of the build process. Or, as I like to title it; Part “I’ve just got some neat hardware so let’s muck about and see if I can get it to do anything”.

Continue reading PiZero Clock Radio – Part 1

Did you like this? Share it:

Trail camera – first outdoors test

Last night I packaged everything up in the trail camera lunch box and gave it the first outdoors test. The first thing it captured was this little guy!

I think there may still be a few things to sort out. The PIR sensor may not be very sensitive or the code may not be 100% functioning correctly (though it seemed to be in all other tests I ran indoors), as the videoing stopped before I would have thought it should. However, as the very first thing it captured was the hedgehog I am very pleased with the result!

Did you like this? Share it:

Dynamically control PiCamera record length: motion sensor fun with the Raspberry Pi

One thing I’ve always wanted to do with my Raspberry Pi was to build a trail camera, and when the Pi Zero was released with a camera port I thought that it was about time I stopped wanting to do it and actually just do it.

It took a while to get parts delivered from various places, but eventually in the last week or so I have finally built a trail camera. I’ll probably post more about that at a later date, but the most intriguing part for me was the programming…

Most of the trail cameras I had seen on the internet that people had built would either take a photo when a PIR sensor was triggered or would take just time lapse photos all night. Neither of these solutions really appealed to me. What I wanted was a video, and more than that I didn’t just want a video to record for a few seconds and stop. I wanted it to keep recording as long as there was movement triggered by a PIR.

In the end I came up with quite a nice small solution using Python and I’ve put it up on GitHub so feel free to fork and use or improve.

What I like about my solution is that when the PIR is triggered it will start recording for a definable number of seconds. If the PIR is triggered within that time it’ll just extend the record time by that many seconds again, and so on and so on until the PIR hasn’t been triggered for at least that many seconds at which point the recording will end.

Easy to use and exactly what I wanted. So feel free to grab my trailcam phython script on GitHub.

Did you like this? Share it:

phpiwire updated – now with PWM!

I’ve pushed a few changes to phpiwire can now use the PWM functions in wiringPi.  You can use either the hardware PWM pins or any of the GPIOs by using software PWM.  A couple new examples of how to do this have also been added to the repository.

With software PWM comes the requirement to include pthreads, so that’s also linked when you compile the zephir extension.

I’d recommend you do a full clean first before compiling with:

zephir fullclean
zephir install
Did you like this? Share it:

Phpiwire: a PHP extension (written using Zephir) for controlling the Raspberry Pi GPIO

So it’s been a while since my lightening talk on Zephir and I realized I hadn’t really done anything to try to learn it a little more in-depth.  Coincidentally, I was recently going through a drawer and realized that one of my Raspberry Pi’s was in there just begging to be put to some use (seriously, I could practically hear it weep).  So I thought that the only thing to do was to attempt to write an extension using Zephir so that I could control the GPIO via PHP.  I mean, isn’t it obvious? Continue reading Phpiwire: a PHP extension (written using Zephir) for controlling the Raspberry Pi GPIO

Did you like this? Share it:

Tweeting on a button press with the Raspberry Pi

A while ago my door bell broke. So I did what any sensible person would; I decided that instead of buying a new one I would hook up an old bell I had to a Raspberry Pi and have the bell ring when someone pushed a button on my door. But then I though, “well, that’s a bit boring.  My doorbell should tweet me, too!”

The long and the short of it is that I couldn’t get the mechanics of the bell ringer to work but had a lot of fun with the tweeting side of things because it involved my first shot at doing some Python code. And the really good news is that it’s ridiculously easy to accomplish.

This was roughly my process…

Continue reading Tweeting on a button press with the Raspberry Pi

Did you like this? Share it: