## 5 Wireless Sensor Network Simulations  
Using the scenario of Figure 1, a simulation was created. The small office was designed as a windowless 3.00 m length \(\times\) 3.00 m height \(\times\) 3.00 m width room in order to avoid external light interference. A global shutter dome camera with diagonal FOV of 90\({}^{\circ}\) and resolution of 640 \(\times\) 480 pixels, installed on the ceiling, was selected as the receiver; this camera was set up with the same parameters of the webcam used in the previous experiment (30 fps, focus = 0, contrast = 255, brightness = 0, and white balance = 4000) adjusting the exposure time to 10 ms. Three sensors were allocated in the office, each one with an optical emitter, represented by an 8 \(\times\) 8 RGB LED matrix (6.00 cm length \(\times\) 6.00 cm width \(\times\) 0.40 cm height) with viewing angle of 30\({}^{\circ}\). One sensor (S3) was over an autonomous vacuuming Robot (9.10 cm height) and transmitted in Green (528 nm). The other two sensors were over a desk (0.80 m height), S1 emitted in Red (623 nm) and S2 in Blue (467 nm). Each matrix turned on 40 LEDs forming a circle that was assumed as a unique LED with optical power equivalent to the summation of all the elements contribution. The selected modulation for this scenario was OOK-NRZ at 15 bps (each bit sampled in two consecutive frames) without undersampling. For this particular simulation, the matrices are not used for illumination purposes and the flickering effect was of no concern. However, for other scenarios where the flickering is considered bothersome, an undersampling technique should be used to avoid this effect. In order to synchronize the received signal, an adaptation of the frame selection technique proposed in [20] was applied for the three first frames of the transmission. The initial header of the message has a known sequence (101010), so the selected frames have at least one \"bit 1\", which has the maximum average pixel intensity value (\(k_{max}\)). For each frame a bit value is determined, if the average pixel intensity value (\(k\)) is greater than \(k_{max}/2\), the bit is marked as \"1\"; otherwise, the bit is marked as \"0\". The signal is considered synchronized when the two first bits are equal and the third one different (Figure 17a,b); otherwise, the signal is unsynchronized with two possible cases. The first bit is different, but the last two bits are equal (Figure 17c), for this case, the first frame is dropped and the remaining ones are considered synchronized. The first and the  
Figure 16: Normalized Power Signal to Interference Ratio for transmitting in white. The left chart presents the interference of close emitters located on the same horizontal line. Right chart shows the interference of the transmitters within the same vertical line. last bits are equal, while the middle one is different (Figure 17d), in this case, the signal cannot be used and the emitter needs to restart the transmission. At first, Equations (1) and (2) were used to determine the proportional separation distances between the emitters in function of the distance to the camera, the transmitter size and viewing angle, the desired pixels, and the dome camera characteristics. The difference in the height of the sensors was taken into account as an element for calculating the angle \(\gamma\). A Monte Carlo simulation of \(10^{6}\) cases was carried out for each projected distance (from 2.03 cm to 4.82 cm), and the worst case scenario (overlapping sensors) assuming the delay \(\tau_{signal}\) of the transmitted signal as a uniformed distributed variable. The interference signal from the close-by LED matrix was turned on for all the cases. The user signal was created covering the four possible combinations of two consecutive bits as shown in Figure 18. In all the cases, the received bit was determined from the sum of the signal and the interference over the exposure time (\(t_{exp}\)) for the affected pixels in each channel (red, green and blue).