Friday, March 16, 2012

arduino prop dropper for Halloween

Already planning for halloween around our house! Ben has his eyes set on a “prop dropper” which is 2 servos and an arduino. Haven’t decided yet how we’re going to control it, PIR or remote control or whatever, but it’s still been some fun. After the first work session on it we’ve got it basically running and now it needs a mounting bracket, a better spooky thing to actually drop and a remote.

Thursday, March 8, 2012

metering the smart meter, part: the third

Well... so far it doesn’t work ;) The IR receiver that I thought worked so well, and does SOMETIMES drops pulses other times and sends multiple pulses still other times completely messing up the reading.  I tried some filtering of it to sane levels in the arduino it’s connected to but that just wasn’t leading to anything helpful.

And after I went to all that trouble to make a nice sensor out of it too.

The next experiment was just a phototransistor which initially appeared not to work at all, but changing it from a digital pin to an analog pin seems to have solved the problem. I can definitely pick up the pulse sampling analog in a loop and it’s quite a long pulse too it seems. 

So it’s back to the drawing board to build a new sensor out of the phototransistor and then some significant software updates once that is working. 

I will post again when I’ve got it working better!

How NOT to run the 5.1 update on your iPhone...

Last night I started downloading the iOS 5.1 update. After seeing that the download alone would take an hour and a half I decided to go to bed. I disconnected the iPhone and left the download running in the background. All innocent I honestly believed that it would just save the file and let me run the update in the morning. An hour and a half later my iPhone waking up on my bedside table woke me up as it shone into the darkness, it had switched to recovery mode even without a USB connection to the computer. I wasn’t aware there was a remote command to put it into recovery mode over the air. Since it was not able to apply the update over the air it seems rather useless, and rather frustrating as I didn’t have a phone.

Once you’re in recovery mode there is no option that isn’t a hack but to restore the phone. Great, more hours wasted watching it reload and restore and put everything back. So digging into the internet I refreshed my memory on the double secret sequence of holding buttons in to get into and out of recovery mode but to no avail. The phone refused to go back to normal. I resorted to the jailbreak tool “tinyumbrella” which has buttons for “enter recovery” and “exit recovery” and it worked. Selected my phone from the list and clicked exit recovery and it came right back to life. I returned to iTunes with the intention of running the update. But the update failed...

“The iPhone could not be updated. This device isn’t eligible for the requested build.” Well.. that’s frustrating, lets start iTunes again and see...

So iTunes says both, yes, it is, and no it isn’t. So back to teh intertubes to read. I WAS behind a version of iTunes, so I ran that update. But even more importantly it turns out that upon quit, TinyUmbrella redirects a specific apple host on your machine. This is necessary if you are jailbreaking as it keeps iTunes from overwriting your new settings on the jailbroken iPhone. This was by default on, which makes sense I suppose if the tool is mostly used for jailbreaking, but my iPhone is not jailbroken. It’s in the advanced tab and is called “redirect hosts to Cydia upon quit” or something similar. After re-running tinyumbrella and turning that off and updating iTunes my phone is now happily running the update.

None of this would have been necessary if it had just not remotely put the iPhone into recovery mode in the middle of the night. At this moment it seems to be stuck at "waiting for iPhone” and seems to have now jumped to “verifying updated iPhone software” without ever actually loading anything. That doesn’t bode well. Oo, now we’ve gone back to “updating iPhone software” and it’s actually running now! The little progress bar on the phone is creeping across ever so slowly. Now iTunes is back to the Verifying message but the phone is still only about half way done with it’s little progress bar, but this is more how I remember things running. I am now more confident that it will complete and that things will go back to normal.

This blog post serves no purpose but for my own documentation of the issue so that a year from now when it does it again I’ll remember what I did to get it sorted out. Mostly I’m just venting my frustration. If you use tinyumbrella to get out of recovery mode though remember to turn off that redirect or iTunes will refuse to do anything with your phone after that.

OK, now wasn’t there something else I was supposed to accomplish today?

Friday, March 2, 2012

Metering the Smart Meter. Part: The Second

Just moments after “they” installed my new Smart Meter it became necessary to figure out how to link it into the Home Automation system. Previously I tested the IR sensor from SparkFun I had laying around to discover that it would indeed pick up the pulses. Once that was working I needed to build a sensor that I could attach to the meter housing that would survive out in the weather, not damage the meter, be easily removed if they needed to access it and not look like someone was fiddling with the meter. I decided to pot the sensor into a short length of aluminum channel.

This channel is available at every hardware and home center type place. I used this same stuff previously as the heat sink for the LED under cabinet lights I built so I had some laying around. It’s very soft and cuts and drills easily though you will have to file the edges a bit to get the sharp bits off.

The sensor is quite small, but I needed the extra space in the channel for filling to make it weather resistant and just to have some surface area to attach the mounting stuff to the meter. In that picture you can see the pins sticking out the back. Those come with it but aren’t attached when you get it. They are for pressing into a breadboard to make prototyping easier but I removed then and attached some nice stranded wire for the final build.

3 wires run to the sensor, +5v, ground and the signal output. Since the switching of the 5v is done on this board it’s possible to run the output from this much further than from just a naked IR sensor without picking up interference or without too much wire resistance getting in the way. This sensor is the earlier version of this one from spark fun. This is the easiest since you dont have to do more soldering than connect the wires, but if you know what you’re doing any IR photo transistor could probably be made to work. In the above picture it’s getting a nice dip in epoxy to seal it away from the elements.

Here it is mounted (glued ;) inside the channel. I carried the wires backwards across the back of the board so that they would be encased in the epoxy for a longer distance than if I ran them out the obvious side. 

Put a bit of tape around the 2 open sides and filled the whole thing with hot glue. Thats probably excessive and there is some danger of the glue heating up in the sun and slumping out of the thing and making a mess. I’ve used hot glue to do this here many times before and it’s never been a problem even here in the “deep south” but take your own situation into account.


And finally all finished and ready for mounting to the meter. I wonder if this isn’t the right sensor as it’s keyed to receive in the frequency range that IR remotes use and I dont know if the output of the LED on the meter is anything other than a strictly on/off pulse. I can’t find specific documentation on it and people are using all sorts of things to pick it up. But I would think this wouldn’t work at all if it wasn’t correct, the whole point of the module is to filter out un-mondulated or incorrectly modulated IR sources. It’s entirely possible though that this isn’t as sensitive as it could be with a proper receiver. If anybody sees specific manufacturer info about the kind of IR or it’s modulation I’d love a note about it. This is pretty picky about placement, it only works if it’s right over the LED on the meter and even small diversions make it not sense it. I’ll be using some outdoor stable velcro like stuff on either side of the hole there to attach it to the meter and be able to re-position it to get it just right. Next time software and install.

.code { background:#f5f8fa; background-repeat:no-repeat; border: solid #5C7B90; border-width: 1px 1px 1px 20px; color: #000000; font: 13px 'Courier New', Courier, monospace; line-height: 16px; margin: 10px 0 10px 10px; max-height: 200px; min-height: 16px; overflow: auto; padding: 28px 10px 10px; width: 90%; } .code:hover { background-repeat:no-repeat; }