Monitoring blinking LED for home power usage

Monitoring Power By Counting Blinks

What do you do when you want to add a new feature to some electronics but you can’t or don’t want to tear into the guts? You look for something external with which you can interface. We like these hacks because they take some thinking outside the box, literally and figuratively, and often involve an Aha! moment.

[Simon Aubury’s] big household load was electric heating and his ancient heaters didn’t provide any way to monitor their usage. His power meters weren’t smart meters and he didn’t want to open them up. But the power meters did have an external LED which blinked each time 1 Wh was consumed. Aha! He could monitor the blinks.

Home power usage graph
Maximum is white, average is orange, and minimum is blue.

Doing so was simple enough. Just point photoresistors at the two meter’s LEDs and connect them and capacitors to a Raspberry Pi’s GPIO pins. Every time a pulse is detected, his Python code increments the LED’s counter and every fifteen minutes he writes the counters to an SQL database. Analysing his data he saw that nothing much happens before 5 AM and that the lowest daytime usage is around noon. The maximum recorded value was due to a heater accidentally being left on and the minimum is due to a mini holiday. Pretty good info given that all he had to go on was a blinking light.

Where else are there LED indicators which you can tap into? Here’s an only slightly more invasive usage where a washing machine’s “end of cycle” LED  was removed and the power going to it was rerouted to an Arduino for remote monitoring.

This Is The Raspberry Pi Robot To Beat All Others

Before the introduction of the Raspberry Pi, building robots was hard. The best solution to turning motors on a chassis was repurposing an old roomba. For the brain, maybe you could throw Linux on a router and move your rover around with an old Linksys. Before that, you could buy a crappy robotics kit, thrown together in a box and sold as an ‘educational kit’. I’m sure there are a few readers out there that built robots by wire-wrapping HC11s.

Now we have 3D printers and Raspberry Pis, and with that comes a golden age of robotics. One of the best robot brains out there is the 8BitRobots Modules from [Tim Wilkinson], an entry for this year’s Hackaday Prize.

The 8BitRobots Modules are made up of a few components, not the least of which is a Pi Zero, a fantastically powerful (for its price) Linux computer that is available for five dollars. With an add-on board, cleverly named the RoBonnet, the Pi Zero gets PWM outputs for servos and ESCs, an H-bridge for motors, TTL serial, encoder inputs, a pressure and temperature sensor, an IMU, a power monitor, and everything else you need for a successful Pi robot.

But hardware is only one part of the equation. If you want to program a robot, you need a software stack that makes everything easy. That’s where the 8BitRobots distributed robot platform comes in. This is a bit of Javascript running on the Pi that allows you to program the robot in Blockly, a Scratch-like graphical programming environment that’s been adapted to run in a web browser. It’s an all-in-one solution to robotics development and programming, and an excellent addition to this year’s Hackaday Prize.

PiPod: A Raspberry Pi Zero Portable Music Player

[Bram] wasn’t satisfied with the portable music playback devices that were currently available. He craved an offline music player that had a large storage capacity but found that this was only available in high-end, off-the-shelf options, which were far too expensive. [Bram] decided to make his own, powered by a Raspberry Pi zero. After building an initial prototype, the design was iterated a few times, with the latest version featuring a BOM cost of roughly €80.

The whole project is open source, with hardware and software files available on the project GitHub. A 2.2″ TFT displays the UI, which is of course completely customisable. Everything is squashed into a 3D printed case, which has the smallest form factor possible whilst retaining a decent amount of battery life. The electronics are what you’d expect: a boost converter to produce 5 V for the Pi from the 3.7V battery, a charge controller and a battery protection circuit. As a bonus, the battery voltage is monitored with a 12-bit ADC which reports to the Pi, enabling it to do a safe shutdown at low voltage, and display battery level on the UI.

Since the whole purpose of the device is to play audio, onboard filtered PWM wasn’t going to cut it, so instead a 24-bit DAC talks to the Pi via I2S. The audio player backend is VLC, so there’s support for plenty of different file types. A disc image of the whole system is available with everything pre-configured, and you can even buy the assembled PCB from Tindie.

Want to keep the look and feel of your old iPod? We covered an impressive restoration of a 6th gen model, upgrading the storage and battery significantly.

Rasberry Pi PoE Hat Released

It was announced at the beginning of March, but now the Raspberry Pi Power over Ethernet (PoE) hat is out. Thanks to the addition of a new 4-pin header on the Raspberry Pi 3 Model B+, the Pis can get power from an Ethernet cable, provided you’ve got the setup to deliver PoE.

This is a remarkable bit of engineering, even though it’s just adding Power over Ethernet to a small single board computer. Mechanically, the PoE hat doesn’t increase the 3D bounding box volume of the Raspberry Pi at all. It adds cooling with a fan controlled over I2C. Even more bizarrely, the transformer is mounted in a PCB cutout, and we’re desperate to know how that was specced, designed, and assembled. Yeah, it might just be an add-on for the Raspberry Pi, but there’s some clever work that went into designing it.

