Cat palace with an automatic heat lamp

[Herpity] was getting tired of his cat manipulating him into turning on a lamp above her bed every time she wanted a nap. She likes the warmth put off by the light bulb but he knew he could do better than that so he built a bed which includes an automatic heat lamp. To help introduce her to the new enclosure he set it on the chair where she normally naps.

The bed has two parts, the lower chamber acts as the sleeping area. There is a false bottom underneath the blanket which acts a platform for the weight sensors which detect when the cat is ready for a nap. A PIC microcontroller monitors two sensors and switches on mains voltage to a heat lamp once the pre-calibrated weight threshold has been reached. The upper part of the enclosure holds all of the electronic components and makes room for the recessed light housing. [Herpity] included an exhaust fan for the upper chamber but it turns out a grating is all he needs to keep the temperature at an acceptable level.

Lesson 2: Wherein we commence to prepare for the Feast of the Cat.
Section A: A guide to proper roasting.
Section B: A guide to getting a new house after burning down the old one.
Section C: Maybe we should have used a thermal limit sensor, a look back

Nice build. However, I would never rely solely upon a microprocessor to control/prevent something from getting too hot–especially a semi-enclosed heat lamp. All it takes is a code bug, a line transient, or even proximity to some statically-charged cat fur to glitch a processor, and your closed-loop control may go away.

A more robust solution would involve the inclusion of a thermal fuse (or even a klixon-type overtemp switch), bonded to the light fixture, to assure failsafe removal of AC power to the lamp in the event of malfunction.

These devices are inexpensive, readily available, and standard components in any commercial appliance that is expected to generate heat.

I disagree. First, proper testing and use of a watchdog timer will deal with most glitches.

Second, read the article (or even HAD’s summary) carefully. The fan and other closed-loop temperature control features were found to be completely unnecessary, as even with the lamp running continuously, it wasn’t able to get hot enough to be uncomfortable to the cat; much less pose a fire risk. As a result, the MCU really does nothing at all, nor does it need to. You’d get the same result omitting the MCU completely, and just wiring the lamp directly to a pressure switch.

How many times have you PERSONALLY seen an MCU glitch in a way that can’t be caught by a watchdog timer? (For me, exactly zero; including both my own projects, and the dozens of MCUs in consumer products and cars.)

Now how many times have you seen a thermal switch fail? (In dryers I’ve owned alone, about a half dozen, in both on and off states. Just two days ago my coffeemaker died due to a failed thermal switch.)

It’s easy to claim anything is a serious safety issue, if you either can’t understand, or deliberately ignore, the actual probability of it happening.

And I did mention this project won’t catch fire, even if stuck continuously on. Not sure what’s so terribly hard to understand about that.

A watchdog timer does not address failure of an I/O bit, the failure of a driver transistor (which often fail-to-short) or the failure of a relay (contacts can stick when eroded.) I’ve seen every one of these failures in the field.

A thermal fuse is like a seat belt. If you want to argue that you don’t need a seat belt because cars have other safety features, or because you’ve never had a wreck in your life, then fine. But the belt is the last line of defense when, through unforeseen circumstances, the other safety measure fail to provide adequate protection.

As to the criticism that adding a fuse amounts to “over design,” I’d answer this way. You could eliminate the CPU, eliminate the fan, and eliminate the force sensors (replace them with spring loaded microswitch.) You could strip the whole thing down, if you want, until nothing remains but a wooden box with a lamp. I’d STILL install a thermal fuse or klixon.

Pi, now those are some good examples of potential failures, which aren’t software or watchdog correctable.

But still, in this particular case, I’d say thermal protection is unnecessary; because I cannot see any scenario by which it can overheat. Yes, it sounds scary, being a 50W heat source in a semi-enclosed area. But several light fixtures around my house, if I were still using the incandescents for which they were designed, are nearly 120W heat sources in smaller, fully enclosed areas (thanks to the glass cover). Even they are not significant fire risks, nor do they have thermal protection; despite safety regulations.

It appears @Chris C. is God, all of his projects perform flawlessly, with nary a logic bug, brownout or other oddities happening.

I find it odd you need a watchdog at all given your talents.

You won’t get a product through safety testing where the only safety is provided by the uP, but as you’re such a successful designer you already know that (don’t you)?

If your appliances failed due to dead thermal switches, then I’d say they’ve done their job (never mind everyone is talking about the resetable ones, not the fuses).

As I said you can reduce this to a switch & the lamp, the thermal switch probably isn’t needed but erring of the side of safety is a good thing. A cut-out timer might not be a bad idea, and that doesn’t need a uP either.

PI, you’re going on about all these doomsday scenarios with flipped bits and stuck relays but are you considering what the actual effect of any of these (extremely unlikely) software failures would be? It’s “the lamp stays on”. A fifty-watt lamp, using less power than most incandescent bulbs, and as the creator notes it doesn’t even need active cooling. Even in the worst possible software failure mode, the bulb isn’t any more likely to melt down or blow up or start a fire than a plain old lamp that you leave on by accident. And if the cat gets too hot, it can always leave.

Well the lamp housing I bought from home depot has a built in thermal protection. I ma not sure what the rating for it is, but since the housing is rated up to 75W bulbs I figured that the 50W was not pushing any limits. While that is there to stop a fire hazard, the other temp sensor are to stop burn the chips and to make sure I don’t hurt my cat.

Long before the days of Arduino, PIC was the hobbyist microcontroller of choice. Some people still like them. I did all of my early hobby projects using PICs. These days I tend towards atmel because of the large community support, but back then it was the opposite.

“[Herpity] was getting tired of his cat manipulating him into turning on a lamp above her bed every time she wanted a nap.”

Right, so she manipulated him into building her a custom heated napping area. [Herpity] may want to re-evaluate his relationship with the cat or, as Zack said above, one day he may be met with a rather unfortunate fatal accident involving a steep staircase and a satisfied-looking cat with a curious habit of walking in between people’s legs.

Cats have a way of getting what they want. Mine showed this odd behavior at the backdoor. She’d sit there, waiting for me to open it so she could go out. I barely opened and closed the door again when she’d walk back, sit there by the door and wait for me to open it to let her in again. This would go on a few times in a row until my penny dropped: the cat wanted the door to stay open and have free passage.

They make low wattage cat cushions that can stay on all the time, set one on the microswitch platform if you want to save even more power. 50 watts is too much. An ill cat may be unable to get up and overheat and die. The lowest grade bulbs are going or gone, those heat lamps are going to get pricy.
Cat looks like a round peg in a square hole not quite the right size, feeties stick out. Those cat cushions are oval shaped with sides just the right height.