Wednesday, August 31, 2016

Unexpected Pest Control Problems.

If you've read a few of my posts, you know I have a few problems with critters out here. I love sitting on the patio watching the quail sneak around the yard trying not to attract the attention of my dog. The rabbits get in the fine sand and roll around playing leapfrog... Really, they actually play leapfrog. They take turns jumping over one another and roll around the the sand kicking it as far as they can. The lizards watch while doing the push-up thing they do.

And then it all comes to an end when a Harris Hawk flies over looking for breakfast. All the critters head for cover, and it can be thirty minutes before they venture out again for play.

There are only a few destructive animals that I don't get along with. Woodpeckers I've already complained about on this blog <link>, but now I want to talk about rats, mice and small ground squirrels. These rodents build nests inside the engine compartment of my SUV and proceed to eat the wiring. They eat the swimming pool wiring, steal anything shiny, and believe it or not, move the dog poop around.

Gross right? They move into a new home behind an outside cabinet and then get some cactus and dog poop to protect the entrance. The reason for the cactus is obvious, simple protection. They move the poop into the entrance to disguise the smell. Hoping that no other animal will realize there's a rats nest in there. Of course the snakes are wise to this and go behind every cabinet. Makes for some interesting times.

Up until the last month I've had this under control. I use Terminix for pest control because I don't want to have to worry about storing poisons, and for 10 years now they kept the rodents under control with poison. Yes, poison. They have a carefully designed enclosure that only lets the small animals in and the poison is inside a chamber at the back of it. The poison is in large pellets with a hole in the middle, and then it is threaded on a wire so it can't be removed. It's a clever design that contains the poison while allowing access to small destructive pests. The nice thing about the poisons is that, after they eat it, they go into a hole and die; they don't lie around the yard.

Yes, there are concerns about 'secondary poisoning,' but that doesn't happen very often. In fact everyone out here uses poison and no one has ever had it happen. Secondary poisoning is where the rat eats the poison and then the pet dog eats the rat and gets poisoned. I haven't heard of it happening, so I called my vet. He hadn't ever had a case of this, but it was a possibility. He said an average dog would have to eat a pile of rats to get enough to cause a problem.  Basic chemistry, 40 pound dog, 10 ounce rat; big difference.

Caveat though! The rat poison Bromethalin is dangerous. The problem with it is that there is no test for its presence and no treatment for exposure. This nasty stuff is a neurotoxin and just flat dangerous. I never let this stuff anywhere near my place. The old fashion anti-coagulants are fine since there are treatments and tests that the vet can do.

Here's one type of enclosure they put out:


Notice the hole on the side? There's one just like it on the other side as well. I put these up against the house, barn, swimming pool fence, etc and the rodents run through it going from place to place. They eat the bait, and my problem is solved for that particular rodent. Here's an inside view:



This one has the trap inside instead of the bait.

Anyway, this method has worked well for me for years now. NO MORE. Terminix decided that they aren't going to use poison anymore and put out traps. I objected, but decided to give it a try.

Serious mistake.

What happens is that the rat goes into the enclosure to get the bait, the trap springs and kills the rat. Now in about an hour the rat swells up and starts to stink. Remember, the trap is inside a black enclosure and the heat accelerates decomposition quite a bit. The stink attracts the ravens which crowd around the enclosure trying to get to the dead rat for lunch. Of course my dog absolutely has to chase the giant crows away barking his head off the entire time. He gets tired and leaves then back come the ravens. This gets the attention of a wandering coyote who sees a chance to grab a big crow and it starts looking for a way into the yard. The dog notices the coyote and goes out to protect his yard and gets snapped at by the coyote. I've already lost one pet to coyotes so I have to go out and scare the coyote away. Usually I just scream at it and it takes off, but the last week they've gotten bolder so I shoot a .22 into the ground to get it to leave.

Don't think for minute that, if I got a clear shot, I wouldn't kill the coyote. I hate those animals. But I don't get a safe line on the coyotes with my dog and a bunch of ravens milling around. Yes, it sometimes results in a call from the neighbors, but they've gotten used to me over the years.

I finally get all the different animals dealt with and have to attend to the dead rat. I open the enclosure and take the rat out, get the water hose and rinse out the blood and maggots, rebait and reset the trap. The rat goes in the bin inside a plastic bag to contain the smell. The ants and such take care of the debris that I rinse out of the trap. It's quite a messy procedure and takes about thirty minutes or so not counting the shower afterwards.

Last week a turkey vulture was circling my house. I had been lazy and left a rat in the trap over night. The stupid vulture stayed around all day driving the rabbits and quail under the bushes and any place else they could hide. It went away finally and things returned to normal. All in all, the trap experiment was a bust. It's just too much aggravation and time.

Just how many rodents do I have around here? This is from a poultry site <link> and can be used as a really rough guide to the level of the problem:

