Shop OBEX P1 Docs P2 Docs Learn Events
LM35DZ temperature sensor and long wires — Parallax Forums

LM35DZ temperature sensor and long wires

MoskogMoskog Posts: 554
edited 2010-07-14 00:40 in Accessories
For a project·I need several temperature sensors to measure on different places a few feet away from the microcontroller. So I soldered each sensor to a 150 cm shielded stereo phono cable,·the shield on both wires connected together and then to ground and Vdd and Vout to the inner wires.

When testing this setup·I·get·what seems to be·a random number each time the BS read the ADC. (I·spent a whole night wondering what was wrong with my setup, testing·the connections on the breadboard, changed ADC, changed to different·sensors and tried different input-pins on the·BS. And checked the supply but found nothing wrong. )

Finally I·took another sensor, not soldered to any cable and placed it directly on the BOE. This time I've got a steady, correct·reading, not flashing against me with random numbers.

So, now I need some advice on this sensor and long cables.

Is it a bad idea using this kind of cable? Should I use twisted cables instead? Recommended max lenght of cable?
Any other good advices here?

Thanks,
KjellO

·

Comments

  • MikeKMikeK Posts: 118
    edited 2010-07-12 21:51
    There's nothing inherently wrong with using long cables. I used an LM35 at the end of ~180cm of shielded cable with good results using a PIC.

    Mike
  • FranklinFranklin Posts: 4,747
    edited 2010-07-13 02:45
    If you are using a multi port adc chip there has been some conversations about the adc being unstable after the channel is changed and it is recommended to change the channel, wait, read the channel, throw away that reading and read it again for your value. This seems to work in most cases. I use the TMP36 because it reads to -50c with a single supply voltage (500mv + 10mv/C)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • MoskogMoskog Posts: 554
    edited 2010-07-13 05:00
    I'm using a simple ADC0831 for this testing, works fine with sensor right into the breadboard but not with wires. Guess I have to do more testing later tonight.
  • MoskogMoskog Posts: 554
    edited 2010-07-13 18:31
    MikeK said...
    I used an LM35 at the end of ~180cm of shielded cable with good results using a PIC...
    MikeK, are you using any kind of bypass capasitor/resistor at the LM-end of the cable? The datasheet recommend different solutions here (beginning at page 7) but says nothing about any cable lenghts when this is necessary.
    LM35setup.GIF
    This is my setup today.
  • hover1hover1 Posts: 1,929
    edited 2010-07-13 18:46
    They do recommend twisted pair cable in some remote applications. It's worth a try.

    Jim
    Moskog said...
    MikeK said...

    I used an LM35 at the end of ~180cm of shielded cable with good results using a PIC...

    MikeK, are you using any kind of bypass capasitor/resistor at the LM-end of the cable? The datasheet recommend different solutions here (beginning at page 7) but says nothing about any cable lenghts when this is necessary.
    LM35setup.GIF

    This is my setup today.
  • MoskogMoskog Posts: 554
    edited 2010-07-13 18:59
    hover1

    The main reason I used shielded phono-cable is·because this·was the only light-weight 3-wire cable I could find in the shead. But I think I can dig up some 3-pairs phone cable somewhere where I think each pair is twisted.·I'll see what I find and then give it a try!
  • hover1hover1 Posts: 1,929
    edited 2010-07-13 19:16
    Or some CAT5 cable.
    Moskog said...
    hover1

    The main reason I used shielded phono-cable is because this was the only light-weight 3-wire cable I could find in the shead. But I think I can dig up some 3-pairs phone cable somewhere where I think each pair is twisted. I'll see what I find and then give it a try!
  • MoskogMoskog Posts: 554
    edited 2010-07-13 19:32
    hover1 said...
    ..Or some CAT5 cable.

    hover1, I found a CAT5 and that solved the problem.

    I hooked up Vdd and Vout to one [noparse][[/noparse]twisted] pair and the Vss to another pair and the reading is now steady and with correct value.
    I wonder why MikeK didn't face this problem but perhaps he used a different shielded cable than me, with different capasitive values.

    Anyway, thanks to hover1 and the others responding to the thread, problem solved and another lesson learned!

    KjellO
  • FranklinFranklin Posts: 4,747
    edited 2010-07-13 20:08
    They do make shielded cat5 cable. Might be what he used.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • hover1hover1 Posts: 1,929
    edited 2010-07-13 22:44
    If you do use a shielded twisted pair, you might want to connect the shield to ground at the ADC end only, so not to introduce any ground loops.

    Jim
  • MikeKMikeK Posts: 118
    edited 2010-07-14 00:40
    I used shielded microphone cable that I picked up at Radio Shack. Didn't do anything special. It just worked. Maybe I was lucky.
Sign In or Register to comment.