This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Interfacing MSP430 with PC to collect sensor data

Other Parts Discussed in Thread: MSP430F2618, CC2520, MSP430F5529, MAX232

Hello Sir,

I have MSP430F2618 controller and want to use it to collect sensor data and store it in a file on my PC. My PC has a serial port. Can you please tell me how to do this, any links or tutorial suggestions would be helpful.

Awaiting Reply

Thank You

  • Haresh,

     

    You will need to be much more specific. What kind of data? What board are you using?

     

    Gustavo

  • I needed to record the humidity, temperature and illumination details of a house to use it in simulink model of my project,, and then in the hardware implementation using MSP43+CC2520. I dont have a board, only the ICs. So i thought of connecting the humidity+temp sensor and the Ambient light sensor to the MSP, record the readings every 5 minutes or so and then write it to a file on the PC. The data will be binary values since the sensor data will be converted to binary using the inbuilt ADC

  • Haresh,

     

    You cannot use the ICs by themselves. They require some external components to operate. Depending on your ability to create PCBs, I suggest that you obtain some sort of evaluation board. You  mentioned using the CC2520 but you didn't say anything about using it. If you are to use the CC2520, you'll need two nodes. Two experimenter boards and two CC2520EMK (One CC2520EMK contains two transceivers).

     

    http://focus.ti.com/docs/toolsw/folders/print/cc2520emk.html

    http://focus.ti.com/docs/toolsw/folders/print/msp-exp430f5529.html

     

    The EXP-MSP430F5529 is a new Experimenter Board with the MSP430F5529. It has an SD Card so you can store data and then transfer it to a computer. You'll need to add the specific sensors to this board using the headers..

    Gustavo

  • I have a MSP430FETU80 80 pin target board and programmer, and for CC2520 i built a board myself. But i dont require CC2520 for storing the sensor data, I ll need it only in the final hardware implementation. As of now I am only concerned about how to record sensor data using MSP430

  • Haresh,

    What kind of sensors are you using? Do they have Analog or Digital output? If digital, what kind of interface do they use?

     

    Gustavo

  • The humidity sensor i am using is SY-HS-230, it gives a voltage output of max 3V, and for sensing ambient light i plan to use a Light Dependant Resistor(the voltage across it will change depending on the light incident on it). So both are analog inputs, and want to sample the values every 5 minutes and convert them to digital values from which I ll get humidity value and the light level, and then send these to the PC where it ll be written in a file

  • Haresh,

     

    As you said the SY-HS-230 has an output between 750mV to 3.25V or so and is somewhat linear.

    Connect 5V to the device, conenct 3.6V or 3.3V to the MSP430 and connect the output of this sensor to the MSP430's analog input. The ADC code examples here can show you how to sample the output:

    http://www.ti.com/litv/zip/slac151d

    You should use VCC as a reference voltage since the sensor output is greater than the 2.5V internal reference. Once you get the code from the ADC, you can transform it into humidity using the graph provided by the datasheet.

     

    As for the LDR, there are many ways to implement that. You can use that and a capacitor and measure the time constant which is a very easy technique. Another one is of course to use a voltage divider circuit. The basic idea is to use the resistance to vary a voltage which you can measure. This depends on the sensitivity you need (how fine you need to be able to measure changes in light/dark).

     

    Gustavo

     

  • Ok, but this is the sensor side connections, i.e how sensors are connected to the controller, but how do i connect the controller to my PC and store the data in a file.  Does Code Composer Studio provide such a option or IAR? 

  • Haresh Chudgar said:
    how do i connect the controller to my PC and store the data in a file.  Does Code Composer Studio provide such a option or IAR? 

    Not really. IAR provides a fake UART connection, bu tit is not reliable for realtime usage, only for transmitting debugging outputs. And it  only works if the whole toolchaing, including a FET, is running.

    To connect a PC, you can use one of the UARTs. You'll need to program them yourself (baudrate etc.) and you'll need a elvel-shifter (e.g. a MAX232 or one of the many alternatives) to convert the MSPs TLL output (0v/VCC) to the voltage levels required for RS232 (-3V/+3V to -12V/+12V). Then you can connect it to any serial PC port (maybe using an USB/serial converter). On the PC side, you can use any terminal program or other software that can read from a COM port.

    Alternatively, you can attach an SD card slot to the MSP, program it using SPI and write the data directly on it for later transfer on the PC. This is, however, a more complex task.

    There are a lot of threads about USCI programming and serial connections in thsi forum.

  • Haresh,

     

    The MSP430 can send the data as bytes through its UART connection. This can be converted to a Virtual COM Port using a USB to UART Converter such as FT232RL. You will need to create some program to open the virtual COM port,  Read the bytes and save them to a file.

     

    Gustavo

  • Will try that Sir, Thank you very much :-)

  • Will try one of the two methods Sir, Thank You very much for helping me out :-)

**Attention** This is a public forum