Heating control for elderly/partially sighted people

Thread Starter

YorkshireDave

Joined Jun 12, 2016
59
Thanks people. It's so comforting to know others understand and are willing to help :)

Been googling feverishly, but there is so much to wade through. Everything I've looked at thus far looks promising but all I find is it doesnt ultimately do what one thinks!

Has anyone specific links to either products or code or both pls?
 

PhilTilson

Joined Nov 29, 2009
131
I appreciate that I may be stepping well away from the general line taken so far, but I think it is worth looking at the problem from a distance, rather than getting too close up.

The requirement is to enable an elderly person to control a thermostat when vision, possibly hearing and general comprehension are, shall we say, limited. You say he has no internet of any kind. Why not? A basic internet connection is now simple to organise and can be relatively inexpensive. Once this is available, a Nest, or similar, thermostat plus an Amazon Alexa would enable him to simply say "Alexa - turn the heat up two degrees", or "Alexa - switch off the central heating".

Once you have this facility available, you can then control all manner of other items within the house simply by asking Alexa to do the job for you. I am sure there must be other routine tasks that the person you are referring to has some difficulty with.

I appreciate that a) this costs money and b) it takes away the 'fun' of building something with a RasPi! But if your aim is truly to achieve the desired result - with possibly far-reaching other advantages - then I suggest this is worthy of consideration.
 

wayneh

Joined Sep 9, 2010
17,498
I suggest this is worthy of consideration.
I agree, but it depends on the person. A smart electric device must be plugged in, probably needs to be turned on, and may have settings that can go wrong. Some people will do fine with these potential failure modes but others will be completely stumped. The simplest things can become overwhelmingly difficult for the elderly. I recall my mom calling in a panic more than once that she needed a new TV. OK, will do, but first I want to see the problem. Turns out it had just been bumped off of channel 3 or whatever the cable hookup needed. Set it back to the right channel and it's good as new. I think another time it had come unplugged from the wall. My mother was a brilliant person, but not so much at 89.
 

Thread Starter

YorkshireDave

Joined Jun 12, 2016
59
Phil thank you very much for your contribution. I am afraid you will simply have to accept the fact that there are still millions of people who have no desire whatsoever to have - even for free - the internet.

My father in law - the person this is aimed at - is 95 and still living on his own in his own home - albeit with the support of his family. When he had his vision, you could put a column of figures in front of him and in seconds he'd have added them all and worked out the important business ratios. Todays tech is alien to him. Todays tech screams at him loneliness. Todays tech screams at him abandonment. All based on his experiences firstly at work and then on those he has interacted with.

As you lose your sight, because of the job it does at a subconscious level, your confidence and ability to learn is deeply affected. Many things he has been used to are no longer doable as vision is used as a subconscious aide memoir.

I'll be honest, I'm not even convinced he could 'master' the simplicity of three buttons, however, what I cannot do, and refuse to do, is sit and do nothing. So I pursue this avenue on the basis that it may well be too late for Ken, but it might, just might help someone else's loved ones.

Upshot. I'd still like some help to take it forward if you're willing ;)
 

wayneh

Joined Sep 9, 2010
17,498
I don't usually recommend it here but I don't see how you could avoid this being a microprocessor project. Have you told us if you have experience with electronics and microprocessors? It will be daunting at first but we've seen worse "first projects" around here. If you'd like to learn Arduino (a popular micro example) for possible future projects anyway, then it may be worth digging into it now. If you have no previous microprocessor experience, then I recommend Arduino just because there is so much online help available. There's almost certainly a handful of thermostat projects already well documented. And display projects and voice projects and so on. You'll need to borrow the work of others to avoid reinventing too many wheels.
 

crutschow

Joined Mar 14, 2008
34,459
If you'd like to learn Arduino (a popular micro example) for possible future projects anyway, then it may be worth digging into it now. If you have no previous microprocessor experience, then I recommend Arduino just because there is so much online help available.
Wouldn't a Raspberry PI be a more complete device to start off with, at a reasonably low cost?
 

ebeowulf17

