Wednesday, February 19, 2020

Temperature adventures with (RaspPI) ESP32 and MQTT.

 Guest speaker today. Glenn has a farm and has contributed before. Farm automation is especially useful for keeping the work down somewhat and getting information. Here is Glenn's latest project:
---------------------------------------------- 
A while back I began looking at convenient, inexpensive temperature measuring devices. Now the reason behind this is very simple. Going out the back door of our place we have what we call the boot room. We live on a ranch, so needless to say we separate our ‘barn’ clothes from our ‘house’ clothes. The barn clothes hang in the boot room. Well before changing into our barn clothes we would like to know what the exterior temperature is. We don’t have an exterior temperature display near the boot room. Soooo… this is where the ESP32 comes in.

I first started this project as a raspberry pi based project. You see I have a raspberry pi 3 B+ in the horse barn and it measures the temperature of both my workshop and the stall area using DS18B20s. Now just about any of the raspberry pi’s from the 2B on up, or the zero would have worked. The raspberry pi zero W would not have worked in my case here as the device is housed inside a Leviton Structured Wiring panel and there is no wifi within the barn. If you are doing this in a location that has Wifi available then the Pi zero W could certainly fit the bill.

I had adapted code from Dave’s other posts to fulfill the need but that code was originally base on Sqlite and wasn’t feeding to my new MQTT docker container. Time for a change but thanks Dave for the original code!!

This project really contains three parts:
1. Temperature measurement
2. MQTT testing and coding
3. ESP32 implementation.

Temperature measurement.


The DS18B20 is probably the best contribution to the temperature measurement in the history of IoT and home automation. I’m not going to go into depth on this as Dave has several posting on it and they are a wealth of knowledge. These are connected to the raspberry pi as shown in this drawing:
Note: I am only using two Sensors at the moment not the three shown.
Full disclosure here. I am a big fan of Python and Python modules. Have been for a long time. So, when I start a new project I go on a search to see what new modules are out there. I’m an engineer, not a developer. I’m not the guy that writes a lot of code day in and day out.

In this case I came across a module that has really captured my imagination. It is called:
rpi-temperature-mqtt.

It was originally written by a fellow who calls himself HackerCowboy. Here is his Git repository link, https://github.com/hackercowboy/rpi-temperature-mqtt.

I grabbed the code and started playing with it.

First you must install the module onto you device (raspberry pi or ESP32).
pip install rpi-temperature-mqtt

All of the configuration is done in a file you create called config.json. Here is my config.json from the barn:
{
    "mqtt_client_id": "barn",
    "mqtt_host": "10.10.XX.XX",
    "mqtt_port": "1883",
    "wait_update": "60",
    "verbose": "true",
    "sources": [
        {
          "serial": "28-0000055aae0e",
          "topic": "workshop"
        },
         {
           “serial”: “28-0000054de0b5”,
           “topic”: “boxstalls”
          }
      ]
}

As you can see I have two DS18B20s that I am sampling. The code supports multiple devices. The other item of note is that the code provides its own scheduler capability. You set the time period between sampling of the collection of devices with the line:

“wait_update”: “60”,

This says to wait 60 seconds between sampling another set.
It also provides a delay between devices. That line is:

“wait_process”: “10”,

In this case it will wait 10 seconds between samples from the two DS18S20s.
Now to the section labelled “sources”. For each device you will need to add two lines.

“serial”: “your device serial number”,
“topic”: “what you call it in MQTT”

Note that each section must end in a comma after the topic statement. That is except for the last section where the comma is left off.

The other item I use in the config.json file is the verbose option. It lets me see exactly what the module is sending and shows me when the connection is made:

NOTE:

Before you start using rpi-temperature-mqtt you MUST initialize the Device Templates. This is a new change in the later versions of Raspian, etc. If you do not do this rpi-temperature-mqtt WILL NOT WORK. So you must add the following instructions to boot/config.txt

# Add the device tree to initialize w1-gpio.
dtoverlay=w1-gpio

Save it and reboot. If you forget you can manually start it by issuing the command:

sudo dtoverlay w1-gpio

Remember if you don’t do one of these the rpi-thermostat-mqtt code will error and say  it can’t find w1-master…..

MQTTfx:

I use a Ubuntu desktop machine in my lab. As well I have a separate server that runs all my docker containers. So for testing purposes I log into my test device (be they raspiberry pi or ESP320) via SSH and control them.
I found that in order to really see what is going on an MQTT broker monitor is really useful. Enter MQTTfx. This piece of code will run on a variety of platforms and gives you the ability to subscribe to a broker (local or remote) and then publish or subscribe to the topic of interest.

The first thing we need to do is create a connection profile. Select the Broker Status tab. Then from the top Extras tab, edit the connection profile:
  

  
· Enter your new Profile name at the top.
· Enter the ip address of your Broker.
· Enter the port number of your Broker.
· Leave the rest as presented.
· Click Apply, then OK.



