Last week, the Lifi system could receive the message correctly after adding a low-pass filter. However, there were still some problems. The first object this week was the system could receive tthe message entered in monitor sensor. Then the distance between LED and photocell was too short. Therefore, the second object was increasing the distance.
Firstly, in order to receive whatever message typed in monitor sensor, the source code was modified.
This part of code was added in loop function of Emitter part. However it did not work in the beginning, The Emitter only sent the message when the length of string exceed 32. It was caused by the program cannot read the '\n' correctly. This was solved then by changing "No line ending" to "Newline" in sensor window.
Figure 1. Sensor Window
Then, for increasing the distance between LED and photocell, we firstly tried to brighten the LED in the Emitter part. Because the output voltage from the arduino board is 5V and it cannot be increased. We decided to reduce the value of resistor which is serial to LED. However, it was found that when the value of resistor was reduced, the output voltage from digital pin was also reduced. Therefore, the voltage of the LED did not change a lot. If the value of resistor was decreased from 100Ω to 22Ω, the voltage across the LED was increased from 2V to 2.2V. The reason may be there is an internal resistor inside the board.
Finally, an amplifier could be added to Receiver part to increasing the detecting voltage. The circuit is shown below:
Figure 2. Amplifier Simulation Circuit
Figure 3. Amplifier Circuit
The voltage was then amplified successfully from 0.3-0.6V to 0.8-1.4V approximately.
Figure 4. Amplified Voltage