Author Topic: Timer alarm  (Read 3493 times)

0 Members and 1 Guest are viewing this topic.

Offline darinsquaredTopic starter

  • Contributor
  • Posts: 39
  • Country: ca
Timer alarm
« on: November 30, 2019, 02:40:28 pm »
I am trying to devise a way to set up an alarm that is based on no motion. Basically the opposite of a motion sensor light. I know how to build this with a PIR sensor but I want the time before the alarm sounds longer than a typical PIR sensor allows. I want 4-5 minutes of no motion to trigger an alarm. I would think using a capacitor and 555 timer in some form.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Timer alarm
« Reply #1 on: November 30, 2019, 03:43:01 pm »
I am trying to devise a way to set up an alarm that is based on no motion. Basically the opposite of a motion sensor light. I know how to build this with a PIR sensor but I want the time before the alarm sounds longer than a typical PIR sensor allows. I want 4-5 minutes of no motion to trigger an alarm. I would think using a capacitor and 555 timer in some form.

Before digging into the specific implementation, is this the concept you are trying to achieve? 
Every time the sensor detects motion, it resets the timer.  Only when the sensor does not generate an output for 5 minutes, does the timer output to the buzzer.  The buzzer needs to have its own timer so that when activated, it stays on for a desired length of time.

In terms of implementation, this is trivial with an arduino.
 

Offline darinsquaredTopic starter

  • Contributor
  • Posts: 39
  • Country: ca
Re: Timer alarm
« Reply #2 on: November 30, 2019, 04:10:07 pm »

Before digging into the specific implementation, is this the concept you are trying to achieve? 
Every time the sensor detects motion, it resets the timer.  Only when the sensor does not generate an output for 5 minutes, does the timer output to the buzzer.  The buzzer needs to have its own timer so that when activated, it stays on for a desired length of time.

In terms of implementation, this is trivial with an arduino.

Basically correct.  I have  aging parents and I want to set an alarm in the kitchen so that when they are cooking they can physically start the alarm when they are cooking. When they leave the kitchen and no motion is detected for 5+ minutes an alarm will sound to remind them some thing is on the stove.
I prefer straight electronics over Arduino. Ideally there would be a relay on the power supply to the stove that would cut out when there is no motion for extended period.
 

Offline jhpadjustable

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: us
  • Salt 'n' pepper beard
Re: Timer alarm
« Reply #3 on: November 30, 2019, 04:14:36 pm »
It's also nearly trivial with a 555. You need only provide your own transistor for retriggering. Bringing the "H" input low brings the output high and resets the timer. You'll also need to bring your own inverter if your PIR module output goes high when presence is detected.


"There are more things in heaven and earth, Arduino, than are dreamt of in your philosophy."
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Timer alarm
« Reply #4 on: November 30, 2019, 04:30:27 pm »

Before digging into the specific implementation, is this the concept you are trying to achieve? 
Every time the sensor detects motion, it resets the timer.  Only when the sensor does not generate an output for 5 minutes, does the timer output to the buzzer.  The buzzer needs to have its own timer so that when activated, it stays on for a desired length of time.

In terms of implementation, this is trivial with an arduino.

Basically correct.  I have  aging parents and I want to set an alarm in the kitchen so that when they are cooking they can physically start the alarm when they are cooking. When they leave the kitchen and no motion is detected for 5+ minutes an alarm will sound to remind them some thing is on the stove.
I prefer straight electronics over Arduino. Ideally there would be a relay on the power supply to the stove that would cut out when there is no motion for extended period.

LOL, this is a very good idea.  I am an aging parent (Grrr!!!!!) and more than a few times I have left something cooking on the stove.  Right now, I have a timer next to the burners...when I start something, I set the timer to warn me.  It works, but I like your idea as well.  jhpadjustable posted a simple solution.  Cascade with another 555 to keep the timer running long enough for your parents to hear it.

You are a fine son!
 

Offline JuanGg

  • Regular Contributor
  • *
  • Posts: 193
  • Country: es
    • My personal blog
Re: Timer alarm
« Reply #5 on: November 30, 2019, 04:31:07 pm »
You can even do it with a comparator and maybe with a couple transistors, although in this case it may not be practical given the 5 min interval. You'd need quite a bit of capacitance to get the desired time constant, and still have a small enough resistor to give the transistor the necessary base current to activate the relay.
    Juan