The Raspberry Pi gained PoE capability with the introduction of the Raspberry Pi 3 Model B+ last March, a release that did require a slight change to the hardware and pinout of the Raspberry Pi. Compared to the Pi 3 Model B, the Pi 3 Model B+ sports a four-pin header right next to the Ethernet jack and one of the mounting holes. This is the same location of the ‘Run’ header found in the Pi 3 Model B, and probably caused much consternation to anyone who built a hat to take advantage of having a real power button on their Pi.

Nevertheless, what’s done is done, and now we have a real PoE solution for the Raspberry Pi. This is bound to be a boon for anyone who wants to build a Raspberry Pi cluster computer, or anyone who is dropping a few Pis into a server rack that already has PoE hardware.

You can pick up a PoE Pi hat through the usual suspects (Farnell, RS, and other resellers) for $20.

Raspberry Shake Detects Quakes

The Raspberry Pi’s goal, at least while it was being designed and built, was to promote computer science education by making it easier to access a working computer. What its low price tag also enabled was a revolution in distributed computing projects (among other things). One of those projects is the Raspberry Shake, a seismograph tool which can record nearby earthquakes.

Of course, the project just uses the Pi as a cost-effective computing solution. It runs custom software, but if you want to set up your own seismograph then you’ll also need some additional hardware. There are different versions of the Raspberry Shake, the simplest using a single Geophone which is a coil and magnet. Vibrations are detected by sensing the electric signal generated by the magnet moving within the coil of wire. Other models increase the count to three Geophones, or add in MEMS accelerometers, you can easily whip one of these up on your own bench.

The entire setup will fit nicely on a coffee table as well, making it much smaller (and cheaper) than a comparable professional seismograph. Once all of the Raspberry Shakes around the world were networked together, it gives an accurate, real-time view of seismic activity anywhere you can imagine. If you’ve ever been interested in geology or just want to see where the latest earthquake was, check out their projects. But you don’t need even a Raspberry Pi to see where the earthquakes are, thanks to a Hackaday Prize entry all you need is a Twitter account.

Thanks to [Rich Cochran] aka [AG6QR] for the tip!

Guardin, Guarding The Garden: Turn Raspberry Pi Into A 3rd Eye

If you are a gardener, you’ll know only too well the distress of seeing your hard work turned into a free lunch for passing herbivorous wildlife. It’s something that has evidently vexed [Jim], because he’s come up with an automated Raspberry Pi-controlled turret to seek out invading deer, and in his words: “Persuade them to munch elsewhere”.

Before you groan and sigh that here’s yet another pan and tilt camera, let us reassure you that this one is a little bit special. For a start, it rotates upon a set of slip rings rather than an untidy mess of twisted cables, so it can perfom 360 degree rotations at will, then it has a rather well-designed tilting cage for its payload. The write-up is rather functional but worth persevering with, and he’s posted a YouTube video that we’ve placed below the break.

This is a project that still has some way to go, for example just how those pesky deer are to be sent packing isn’t made entirely clear, but we think it already shows enough potential to be worthy of a second look. The slip ring mechanism in particular could find a home in many other projects.

It’s worth reminding readers that while pan and tilt mechanisms can be as impressive as this one, sometimes they are a little more basic.

Continue reading “Guardin, Guarding The Garden: Turn Raspberry Pi Into A 3rd Eye”

Cross-Correlation Makes Quick Work Of Ads

Once relegated to the proverbial Linux loving Firefox user, ad blocking has moved into public view among increased awareness of privacy and the mechanisms of advertising on the internet. At the annual family gathering, when That Relative asks how to setup their new laptop, we struggle through a dissertation on the value of ad blockers and convince them to install one. But what about mediums besides the internet? Decades ago Tivo gave us one button to jump through recorded TV. How about the radio? If available, satellite radio may be free of The Hated Advertisement. But terrestrial radio and online streams? [tomek] wasn’t satisfied with an otherwise sublime experience listening streaming Polish Radio Three and decided to build a desktop tool to detect and elide ads from the live audio stream.

[tomek] was aware of this hip knowledge domain called Digital Signal Processing but hadn’t done any of it themselves. Like many algorithmic problems the first step was to figure out the fastest way to bolt together a prototype to prove a given technique worked. We were as surprised as [tomek] by how simple this turned out to be. Fundamentally it required a single function – cross-correlation – to measure the similarity of two data samples (audio files in this case). And it turns out that Octave provides it in the box. After snipping the start-of-ad jingle out of a sample file and comparing it to a radio program [tomek] got the graph at the left. The conspicuous spike is the location of the jingle in the audio file.

At this point all that was left was packaging it all into a one click tool to listen to the radio without loading an entire analysis package. Conveniently Octave is open source software, so [tomek] was able to dig through its sources until they found the bones of the critical xcorr() function. [tomek] adapted their code to pour the audio into a circular buffer in order to use an existing Java FFT library, and the magic was done. Piping the stream out of ffmpeg and into the ad detector yielded events when the given ad jingle samples were detected.

[tomek] packaged that tool into a standalone executable, but the gem here is the followup post. After removing ads in the online stream they adapted a RaspberryPi to listen to an FM receiver and remote control their Yamaha tuner over the network. So when the tuner is playing Radio Three the Pi notices and ducks the audio appropriately to avoid those pesky ads. Video of this after the break.

Continue reading “Cross-Correlation Makes Quick Work Of Ads”