I'm not sure where to look for, but I'm looking to create a project where;
if i have 4 ppl with 4 switch, attached to an Arduino that transmit signal using RF. the receiver will receive the signal according to the order the switch has been triggered.
Example; If switch was triggered by order of 2,3,1,4.......this will send signal to a LCD Display/LED to show who send the 1st signal (Switch 2) and will ONLY show the 2nd (switch 3) when the 1st signal (Switch 2) is switched OFF.
Your help will be greatly appreciated....thank you
Grumpy_Mike:
Still not too clear.
Four people with four switches each or four people with one switch each?
Is this like a quiz, fingers on buzzers sort of thing?
Is this homework?
It will be 4 people with one switch each, they will trigger the switch when they require help.
once it's triggered it will send continues signal till its switched off.
I've looked into it but the issue will be, i need the signal to populate according which signal was send 1st.
and I'm looking to expend this to 16 unit (transmitter) and 3 station (receiver)
If you have 4 transmitters and one receiver what happens if two (or more) of them overlap, or partially overlap.
My instinct is to work on a master-slave basis in which the master sequentially polls the slaves and waits (briefly) for a reply.
However if your time differences are very small that may not be suitable. Of course that is also the situation in which overlap is most likely.
Maybe the slaves could record the time when the button was pressed and transmit that. But then there is the problem of synchronizing clocks. Maybe the master could send a time sync message that is received by all of the slaves at the same time.
It will be 4 people with one switch each, they will trigger the switch when they require help.
So how critical is identifying the first to press? For example if presses are closer than a second does it actually matter which gets helped first.
I once worked on a nurse call protocol a bit like this. This used the master / slave polling protocol that Robin2 talks about. Each location had an address and the master calls out each address in turn and waits for an answer. it no answer is received with an certain time the next on is called.
When a slave does answer, the master responds with an acknowledge and then it transmits no more for that press. The slave counts the time between the last unsuccessful call and the button press and sends this as part of its call. At the end of each round of polling the master can sort out which call was first from the times received.
Grumpy_Mike:
if no answer is received with an certain time the next on is called.
When a slave does answer, the master responds with an acknowledge and then it transmits no more for that press. The slave counts the time between the last unsuccessful call and the button press and sends this as part of its call. At the end of each round of polling the master can sort out which call was first from the times received.
That sounds like a very clever way to synchronize timing.
Another problem you have, is that, if those transmitters are all working on the same frequency then the first to answer would get noticed. Then the second signal will likely be corrupted by the inteferance caused by the first.
you ideally want to ensure that only one rf device is sending at any time. An implementation of GMP (Grumpy_Mike protocol) would do the job nicely. The "ppl" devices would only answer the call if the button has been/is being pressed.
You could also have a separate signal sent by the master to tell the ppl units to reset. (ready for the next question or whatever)
Grumpy_Mike:
So how critical is identifying the first to press? For example if presses are closer than a second does it actually matter which gets helped first.
I once worked on a nurse call protocol a bit like this. This used the master / slave polling protocol that Robin2 talks about. Each location had an address and the master calls out each address in turn and waits for an answer. it no answer is received with an certain time the next on is called.
When a slave does answer, the master responds with an acknowledge and then it transmits no more for that press. The slave counts the time between the last unsuccessful call and the button press and sends this as part of its call. At the end of each round of polling the master can sort out which call was first from the times received.
I would say not that critical, chances are there will be a 5-60 min different between switch times.
This is almost the same as you can find in a supermarket where you queue and wait to be called, the next available till will only show when the transmitter is switched off but I think they work with full wired not wireless.
But in this case, the transmitter will continue to send signal till the transmitter has been switched off.
Grumpy_Mike:
Yes just like an LED will continue to be on until it is turned off.
What do you mean exactly?
And have you still got questions?
say if im using a digit display, and it can only show single number. this will only show the 1st number and will populate the remaining number (if switched on). the next order of number will only be shown only the transmitter switch is switched off.
My problem is the program it self?
how will i write this kind of program?
Robin2:
This makes no sense to me when related to the original post.
Either you need to know which is first, or you don't care. There is no in-between.
The fact that there might be a long gap is irrelevant. What is critical is what is the shortest possible gap that needs to be managed successfully.
Have you any objection to the master-slave system that myself, @Grumpy_Mike and @KenF have suggested ?
...R
the respond time for the 1st switch to be switched off could very from 5min - 120min (not more than 2hours). i do need to know who trigger 1st as this will be fair to respond to 1st come 1st served basis.
so what you are trying to say is that using master -slave system will populate the order which switch has been triggered?
but what is 'Master Slave System', i'm not from an electronics background.
I wonder if you have the idea that a transmitter being on or off is like a light being on or off. It is not like that.
A transmitter must transmit something - perhaps an ID number. If 2 transmitters transmit at the same time on the same frequency the receiver will only see garbage. If you want the transmitters to work on different frequencies then you need a separate receiver for each transmitter.
You can't start writing a program until you have decided what you want the program to do.
First thing is to write down in plain language the series of detailed steps (one on each line) for exactly how you want the system to work. When you have done that it is likely that the series of steps will form the framework for the program.
...R
marko1984:
but what is 'Master Slave System', i'm not from an electronics background.
Did you read Replies #9 and #10 ?
In a master-slave system the slaves are listening all the time. The master sends a message with the ID for one of the slaves and the slave replies saying whether the switch was pressed or not. Then the master sends a message for the next slave. It means that the slaves only transmit when asked to do so.