Showing posts with label Hack. Show all posts
Showing posts with label Hack. Show all posts

Saturday, June 18, 2016

Automating the Air Conditioning - Step One: Control

Over the last couple years, a few articles about interfacing with IR controlled devices have popped up in my news feeds. Coincident with getting our new Air Conditioning Units (which have IR remote controls), a new walk-through popped up that seemed like something I could handle. The project required a cheap ESP8266 board (which has WiFi, some general purpose pins, and runs off micro USB for power), and an IR receiver and LED set for a total bill of materials of around ten dollars.

Here's another link to the project, to give credit where credit is due.

Once the parts arrived, it was time to get into black magic territory:

Here be Dragons

I got the Arduino IDE set up with no issues, and started playing with "sketches" - the code that runs on this little guy. I immediately ran into problems. It turns out you can't have spaces OR punctuation in the sketch name (which nobody bothered to mention in the tutorials I read), so my file "Brian's IR Emitter" had several problems right off the bat.

Once I got that figured out, I was able to load up the example IR recorder with no problems. I pointed the remote control at the receiver and started hitting buttons, with no idea what would happen next. Eventually I figured out (mostly by random clicking) that I needed to open the "serial monitor" to see the data the remote control was sending over IR. Here's the sample data from the "On/Off" button:

Encoding  : UNKNOWN
Code      : BBF4F9F (32 bits)
Timing[67]: 
     +9050, -4550     + 550, - 600     + 600, - 600     + 550, - 650
     + 550, - 600     + 600, - 600     + 550, -1700     + 600, - 600
     + 550, - 650     + 550, -1700     + 600, -1750     + 600, -1750
     + 550, -1750     + 550, -1700     + 600, - 600     + 550, -1750
     + 600, -1750     + 550, - 600     + 600, -1700     + 550, - 600
     + 600, - 600     + 550, - 650     + 550, - 600     + 600, - 600
     + 550, - 600     + 550, -1700     + 550, - 650     + 550, -1750
     + 550, -1750     + 600, -1750     + 550, -1750     + 550, -1750
     + 600, -1700     + 600
unsigned int  rawData[67] = {9050,4550, 550,600, 600,600, 550,650, 550,600, 600,600, 550,1700, 600,600, 550,650, 550,1700, 600,1750, 600,1750, 550,1750, 550,1700, 600,600, 550,1750, 600,1750, 550,600, 600,1700, 550,600, 600,600, 550,650, 550,600, 600,600, 550,600, 550,1700, 550,650, 550,1750, 550,1750, 600,1750, 550,1750, 550,1750, 600,1700, 600};  // UNKNOWN BBF4F9F

As far as I can tell, the remote for this particular model is pretty dumb. It sends out one command per button press, identical every time, and the AC unit decides what to do with that command (turn on or turn off, increment or decrement the temperature, etc.)

Next step was to swap out the receiver for an emitter (the IR LED). I made the switch, and tried to load the original poster's "emitter" sketch. And tried. And tried. And tried again. Nothing.

Turns out, the IR diode does something weird at start up (draws too much power, maybe?) and the entire ESP8266 hangs. I have to physically detatch the LED, boot the ESP8266 and then plug in the LED. That particular bug was not a lot of fun, and was only solved through an equal measure of google searches and dumb luck.

Once I got that working, I copied the original poster's simple web server, and made it even simpler, knocking it down to a single entry to toggle the power on my AC unit. Here's what the front end looks like, in its entirety:

Brian's ESP8266 IR Remote

FAN ON/OFF




Miraculously, it worked! And all I really needed is that link: http://192.168.1.194/ir?fan=power. A GET command to that link with cause the ESP8266 to issue the "toggle" IR command. Booyah!


Later on, I'll have to put this on a smart plug that can monitor energy usage, so I can know whether the unit is on or not, and decide to toggle the IR command or not. But that's for Step 2: Automation. For now, all I've done is add that toggle command to my Alexa HA Bridge (from BWS systems - it's the best Alexa HA bridge I've used so far)

Now that I've got this one working, I'll but together another one for the AC unit in the master bedroom, and then I'll integrate it with OpenHAB, and (hopefully) Nest. Making it work with Nest would be a real coup - I don't think anyone else has pulled that off yet, and I've got an idea for how to do it that I haven't ready about anywhere else. But that will be a post for another day, after some more parts arrive from Amazon.

