Sensor network
I worked out a basic setup for how it should work, being the following:
The room control board sends out two kinds of messages: the first is a message with the current status of everything that needs to be activated. This is just one byte, as we have 8 different things we want to turn on and off (2 lasers, 5 el-wires, 1 paper).
The second is a message with a request for information from a lightstrip. It has a byte to indicate from which one it wants to get an update.
So the room control board cycles through sending:
- status update
- request light data 1
- request light data 2
- request light data 3
- request light data 4
The different actuators in the room, listen for the status update, and turn on or off the thing they are supposed to turn on or off.
The light boxes reply with data, when they are asked to transmit data. The data they send is:
8 photo sensor values
2 bytes for PIR data
1 byte for laser data
The bytes for the PIR and laser are created as follows:
upon a state change of the sensor (movement detected or laser break detected), the board rotates the byte one time to the left, and adds the new value (0 or 1).
Just before transmission, the byte gets updated one more time with the current value.
This way, there is some history of whether or not the sensor has detected something in the time in between sending. It should be possible to also detect a change if data gets lost on the way, and only gets received correctly the second time (or third).
So, this is the theory. Didn't get it to work yet.
The room control board sends out two kinds of messages: the first is a message with the current status of everything that needs to be activated. This is just one byte, as we have 8 different things we want to turn on and off (2 lasers, 5 el-wires, 1 paper).
The second is a message with a request for information from a lightstrip. It has a byte to indicate from which one it wants to get an update.
So the room control board cycles through sending:
- status update
- request light data 1
- request light data 2
- request light data 3
- request light data 4
The different actuators in the room, listen for the status update, and turn on or off the thing they are supposed to turn on or off.
The light boxes reply with data, when they are asked to transmit data. The data they send is:
8 photo sensor values
2 bytes for PIR data
1 byte for laser data
The bytes for the PIR and laser are created as follows:
upon a state change of the sensor (movement detected or laser break detected), the board rotates the byte one time to the left, and adds the new value (0 or 1).
Just before transmission, the byte gets updated one more time with the current value.
This way, there is some history of whether or not the sensor has detected something in the time in between sending. It should be possible to also detect a change if data gets lost on the way, and only gets received correctly the second time (or third).
So, this is the theory. Didn't get it to work yet.

0 Comments:
Post a Comment
<< Home