Got My littleBits Cloud Starter Bundle!

By Tuesday, September 23, 2014 0 , , Permalink 2

As mentioned in the last weekly review, I just got my first littleBits kit. It’s a Cloud Starter Bundle, and it looks fun.

I haven’t decided what I’m going to do with it first. The most interesting part, as far as I’m concerned, is the cloudBit. With this module, it should be easy to turn any DIY-electronics project to a connected IoT thingy. I thought I’d use it to improve my connected A/C project, by replacing the laptop that drives the Arduino with the cloudBit. To do that, I need to change the way I get feedback from the A/C, which is something I wanted to do anyway.

In my original connected A/C project I determine the state of the A/C by listening to beeps from the control unit. This approach has several drawbacks:

  1. It requires something that can listen to beeps, and analyze them. Currently it’s the laptop that I use as a bridge between the Arduino and the world. I guess I could do it using the Arduino itself, or a Raspberry Pi. But it would add complexity, and require extra hardware to enable listening.
  2. It is susceptible to mistakes. The laptop is close to the sound source, but not close enough to detect with 100% reliability. It may miss beeps.
  3. It is passive. I cannot monitor the state of the A/C without sending a command to change it. It doesn’t solve the scenario where I’m out, and I want to verify that I turned off the A/C.

Given the above, I want to improve my existing project. If I can do it with the littleBits stuff, that’s a bonus.

The improvement I’m seeking is a way to actively detect the current state of the A/C with high reliability, without needing to change it. Ideally, I’d want to monitor the full state – on/off, temperature, mode, and fan speed. I think that Sensibo is supposed to do that, once they complete the project and ship (I backed the Indiegogo campaign the minute it started πŸ™‚ ). Until that happens, I’d be happy to detect just the power state (on / off).

The state monitoring solution must be non-destructive, as the A/C is a central unit in a rented apartment. One idea I have is to find a way to monitor the A/C power consumption. If I could do that in a non-destructive way, I should be able to differentiate between on and off states. But I’m not sure how to implement it…

Do you have an idea how I can monitor the A/C power consumption? Or any other idea on how to actively determine its state without changing it? I’d love to get more ideas, so I can go ahead and make it happen! πŸ™‚ I’m OK with purchasing extra hardware, as long as it’s cheap enough.

Continue Reading…

A/C Control Project: Bringing it all Together

I have central air-conditioning in my apartment. It’s controlled by a remote, using IR signals to send commands to the A/C control unit.

As any decent geek would, I’d like to be able to control my A/C using other means (e.g., a smartphone).

In previous posts, I went into great detail on specific aspects of this project, like using an Arduino to decode and send A/C commands, and recognizing A/C beeps for feedback.

The last part in the puzzle is making all the pieces play nice with each other, and finally accomplish the intended goal – Controlling the A/C at home with the smartphone from anywhere over the Internet!

How was that accomplished?

An always-on computer in the apartment is running a web server accessible from the Internet, serving an “A/C-control site” (screenshot above from Android smartphone). The site is developed with the Django web framework and Bootstrap front-end framework.

The controls in the web-app are associated with server-side Python functions, that pass the parameters to an RPC server that talks with the Arduino that is connected to its USB port.

The RPC server uses the Arduino to send commands to the A/C based on the parameters it received from the web-app, and uses the microphone to verify that the commands were transmitted successfully.

As usual, the rest of this post provides in-depth description of what I’ve done. The actual projects are available on GitHub (web-app project, and RPC-server project) for anyone to fork, clone, tinker and use.

Continue Reading…

Using “Beeps” for Feedback from A/C commands

I have central air-conditioning in my apartment, and it’s controlled by a remote, employing IR signals to send commands to the A/C control unit.

As any decent geek would, I’d like to be able to control my A/C using other means (e.g., a smartphone).

In a previous post, I covered thoroughly the details of using an Arduino to send IR signals to the A/C instead of the remote – but if I’m far away, how can I know if the command was received and executed by the A/C successfully?

Well, given that the A/C control unit beeps when it receives and executes a command, I thought I might take advantage of that – and virtually “listen for beeps” after sending A/C commands to verify successful execution!

The short version: A laptop running Ubuntu Linux is located in hearing distance from the A/C. Just before sending a signal from the Arduino, the laptop starts listening on the microphone (using the PyAlsaAudio library). It calculates Fourier transforms over the recorded audio sample, and measures the power around the beep central frequency (4100Hz), looking for power-peaks that correlate to a beep.

For the longer, detailed, version – do read on!

Also, check out the code that implements this on GitHub.

(nitpicks-alert: while I am aware that “power” and “energy” are different things, I am using the terms loosely and interchangeably throughout the post. please forgive me.)

Continue Reading…

UPS Hacking: Adding Standard Outlets to My Advice PRV UPS

By Monday, September 16, 2013 0 , Permalink 0

My home server is powered with a UPS, so it can handle power outages gracefully (live through short ones, or shutdown gracefully if the outage persists) – which is nice and dandy.

The UPS (an Advice PRV 850) has four built-in outlets, that can drive up to four PCs and monitors. But the sockets are for “kettle cords”, which is a shame if I want to power other devices (e.g., router, modem) using the UPS…

So what can one do..? Well – why not hack standard outlets into the “kettle cord” socket? πŸ™‚

Continue Reading…

Controlling My A/C With an Arduino

I have central air-conditioning in my apartment, and it’s controlled by a remote, employing IR signals to send commands to the A/C control unit.

As any decent geek would, I’d like to be able to control my A/C using other means (e.g., a smartphone).

In a previous post, I went into detail about reverse engineering the remote. Now it’s time to proceed to actually using these powers to replace the original A/C remote with my own Arduino-controlled thingie!

The gist: using an Arduino Uno board with a IR-LED circuit (see below), along with Ken Shirriff’s Arduino IRremote library (slightly modified), I was able to transmit the A/C commands that were analyzed in the previous post in lieu of the original remote.

Keep reading for a full drill down, or jump straight into my home-control-arduino GitHub project for the actual code and documentation.

Continue Reading…

Using an Arduino to Reverse Engineer My A/C Remote

I have central air-conditioning in my apartment, and it’s controlled by a remote, employing IR signals to send commands to the A/C control unit.

As any decent geek would, I’d like to be able to control my A/C using other means (e.g., a smartphone).

Towards that goal, I figured I should first reverse engineer the IR commands the remote sends to the A/C, so I could later send these commands using other methods.

The gist: using an Arduino Uno board with a Phototransistor circuit (see below), I was able to obtain the IR waveform using Ken Shirriff’s Arduino IRremote library (slightly modified), and even graph these waveforms with Python’s matplotlib, as shown below.

Keep reading for a full drill down, or jump straight into my home-control-arduino GitHub project for the actual code and documentation.

Continue Reading…