Offline darinsquaredTopic starter

  • Contributor
  • Posts: 39
  • Country: ca
Re: Timer alarm
« Reply #6 on: December 01, 2019, 02:50:10 pm »
It's also nearly trivial with a 555. You need only provide your own transistor for retriggering. Bringing the "H" input low brings the output high and resets the timer. You'll also need to bring your own inverter if your PIR module output goes high when presence is detected.



Pardon my ignorance but I do not comprehend the use of an inverter.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Timer alarm
« Reply #7 on: December 01, 2019, 03:18:21 pm »
It's also nearly trivial with a 555. You need only provide your own transistor for retriggering. Bringing the "H" input low brings the output high and resets the timer. You'll also need to bring your own inverter if your PIR module output goes high when presence is detected.



Pardon my ignorance but I do not comprehend the use of an inverter.

If your PIR detector pulses "high" on detection, you will have to invert that signal so that it pulses "low" on detection--thus an inversion, or inverter.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: Timer alarm
« Reply #8 on: December 01, 2019, 07:46:30 pm »
Yes, a comparator or 555 will work but 5 minutes is a little long, so how about the good old 4060? Replace the switch with a diode, connected to the PIR.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Timer alarm
« Reply #9 on: December 01, 2019, 08:11:39 pm »
All of these ideas are fine, by as I said in my original response, an Arduino solution is incredibly simple.
 

Online golden_labels

  • Super Contributor
  • ***
  • Posts: 1474
  • Country: pl
Re: Timer alarm
« Reply #10 on: December 01, 2019, 08:35:00 pm »
darinsquared:
After building the primary version according to your initial idea, which you should do first before perfecting the device for various reasons (below), consider extending it by requiring some additional action after 15–20 minutes. Within a 5 minute period a PIR sensor can be triggered even without anyone around. In particular in kitchen environment, with both steam and radiation heating surfaces all over the place.

As for the reasons to first build the potentially worse solution: trying to make a perfect thing usually ends in not producing it at all. Fight the urge, uncontrolled perfectionism is really a horribly thing :). Second: it is unlikely that everything will work ideally upon the first run. It is easier to debug and tweak a simpler device, and it makes little sense to build extensions upon a platform that is not stable yet.

Wimberleytech:
As a software developer, I prefer to approach problems from the digital end of things too and sometimes I think that analog guys are way too much attached to their continuous domain solutions. But in this case I am forced to agree with them: it has a lower risk of failure, it is much much simpler, it is easier to debug/repair. On top of that the solution using specifically Arduino is pointlessly expensive: Arduino is good as an educational platform, but it is not a great choice for practical purposes if someone has knowledge of electronics and can handle a soldering iron.
« Last Edit: December 01, 2019, 08:36:31 pm by golden_labels »
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Timer alarm
« Reply #11 on: December 01, 2019, 08:59:56 pm »


Wimberleytech:
As a software developer, I prefer to approach problems from the digital end of things too and sometimes I think that analog guys are way too much attached to their continuous domain solutions. But in this case I am forced to agree with them: it has a lower risk of failure, it is much much simpler, it is easier to debug/repair. On top of that the solution using specifically Arduino is pointlessly expensive: Arduino is good as an educational platform, but it is not a great choice for practical purposes if someone has knowledge of electronics and can handle a soldering iron.

I respectfully disagree.
1) I am an analog guy. 
2) As I posted, the arduino solution requires almost no effort. (I have not done the exercise myself to check for gotchas, but I will).
3) Arduinos are cheap.  Depending on where you are...under $8.  Yes, a 555 and a couple of caps and resistors are cheaper--I grant you that.
4) Arduinos are reliable.  Can you site a reference that supports this reliability concern? 
5) I have used Arduinos to make a reliable "bucket-level-detector" for my tractor.  Works fine in a relatively harsh environment.
6) Yes, it is fun to solder up a 555 dip package on a perf board and hang some resistors and caps around it with wires here and there to connect to the PIR and buzzer.  My lab is full of that stuff.  Well...maybe put it on a pcb, no?  OK, I do that too...fab my own pcbs when I want to stain my hands with ferric chloride, or slap one together and send it to expresspcb (that aint cheap).

I still stand by my position that an arduino solution would be nice.

