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.

MSP430F2274 + pt100 sensor

Other Parts Discussed in Thread: MSP430F2274, TMS37157

Hello,

I bought the EZ430-TMS37157 kit and i want to integrate a pt100 sensor with the msp430f2274.

Are there some application notes or examples explaining how to do that ? I don't really find it...

Thanks for your answers.

 

Brice.

  • Brice,

    Is this the temperature sensor?

    Lets start with a few questions, does the sensor have an analog output? Does it have a digital output?

    If it's analog, what is the output voltage range (swing)? What's the resolution you're looking for (probably the ADC would be limited by the sensor).

    If it's digital, what interface does it use?

     

    Gustavo

  • Hi,

    First point, i want to make some temperature measurements thanks to a rtd sensor (pt100) and integrate that with my EZ430 kit.

    I'm looking for a circuit (or component ?) that :

    - brings me at maximum 1mA in my rtd. My resistor  will evoluate between 100 and 150Ohms so the output voltage range will be low. 

    - amplifies this tension, 

    For now, I'm working with operatinal amplifiers. Create a circuit that amplifies a tension is easy but i have some difficulties obtaining 1mA in my rtd. So it's why i ask for application notes or something like that... 

    Second point: 

    If I understand right the msp430f2274 datasheet, the ADC10 CAN'T  have an input voltage above VCC (page 46/91) ? 

    I have another problem. I'm looking for a 0.1°Celsius resolution and I'm not sure that 10bits are enough to the conversion.If i'm right, according to page 48, I can configure what tension I want to convert thanks to Veref+ and Veref- ? In this case, i thinks it would be enough.

    I am thinking about another solution by adding a 12 (or 16) bit ADC that would be connect to an I/O of the msp430 (So i won't use the ADC10 already present in the msp430). I don't know what solution would be easier. 

     

    Thank for your time.

    Brice.

    PS: I'm French so don't hesitate to ask me if you don't understand ! I'll try to explain better ! 

  • Brice,

    As for your first question, Op Amps for Everyone is a gread Design Reference for Op Amps. You can find it here:

    http://www.ti.com/litv/pdf/slod006b

    It's easy to understand and is very practical.

    Page 198 talks a bit about resistive transducers like the RTD you have. You will need to design a circuit with an op amp to provide this. The good news is that the MSP430F2274 has Op Amps internally, so this will simplify your job immensly.

    You can use TINA to simulate using Op Amps. I've used it to design circuits in the past and it's very nice.
    http://e2e.ti.com/blogs_/b/analogwire/archive/2010/02/11/tina-ti-free-simulator-tool-make-amplifier-sims-easy.aspx

     

    As far as the ADC of the MSP430F2274, you are correct. The limit is basically Vcc which is 3.6V or so. In any case, since you have a resistive sensor, you can tailor your circuit to cover the dynamic range of the ADC. Since I don't know the slope of the RTD, I can't tell whether the 10 bit ADC is enough for you. Please provide a link to the datasheet.
    In any case you can add another ADC to the circuit, which is usually using the SPI interface. On the EZ430-RF2500, you will need to share the SPI bus with the transceiver.

    Another reference:
    http://focus.ti.com/lit/an/slaa038/slaa038.pdf

    Gustavo

  • Brice Gauthier said:
    the ADC10 CAN'T  have an input voltage above VCC

    Yep. But you can easily divide the voltage down by a resistor divider.

    Or use an OpAMP. Operating a PT100, however, isn't an easy task. And it is not really low power. To get a linear voltage form a PTC, you need a constant current source. A PT100 has a low resistance and so you need a high current ofr a high otuput voltage, or you se tthe PTC into the head of a current mirror (two NPN transistors with bases and emitters coupled and the PTC on one collector,  and make a difference aplifying of the voltage over the PTC using an OpAmp. Then you can also adjust the aplification (and maybe even the offset) of the signal and get  alinear reading of the resistance (and the temperature).

    With proper offset, you have 1/10° resolution over 100° (e.g. -20°..+80°) with the 10 bit ADC. Or you go for an MSP with 12bit ADC.

    I wouldn't use the internal OpAMPs, as they have relatively high tolerances asn are difficult to handle, which makes the calibration process difficult. But it's not impossible to use them.

    Brice Gauthier said:
    I can configure what tension I want to convert thanks to Veref+ and Veref- ?

    You can use Veref- instead of the offset elimination. You can even use a pot to fine-adjust it manually. Yes, it works. For higher precision, however, I'd suggest tying VEref- to the base GND of the measurement circuit and remove the offset in the OpAMP. And use the internal reference. It's lower power :)

    Brice Gauthier said:
    I'm French

    And I'm German. But your English is quite good (and way better to understand for me than French :) )

  • Thanks for your answers ! I'll work about what you said and i'll contact you if  I've some other questions !

  • Jens-Michael Gross said:

     For higher precision, however, I'd suggest tying VEref- to the base GND of the measurement circuit and remove the offset in the OpAMP. And use the internal reference. It's lower power :)

     

    I d'ont really understand this part. Can you explain more precisely how i do that ?

    I need 0.1°C resolution between 30° and 130° so 10bit ADC will be enough.

    Easy way, in my RTD, i'll have about 1mA so the tension will be between 110 and 150mV. (at 30°, RTD = 111.67Ohms and at 130° RTD = 149.83Ohms).

    At the beginning, I think to amplify this tension by 10 (with OpAMP). And according to the datasheet of the msp430f2274 (page48/91), i'll  program Veref- at 1.1V (<1.2V) and Veref+ at 1.5V (>1.4V). Does it work ?

     

    Thank a lot !

     

  • Brice Gauthier said:
    I d'ont really understand this part

    It depends on how you imprint a current into the the sensor to get a voltage reading.

    The easiest way is a current mirror. But in this case, the PT isn't tied to GND on one end. It will be floating above the current mirror (with a head resistor to VCC or so). In this case you'll need to measure the differential voltage over the sensor.
    You can do so by connecting Vref- to the base of the PT, to spread the resolution of the result. If e.g. Vpt1 is 2V and Vpt2 is 2.1..2.15V, you'd need to use the 2.5V reference, and your result range would be 860 to 880. not your desired resolution.
    Putting VEref on VPT1 and using a smaller reference would spread the range of the result. However, the reference would be somewhat unstable.

    it's better to feed Vpt1 and VPT2 into an OpAMP (preferrably an external one, so you can adjust the gain much better and more precisely) and set it to a gain of e.g. 10. Then you'd get 1.1V..1.5V giving you (with an 1.5V reference) a reading from 750 to 1024. Alternatively, you can raise the gain to 30, but subtract 1V from the result (using the same OpAMP). This would give you 0.3..1.5V output signal or 68 to 1024 as the result range.

    Brice Gauthier said:
    i'll  program Veref- at 1.1V (<1.2V) and Veref+ at 1.5V (>1.4V). Does it work ?

    You cannot 'program' it. You have to provide it externally. And that's the problem: getting a stable, noise-free reference (or two, in this case).

    Brice Gauthier said:
    I need 0.1°C resolution between 30° and 130° so 10bit ADC will be enough.

    Yes, if you can trim the output signal to cover exactly your reference range. Using a 12 bit ADC allows you to still get the resolution even if your signal only covers 1/4 of the reference range. And believe me: what looks easy when looking at nominal values sometimes becomes completely impossible if you take the existing part tolerances into account and recalculate with the worst-case values (in both directions).

  • In fact, I'm only a student-engineer so I took some advices from my teacher yesterday. He said that a current mirror wasn't a good solution (because NPNs have to be exactly similar) but I've found another possibly with two OpAMP to make the excitation current and he thought it was better. This part is no longer a problem...

    But he told me that we can't take into account the LSB of the ADC as a true value (error). So i've to add a 12bit ADC and connect it to the MSP430.

    I don't really know I2C or SPI: which is more easy to use ?( I'm working for a project, I don't have unlimited time to work on it !).

     

     

    Then question about Target Board available pins: According to SLAU281A.pdf, pin 2 is a VCC. Can I set the value of this tension by programming the MSP ? What tension can i have ?

     

    Brice.

  • Brice Gauthier said:
    because NPNs have to be exactly similar

    Indeed, bu tthey usually are if you buy them together. NPNs form teh same charge usually (except for very rare cases) have almost identical values. Of course if you order them as single units from a reseller, and not on a reel, you can't be sure they are from the same charge (unless the charge nr is printed on their case)

    Brice Gauthier said:
    So i've to add a 12bit ADC and connect it to the MSP430

    Using a different MSP with built-in 12 bit ADC is not an option? Many MSPs have an ADC12. I think as many as there are MSPs with an ADC10. About the error, you can do oversampling, which will reduce noise. It could even increase resolution, if you overlay a very small sine or sawtooth signal to the signal you want to measure. :)

    Anyway, about SPI and I2C, well, an SPI master is quite simple. If you get the idea of  the bidirectional-synchronous transfer and the internal double-buffering, SPI is as easy as writing to a port register. There is, however, no failsafe feature on PSI
    I2C implements a protocol. It is slower and more complex, but allows detection of the presence of the slave (SPI cannot) and where SPI requires oen separate chip selec tline per slave, I2C only requires two signal lines for up to 127 slaves.

    Brice Gauthier said:
    Then question about Target Board

    If I read teh schematics right, P2 is the external VCC input. There you provide the external VCC if the board isn't powered by USB. It is connected by R1 to the USB/Programmer part (in case you do not power teh target board from its own source) and nothing you can change by software or used as controllable output. It's the supply voltage.

  • AS I said in my first post, I'm using EZ430-TMS37157 kit so I can't really change the MSP...I don't have enough time to begin with nothing, I need something already existing and then do modifications ! Moreover , I have to transfer the temperature with low frequency communication, so this kit was a good foundation to start !

     

    So, I've looked for ADC 12bits but  I didn't find anything good at TI (3.6V power supply, very low consumption, serial interface...). I found this one which seems not bad :

    http://www.farnell.com/datasheets/608922.pdf

    With this one, I will need to use Ref+ and Ref- to obtain 0.1°C resolution. I have the possibility to take the same component but with 16 bits (ad 7171) and don't using Ref-.

    But I don't really study about the interface with my msp (so with my target board pinouts)...

  • Brice Gauthier said:
    I found this one which seems not bad :

    Yep. I think there is a thread in this board discussing addressing this one or one of his brothers.

    Brice Gauthier said:
    With this one, I will need to use Ref+ and Ref- to obtain 0.1°C resolution.

    You can output a stable reference from the MSP (enable the internal reference and set REFOUT). You'll need to provide external capacitors for stabilizing it. For REF- you can use a large POT from REF+ to GND (at elast 10kOhms) and use the wiper output for REF-.  This allows you narrowing the scaling range as close as you want. Calibration, however, is easier with REF- tied to GND.

    The data interface itself, SPI, is easy to handle.

    Brice Gauthier said:
    I have the possibility to take the same component but with 16 bits (ad 7171) and don't using Ref-.

    Yep. But it' slikely more expensive. Well, for a student project, these two dollars won't count. For mass production, however...

  • Hi,

    I'm worried about the SPI Interface between the MSP430 and my ADC. In SLAU281A.pdf, page 39/46, there is the target board schemactics. SIMO, SOMI and CLK pins of the MSP430 are already connected to the TMS37157. Is it normal ? How can i use these pins with my ADC ?

  • SPI is a bus.

    As long as there is only one master and the master is enabling/disabling the slaves with eseparate chip select signals, you can attach almost any number of slaves to the three SPI signals.

    The usual convention is that there is a fourth line that is unique for every attached slave. If the master pulls it low, the slave on this line will start listening to the clock signal and teh incoming bits and also activate its output. All other slaves will be passive.

    So if the TMS is running slave software, the MSP can easily address the TMS as well as the ADC through the same lines. Just there have to be a chip select line (a normal I/O pin) for the TMS and another for the ADC.

    If, however, the TMS is the master (and in the likely case that the TMS does not support multi-master SPI), then the MSP is considered to be a slave and cannot switch into master role on the same SPI bus.

    The MSPs USCI, however, has two SPI interfaces, so if the connection to the TMS does not use 4-wire SPI and you don't need teh UART or I2C connection, you can make a separate SPI connection.

    As last resort,you can interface the ADC with three/4 normal port pins, simulating clock and the input/output shift registers in software. It's really not difficult, since as SPI master, you define the clock signal and thereefore the speed of the transmission.

**Attention** This is a public forum