Team:SJTU-BioX-Shanghai/Project/Software

From 2013.igem.org

(Difference between revisions)
(Start Point)
(How to Start)
Line 12: Line 12:
=How to Start=
=How to Start=
-
First of all, you must have a PC to run the software. Also, a '''USB-COM line''' is needed, because we use serial port as our communication port. In fact, USB should be in our first place for its universality in most place, but Drivers should be written to apply USB port, which is nearly impossible for us to finish it. In addition, serial ports are widely used in '''PC-MCU communication''' for its easy operation.  
+
First of all, you must have a PC to run the software. Also, a '''USB-COM line''' is needed, because we use serial ports as our communication port. In fact, USB should be in our first place for its universality in most place, but Drivers should be written to apply USB port, which is nearly impossible for us to finish it. In addition, serial ports are widely used in '''PC-MCU communication''' for its easy operation.  
After linking PC with devices, set the serial port as '''one of COM1 to COM5'''. Then, open the programme and wait for inputs.  
After linking PC with devices, set the serial port as '''one of COM1 to COM5'''. Then, open the programme and wait for inputs.  

Revision as of 02:38, 29 October 2013

Start Point

13SJTU BB lumpng.png

For the sack of encapsulating the project in a BLACK BOX, we writed a user-friendly interface as the Start Point. The software provides the orignal inputs for the whole modification system which affects the outputs of a metabolic circle or system. In our project, biological tools and hardwares are encapsulated into a BLACK BOX, which makes users only concern about inputs. The inputs can be generated from modelling data, emppirical hypothesis and many other ways. Once the values have been transferred to The Box, you can just walk away and wait for the results. Such design embodies the superiority of engineering: hommization, serviceability and productibility.


13SJTU usb-com.png

How to Start

First of all, you must have a PC to run the software. Also, a USB-COM line is needed, because we use serial ports as our communication port. In fact, USB should be in our first place for its universality in most place, but Drivers should be written to apply USB port, which is nearly impossible for us to finish it. In addition, serial ports are widely used in PC-MCU communication for its easy operation.

After linking PC with devices, set the serial port as one of COM1 to COM5. Then, open the programme and wait for inputs.


Programme

13SJTU UI.jpg

When the UI interface has been launched, there are eight blank and two button on the window. The eight blanks can be filled by number from 0 to 255, which corresponding to 0x00 to 0xff in HEX. Every LED has 256 kinds of light intensity, which provide enough choose for adjust expression of gene.

Then push the send button, the data will be transferred to devices though the USB-COM line. Once the MCU(Microprogrammed Control Unit) recieves the data, it transfrom the value in HEX to voltage on each output port, which decide the light intensity of each LED.

There is a perfect linear relationship between value in UI and light intensity with LEDs, the result is show in result parts

       private void button1_Click(object sender, EventArgs e) //Push the send button
       {
           if (!IsConnect) //Is there any connect?
           {
               MessageBox.Show("Please choose a COM port!");
           }
           byte[] cmd1 = new byte[4]; //Set a temporary array
           try
           {
               cmd1[0] = 0xf0; cmd1[1] = 0x00; //Start signal and light number(here is 0)
               cmd1[2] = Convert.ToByte(numericUpDown1.Value); //Get the light intensity value
               cmd1[3] = 0xff; //End signal
               PortSend(cmd1); //Send data
           }
           catch (System.Exception ex) //Is there any error?
           {
               MessageBox.Show(ex.ToString());
           }

What is in MCU

MCU part is a special part in our project, we want hide it from users. But for the persuasion of the whole project, we will expain the details.see also device

13SJTU MCU.jpg

MCU use PWM(Pulse-width modulation) theory to control the light intensity of each LED. The main advantage of PWM is that power loss in the switching devices is very low. When a switch is off there is practically no current, and when it is on, there is almost no voltage drop across the switch. Power loss, being the product of voltage and current, is thus in both cases close to zero. PWM also works well with digital controls, which, because of their on/off nature, can easily set the needed duty cycle.

PWM signal consists of two parts:

Period

Time of each pulse.

5Hz signal has periods of 1/5 second = 0.2 second.

Duty cycle

The percentage of period the PWM signal is On or high.

A period of 0.2 second and 10%

duty cycle = 0.10 * 0.2 second = 0.02 seconds.

If the signal has a low voltage of 0 and a high voltage of 10 volts, a 50% duty cycle produces an average of 5 volts, a 10% duty cycle produces an average of 1 volt.


LED under PWM control

Msp43017.png