Joined Aug 12, 2014
3,307
Wouldn't a Raspberry PI be a more complete device to start off with, at a reasonably low cost?
Depends what you need. No ADC, no real-time capabilities, steeper learning curve. For most of my project ideas Arduino MCUs have made a lot more sense... on the other hand, if you need mass storage capability, computer-style graphics, or internet connectivity, then Raspberry Pi has a lot to offer.
 

wayneh

Joined Sep 9, 2010
17,498
Wouldn't a Raspberry PI be a more complete device to start off with, at a reasonably low cost?
I'm not qualified to answer, except that I've seen people do Arduino projects that I didn't think they were capable of. I don't know anyone that's done a R-pi project.

It's definitely worth some thought and study, and introspection about your future projects, before you set out to learn one or the other.
 

Thread Starter

YorkshireDave

Joined Jun 12, 2016
59
I don't usually recommend it here but I don't see how you could avoid this being a microprocessor project. Have you told us if you have experience with electronics and microprocessors? It will be daunting at first but we've seen worse "first projects" around here. If you'd like to learn Arduino (a popular micro example) for possible future projects anyway, then it may be worth digging into it now. If you have no previous microprocessor experience, then I recommend Arduino just because there is so much online help available. There's almost certainly a handful of thermostat projects already well documented. And display projects and voice projects and so on. You'll need to borrow the work of others to avoid reinventing too many wheels.
I have lurking about somewhere both an early Pi & an Arduino Mega. I've never actually used either tho. They were bought as my 10 year old showed (for about three weeks ;-( ) some interest...
I quite agree with you. It simply seems the fastest route at this juncture...
My dilemma, as mentioned, is that I've been through lots of sites and examples which, on the surface, seem to do what I need however each has thus far turned into a blind alley...

I'll pursue those suggested above and report back...
 

Thread Starter

YorkshireDave

Joined Jun 12, 2016
59
Fortunately I do not need to interface with anything. All I have to have to be able to control his boiler is an output to control a relay. Nothing else.

This is how, knowing no better, I see things.
Inputs:
- Temp sensor (prob bead type - possibly directly into an analogue input?)
- Push button 1
- Push button 2
- Push button 3 (all into digital inputs so they can be debounced and counted etc)
Outputs:
- Three outputs to control LEDs in push switches
- Relay output (for boiler)
- Speaker output
 

wayneh

Joined Sep 9, 2010
17,498
My dilemma, as mentioned, is that I've been through lots of sites and examples which, on the surface, seem to do what I need however each has thus far turned into a blind alley...
Finding the complete solution is unlikely and I think you'll have to cobble together the separate pieces. But working pieces will hopefully save a lot of time, as long as the code makes sense and is something you can adapt.
 

ebeowulf17

Joined Aug 12, 2014
3,307
I have lurking about somewhere both an early Pi & an Arduino Mega. I've never actually used either tho. They were bought as my 10 year old showed (for about three weeks ;-( ) some interest...
I quite agree with you. It simply seems the fastest route at this juncture...
My dilemma, as mentioned, is that I've been through lots of sites and examples which, on the surface, seem to do what I need however each has thus far turned into a blind alley...

I'll pursue those suggested above and report back...
As I said before, I think the key to success is attacking manageable, small projects until you get the basics figured out. I'm inclined to recommend Arduino over Raspberry Pi unless you have a specific reason to choose otherwise, simply because I think it's easier to learn. Others may disagree.

Regardless of system choice, don't scour the internet for a complete solution. It's not gonna happen.

Find a piece of code that blinks an LED (the ubiquitous "blink" program) and try that first. That will establish that you've figured out how to load a program into the controller, and give you a chance to wire an LED up, being sure to include current limiting resistor and observing LED polarity. Boom, you just mastered several skills.

Next find a piece of code that reads a button, and try wiring up a button. Test that code, then maybe take your first attempt at merging code snippets. Add your button code to the blink code and make a button press change the blinking behavior. Now you've got buttons down.

Find a circuit example that shows the necessary output stage that goes between an mcu and a relay (including flyback diode, etc.) and try building and testing that, or simply buy one of the pre-made relay packages designed specifically for Arduino and/or Raspberry Pi.