Please rebut my points as I am happy to be proven wrong.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Timer alarm
« Reply #12 on: December 01, 2019, 09:25:40 pm »
I would probably use an 8 pin microcontroller, I've used the attiny series on a number of occasions. There's a tiny85 Arduino core but a project like this is trivial to do in any language, even raw assembly wouldn't be too hard.

Nothing wrong with the analog approach either though, or an oscillator driving a counter, this is one of those trivial projects where all kinds of different methods will get the job done.

Of course it also depends on the aging parents remembering to activate the device when they start cooking, so it might ultimately be more effective to have a functional smoke alarm in the kitchen.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Timer alarm
« Reply #13 on: December 01, 2019, 10:04:07 pm »
Quote


2) ... (I have not done the exercise myself to check for gotchas, but I will).


I built it.  It works as expected.  Simple, as expected.

Once you are in "code" land you can address issues (such as the one pointed out by james_s) with clever algorithms and perhaps other sensory inputs.
 

Online golden_labels

  • Super Contributor
  • ***
  • Posts: 1474
  • Country: pl
Re: Timer alarm
« Reply #14 on: December 01, 2019, 10:05:06 pm »
Please rebut my points as I am happy to be proven wrong.
I would, if they would even refer to what I’ve said. :D

1) I am an analog guy.
I can’t disprove that.

2) As I posted, the arduino solution requires almost no effort. (I have not done the exercise myself to check for gotchas, but I will).
Except writing and testing software. I stress the second part.

3) Arduinos are cheap.  Depending on where you are...under $8.  Yes, a 555 and a couple of caps and resistors are cheaper--I grant you that.
By mentioning Arduino I meant it in comparison not only to the analog solution, but to digital alternatives. They’re much more expensive than even the corresponding microcontrollers themselves — not to mention anything needed for that task. Even with in the software domain this can be done at under 15% of Arduino’s cost.

4) Arduinos are reliable.  Can you site a reference that supports this reliability concern?
I have never said Arduinos are not reliable. I claim that the software solution is less reliable. That arises from orders of magnitude higher complexity of both the underlying technology and the design, harder testing, less previous testing and higher chance of making a mistake in the first place.(1)

5) I have used Arduinos to make a reliable "bucket-level-detector" for my tractor.  Works fine in a relatively harsh environment.
I was never talking about the environment. And if you did, I am happy you made something working. But your success doesn’t prove in any way that there are no better solutions or that someone else may repeat that with similar outcome.

6) Yes, it is fun to solder up a 555 dip package on a perf board and hang some resistors and caps around it with wires here and there to connect to the PIR and buzzer.  My lab is full of that stuff.  Well...maybe put it on a pcb, no?  OK, I do that too...fab my own pcbs when I want to stain my hands with ferric chloride, or slap one together and send it to expresspcb (that aint cheap).
We do not know what the author has. We are on the electronics forum, so — unless clearly stated otherwise — it is a sane assumption that if someone wants to build an electronic solution, they will have to build a circuit on a PCB. Isn’t it? :)

Consider it a kind of a joke (I don’t suggest doing that), but with the 555 circuit presented above, you can go without a PCB: dead bug potted in epoxy or lowe temperature hot glue. ;)

____
(1) The easiness of turning an idea into software and its seemingly shallow learning curve misleads many people into false feel of comfort, despite their software is far from being reliable.
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Timer alarm
« Reply #15 on: December 01, 2019, 10:22:54 pm »
golden_labels:

Fine.  I did build it inside of 20 minutes using stock code. 

Yes, deadbug and hot-glue can be made to work...ugh.

As for me being an analog guy...true...there was no way for you to rebut that, sorry for suggesting.  But FYI, I co-authored an analog book 30 years ago that is still in print and in 3rd edition in both english and chinese...so...yeah I am an analog guy (OLD analog guy to be accurate)
 

Offline darinsquaredTopic starter

  • Contributor
  • Posts: 39
  • Country: ca
Re: Timer alarm
« Reply #16 on: December 01, 2019, 11:06:26 pm »
All of these ideas are fine, by as I said in my original response, an Arduino solution is incredibly simple.

That is a great idea for people without an irrational fear of programing.  But I should challenge myself.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Timer alarm
« Reply #17 on: December 01, 2019, 11:14:09 pm »
All of these ideas are fine, by as I said in my original response, an Arduino solution is incredibly simple.