You will be returned to the main screen. Now make sure Broker status is selected. From the profile pull down window select your newly created profile and then click on CONNECT:


Once you connect you should see this screen which connects you to the Mosquitto Broker:



Now click on Subscribe.

At this point you need to start the rpi-temperature-mqtt software running on your device by issuing this command:

rpi-temperature-mqtt config.json

Make sure that you do this from the subdirectory that contains config.json.

Now when you switch back to the MQTTfx screen and you select your topic(s) you should see something like this:


Note I’ve selected to view the workshop topic from the pull down. The lower right window displays the last reported value.

Ok, so this post is getting a little long so I’ll end it here. Next we’ll move to the ESP32 and talk about micopython, rpi-temperature-mqtt, and Hazzuh32 (ESP 32) from Adafruit.

Cheers.
Glenn.


Sunday, January 5, 2020

Introduce End Devices to a Network and Introduce Problems

As I've touted for years now I have a network of XBees that I (basically) run my house with. I monitor room temperatures in key areas, control my pool, monitor my power, etc; all without a bunch of wires strung around the house. For the first year I ran a network transparent (AT) mode that broadcast to all devices and all of them listened to what was going on....that didn't work well.

I described what the problem turned out to be back then <link> and moved to a more directed network using API mode to control the traffic level and increase the speed of throughput. That all worked really well. Then I created the room temperature monitors. They were created as battery operated devices since I wanted to put them in places where there was no power; XBee routers use too much power for such an application, so they had to be XBee End Devices.

That was the beginning of a long time problem that I simply couldn't find, and has driven me nuts a few times before finally getting the entire mess to work again.

The symptom was that a device would leave or get kicked off the network and then simply refuse to join back in. I'd go for a few days and a sensor would leave and no amount of resets, power cycles, slaps or flights across the room would get it back on the network. Hell, I even programmed another XBee and put it in the same place and it wouldn't work. Then, seemingly at random, it would connect and start working all by itself.

Months of watching the XBee traffic after adding a ton of logging to almost every device in the house led me to nothing at all. Reading every blog and question remotely related on the web told me nothing. I was completely baffled by this problem.

Some of the things I tried were to automatically reset the network to force it to reform using the NR=1 command. This dumps all the routing tables and everything rejoins. This would work, but if it happened to often, the entire network would go down and I had to intercede at each device to get it back up.

Hook up a tablet using an OTG cable hooked to the device that most often failed and monitoring the activity for hours hoping to get a clue what was going on. This was cool because it allowed me to learn how to watch a device using something that wasn't a laptop running the entire Arduino IDE. I could plug into an active device and watch what was being logged without resetting the device. This is a nice thing to have available, but it didn't help find the problem.

I had the device reset itself, issue it's own NR=0 command to clear the local tables, reset the XBee, just about anything I could think of and nothing helped. I could have ignored it if I was only reporting temperatures, but two of the sensors were serving as the temperature sensors for my air conditioning system.

It really sucks when the cooling stops at 110F outside and the house heats up. It sucks about equally when the heater sticks on and the temperature goes up to 90+ inside on a cold day. Power bill didn't like that much either. I didn't want to break down and go back to the old method of measuring temperature, the sensors made the house much more comfortable.

I finally got a hint from a question asked about the XBee end devices not being able to rejoin a network. Seems the XBee routers have a table of 12 entries reserved for end devices that they can parent. That's cool, but I don't have 12 end devices. I still read the device tables on the XBees looking for what the heck was going on though. Then I found it.

I had relatives visit during Christmas and they brought their cell phones. The folk (my kids and grandkids) are ALWAYS on their phone. Either talking, playing games, texts, whatever; their eyes and hands are literally glued to the phone. The increased RF and WIFI traffic saturated my house and the network struggled trying to get packets through the interference that comes with low power RF activities. Devices disconnected and couldn't rejoin, packets got lost in the ocean of packets from all the devices, it was a total mess. I dug in again to see if I could get a clue.

I actually found the problem. What was happening to me is that the XBee end devices have to check in periodically to maintain their connection. If you wait too long, the table is purged to conserve the device table space for end devices. The time allowed is set by parameters on the XBee router and the end device needs to check in often enough not to get purged. I was using a 2 minute timeout on the temperature sensor and the default on the router.

To make things worse, I was using hardware control of the sleep period, and not correctly handling the interaction of the Arduino and the XBee conversation.

A couple of corrections such that I would send the temperature message, ask the XBee to go to sleep, then WAIT until it actually went to sleep before sleeping the Arduino made things much better. I allowed the end device to exhaust the stored messages that the XBee router parent was holding by just waiting until they all came in. The final item was to extend the XBee router timeout to way higher than necessary for a couple of missed transactions (like a full day) took care of the problem of it not being able to rejoin.

