LMT01 - My Favorite Accurate Temperature Sensor - Full Tutorial Arduino and ESP8266

Поделиться
HTML-код
  • Опубликовано: 5 сен 2024

Комментарии • 70

  • @TexasInstruments
    @TexasInstruments 6 лет назад +16

    Hi Kevin, very cool video, we’re glad you liked the LMT01! Would you be interested in receiving additional EVMs and connecting with one of our temperature sensor experts?

  • @iconoclad
    @iconoclad 6 лет назад +3

    In getTemperature(), you should disable and then re-enable interrupts whenever you read or write the pulsecount variable. It is 16 bits, made up of two bytes, and one or the other of them may get changed by the interrupt handler simultaneously with your main loop access giving confounding results.

  • @PrivateYTPlaylist
    @PrivateYTPlaylist 6 лет назад +2

    Thanks again for the interesting video and clear explanation! I love your trigboard with the ESP8266!

  • @moeburn
    @moeburn 2 месяца назад

    7:24 don't drive that pin low, set it to INPUT aka high impedance state. Datasheet specifically warns against setting GPIO pin to LOW if you are using it to power the LMT01, something about reverse-biasing damaging the sensor.

  • @jeffbeck6501
    @jeffbeck6501 6 лет назад

    Thank you Kevin. Impressive on the math, and explanations of how it all works. This looks interesting to me from both the temp sensor and the wireless. Great video as usual. Thanks.

  • @Scorp1u5
    @Scorp1u5 6 лет назад +1

    Not sure shy the math is 256 * pulses /4096... Left shifts the bits 8 places then right shifts them 12, you could just do pulses / 16 or a right shift of 4...

  • @aladino10100
    @aladino10100 6 лет назад +1

    Excellent video well explained and well documented. Thx. Happy (and creative) new year.

  • @ddjazz
    @ddjazz 6 лет назад

    Thank you for sharing , it shows you,ve did a good amount research and testing on this and i’m sure it will help anyone trying out this sensor. Love your videos

  • @PhG1961
    @PhG1961 6 лет назад +1

    Nice video ! Looking for more !

  • @Ed19601
    @Ed19601 3 года назад

    I didn't know if this sensor. Like many my goto sensor is the DS18B20, but i may have some use for this one

  • @chrisridd9423
    @chrisridd9423 6 лет назад

    There's a bug in your getTemperature code - if you fail, you return 1000 without disabling the interrupt handler. I don't know how the Arduino handles that, but I suspect it'll keep running and waste some power. You should disable the interrupt handler a couple of lines further up as soon you stop needing to count pulses.

  • @TristynRusselo
    @TristynRusselo Год назад

    i really wish there was a closeup of your 8266 with your "hacked-on parts".

  • @hansellito
    @hansellito 6 лет назад

    Well done with these boards

  • @johnmccormick2883
    @johnmccormick2883 6 лет назад

    Very nice ... your videos are always very clear & helpful !
    Happy New Year to You

  • @avejst
    @avejst 6 лет назад

    Thanks for sharing 😀👍 happy new year to you

  • @int2str
    @int2str 6 лет назад +4

    I feel like the code is needlessly complicated (in the getTemperature function).
    Maybe something like this would be simpler (UNTESTED!!!):
    #define pulsePin 2
    uint32_t last = 0;
    uint16_t pulses = 0;
    volatile uint16_t last_pulses = 0;
    void pulseDetect()
    {
    uint32_t now = millis();
    if (now - last > 50) {
    last_pulses = pulses;
    pulses = 0;
    }
    ++pulses;
    }
    // This needs to be called only once!
    void startTemperatureConversion() {
    attachInterrupt(digitalPinToInterrupt(pulsePin), pulseDetect, FALLING);
    }
    // Returns temperature from last conversion
    float getTemperature() {
    return 256.0 * last_pulses / 4096.0 - 50;
    }
    void setup() {
    Serial.begin(115200);
    pinMode(pulsePin, INPUT);
    startTemperatureConversion();
    }
    void loop() {
    Serial.print(getTemperature());
    Serial.print("C");
    delay(250);
    }

    • @robertrobert5583
      @robertrobert5583 6 лет назад

      thanks for posting this. The sketch throws an odd error on last line (35). I've looked it up but can't fathom it. Code looks fine to me.
      LMT01_test:35: error: expected unqualified-id before '?' token
      }?
      ^
      exit status 1
      expected unqualified-id before '?' token

  • @robertrobert5583
    @robertrobert5583 6 лет назад

    Thanks for this, Kevin. A really helpful tutorial. The code works fine on arduino uno and a cheap generic esp8266 (lolin NodeMcu v3) but curiously on my Wemos D1 R2 the serial monitor shows that it keeps on resetting every few seconds. With an error message that is well beyond me (runs out of memory?).
    ets Jan 8 2013,rst cause:2, boot mode:(3,6)
    load 0x4010f000, len 1384, room 16
    The LMT01 is a great little device and has confirmed what I suspected - that my ds3231 tend to read a couple of degrees high.

  • @TheSadButMadLad
    @TheSadButMadLad 6 лет назад +1

    I've used -273C to indicate errors in temperature sensor readings.

  • @mirkorenerLT
    @mirkorenerLT 6 лет назад

    Thanks Kevin 👍👍👍

  • @fatihylmaz8
    @fatihylmaz8 6 лет назад

    that was awesome. thanks for sharing

  • @Dr44dst44l
    @Dr44dst44l 6 лет назад

    can you help me with the reference to accurate where you take the measurement and compare it with a calibrated temperature sensor

  • @lasersbee
    @lasersbee 6 лет назад +1

    We have used the DS18B20 on many projects..
    What was the Temp range you needed for your project ??

    • @Kevindarrah
      @Kevindarrah  6 лет назад

      this project didn't need anything special, but the low current and conversion speed was very important. Nothing against the DS18B20, but a while back I bought a bunch of them from Amazon and pretty sure they were counterfeit.... so watch out for that. Again, buying from Digikey and you're good, but I think they are pricier than the LMT01

  • @fuzzy1dk
    @fuzzy1dk 6 лет назад +3

    you are never going to see 1.25V on that 10k resistor, it is shorted by the BE diode

    • @Kevindarrah
      @Kevindarrah  6 лет назад +3

      yes! that is true - I definitely could have explained that better. It clamps at ~0.7V, so really should have said the 1.25V will be enough for the BE junction to clamp - thus turn on

    • @originalmianos
      @originalmianos 6 лет назад +1

      Lol, I just went to the comments to find this as expected. :)

    • @jeffbeck6501
      @jeffbeck6501 6 лет назад

      I was kind of hoping for more drama and controversy on this thread, with a math dispute.

  • @peasantrobot
    @peasantrobot 6 лет назад +7

    why you had no luck lately with DS18B20? i'm using it with PIC, AVR, STM32 (5Vcc tolerant) micros.

    • @originalmianos
      @originalmianos 6 лет назад

      peasant vasea so many reasons, .1 not .5 degree precision. The ESP has wifi and is fast and is 3.3v.

    • @peasantrobot
      @peasantrobot 6 лет назад +2

      Well, precision at .5 (both have the same precision) is good enough, you can work with multiple buses of say 8 devices each and doesn't require processing power - I can use the micro for any other task. And of course, I can use it with an STM32 at 3.3 or 5Vcc nucleobytes.blogspot.ro/2017/01/the-wire-has-fever.html. But it is nice to know how to use the TI temperature sensor, without any other reason. Thank you for that!

  • @user-ik2xl1co6g
    @user-ik2xl1co6g 6 лет назад

    where can I find a schematic TrigBoard? Very cool project.

  • @MKhurramAziz
    @MKhurramAziz 6 лет назад

    I have a question about your use of an NPN transistor, Why? Doesn't an NPN's gate react to changes in the current flow between the Gate-Drain terminals? Not the voltage differential between the two (like a MOSFET).
    Also, wouldn't it be better to forego the 10k shunt resistor and just push the current flow through the sensor directly into the NPN transistor? It would introduce a 0.7 volt drop across the gate-drain terminal of the transistor but you can compensate that by pulling the voltage on the Vp pin to 4 volts, or add another diode in series with it and pull it up to 4.5-5 volts.
    This might just be a moot point since it obviously works for you, but I was just curious.

    • @iconoclad
      @iconoclad 6 лет назад

      NPN transistors don't have gates or drains. Effectively they amplify the E-B current by approx 100. Voltages discussed here are inconsequential, it's more about current flow into the base (technically, out of the base). If you were to forego the base to ground resistor this would send all of the idle current (34uAmps) into the base, possibly biassing the transistor permanently on. The resistor has to be just the right value for the transistor to be biassed off between pulses and biassed on during a pulse. It actually should be closer to 6.8k not 10k.

  • @Nono-hk3is
    @Nono-hk3is 6 лет назад

    Very cool. Do you have the schematic posted anywhere?

  • @michaelbyron2321
    @michaelbyron2321 6 лет назад

    Does the PUSH notification sent to my smart phone get mixed in with all the emails that i would get if i enabled getting emails on my phone? Thanks. Great design!

    • @Kevindarrah
      @Kevindarrah  6 лет назад +1

      it's from a separate app - I use Pushbullet, but could reprogram to use Pushover or even Slack. You an turn off notifications for this though, if you don't want to be bothered.. like if you just want to check in and see if there was any activity

  • @DesignitBuilditRepairit
    @DesignitBuilditRepairit 5 лет назад

    Does your code work with mqtt I would like to get this working with hassio / homeassistant

  • @jeffvoight6586
    @jeffvoight6586 6 лет назад

    Why not set a flag in your interrupt code and in your loop, just test that flag. Keep resetting the flag back to zero, yield for 10ms, check the flag, and keep resetting it until it stays reset, then read your value.

  • @michaelbyron2321
    @michaelbyron2321 6 лет назад

    I apologize. the question is about the TrgiBoard. Is the message sent from Pushbullet an email to get lost in alll my emails everyday, or a phone text message? I want a phone text message.

    • @Kevindarrah
      @Kevindarrah  6 лет назад

      SMS text is possible - haven't worked it yet though... coming soon

    • @vic10us
      @vic10us 6 лет назад

      You could use a service like Twilio to do that.

  • @garywilson-2e0apg93
    @garywilson-2e0apg93 6 лет назад

    Is it possible to add this temp sensor to a sonoff?

    • @Kevindarrah
      @Kevindarrah  6 лет назад

      probably - stick around till the end where I go over the code changes to support the ESP8266

  • @johnacsyen
    @johnacsyen 6 лет назад

    Where did you buy the Salae logic analyser?

    • @Kevindarrah
      @Kevindarrah  6 лет назад

      Sparkfun - actually use it more than my scope these days.

    • @johnacsyen
      @johnacsyen 6 лет назад

      Kevin Darrah thanks

  • @metamud8686
    @metamud8686 4 года назад

    delete the whole for-loop nonsense for the random timeout and instead do:
    delay(random(50,200));

  • @i_am_justin
    @i_am_justin 6 лет назад

    Sir I need to do the project of "Real time monitoring of transformer by using IoT"Can you help me? Please sir!! I want to submit project before February 5 ..I don't have enough knowledge please help regarding my project 🙏🙏🙏
    I want to monitoring real time values of voltage, current, temperature,oil level and transfer these data by IoT . What can I do for that? Please suggest some helps 🙏

    • @davidjackowski4336
      @davidjackowski4336 6 лет назад +11

      Hire an electrical engineer.

    • @i_am_justin
      @i_am_justin 6 лет назад

      David Jackowski sir I'm also electrical engineering student sir. I want to do the project myself with the help of RUclipsrs .. That's why I'm asking his help..If you have an idea about my question please suggest some ideas..Thank you!!

    • @mikehudson3620
      @mikehudson3620 6 лет назад +4

      Have a look at ruclips.net/video/fwb5YAPzPGk/видео.html
      There are many other good videos on RUclips
      Do the work yourself and learn!

    • @ddjazz
      @ddjazz 6 лет назад +1

      Can you describe the steps you already took to accomplish your goals? I would start with a simple project rhat just monitors a temperature there are dozens of examples you can find by googling and expand from that.

    • @i_am_justin
      @i_am_justin 6 лет назад

      ddjazz I have lot of confusion on which board can use for this project among (NodeMcu esp8266) or (aurdino uno+ wifi module) Due to this I don't start my project. Just collecting information regarding the project. can you provide links based on my questions...if you can 🙏 Thank you for your reply