Friday, March 25, 2016

Dining Room Light

Brianna likes as much light as possible, and our Great Room is a kinda dim relative to the rest of the house. So I updated the dining room light fixture from three bulbs to four.


Now the light fixture is like a shielded ball of plasma, with four LED bulbs throwing off 3200 lumens inside the central enclosure.


Saturday, October 11, 2014

Bountiful Baskets CO-OP

This Saturday morning, I got up early to pick up my goodies from the Co-op that I had contributed to on Monday. Tried out this CO-op last weekend when I went to Colorado Springs to visit my family while Brian painted. This time I tried the site that is close to my house... Only problem, you have to pick your food up between 7 & 7:20am!   I was a few minutes late and it wasn't a problem as there was a line in the 45 degree morning.

I gathered my fruit & veggies from the two baskets, signed for my add-ons, 5 loaves of 9-grain organic bread and granola, then toted the haul to my car. 

The fruit and vegetables are an ever changing variety and you don't know what you will get until you show up. I am amazed at how much they pack into a $15 mix!

This week:
 2 small cantaloupes
 2 Apple/Pears (never had these before)
 8 bartlett pears
 5 bananas
 7 very large limes
 5 very tiny lemons
 7 small apples
 3 avocados
 9 anaheim peppers
 2 1lb-bags of baby carrots
 3 heads of broccoli
 1 bunch of spinach
 1 head of lettuce

Let us see what I do with those Anaheim peppers to get my husband to unknowingly eat them!

Wednesday, May 7, 2014

Photospheres

Well, my Moto X phone on Republic Wireless finally got its update to Google's latest version of Android, and now I can take Photospheres!

I've been playing around with it for a few days, but inside the house, where the walls are really close to the camera, the photo stitching wasn't working well - things were jagged and blurry. I looked around a bit, and came across this cheap phone mount:


And decided to build my own:


It's basically joist hanger, a cheap phone case and a bent wire hanger mounted on a tripod. It's arranged so the two axes of rotation pass through the camera lens, making the camera the exact center of the photosphere. And it works fairly well! Much better than doing it by hand, anyway.


I can't embed photospheres without uploading geo-tagged versions to Google's Maps app. And even if I wanted to do that (which I don't, not for interior photos), Google's terms of service don't allow interior photos. But! If you click this link, you should be able to open up my new public Photospheres album and rotate through the entire photosphere. I recommend it - it's a lot better than the flattened-out version above. Let me know in the comments if it doesn't work for you.

Thursday, April 24, 2014

First Fruits from the Workshop

I found this floor lamp:


and this pendant lamp:


in the IKEA As-Is section over the past few weeks. I paid $25 for both. Original price would have been $90 total.

I thought they would look pretty good combined, and tonight I finished putting them together:


(the amazon box on the floor has a transformer and some wiring connections. I'll have to figure out a better box in the near future). The metal finishes match exactly. While it's not LED, the halogen light bulbs supposedly only draw 10 watts total. I'm pretty pleased with how this turned out. Now I just have to find a place for it.

Tuesday, April 22, 2014

LED Strips on Computer Power Supply


I got the LED strips running off the computer power supply this evening. The power supply is on the top shelf in the center of the photo. I built a shelf in floor joists to hold the power supply, but didn't have quite the right wiring to make it a permanent installation tonight. The LED strip on the left is the brighter 5050 SMD LEDs, while the strip on the right is the dimmer 3528 SMD LEDs... Those are going to be replaced.

Shocking no one, the adhesive on the LED strip, which was shipped across the Pacific Ocean on a slow boat from China, did not hold up. I'll staple it in place soon, just like I did with the 3528 strip on the right (which will come down as soon as I get another 5050 strip).

Thursday, April 17, 2014

Electrical Engineering

Don't tell my Dad, but I was messing around with the "dark side" of engineering tonight.


I'm trying to modify a computer's ATX power supply so I have an ample supply of 12 volts DC to power my LED strips. (Un)fortunately, there seems to be a number of fail-safes in place to prevent shorts and overloads, and I have only circumvented one of them thus far. I'll have to go back to the forums to learn a little more, but it will wait til after I get some sleep.

***Update April 22, 2014***

It works!