I was actually preventing it from rejoining by sleeping the device too quickly; it just couldn't get back in before I told it to shut down.

Why don't other people have this problem? I think they do sometimes, but didn't spend the time it took me to chase it down. I spent months watching and trying things before I stumbled on it mostly by accident looking at the tables because of some other problem someone else had with their network.

My network is humming along with only an occasional missed message. The extended awake time hasn't seemed to be a problem with the battery life either. The XBee trying to rejoin was a heavier load on the battery than the extra time the receiver is on. Transmit takes more power than receive, and I only transmit one message every two minutes, so the tiny overhead of the acknowledge packets isn't noticeable.

It's been seven full days of bliss because all the sensors and control systems are working perfectly. The network even has more capacity available for even more XBees. This is really tempting because my indoor freezer has a failing thermostat. Stupid thermostats on freezers are expensive and I already monitor the temperature inside it. It may be time to take complete control of the freezer. I wouldn't even consider that with the devices acting the way they were.

I know, in the scheme of things this short a period of time doesn't actually prove the problem is gone. But, the instant clearing of problems that had culminated with the increased number of cell phones pretty much convinces me I have it taken care of.

Maybe I can start thinking about something else now.

Friday, October 25, 2019

Naturally, Blogger Changed Something

Of course blogger changed how the blog appears ! That led to a mess of my background image tileing and messing things up in the appearance. After some messing around I managed to get it appearing somewhat reasonable, but had to change the background picture. I've used the same one for years and years now, but so be it; I can update with the times ... sort of.

I kind of like the look, and will stay with it for while, or until google gets a bug up their butt and changes things again.

Yes, I'm still alive. I haven't been blogging because I got myself involved with local politics and have been up to my ears in that effort for many months. I do get in a technical project once in a while, but haven't had the time to write them up.

I'll put them on the blog at some point, since they may be interesting to some people out there. Here's a quick list off the top of my head of the things I've been into that haven't surfaced here yet.

1. A horrible problem with my XBee network. My end devices would leave the network and not rejoin. That meant that some of the critical ones that controlled the AIR CONDITIONING didn't update the thermostats that control the temperature. Hot house or cold house depending on where it quit working. The thermostats protected me against using power during the Peak period, so the power bill didn't get out of hand, however it was painful to deal with. I have it mostly fixed, there's still one strangeness that I have to work on to get everything back to working reliably though.

2. I still have the parts for monitoring my 220V devices piled up with an enclosure, and haven't done anything else with them. They stare at me mournfully each time I walk through the garage. I'll get to them as soon as I can. To see that project's beginnings look here <link>.

3. Stumbled across a really cool phone from the crank-to-call days. I fully plan to put this thing in service. I may have to update a few parts, but maybe I can hide them inside. There's a lot of these out there, so I'm not going to worry much about the value afterwards, but I do want to keep it as original as possible. Here's some pictures of the phone; notice it has a BRASS earpiece !


It's an Australian model, but the parts are easily found to update it. This phone was updated over the years that it was in service. The crank was disconnected and the handle lost (or taken by the phone guy that did the work) the earpiece and mouthpiece elements were changed and finally the dial was added. It is really fun to play around with. I hope I can get the ringer to work; that would be great.

Might want a switch though.

3. Stupid AcuRite 5n1 weather station channel A died. Now I have to set it up for channel C since I that's the only way it will work. Sigh, don't happen to know what the frequency is for channel C would you? If you want to look at this project, it's all under 'Weather' in the list on the right side top of the page.

4. The battery life of my XBee end device temperature sensors has been a little over 5 months consistently. That's not as much as I calculated, but it's still pretty good. I'm getting tired of buying AA cells though. They're not expensive, but when you have a half dozen devices that run on three of them each, it can get annoying replacing them. I always seem to be out of the darn things.

So, I'm looking at those Li-Ion cells that sell pretty cheaply on Amazon. They seem to last forever, have close to 4 VDC output when full and are really fast to recharge. I have a bunch that I use in flashlights around the house and one installed in a sensor being tested (for months, these things take time). I suspect I'll be switching over to them on all the battery devices; they're just great since you can always have one charged up for replacement and don't have to run to Walmart because the AC crapped out.

And Etc. See, I'm still at it, just don't have the time to gather the graphs, pictures, measurements and such that it takes to make a coherent blog post about these things.

But, like the Terminator, "I'll be back."



Friday, March 1, 2019

I Finally Gave Up On My Hayward Variable Speed Pool Pump.

