Designing a 7-Day Alarm System with PLC Using Timers and Counters

  • Thread starter Thread starter Malkyboy
  • Start date Start date
  • Tags Tags
    Logic Relay
Click For Summary

Discussion Overview

The discussion revolves around designing a 7-day alarm system using a Programmable Logic Controller (PLC) that triggers a lamp after a specific input condition is met. The input simulates an alarm that must be pressed 10 consecutive times within a 7-day period, with older alarms being disregarded. Participants explore various approaches to implement timers, counters, and logic without using 7-day clocks or shift registers.

Discussion Character

  • Homework-related
  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant describes their struggle with using timers and counters in the Zelio program to meet the alarm requirements, expressing frustration after multiple attempts.
  • Another participant suggests using a microcontroller, specifically an ATtiny, as a potentially simpler and cheaper alternative to a PLC for this task.
  • A question is raised about the availability of up/down counters and the maximum up count that can be utilized in the design.
  • A participant proposes a concept involving multiple timer blocks that activate and reset each other in a cyclic manner, allowing for the counting of input pulses while managing the 7-day timer logic.
  • This participant emphasizes the need for careful management of the input pulse counter to ensure it only counts up to 10 and suggests that the design may require further refinement and detail.

Areas of Agreement / Disagreement

Participants express differing views on the best approach to implement the alarm system, with some advocating for the use of PLCs and others suggesting microcontrollers. The discussion remains unresolved, with multiple competing ideas and no consensus reached on a definitive solution.

Contextual Notes

Participants note limitations regarding the use of specific components, such as the restriction against using 7-day clocks or shift registers, which may impact the proposed solutions. Additionally, there are concerns about the complexity and potential flaws in the suggested designs.

Malkyboy
Messages
2
Reaction score
0

Homework Statement


Ive been asked to create a roaming 7 day alarm for college. This alarm must trigger a lamp (output), after the input, which i am using to simulate an alarm, has been pressed 10 consecutive times in a 7 day period. if it is pressed less than 10 timesin a week, then any alarm that is older than 7 days must not be counted, but all other alarms that are younger than 7 days kept.

I am using N/o, N/C contacts,as well as timers, (various types i.e. off delay, on pulse one shot etc) counters and counter resets and I am getting absolutly nowhere.

Homework Equations


I am using the Zelio programme if anyone is aware of this.
I cannot use 7 day clocks or shift registers.

The Attempt at a Solution



i have tried to use timers to trigger off by a pulse, then count for 7 days, and if another pulse come into trigger the next timer off, and so on for 10 timers, but i can seem to get it to work.

Ive been at this for at least 10 hours oveer a 3 day period now, and I am getting fustrated!

Any help would be much appreciated.
 
Physics news on Phys.org
You need to know for each event how much time has passed since, or better how many time we have until expiry. This means as many counters.
You need a logic to find a unused counter, and count them.

However I would use a microcontroller for this type of task.
An ATtiny comes to mind. It is packaged in SOT23-6 . Yes, 6 legs.
Needs no extra circuitry for this task (other than a switch, the lamp, and e.g. a FET to drive the lamp).
And it is dirt cheap. I would guess cheaper than the circuitry you would need for implement the logic.
 
Last edited:
Do you have up/down counters and if not what is the maximum up count?
 
i have counters that can up count and down count, and also have resets for these(outputs).
 
I pretty much only know the theoretical basis of PLC and I surely do not know what you have already tried, but perhaps you are able to use parts of this idea:

Counting input pulses and turning on the output after 10 with a counter is easy. The tricky part is directing each input pulse to a separate timer that after 7 days will count the counter down. One idea could be to have a 11 of what we could call timer blocks.

Each timer block is associated with a logical 7 day timer (will come back to that) and one register bit indicating if the block is active. Each block has an input guard that only triggers if there is an input pulse and this block is inactive and the previous block is active, and as output it starts its 7-day timer and sets it active bit and resets the next timer block. The previous block for the first block should be the last block and the next block for the last block should be the first block so that the 11 blocks activate and reset each other in a cyclic manner. When the 7-day timer triggers, it result in count down of the event counter and a reset of this timer block. Initially all blocks are inactive and the first timer block should activate on the first input pulse, so you probably need some initialization or special bits to handle this situation.

Each block then has a 7-day timer that is build from a counter that, when the timer block is active, count pulses from a single shared timer (or a timer with one or more counters if you have low word length) that act as clock sending out pulses, say, every hour. The limit of the timer block counter is set to make it trigger after 7 days (i.e. count 168 if your clock pulse is one hour). The timer block counter is reset when the block is reset.

The idea of all that is to only remember the latest 10 input pulses and in case of "overflow" the latest pulse will just "overwrite" the 10th timer without making a count down of the counter. For this to work we also need to filter the input pulse counter to only count to 10 (it should only count up if alarm output is not on).

Please note, that this is just "loose thoughts" that, even if it would work in principle, most likely require a lot more details in order to work as you like. Or maybe it would never work or has some serious flaw and make your PLC blow up. You have been warned :)
 
Last edited:

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
Replies
6
Views
3K
Replies
9
Views
4K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 11 ·
Replies
11
Views
8K
  • · Replies 6 ·
Replies
6
Views
11K
  • · Replies 4 ·
Replies
4
Views
22K
  • · Replies 3 ·
Replies
3
Views
3K