Monday, 6 March 2017

5th week

Previous experiment realized the basic light transmitting function of the system and variety of information is also available to be transmitted. While, LED and photo diode should be placed very closely to each other, or there will be much noise detected on the receiver side. To solve this problem, a lens is used to improve this problem.

Lens is the equipment to focus or disperse light [1]. In our project we used a lens to focus the light on the detector. The parameter focal distance of the lens is 10cm. The lens is placed between LED and photo diode, while the lens is close to LED and 7-8 cm away from the photo diode. (This distance is discovered by moving the lens and choosing the point with the best result. It is revealed in Figure 1) This lens enables the detector and LED separated and information transmitted over some distance. The following video showed the experiment result of using lens.



Figure 1: system with the lens


To improve the stability of the system, the final version of amplifier and filter is decided, which is shown in Figure 2.
Figure 2: simulated receiver circuit
The TL073 is applied in this system. It is a low noise operational amplifier (18nV voltage noise density) is an excellent analog building block for designing low noise differential circuits. The typical gain bandwidth of this amplifier is 100MHz and op amp slew rate is sufficient for signal frequencies up to 5MHz.
Since the output voltage follows the input, a basic non-inverting op-amp circuit, which is also called as a voltage follower, has been designed in the project to amplify the input voltage. Feedback control of the non-inverting operational amplifier is achieved by applying a small part of the output voltage signal back to the inverting (  ) input terminal via a voltage divider network, again producing negative feedback as shown below. This closed-loop configuration produces a non-inverting amplifier circuit with very good stability, a very high input impedance.

Figure 3 is the final version of our visible light communication system. This system shows the ability to complete visible light communication with the acceptable level of stability.
Figure 3: Visible light communication system



Reference
[1] Wikipedia, "Len(optics)''  [Online]
Available: https://en.wikipedia.org/wiki/Lens_(optics)



Sunday, 26 February 2017

4th Week

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. 

  #ifdef TRANSMIT_SERIAL
  if(Serial.available() && transmitter_available()){ //constructing the data frame only if transmitter is ready to transmit
    char c = Serial.read();
    com_buffer[com_buffer_nb_bytes] = c ;
    com_buffer_nb_bytes ++ ;
    if(com_buffer_nb_bytes >= 32 || c == '\n'){
      if(write(com_buffer, com_buffer_nb_bytes) < 0){
        Serial.println("Transmitter is busy");
      }else{
        com_buffer_nb_bytes = 0 ;
      }
    }
  }
  delay(10);

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

Sunday, 19 February 2017

In this week, we improve the circuit on the breadboard and the code of the Arduino equipment. In the past circuit, when we measure the wave of the output of the circuit, we discover it exists so much wave we don't need like figure1
figure1

we decide to use a filter to decrease the noise and the wave we don't need. We use a  capacitance as a filter in parallel with the circuit like figure 2. 

figure2


Firstly we choose a capacitance resistance 390Ω capacitance be the filter. We could get a figure 3 of the output.
figure3
Then we choose a 680Ω capacitance be the filter we get a wave picture like figure 4
figure4

Then we choose a 1kΩ capacitance be the filter we get a wave picture like figure 5 
figure5
By the observation could discover that when the resistance of the capacitance become bigger that the noise and the wave we don't need is decreased . 



Apart from the activities the above, we change the message in the code that " HelloWorld" to another word. And we discover that quantity of the letter of the another word should be equal with the initial word that "HelloWorld.

Wednesday, 15 February 2017

For the second week experiment, we built the circuits for emitter and receiver parts respectively on the preliminary attempt, and succeeded in doing the experiment on 10th Feb morning. When we sent a message like "Hello World" in the control side, we would be able to display this message on a LCD screen through a circuit transmitted the signal by light. This bog is enriched by review of the basic process, functional or technical specifications, data dictionaries, other sources of data knowledge we've done last week.