The presence of rats and mice is not always obvious. However, one rule of thumb for the estimation of rat populations is as follows:
  1. Rat sign but no rats seen – 1 to 100.
  2. Occasional rat sightings at night – 100 to 500.
  3. Seen every night and occasionally by day – 500 to 1000.
  4. Many by night and day – up to 5000.
The frequency of catching rodents in traps may also be used to assess the level of infestation.
According to this I have between 500 - 1000 rats to deal with.

I called Terminix and they said they would have the local service manager contact me. About an hour later he did, but there was no satisfaction there. I'm extremely polite when I do this kind of thing. I try to 'nice' my way into getting what I want because yelling and anger just doesn't work. However, the service manager works by different rules.

"I will never allow poison to be used on your property." is a direct quote. Another one is, "Are you licensed to spray pesticide?"

My answer was simple, "No, that's what I hire you for." I didn't see any relationship between being licensed for commercial application of insecticide and rats, but when people get excited they tend to wander.

I thanked him for his time and told him I was going to call his corporate headquarters to hear directly that this is their new policy. I wished him a good day before hanging up. See how I do this; 'nice' them to death.

About six minutes later, when I got hold of a rep in corporate, they already had an email telling all about the conversation from his point of view. It didn't match mine, but this isn't a court of law, it's just a customer complaint. The rep at corporate told me that it was truly their policy to not use rodenticide any more, and they had moved to kill traps instead. I pointed out that I had essentially an infinite supply of rodents and that just wasn't going to work out. Their solution to my problems disposing of the rodents was to simply call the technician out and have him take care of it.

Think about that a minute. I have a dead rat in a trap and call them. They schedule an appointment for two days from now and I have to put up with all the above for two days before he comes out. It wouldn't be too long before the tech would be too 'busy' to get to me, and I'd have to wait longer, or take care of it myself like I've done for the last month. Keep in mind that there are literally hundreds of rodents. Not acceptable.

Also, an unexpected problem came up. The rats figured out how to break the trap. They simply go around the back and chew away the trip mechanism which releases the trap and they get the bait. I was actually surprised at this; the average rat intelligence must be going up in this area. Here's the trap:


And here's shot of the back of it:


Look closely, there's teeth marks on the trip mechanism where the rat disabled the trap. This trap is fodder for the garbage can unless I want to use it as a clip somewhere.

Currently, there is no solution. I'm waiting for a call from their regional manager to discuss it. We all know what will happen. I'll simply not pay the bill and let the service lapse while finding some other company to take care of spraying for insects. I think I'll just use their bait enclosures and buy my own poisons. That way I can use what I want and not adhere to guidelines that some company has put in place.

It's a shame though. I've used the same company in two states and different houses over almost thirty years and some manager somewhere institutes a policy to avoid a problem I simply don't have and haven't seen. Thus, creating a whole bunch of problems for customers like me. Typical short sighted management that doesn't allow for enough situations.

Bet I wind up saving money though.

Monday, August 8, 2016

Sensing Temperature and Doing Something With It

A few weeks ago my defrost controller in my freezer died <link>. One of the two relays had just quit conducting current. These things are sealed, and I didn't want to just clean the contacts and have it fail, so I modified the code a tiny bit and switched to the other relay. About two weeks later, the other relay died. One relay lasted a couple of years and the other one a couple of weeks. Both relays would click, but it appeared the current just couldn't get through it. Sigh.

I ordered another two relay board with the same relay as a replacement. I seems almost all of the relay boards for the Arduino use exactly the same relay. When I looked at the specs more carefully, they are rated for 10 amps, but only a fraction of a horsepower. I'm pushing them at the limit by running the compressor through them. But, ... I can get replacement relays for about twenty cents if I buy 10 or more of them, so maybe I'll just put in a relay socket and rotate the relays on some schedule. I could also come up with my own shield board and use a nice big quarter horsepower relay in there. I'll look into that later, but I needed the freezer running properly; I installed the new board with the two relays paralleled to (hopefully) double the life by cutting way down on the surge current each relay had to handle.

A few days later I had visitors with small kids. The kids were fun and enjoyed the desert and especially the pool when the afternoon was around 115F. However, the frequent trips to the freezer to get ice and little hands managed to leave the freezer door open a little bit and the evaporator on the bottom froze up.

I drug out the heat gun and melted the ice and the freezer took off and started working again, but this was the second time in less than a month that the freezer had given me trouble. Clearly, I needed to monitor it somehow.

I thought about using various methods to look for ice build up on the evaporator, or sense the airflow that should be moving through it, but they were too complex for a simple job like this, so I decided to just monitor the temperature in the freezer and set off an alarm of some kind (email, text message, big red light, siren) when the temp reached some level. I already have a temperature monitor that runs on batteries <link>, but I didn't really want to put one of those inside the freezer. Mostly because I'm not sure it would work at temps below zero Fahrenheit, and the moisture would probably kill it anyway. Since I already had an Arduino in the top of the freezer running the defroster, why not just attach a temperature sensor to it and get the reading that way?