You're not going to get audio directly out of an Arduino, but there are breakout boards from places like Adafruit and SparkFun that make it incredibly easy. I don't remember if Raspberry Pi has native audio capabilities. If so, maybe that's a reason to consider going that way. Regardless, try the basic demo program first and establish that you're successfully getting audio out. Only after that is done should you try to combine it with your other code.

I hope you're getting the idea by now. By the time you've wired, programmed, and tested all these subsystems, you'll be reasonably comfortable with the operating environment and code structure. At this point, creating code for the parts that are truly custom (incrementing temperature, requiring long presses for certain actions, but not for others, etc.) will be easy.

At some point before you try to put it all together (or maybe right now, before you do anything else,) draw a flowchart of intended behavior. Having a clear roadmap for all possible machine states and expected behaviors makes it a lot easier to get your code right.

If you need specific help along the way, drop in and ask, but don't expect anyone to give you this whole thing, wrapped up in a tidy package, ready to go.

You've got some work ahead of you.

Just take it step by step.
 
Fortunately I do not need to interface with anything. All I have to have to be able to control his boiler is an output to control a relay. Nothing else.
Unfortunately, when i hear boiler, i think of system that is part domestic hot water and part heating with zone valves. Although, i guess it used to be hand valves to regulate the relative temperatures.

"thermostats" are a bit more magical now and they were even magical in the past. They usually turn off earlier so that the thermal mass of the residence keeps heating long after the system is turned off.

You can;t "play" with the thermostat either, I think I've seen systems that control the temperature of the room with the remote,

You could have the one room type system like my grandma did. It was later replaced with something more modern.

I had an aunt that heated her house with coal.
 

Thread Starter

YorkshireDave

Joined Jun 12, 2016
59
What are your thoughts peeps? Please excuse my formatting, I've no idea how to do it properly!

Elderly friendly temp control

Press any button and it acknowledges the person e.g. “Hello Ken” (Note 1)

The current temp is then read out. “It’s currently 21.5 degrees.” The stat then continues, “Press the upper button to make it warmer and the lower button to make it cooler. If you are going out, or off to bed, press both buttons together until the beep sounds to make it cooler for that time.”

When both buttons then pressed together. “The setting for the next X hours is XX degrees”

When upper OR lower pressed, “Your setting is now…x”

No input for 50 secs, ‘Going back to sleep…”

Notes:
1 – Reads temp every 1 sec.
Hysterisis. Plus/minus 0.5 degree to give a 1 degree band. So, when set at 21.0 the boiler will not fire until the temp drops to 20.5 but then it stays firing until 21.5 degrees is reached.
‘Ken’ would need to be a programmed name.

2 - Basically, sits there:
a) polling buttons in ‘asleep mode’ every 0.5 sec till it picks up an input. BLUE LED solid on to show ‘listening’
b) runs the temp and control loop every second. Part of running the control loop could be the red LED on the button being solid on when the boiler is firing. Like solid blue to indicate listening this changes to hard alternate flashes when thing 'woken'.

2 – Once ‘woken’ button presses are polled much more frequently polled (every 0.1 sec ?) so no press is missed. If more than 2 secs sensed tween presses then offer, “Can you get a move on you old fool, you’re confusing me!!” Just kidding :eek: Some form of prompt.

When higher or lower button is pressed, then start telling new set point. However, if another press follows before it’s finished its announcement) then abandon the previous statement and move to new one to keep up & not confuse…

If both pressed before two seconds is up, ignore previous ‘adjustments’ and announce, “The temperature is now set at XX for XX hours.” This also sets a flag called ‘setback’ which then looks up the time and temperature setting assigned to it.

If the setback flag is still set when it senses a single press to wake up, it could say, “Currently xx degrees. Setting temperatures back to normal.”

The setback temp, and the number of hours it is setback for, must be pre-programmable by users support.

Does this make sense ? Is it doable ? Any suggestions to improve ? Where do I start ?:(
 

philba

Joined Aug 17, 2017
959
Not sure why you make a user visible distinction of sleep mode. Trying to save power? The users shouldn't need to understand that. To them, the machine should be viewed as always immediately available. No need to complicate the mental model people use..

Buttons are more complex than you might think. There is debouncing that needs to happen. When you close any switch, there is a series of spikes while the physical contacts of the switch settle down. Polling can solve that but too long a period makes the device act sluggish. Even a 100 mS delay can be noticeable. If you put low pass filters on the buttons, you can use them for interrupts and then the whole issue of polling goes away. Also, think about button down and button up as two separate events, You may only use down but there is the question of repeat when held down. Button up stops the repeat in that case.

It's not clear to me how the "hurry up" prompt would be received. No matter how nice the prompt is, it is still eNagging and that bugs the crap out of me. Not sure how your nonagenarian will like it.

On your temperature based control. You'll need to do a good job of filtering out noise on the temp sensor. 1 degree hysteresis may not be effective with a noisy sensor. Lots of ways to do this including software based filters - look up FIR and IIR filtering.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Not sure why you make a user visible distinction of sleep mode. Trying to save power? The users shouldn't need to understand that. To them, the machine should be viewed as always immediately available. No need to complicate the mental model people use..

Buttons are more complex than you might think. There is debouncing that needs to happen. When you close any switch, there is a series of spikes while the physical contacts of the switch settle down. Polling can solve that but too long a period makes the device act sluggish. Even a 100 mS delay can be noticeable. If you put low pass filters on the buttons, you can use them for interrupts and then the whole issue of polling goes away. Also, think about button down and button up as two separate events, You may only use down but there is the question of repeat when held down. Button up stops the repeat in that case.

It's not clear to me how the "hurry up" prompt would be received. No matter how nice the prompt is, it is still eNagging and that bugs the crap out of me. Not sure how your nonagenarian will like it.

On your temperature based control. You'll need to do a good job of filtering out noise on the temp sensor. 1 degree hysteresis may not be effective with a noisy sensor. Lots of ways to do this including software based filters - look up FIR and IIR filtering.
Sleep mode: I agree. Not sure any sleep mode is necessary at all. If so, it should be transparent to user.

Buttons: You're right that debouncing needs to be handled, but somehow your paragraph makes it sound imposing, menacing. It's not that serious. There are numerous options. But it does definitely need to be handled. I think it all depends on comfort level with code. Personally I would write my own debouncing code (not a simple polling delay with its latency issues) in order to use fewer physical components. But for someone new to coding, that might be a hassle, so an RC filter sounds good too. On the other hand, there are lots of button demo sketches for Arduino, and I'm almost positive several of them have debouncing code that you can just copy and paste. Maybe I'll try to dig up some links or share some code I have working for that.

I agree that a hurry up prompt is probably a bad idea.

Temperature sensor filtering is a very good idea. Even if the sensor and electronics are perfect, there are drafts and such making the temperature wiggle a lot. For a residential thermostat you want to average that out over a long-ish time scale. I'll try to dig up a sample snippet of code for a simple IIR filter that should meet these needs.
 

philba

Joined Aug 17, 2017
959
Buttons: You're right that debouncing needs to be handled, but somehow your paragraph makes it sound imposing, menacing. It's not that serious. There are numerous options. But it does definitely need to be handled. I think it all depends on comfort level with code. Personally I would write my own debouncing code (not a simple polling delay with its latency issues) in order to use fewer physical components. But for someone new to coding, that might be a hassle, so an RC filter sounds good too. On the other hand, there are lots of button demo sketches for Arduino, and I'm almost positive several of them have debouncing code that you can just copy and paste. Maybe I'll try to dig up some links or share some code I have working for that.
Menacing. laughing and crying at that one. But seriously, it's an area that beginners completely misunderstand. My point was to make it clear that it needs close attention.

The reason for a low pass filter is so it makes interrupts easier. You can get a large number of interrupts off a single switch closure which can play havoc with your logic. Basically, a resistor and capacitor per button is all that's needed. Beginners often just use polling in their main loop and then discover that it makes it hard(er) to be responsive to button presses. You can do a form polling off of a timer interrupt and use debouncing in that but it's still a lot more than just reading the state of an input bit.
 
Top