The key process was to build the receiver circuit correctly based on the principle of photocell[1],so that we could transfer two original codes into two ardunio board dividually. The basic emitter system is able to translate the phase into digital signal(LED), hence the photocell would catch the subtle change of the LED slighting,  it was required to modify the position of two breads so that the sub-units could be in proximity to each other (as shown in Figure1).
Figure1: modification of the two breads position

Once the photocell transmit the digital signal to a current signal, the receiver part would be able to turn that back to digital through a rational bandwidth included some inevitable noise and interference.
One effective way to avoid the noise is to operate in dark environments, to bright the LED light better ( as shown in Figure2). Therefore, we could achieve a more accurate received signal on the displacement side (as shown in Figure3).

Figure2: Experimental operating in dark environment
Figure3: receive a more accurate message on another laptop


To optimize this communication system, the group members were divided into two parts for different objectives concurrently during the latter experimental hours.
For the circuit promotion testing,  the objective is to select the appropriate resistance and LEDin different colors to apply a maximum current brighter the light. Specifically, the emitter circuit withs parameters on different resistance are investigated and collected the current data of one same LED. In addition, if the resistance remained constant, the LED with different color would lead to different current (as shown in figure4).
Figure4: RED LED in constant resistance

 For LCD displacement screen process, we built the circuit followed be figure5, which required:
-Arduino Board
-LCD Screen (compatible with Hitachi HD44780 driver)
-10k ohm potentiometer
-220 ohm resistor
-pin headers
-hook-uo wires
-breadboard

Figure5: LCD screen circuit

After the combination of the two circuits into one breadboard(as shown in Figure6), the optimized system has achieved to display on LCD screen( as shown in Figure7).

Figure6: both emitter and receiver combined  in one circuit 

Figure7: LCD screen displayed detailed 

In particularly, the group have achieved the basic requirements of this project through the week2 experiment, and concentrated on enhanced design of this communication system, which required a good signal fidelity with corresponding noise filter and a ability of transmission of a large amount of information in time.

Reference:


Monday, 6 February 2017

Arduino simple visible light communication-The first week


Li-fi (Arduino simple visible light project) targets to transmit data through light. It is a method of wireless information communication within limited area. In this project, arduino and circuits built on arduino are required to achieve this. The system is seperated into two sides, the emitter side and the receiver side. The emitter side, obviously, has the function to convert the input words (all words should be within the range of ASCII code) into binary type. And this binary data can be represented by the on/off  of the small LED. The receiver side receives data illustrated by LED and converts into ASCII according to ASCII code. In this way, visible light is used as the medium to transmit data.


As it is the first week to conduct experiment, we first determined the material required to conduct the experiment. And then, we tried to program the code of the emitter side and set up the simple circuit of the emitter side. The program succeed to split input string into separated characters and illustrated by LED which is part of the work that the emitter should do.


Components
Arduino Uno*2
LED(several)
Photo diode (several)

Two arduino Uno are required as the emitter and receiver part respectively. Arduino IDE 1.8.1 are used as the algorithm to program. LED with various colors are studied because they have various wavelength. Resistors with various resistance are necessary to control current to prevent the broke-down of LED.

Code and experiment photo



String incoming;   // for incoming serial data

void send_one_char(char single){
  
}

void setup() {
    Serial.begin(9600);  // opens serial port, sets data rate to 9600 bps
    pinMode(2,OUTPUT);
}

void loop() {

    // send data only when you receive data:
    if (Serial.available() > 0) {
            // read the incoming byte:
            char incoming = Serial.read();
            // say what you got:
            int i;
            for (i = 0; i < 8; i ++){
              if(incoming & 0x80){
                Serial.print(1);
                digitalWrite(2,HIGH);
              }else{
                Serial.print(0);
                digitalWrite(2,LOW);
              }
              incoming = incoming << 1;
              delay(500);
            }
            Serial.println(".");      

    }
}