That is a great idea for people without an irrational fear of programing.  But I should challenge myself.

My first program was in Fortran 77 on an IBM/Amdahl 360 using punch cards.  For years I had an irrational fear of the damn things.  No more!
 

Online golden_labels

  • Super Contributor
  • ***
  • Posts: 1474
  • Country: pl
Re: Timer alarm
« Reply #18 on: December 01, 2019, 11:40:07 pm »
Fine.  I did build it inside of 20 minutes using stock code.
How is your WDT handler signalling failure and, if it does that in a fail-safe manner by beeping, how do you solve the possibility that it may occur in a middle of an already running beep?

Don’t bother answering the above question. Before one does even fully understand the question, the 555 circuit is already shown to be right.

You got your point: possibly you have proven that it is possible to implement that. I have no slightest idea why you wanted to prove that, as no one ever said otherwise.

I do not have an irrational fear of programming. I have a rational respect for the risk involved and realization that I am merely a human.


« Last Edit: December 01, 2019, 11:42:19 pm by golden_labels »
People imagine AI as T1000. What we got so far is glorified T9.
 

Offline jhpadjustable

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: us
  • Salt 'n' pepper beard
Re: Timer alarm
« Reply #19 on: December 01, 2019, 11:46:31 pm »
This being a safety application, I 100% understand if someone doesn't want to bother about with programming, let alone gather all the tooling for it on top of the interfacing and so on. There are times to stretch and there are times to K.I.S.S. and get it done in the way you're surest-footed.
"There are more things in heaven and earth, Arduino, than are dreamt of in your philosophy."
 
The following users thanked this post: darinsquared

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Timer alarm
« Reply #20 on: December 02, 2019, 12:34:50 am »
I'm not sure I'd worry too much about it being a safety application, currently there is nothing, having anything that reminds them sometimes even if it is not 100% effective is better than nothing.
 

Offline jhpadjustable

  • Frequent Contributor
  • **
  • Posts: 295
  • Country: us
  • Salt 'n' pepper beard
Re: Timer alarm
« Reply #21 on: December 02, 2019, 08:35:21 am »
Oh, right, my mistake. I had taken the ideal, "a relay on the power supply to the stove that would cut out when there is no motion for extended period," for the minimum. So much for not stretching! :)
"There are more things in heaven and earth, Arduino, than are dreamt of in your philosophy."
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20363
  • Country: gb
  • 0999
Re: Timer alarm
« Reply #22 on: December 02, 2019, 09:45:18 pm »
I'm also an analogue, more than software person. I'm not scared of code. It just doesn't interest me so much.

Yes, all of the options discussed above will work. If I had to pick one, it would be a simple 6 or 8 pin microcontroller, probably programmed in good old assembler.

I don't see how a 555 timer is any more reliable than a simple microcontroller. The 555 timer has its quirks. It's prone to false triggering and resetting, due to glitches in the supply voltage which can be caused when the output pin changes state, which results in huge current spikes. I know software can be prone to bugs, but that tends to be the case for complex systems, running on a deep software stack, containing many potentially buggy libraries and drivers. Such a simple program, running on a basic microcontroller, should be fairly reliable, given sufficient debugging. It will have less components, than an analogue design, therefore fewer parts to go wrong. We also mustn't forget that the timer is only a small part of the system. There are other parts such as the: power supply, PIR sensor, relay and alarm which have the potential to fail.
 

Offline Wimberleytech

  • Super Contributor
  • ***
  • Posts: 1134
  • Country: us
Re: Timer alarm
« Reply #23 on: December 03, 2019, 04:26:41 pm »
OK golden_labels, you have bested me.  I declare you the winner.
 

Online golden_labels

  • Super Contributor
  • ***
  • Posts: 1474
  • Country: pl
Re: Timer alarm
« Reply #24 on: December 04, 2019, 04:22:04 am »
It is sad that people get so deeply emotionally involved and hurt as a reaction to a simple event of someone else noticing possible problems with their solution — not even claiming that they’re outright wrong or their it is crap, but just that it may be lying at a position worse in some scale than some other option. :(

No one has won, because there never was any fight. Though you may perceive it in a different way. After all I’m not totally immune to XKCD 386 myself.
People imagine AI as T1000. What we got so far is glorified T9.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf