Monday, June 27, 2011

Another project Idea

Nothing brings joy to a nerds heart like smashing two hobbies together and getting something amazing out. I do a bit of photography, mostly astro stuff with a telephoto lens. Not the best set up but you use what you can. If you want to take nice long exposures of deep sky objects you need a tracking mount to account for the earth's rotation otherwise you get star trails. Sometimes that's cool but if you want a pic of the Orion Nebula it's a pain.

Switching gears, I like stepper motors. As in REALLY like them. No idea why. A lot of my ideas feature them and these projects are the ones I think about a lot. So, the plan is to build a small car/ute trailer mounted computer controlled portable tracking observatory for my camera. Basically a pan/tilt stepper kit connected to a computer in order track stars and control the camera. The idea is that I could drive out to somewhere dark and clear and set this thing up in the back of the ute or on the roof and sit in the nice warm car and control everything from there. Maybe have some other gizmo to adjust the focal length of the lens and control a green laser mounted on the flash shoe to help me pin point an object. Oh the possibilities!!

In regards to my heat pump remote project, I've kinda stalled. Haven;t had much progress. Mostly trying to find a nice IR transmitter circuit for the arduino. /END MESSAGE

Wednesday, June 1, 2011

Decoding

Progress progress progress. Since my last post I received my order from Little Bird which contained the IR receiver. Time to start decoding IR signals. I've read the heater remotes tend to send large multi byte "Status Packets" which, rather sending a signal to increment or decrement the temperature, waits for the user to set a temperature and other settings then  sends all the settings in one big lot. This is great for my project as it means I don't have to know what the heater is currently set to before I set a new temperature.

The down side of this is that any signals are going to be big fat things full of info. In order to cut my teeth on decoding IR signals I decided to have a crack at a TV remote. Fortunately I had access to a TV with a remote! Yay! So I plugged the IR receiver into my trusty Pickit 2 and fired up the logic analyser software and got to work.

First capture. Head scratching ensued


Gibberish. IR gibberish. In my research I'd come to believe that most IR signals were sent with Manchester encoding which indicates 1's and 0's by a rising or falling edge. Seems simple enough. Until you try to decode it by eye. The problem I was having was that I didn't know how long a clock pulse was. This is a problem as the Manchester signals use 2 clock pulses per bit. Not knowing the boundaries of the bits made it tricky. I also didn't have an easy way of overlaying a grid to divide the bits using the clock pulses I didn't have. I could have used Gimp or Photoshop but I am unapologetically lazy. All in all this gave me a headache and many other things suddenly seemed more important and interesting than this project of mine.

Then one day a week or so later I was surfing the intertubes and came across a great blog post that showed the process a certain dude took when he was decoding IR signals. In his case a 1's and 0's were indicated by a short high pulse followed by either a long or short low. The high pulses marked the boundaries between bits and the lows indicated a 1 or 0. The "aha" moment came when I realised that his logic captures started low. When I was setting up the trigger for my logic analyser I had to set it to a falling edge as the signal from my receiver started high. I didn't even click. After that I took another look at my data and for the hell of it flipped the image in Gimp.


Victory!


Holy crap! It looks almost exactly like the other guys data, a high preamble, high pulses and long/short lows! Woot! It all made sense now. The signal was not Manchester encoded, it was just upside down! Now it's so much easier to read. I haven't done any actual decoding yet, or set up a spreadsheet with all the signals in it, but it's on my list. I'll probably be ordering some more stuff from Little Bird soon to build a transmitter.

It may seem like an obvious mistake to some but that is the whole reason I'm doing this project! I don't know jack and want to learn in a practical way and have a cool gadget to play with at the end.

Wednesday, May 18, 2011

Taste the metal

About a month and a bit ago I started watching videos of people metal detecting on Youtube. It looked so fun that in a fit of wild optimism I burned up some of my savings and bought a Garrett Ace 250 and a Garrett Pin pointer. After shopping around it was clear that ordering one domestically was bad idea as the local distributor seems to be a con man. Screw him. I got mine from the States. Detector, Pin pointer and shipping from the US was less than what the detector alone would have cost from the local.

After some shenanigans with USPS, they sent my package all the way to Canada, I finally got my hands on my new toy. I had to wait a few days till I had a day off to play with it properly. That day was today, so I woke at the crack of dawn, went back to sleep and got up at the more reasonable hour of 0800. My plan had been to head down really early before the sun was up to avoid the awkward stares that you get when wandering the beach digging small holes.

I spent a couple of hours searching Bathers Beach in Perth and found plenty of crappy aluminium junk and a couple of coins.

Sweet sweet treasure
An aussie 5c piece and a Malaysian 20 sen piece. The sen is hard to see as it's fairly corroded. They are made of Cupronickel which is supposed to be highly resistant to erosion in sea water. I guess that myth is busted.
This is what they are supposed to look like

While the whole adventure was definitely not profitable, it was a lot of fun. I think next time I will actually drag myself out of bed early and head up to some of the wealthier beaches and see what I can find. I'm hoping for tonnes of gold but will be happy with a few coins. The only thing I have to sort out now is all the district council red tape and hoop jumping to figure out whether I am a horrible criminal for wanting to do a bit of detecting on the beach. As with all government and corporate bodies a straight answer is definitely not on the cards. As the old saying goes "None of us is a dumb as all of us".

Wednesday, May 11, 2011

My first project

So basically I'm a nerd with a whole bunch of undeveloped interests, electronics, programming, digital art, photography, astronomy, bull riding and moon walking. Well maybe not the last two. What I need is a project that will motivate me to actually start learning the deeper parts of some of these interests.

To that end I have come up with an idea hat will allow me to at least cover some of the electronicy parts.


My flat has a Daikin heat pump, and for no reason at all I thought it would be cool to build a web based remote control for it so that I can control it via a web page on my phone and also get some basic info about the room, temp, light levels and random things like that. It will be a micro controller hooked up to a router and communicates with the heat pump via IR.

The first thing I'm going to have to do is figure out how to build and IR receiver so that I can begin to reverse engineer the IR protocol that the remote uses. I'm assuming that it uses a 38khz carrier wave with manchester encoding as every other website about IR signal decoding says this is what they use. I hope the assumption is correct as I've ordered that parts accordingly.

I will be prototyping everything on the Arduino as it's easy to use and I can be very lazy as a lot of other people have been very hard at work writing libs and schematics for me to leech off of. Eventually I want to run it all using a PIC but all in good time. Hopefully more pictures to come.

Things I need to learn/do:
  • Learn to decode IR
  • Map Daikin remote protocol
  • Learn how to make an IR transmitter
  • Transmit working IR codes
  • Learn how to connect an Arduino to the intertubes
  • Learn php or java or whatever and make a website for the arduino to connect to
  • Learn how to optimise a website for cell phones
Piece of cake right?