Also, since the Arduino has an XBee attached to transmit when the defroster is running, I could transmit the temperature to my house controller and actually log it to my database server up in the attic.

It took a couple of hours to come up with the first version of the Arduino code and another couple of hours to figure a way to get the temperature sensor inside the freezer. I wound up actually drilling a hole in the freezer and feeding the sesnsor down inside where it could catch the airflow inside. I just can't praise these little temperature sensors enough. I used one of the sealed DS 18B20 sensors that have a stainless steel can over them:

These have a wire long enough to run where I needed it and are as easy to read as the regular 18B20. Nice solution with no calibration required.

When I got the Arduino part running, I went to my house controller and added code to catch the XBee message which now contained the temperature as well as the status of the defroster and started saving the data to my database. Then, I modified my status web page to display the freezer and set up some code to grab the reading out of the database and display it for a 24 hour period.

While I was doing that I realized that I was already grabbing the power usage of the freezer using an Iris SmartSwitch so I couldn't resist saving that data as well <link>. Now I could display both the power usage and temperature on the same graph. Heck, now I can see the health of the freezer at a glance and (maybe) catch a problem before it melted all my frozen food making a nasty mess that would take hours to clean up, and cost a bunch of money.

I was standing back, watching the blinking lights on the freezer and looked over at the fridge ... I really should do one of those for the fridge also, shouldn't I? I went back over to my box of parts and drug out enough pieces to build another device. This time I didn't need relays because I wouldn't actually be controlling anything, just monitoring stuff. I wound up with these pieces to build one of these:


The board in the upper left is an XBee shield that allows me to choose which port I hook the XBee serial lines to. I use the serial port for debugging and then use SoftwareSerial to enable a couple of digital pins to control the XBee. The XBee is lower left; the Arduino is center beside a 4.7K resistor. You HAVE to have the resistor for the sensor, far right, to work. Since I managed to grab a handfull of Arduinos for three bucks each some months ago, the whole collection, including the XBee cost less than $25. I powered the entire mess with a wall wart that I picked up for a buck or so and used one of my many USB cables for the power cord. Straight forward and simple project.

I also modified the code for the Arduino such that the name of the device is taken from the XBee and used in the message I send. That way, when I build one of these for the freezer I have out in the garage, there are no code changes needed at all, I just name the XBee to match the device I hook it to.

Then, I made the same kind of changes to my controller code and database as the freezer and I can monitor the fridge exactly the same way. I took the easy way out on the web display and just added a couple of tables to the html to display the current temp and a button so I could get to the graphs for each of them:


Since getting the highest and lowest values for a 24 hour period is a database query, I can display them. I added the status of the defroster to the freezer because it can get warm for a few minutes in there when it's running, and I didn't want to get excited when I saw a higher reading if that was what was causing it.

The indicator on the fridge is on because I haven't decided what to set the indicator to yet. I want a few days of data before I start setting up alarms to tell me something is wrong. I'll probably wind up setting it to 50F or so though.

When you click on the 'Chart' button for the freezer you get:


The wide jumps in power are the compressor turning on and off; the narrow spikes are the ice maker doing its thing; and the jumps that go off the chart are the defrost cycles running. I need to do a little tweaking on the chart to keep that from going off the top. Notice how the temperature rises slowly and then crashes down when the compressor turns on? There's a little interaction between the temperature changes and the frozen items in the freezer that causes some 'ballast' effects. It's all good and everything is fine.

Similarly, the fridge graph looks like this:


This looks cleaner because there's no ice maker or defrost cycle to clutter things up.

It's nice being able to actually see how the appliances are working and what level of power is actually being used. I still have to decide what values I'll set up for alarms for the devices and implement them in some fashion. I'll probably just send myself email telling me to take a look, because it takes a few hours for something bad to happen when the fridge or freezer acts up. The big thing is that now I can.

While I was doing this I noticed how easy it is to save my own data locally and then do something with it. For years now I've been using cloud providers like Xively, GroveStreams, etc. for this. I'm going to totally reverse that decision. As I've said a number of times, I hate depending on some provider out there somewhere to save my data for me. When the internet goes down, my data just drops on the floor and disappears; saving it locally for a year or so is not that bad and I have complete control over it. I won't have to rely on the provider not changing the interface, changing the storage price, changing the manner they deal with me, etc. Home automation and monitoring is a multi-year endeavor and internet companies work on a month by month basis. Not a good combination.

Don't get me wrong, I love the IOT (Internet Of Things) idea, but to me, it means being able to get to MY things over the internet without having to rely on someone else's company policy.

All the code for this is in github if you want to grab something.