# Hybrid RF/VLC Network Architecture for the Internet of Things
## 5 Implementation
### VLC Subsystem  
With respect to the VLC subsystem, it was defined as a downlink-only technology in which a user could receive data from the LED lamp using the appropriate optical receiver. A VLC-based uplink has not been considered since this technology is intended to work for both data transmission and illumination, and a visible light uplink could produce discomfort. Although in this work no uplink was defined, it could be implemented using any infra-red band or other optical technology such as optical camera communication, in which high power emissions are not needed. The implemented receiver was based on a positive-intrinsic-negative (PIN) photodiode and a high impedance amplifier followed by a comparator stage (Figure 11). It is important to note that the circuit presents a variable threshold level, which means it can be adjusted _ad hoc_ depending on the background illumination level. The transmitter was based on the use of COTS devices. Both the LED lamp and the current driver were commercial, and the transmission was controlled by one of the waspmote's digital pins and a MOSFET transistor. In order to avoid flickering, Manchester encoding was also implemented, resulting in a data rate of 1200 bps. The signal-to-noise ratio (SNR) at the input of the comparator stage of Figure 11 can be observed in Equation (1). \[SNR=\frac{\left(\int_{\lambda}P_{rx}(\lambda)R(\lambda)\mathrm{d}\lambda\right) ^{2}}{2q\left(\int_{\lambda}P_{rx}(\lambda)R(\lambda)\mathrm{d}\lambda+i_{d}+ i_{b}\right)B+4k_{B}TBR_{L}^{-1}} \tag{1}\]  
where \(P_{rx}(\lambda)\) is the received optical power spectrum (Equation (2)), \(R(\lambda)\) is the photodiode's responsivity, \(q\) is the electron charge, \(i_{d}\) is the darkness current, \(i_{b}\) is the background current, \(B\) is thebandwidth, \(k_{B}\) is Boltzmann's constant, \(T\) is the noise temperature, and \(R_{L}\) is the high-impedance amplifier's gain. In VLC, the received power \(P_{rx}\) depends not only on the line-of-sight (LOS) contribution but also on the non-LOS (NLOS) part of the optical channel impulse response. However, for LOS links, the NLOS contribution is usually residual and can be neglected. Regarding bandwidth, VLC supports hundreds of MHz in indoor applications [33]. Nonetheless, for IoT, these huge bandwidths are not needed, and coverage can prevail over throughput (which is purely limited by the frontends' frequency responses). \[P_{rx}(\lambda)\approx\left\{ \begin{array}{ll}P_{tx}(\theta,\phi,\lambda) \frac{A_{pd}\cos(\Psi)}{d^{2}}G_{lens}&\Psi\leq FOV/2\\ 0&\Psi>FOV/2\end{array} \right. \tag{2}\]  
\(P_{tx}(\theta,\phi,\lambda)\) is the emitter's radiance depending on wavelength, \(\phi\) is the azimuth, \(\theta\) is the elevation, \(A_{pd}\) is the receiver's cross section, \(\Psi\) is the incidence angle, \(FOV\) is the receiver's field of view, \(G_{lens}\) is the optical gain, and \(d\) is the link's range. In this work, no optical concentrator was used, and the FOV was limited by occlusion using a tube. All the parameters of the implemented VLC subsystem are summarized in Table 2.  
The operating base of the VLC transmitter circuit is the control of an LED lamp, through which the data are sent. The control of the LED lamp for communication through VLC is carried out for a common driver, which commutes the LED lamp, where the control pin corresponds to the output of data emitted by the VLC transmitter device. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameter** & **Value** \\ \hline Tx Optical Power & \(\approx\)1 W \\ Tx FWHM angle & 60\({}^{\circ}\) \\ Tx spectrum & Figure 12 \\ \hline Rx FOV & 60\({}^{\circ}\) \\ \(G_{lens}\) & 1 (no concentrator) \\ \(A_{pd}\) & 1 cm\({}^{2}\) (Hamamatsu S1227-1010 BR) \\ Noise Equivalent Power & 6.7 \(\times\) 10\({}^{-15}\) W\(\times\)Hz\({}^{-1/2}\) \\ \(R_{L}\) & 1 k\(\Omega\) \\ \(B\) & 3 kHz \\ \hline Data rate & 1200 bps \\ Encoding & Manchester \\ Spectral efficiency & 0.5 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Parameters of the implemented VLC subsystem.