Several times over the years I've mentioned my Hayward Variable Speed Pump. When I got it, it was a dream come true. Here was something that could filter my pool and save me money doing it. I could control the speed and pretty much design my pool filtering around the power company's lowest rate requirements.
But, right off the bat, it failed. Hayward fixed it and all was well with the world. Then, it failed again. Hayward fixed it again. Then, you guessed it, it failed again. This time Hayward told me it was out of warranty and would cost me $550 to get the new 'drive' unit. I bought one, but from a supplier on ebay because I didn't want to pay the required installation fee they wanted to hook up the wires that replacement would require. I'm perfectly fine with hooking up wires.

It failed again a few days ago. At that particular time it was actually snowing here in the Arizona desert. Surprisingly, we had about four inches of snow on the ground that morning. No, it wasn't frozen, I checked and the darn thing failed before the temperature dropped below freezing. Remember, I record the power usage of the house and monitor the status of the pool as well. The way I discovered the pump had failed was noticing a thin layer of ice on the pool. That has never happened because the no freeze controls on the pool keep the water moving.



Looking at it, there was an error message, "Motor Stalled". I actually believed that message and took the pump loose from the plumbing (yes, in the snow) and turned the impeller. The motor was not frozen. It did cog a bit from the magnets, but it turned freely. Next, I pulled the wiring loose and took it to the patio table (out of the snow) and pulled it further apart. There was nothing mechanically wrong. Fine, look on the internet.

There was story after story about this pump. "Drive Error," and "Motor Stalled" were the two that most often occurred. I asked around, and a friend recommended a place that specialized in pool pumps. I called them. and they were very nice to me, consoling me on the problems with that pump, but didn't offer much in the way of suggestions other than replacing the electronics for $650 plus a small labor charge.

Gag!

I asked about just replacing the dog gone thing. For a little over $500 I could get a 2.6 HP two speed pump motor installed on the existing impeller housing. Really? You can do that? Yes. I'll be down tomorrow morning. Here's the pieces sitting on the garage floor waiting for me to do something else to it:



I loaded up the Hayward VSP pieces into the Jeep and took it in. True to their word, they fitted the motor to the impeller housing and replaced all the gaskets and worn parts as well. These folk actually did it while I waited, and I got to talk to several people that came in for various problems and parts. 

I noticed on their outgoing shelf waiting for pickup were three pumps just like mine. All of them waiting for pickup after having some similar problem. Of course the "doctor" analogy applies. I'm at a doctor's office so everyone I see is sick, but it certainly made me feel better because, "Misery loves Company."

Here's what it looks like with the old impeller housing and new motor.



I'm sure someone wants to know what the motor is, so here's a picture of the label on the side of the motor. Thinking about it, I need to put clear packing tape over that so I'll be able to read it in a year or two.






























And, here are the pieces that should go in the trash, but I want to play with that motor some. I suspect I may be able to used a three phase converter from some ebay supplier and turn this into a variable speed motor for my drill press. A three horsepower variable speed drill press !  Sweet.




So, the only piece that is going in the trash (after I see if there's anything inside worth keeping) is the part with the heat sink on it.

I brought the new assembly home and have it sort of installed. I didn't have to change the plumbing at all since it was the same impeller housing. I do have to add a wire for low speed, but (surprise) I want to change some things.

I want to add multicolor wiring for the various line power items. I had a heck of a time chasing down which wires went where and it was a real pain walking back and forth from the power panel each time I wanted to shut off the power to the pump. So, since the controller housing has facilities for breakers, I'll add breakers right where I can get to them and multicolor wiring so I can tell which things hook to what. That should make it much easier to work on next time.

But, since the motor technology is over a hundred years old, all I'll need is bearings, seals and an occasional start capacitor. If the motor wears out entirely, there will be plenty of choices on what I can stick in its place.

Heck, for that matter the Goldline controller I use is not made anymore and I probably can't get parts for it when it fails, so next time it fails, I'll gut it, keeping the power supply, power relays and tossing everything else. That complex, ever failing, mess will be replaced with a simple XBee, Arduino, and the power relays that the controller already has.

Yes, the VSP was a cool piece of technology, and did save me money on power usage. However it simply didn't save me as much as I spent on it to keep it working. Where's the fun in that?

And, yes, that means all the research I did on the protocol and operation of the motor won't ever be used by me. Others have leveraged that work and I know there are some control systems for this motor out there based in part on that work, plus it was fun to work on.

But what about saving energy? I have friends that are energy conscious, and they don't understand my motives. I'm not energy conscious as much as I'm MONEY conscious. The latest rate increase my power company put into place played right into my hands. Without thinking about it, they gave me the periods of greatest need at the lowest rate. I need to run the motor while the sun is at its peak, around noon or so, so the solar heater can have maximum impact. That's also the time for sitting by the pool and cooling off from the intense summer sun. The (idiotic) power company in their infinite greed made the peak sun period part of the "off-peak" period so they could screw over the solar installations since that is also peak solar production hours and they get to credit the solar folk less.

That played right into my miserly little hands. I can run the pump at any speed I want to from 8 PM until 3PM the next day. Sure, that falls right across dinner hours, but I can easily work around that little problem.

And while we're at it, take that Hayward. You charged me a small fortune for the pump, and due to your own bad engineering, had to fix it twice (which must have eaten up the profit). I had to fix it once, but learned my lesson, and used part of your mess and created my own custom pump arrangement.

Soon, I'll be looking for a three phase converter to try on that fancy motor.

Wednesday, February 27, 2019

Yes, I'm Still Writing About My Power Company

I've been battling my power company since 2009 or so. It started off with a bad meter and eventually wound up with my giving testimony at a hearing about their slopping and greedy way of doing business. It also directly led to me working on lower my power bills, and to this blog.

I guess I sort of owe them for that.

However, with the filing mentioned in previous posts, and an election where we the voters booted out one of the commissioners that was sympathetic to APS, Forese, things are happening a little differently. There have been two dockets opened directly against APS and the way they handle themselves.

E-01345A-19-0003 - In the matter of the rate review and examination of the books and records of Arizona Public Service Company and its affiliates, subsidiaries and Pinnacle West Corporation.

E-01345A-19-0005 - In the matter of the Commission's Inquiry/Investigation into the Campaign Expenditures and Political Participation of Arizona Public Service Company and its Affiliates, Subsidiaries and Pinnacle West Capitol Corporation in the Election Periods of 2012, 2014 and 2016.

In the fhe first one, the Arizona Corporation Commisssion ordered its staff members to audit APS and its recent profits after the rate increase. This IS A DIRECT RESULT of citizen action over the last many months.

First protests about the initial filing for the rate increase, then the lawsuit I posted many times about, then the election where Tom Forese was not re-elected (he used to chair the commission), then the two crowning touches: Tom Forese after losing, asked for APS to explain the excessive increases people were seeing, AND Bob Burns was appointed chairman of the board. Bob Burns has opposed this increase and the handling of the APS contributions in the previous election; he even brought a law suit to expose it.

Take a closer look at the second one. Yes, you read it right, they're investigating (or at least trying) the political hanky panky that was reported and suspected in past elections. You know, spend enough money to get your own people elected, then get your way with whatever you want to charge?

Then, since I'm registered to receive updates on these items, I received the following announcement headline:

"Sandra Kennedy (our new Commissioner on the Arizona Corporation Commission) has ordered a subpoena issued to APS to disclose their 'Dark Money' political contributions."

Yes, someone actually did it. Of course there will be a huge court fight at some point, but someone had the courage to actually do it. Bob Burns tried last year, but couldn't get the other commissioners to actually let it happen. This time, I bet it goes out since we fired a major roadblock in the last election.

Since most of y'all aren't on that particular mailing list, here's the significant text of the press release that I received and came out on 2/26/2019:

"Commissioner Sandra Kennedy has finalized and docketed a letter to Matthew Neubert, executive director of the Arizona Corporation Commission, directing him to prepare a subpoena to Arizona Public Service (APS) and its parent company, Pinnacle West Capital Corporation, regarding its spending on political races, lobbying, advertising, and contributions to 501 c 3 and 501 c 4 organizations for the calendar years 2013 through 2018. (Contributions to 501 c 3 and 501 c 4 organizations can be used to mask dark money spending.)

The subpoena effort has been fueled by concerns about millions of dollars of dark money spent in Arizona elections starting in 2014, and APS’ refusal to provide that information. About 30 million dollars were openly spent by APS to defeat Proposition 127 in the 2018 election, but the issue of other political spending by APS in other races is still an unknown. Commissioner Kennedy supports full transparency and looks forward to providing the subpoena results to the public.

Commissioner Kennedy promised in her successful 2018 Corporation Commission campaign to sign a subpoena to finally allow transparency regarding APS’ political spending, and she will be inviting her fellow Commissioners an opportunity to sign the subpoena as well."

The actual letter that was filed is at http://docket.images.azcc.gov/0000196338.pdf and makes for some fine reading.

Additionally the next day (today for me), there was an additional announcement:

"Commissioners Seek Information from APS on Political Spending
Chairman Burns and Commissioner Dunn issue joint request seeking transparency"

As with all things political, the two additional Commissioners drafted their own paperwork. They created another docket, E-01345A-19-0043, and their own letter. This letter has places for all Commissioners signature and a very bold letter. If you're interested (for a political science paper when mid-terms are looming) it's at <link>.  It has a wonderful line in a couple of pages that I actually cheered when I read it:

"YOU ARE HEREBY COMMANDED"

If anyone ever thought that voting didn't matter, think again. The first docket was filed by Bob Burns, and the second was filed by  Sandra Kennedy. This all happened after Forese was not re-elected. Of course, there were many people like me following this closely and myself and other spoke at various hearings. Money was donated, charges were filed, hearing were held.

And, we're not done yet. This will take more months and more hearings before anything of any substance happens. But, the people have actually started something.

What's coming to the world? There actually are some politicians (well sort of politicians) that keep their campaign promises. 

Sunday, December 30, 2018

Have You Ever Thought About Tire Inflation?

Well, neither had I. At least not much more than topping of a tire once in a while. However, I got new rear tires on my big tractor and after a while of just sitting, one of the tires was very low. Getting the new tires was an interesting experience. Those things weight a lot and I didn't want to spend hours trying to break the bead and leverage the tire off using long tire irons, so I just called in a mobile tire service and let them do it for me.

They came out in a big truck with a crane installed in the middle of it. They didn't even have to remove the wheels from the tractor; they simply pulled the tires off of it and put the new ones on. I sat in a lawn chair and watched. That's the 21st century way to get tractor tires changed.



Anyway, the brand new tire was flat and I had to air it up. I grabbed my trusty tire inflator and about ten minutes later I was still messing with it. I have a pretty good compressor, but putting air in a tire as big as the ones on my tractor through a hole a little more than an eighth of an inch was going to take some time. Plus, holding it up to the valve stem was getting tiring. You all must have either owned or used one of these over the years:



I had another one to try out that I picked up at Tractor Supply a few months back, so I gave it a try and it didn't work much better.



The little assembly that was supposed to hold the hose on the valve either leaked or popped off each time I tried to use it.  I did eventually get it to fill the tire, but it was an experience that I didn't want to repeat.

Off to Amazon I went and found an inflator that had many good reviews and looked like it could do the job because it was substantially better made than the one I had. There were rave reviews that indicated that it would tell me the tire pressure as I filled the tire, it filled fast, was accurate, all the hype one should have learned to expect and disregard. I ordered it. When it came in, I drove the tractor (with a flat naturally) in front of the garage and tried the new device out.

Although the clip on part that should hold it to the tire worked better, it leaked if moved even a little bit in any direction. Since the valve stem was on the inside of the wheel that meant I had to lean over the tire and hold it in place. All was not lost though, it had a screw on fitting that could actually be put on the valve and would allow me to relax a little bit while filling the tire. But I couldn't figure out how to hook it to the inflator hose.

I used this inflator to fill the tire, but it wasn't a very satisfactory experience since, even though the clip on was better, I still had to make sure it stayed straight on the tire.



I went looking for another one based on about $40 spent so far and several hours direct experience and ordered this one.



It had exactly the same valve assembly as the last one with exactly the same screw on adapter, but this one had a hose that I could use the screw on with. I installed the 'hands free' adapter and hooked it up. No leaks and I didn't have to hold the hose totally straight to use it. The problem with this one was the same as all the others I had to lean over the tire to hold the stupid lever that released the air.

Fishing around my drawers of junk I found a piece of velcro (you can see it above) that I could wrap around the valve to hold it open so the tire would fill unattended. I was totally set up now. I could attach the fitting, fill the tire while checking fluids and such, then put everything away for later. Of course the eventual goal was to get the leak fixed, but I hadn't been able to find where it was.

I did notice a few things I want to share about these simple devices that don't work as well as they should. First, these days it's actually getting harder to find inflators that aren't digital. They all tout how wonderful they are because they are 'easy to read'. That is a simple lie not only will the batteries be dead when you need it, you can only see the numbers when they are oriented correctly. And, who the heck cares about a half pound resolution in a tire's pressure? As soon as you disconnect the device and the air warms up a bit whatever reading you had will change. My bet is that the accuracy is around ten percent or so and a digital reading just isn't necessary. It will also save you time, money and frustration with an old fashioned analog gauge.

None of them read the pressure of the tire, they all read the hose pressure. Think about it, it's a hose transferring air, the only pressure it actually can read is the pressure in the hose. That's neither the compressor pressure nor the tire pressure. This all means that you have to stop the flow of air to actually get a reading. I checked it every couple minutes (yes minutes) to see how it was going. Usually, I over inflated it and had to drop it down to the right pressure by hand, but that didn't take too long.

The high end devices cost from $25 up to over a hundred and they're all basically the exact same device with different names stuck on the outside. Take a look:



Lastly, don't believe the comments and advertising. If you have big tanks or tires to fill, get a screw on adapter and use it. It won't speed things up much, but you won't be holding the hose a certain way to keep it working while having to hold the lever down.

Heck, the first inflator I tried that had been my buddy for years and years would have worked with the adapter and I would have saved roughly fifty bucks and weeks of frustration.

Oh, I finally did find the leak. After washing the tire down six times with soapy water and turning it slowly in the sun and finding nothing, I was under the tractor working on a simple drain valve and happened to think that I hadn't checked the valve on the tire. The valves on the tractor are all on the inside to prevent rocks from ripping them off and they are a bit hard to check. Sure enough, the valve was not tight in the wheel and leaked. A few minutes with some soapy water and a wrench and the problem was fixed.

So, learn from my mistakes.

Saturday, July 14, 2018

Thermostats, Location, Location, Location

When I was researching supercooling as a way of limiting my power bill I kept getting readings and such that just didn't make sense. One side of my house was comfortable, the other ... not so much. Sure it was the sunny side this time of year, but it has really good windows and good curtains. The only two major problem areas were a couple of windows that faced directly into the after noon sun.

I fixed those years ago with reflective insulation that I put in for the summer and (sometimes) take out for the winter. It's easy to work with and will last forever if I just give them a little attention every once in a while. I wandered around the room and noticed that the interior walls were about 2 degrees warmer than the rest of the house and there was heat getting in through the foundation.

The sun bearing down on the exposed slab foundation would heat up the concrete slab and transmit heat inside the house. That's something that might go unnoticed if I had carpeting, but the tile felt warmer as you approached the wall.

So, basically, it was like any other house on the sunny side. Why was my AC running all the time and having little impact on that room?

A little background: I have a house shaped like an "L" and two AC units. The one on the north is a 3 ton and the one on the south is a 5 ton. Both of them going could cool the house, but when they cycle, it doesn't seem to handle it. I had two thermostats that were located by the AC 'experts' that did my house and were in the top middle of the price range. I replaced them with highly programmable thermostats that were in the high range of prices. These wouldn't do the job of handling peak periods well, so I got a high priced "learning' version. It was crap.

The learning thermostats only learn what the programmer wants them to learn, and it was great at anticipating my needs. It decided I liked the AC on at 07:00 and off at night ... exactly the opposite of what I wanted. They tried to predict what temperature I wanted the house at and must have been born in Nova Scotia because they wanted to keep it at around 65F.

I sent those things back before the 30 day refund period was up. What a waste.

Then, I built my own <link>; I could control them any way I wanted to. Over the years I tried recirculating the air around the house with them, experimented with differing hysteresis curves, used various smoothing algorithms on the temperature readings, etc. Basically, I tried everything I could think of to get the environment the way I wanted it.

Nothing worked very well. I would still wake up with the bedroom running around 85F at night.

But, during my experimenting with supercooling the house (look at the posts on supercooling by using the contents search on the top right of the page) I noticed a whole bunch of things that really shouldn't be happening. First the south AC unit was short cycling. Short cycling is where the AC comes on and then shuts off in seconds or minutes. This is NOT a good thing.

Cycling like this can radically shorten the lifetime of any motor driven device. It causes undue wear on the bearings to be jammed up by the quick start of the motors. It can cause fan blades to slip and that scores the shaft. The air start up can loosen vents and cause rattles. Basically all the things that destroy devices like this. This behavior can also cause a room to be too cold and then too hot within minutes.

The very most expensive AC units start slow and ramp up to speed, they will run slowly to keep the air moving, they even open and close vents based on the need for cooling in a particular area. But, I'm not Bill Gates; these things are way out of my price range.

So, I started looking for the cause of this situation on my south AC. TLDR (too long didn't read) the thermostat was in the wrong place. The thermostat was in a hallway like most of the thermostats in the world close to an overhead air return for the AC. Over half the air for the house went through that return. The temperature would drop rapidly in that location when the AC turned on and cause shut off in a matter of a couple of minutes. Then it would rise rapidly back up because it was only the breeze that cooled it off and repeat the cycle.

Another factor was that I run in and out of the garage a lot. Each time warm air would hit the thermostat and cause the same problem. Add to that the garage is on the other side of the wall and it doesn't have AC. When it heated up, the wall was warmer than the air in the house; cycle started all over again. Obviously, the thermostat had to be moved to get better performance.

Based on this research, I modified the house code to save the activity of the two AC units and looked at them for a day to see how bad it was. It was pretty bad. Here's a chart of my findings on the first day for the south AC unit:


The tall vertical stripes are when the compressor was running, and the jagged line down the middle was the temperature the thermostat was reading. Each shaded long vertical strip is the compressor chewing up power and wearing itself out. Here's a closeup of a couple of them from the middle of the chart:


The stair steps in the temperature is due to the granularity of my recording the data. I only mess with one degree changes, so it comes out like this. So, you can easily tell that the hysteresis is three degrees and it takes very little time to overcome that with the AC unit essentially blowing down the hallway from all the rooms. Similarly, the temperature will shoot back up in a similar fashion because that short a cooling interval doesn't really cool anything except the air the it is blowing around. The gap in the middle is because the cumulative impact of a series of cooling cycles finally does cool things down a little.

When I looked at the North thermostat, it was a different set of environmental factors that added up to a different problem. This thermostat was in a short hallway outside the master bedroom (my room darn it) while the AC unit was venting into that room. There were also a couple of vents that dumped air into the rest of the house to aid there as well. When I looked at it, it looked like this:


Same things on the graph, compressor run period and temperature recorded by the thermostat. Notice the compressor runs a lot even though the temperature isn't changing? Part of that problem is that the thermostat isn't really looking at the AC activity, it's looking at a completely different area. The rest of the problem is that the two vents into the rest of the house are letting almost a great a volume of air get out there as it allows inside MY ROOM.

Fine ! I gotta move the thermostats, but where the heck am I going to put them? Also, it's a real pain to move a thermostat. I don't have a real attic, it's an area that is totally filled with insulation about two feet tall. I really, really don't want to go up there --- ever. I could carve out the wall and move the thermostat and then patch up the wall. That's equally unlikely to happen. Instead I experimented with really long hysteresis values. I was up to 10 degrees at one point. That solution was not satisfactory. I also tried running the fan longer to make sure the air got moved. That didn't work well either; it actually made the problem worse.

Then, I thought about it a bit. I had these temperature sensors <link> all over the house, why couldn't I just use them instead of the temperature sensor inside the thermostat? There wasn't a single reason why not except I would have to change some code in a few places. I took all the code out of the south thermostat related to reading temperature and reorganized it a bit. Now, it would receive the temperature forwarded by the house controller from any of the temperature sensors around the house.  I chose a room where the sensor was on an inside wall away from any breeze from the AC directly. The sensor gets air circulation, it just wasn't directly in the cool air path.

Now, I was ready to test the newly modified south thermostat. The one that was banging the compressor to death with short cycles. Let's see what this accomplished:


Now, that's more like it. Granted, it was a stormy day and not our usual 100+ temperatures, but look, it wasn't short cycling any more. There are long periods of AC activity and the temperature rises slowly instead of a few seconds at a time. This may look like I'm actually using more power, but I'm not. It's actually about the same because the gaps are longer as well. the big thing was that I wasn't tearing the guts out of my AC.

I did the same thing with similar results to the North AC, except I also closed off the vents to the rest of the house. Now my bedroom cools down pretty quickly and stays that way for a while.


Notice that it isn't on all the stinking time blowing air where it isn't needed? The big gap is the 'demand' period where the AC isn't allowed to run 15:00 to 20:00. After the down time, it kicked on and recovered a little after midnight.

The beauty of this is that I can build a couple of temperature sensors specifically for the AC units and put them anywhere I want. If I want priority in the bedroom, put the sensor by the bed. If I want it for the shower, put it just outside; you get the idea. Basically, this is a priority system now that allows me to carry the priority anywhere I want.

<rant>
I hereby copyright this idea !! Anyone is welcome to do anything similar; heck steal my code if you want, but you commercial shark guys out there better get permission to use this. It's real annoying when you find your code, stolen right off the site and only perfunctorily changed in a book that sells for $35 a copy at a book store. I'm looking for new ideas and find my old ones on the shelf...sigh. I have found my code and ideas all over the web and almost every single time it's attributed; that makes me feel good. When someone is selling it, not so much. This stuff is supposed to be free dog gone it.
</rant>

Anyway, the jury is still out on this idea. I need to watch it over time and see if there are problems with the devices talking to each other, getting out of hand unexpectedly, actually working the same way over time. That kind of thing. One thing I did notice though is that a web only version where there is no control station nearby sucks. It's really nice to be able to lower or raise the temperature by pushing a button on the wall instead of starting up a browser and working through pages to get to it. Now, this could be a cheap tablet, and old phone, or something like that if you want to get fancy, but a nearby control is nice. I like buttons.

Also, it's a good thing to have a display that shows everything is working OK. I'm currently using the display on the thermostats, but it could be anything that you can see when wandering aimlessly around the house looking for the car keys. This also helps with the, "It's too hot." comments. You can point to the thermostat and show them that it's only 80 and not hot at all. Folk visiting from the East do this all the time.

Another thing I learned is that AC 'experts' are not to be trusted. These things were professionally installed and came highly recommended. They put one thermostat outside the room it was needed in and the other in a breezy hallway next to the air intake and a garage door. In retrospect, I may be to blame somewhat for not asking enough questions, but these were experts hired for their knowledge and experience. I don't have a suggestion on how to handle this problem except to get two or three experts to present proposals and pick their brains. If you are Bill Gates and can afford to do that kind of thing. I even blogged about the unreliability of 'experts' a couple of times; my experiences are not good with them. Of course, now that I can put the temperature sensor anywhere I want, it doesn't matter as much.

See what happens when you start automating your house? Ideas may come slowly, but actually doing them is entirely possible.

Oh, this is another post that will attract attention from the spammers. If you post advertising in a comment, it will be quietly deleted. Usually the same day. So, don't bother advertising your AC repair company here.