TMP36 Temperature Sensor with Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 มี.ค. 2021
  • The TMP36 is a low voltage, precision centigrade temperature sensor. It provides a voltage output that is linearly proportional to the centigrade temperature.
    In this video, we hook up the sensor to an Arduino Uno and demonstrate just how easy it is to readings from it. We then demonstrate how the reading can be used to control an output by switching an LED on and off depending upon the temperature.
    Source code for this video can be found on GitHub:
    github.com/srayner/tmp36/blob...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 28

  • @williamvanzyl5922
    @williamvanzyl5922 ปีที่แล้ว +2

    Hi Steve. Great video embedding Science, Maths, and Technology in learning! Your video is simple and to the point. Excellent video. Thanks for being patient - great to see that in our fast-moving world! I'm an Electronics teacher (secondary school in NZ) - using Arduinos. Started this year with my students using Arduinos - relatively new to me. I will be using this for a research project with high school students (my studies - Master's research project). The TMP36 is perfect for fostering science, math, and technology in sensor-based inquiry (the preliminary title of the research). In short, compare and contrast the knowledge and skills before and after doing the investigation. and exploration with the TMP36. Students will go deeper and draw diagrams - of how the TMP36 sensor works - the science behind it (details on materials, chemistry, physics and more). Then, explore other temperature 'sensors'. Then present the data (graphs/charts/tables) through the scientific method. After exploring the TMP36, they choose to solve a problem with the Arduino - choosing one of the 17 SDGs (sustainable development goals). Link - 17 SDGs UN: www.un.org/development/desa/disabilities/envision2030.html. The focus is on solving real-life problems. For example, temperature sensors in the ocean (floating/Bluetooth/GPS/WIFI/satellite communication) monitor areas in the ocean heating up. Coral and fish are affected by global warming. There could be other areas. Do you have any suggestions? It sounds complicated. However, learning has to be very simple. Able students could include a simple relay to control a second circuit. Thanks for the excellent video and for taking the time to explain in detail. Well done! You are very knowledgeable. Do you know of any other simple electronic components (breakout breadboard with Arduino/or other) that could fit my research project for 16-year-old students? Would appreciate your feedback. Any suggestions and ideas would be fantastic. Regards. William Van Zyl (NZ).

    • @SteveRaynerMakes
      @SteveRaynerMakes  ปีที่แล้ว

      Hi William, glad you found it interesting. I guess there are many applications for temperature sensors. What I remember doing when I was at college many years ago was a closed-loop control system. The temperature sensor signal was fed into an amplifier, and from there it fed into a microcontroller. The microcontroller had an output connected to a small lamp. The sensor was positioned just above the lamp. So the microcontroller would read the temperature and turn the lamp on and off to maintain a steady temperature. It was fun because we started learning how the temp sensor worked, then had to design the amplifier to generate a more usable signal, then write the computer program to run on the microcontroller. We had to build the amplifier on a PCB. I like the concept of building on top of what you have already learned to create something larger and more complex. I also really like the idea of understanding all areas of the project, mixing electronics, software engineering, and mechanical/physical aspects, which might be a PCB or a case design. I think a nice way to build on this temperature sensor project would be to add a small screen to display the temperature, then add a relay that could control something. Finally, you could add data logging by adding a real-time clock and an SD card to store the readings. And if you really wanted to take it further you could transmit the readings over some form of wireless technology. You should be able to find that I already have videos on small display screens and a real-time clock. My next video is going to cover the SD card. I suppose I should do one on using relays (I already have the parts).

  • @williamvanzyl5922
    @williamvanzyl5922 ปีที่แล้ว

    Steve. Your video is just what I need! Great work, Steve! Do you have any other ideas on sensors (other than the TMP36) for the Arduino? For example, to explain the science, math and technology behind it - as you did with the TMP36. My intention is to get students to explore these sensors in depth. I will use your TMP video in my research as an introduction and include 2 more examples of sensors so they can learn about the science, math, technology and programming behind them. Simple, though, like the TMP36 you have explained beautifully. Any links (videos/projects) to similar sensors? Please let me know. Your TMP video is just what I need. I will include tables - data logging ( excel/sheets), charts, and graphs. Then connect the OLED screen. I don't know how to connect the OLED screen. I have LCD screens. Could it work? .Did you make a video on an OLED screen? They will engage in the scientific method (hunch, hypotheses, design, collect data, interpret data, and then use the sensor as a tool to solve a real-life problem. I want to keep it simple - not too complicated. They lose interest if it is too complex. Thanks! William Van Zyl

    • @SteveRaynerMakes
      @SteveRaynerMakes  ปีที่แล้ว

      Thinking about sensors, the photo-resistor is fairly simple, used to measure light levels. And the ultrasonic range finder is fun which measures distance to objects by using ultrasonic sound waves. For that one you to consider the speed that sound travels and then calculate how long it takes for the sound to bounce off an object and reflect back to the sensors. Search for HC-SR04. www.amazon.co.uk/ALAMSCN-Ultrasonic-Distance-Rangefinder-ElecRight/dp/B08NT1NRZ7/ref=sr_1_5?crid=2SQW0C1M8BT0L&keywords=ultrasonic+range+finder+arduino&qid=1665521755&qu=eyJxc2MiOiIwLjAwIiwicXNhIjoiMC4wMCIsInFzcCI6IjAuMDAifQ%3D%3D&sprefix=ultrasonic+range+finder%2Caps%2C124&sr=8-5 The OLED video is here th-cam.com/video/sTKb7vh74D0/w-d-xo.html

  • @adrianvalentin4281
    @adrianvalentin4281 8 หลายเดือนก่อน +1

    Just subscribed. keep it up

  • @pixel_dominator598
    @pixel_dominator598 2 ปีที่แล้ว +1

    This video really helped thanks what why didn't you put the "pinMode();" ??

    • @SteveRaynerMakes
      @SteveRaynerMakes  2 ปีที่แล้ว

      I think as long as you have not previously set the pin as an output then it will default to be an input.

  • @saskiah3123
    @saskiah3123 ปีที่แล้ว +1

    Hi Steve, could I integrate the sensor into a small device and use it as temperature data logger? Thank you and best regards Saskia

    • @SteveRaynerMakes
      @SteveRaynerMakes  ปีที่แล้ว

      Well the sensor really just reads the temperature. For a complete data logging solution you need somewhere to save the data. You could use this sensor along with an Arduino and a shield such as this one: thepihut.com/products/adafruit-assembled-data-logging-shield-for-arduino?variant=27739231185¤cy=GBP&gclid=Cj0KCQjwyt-ZBhCNARIsAKH1177u2veE15CUwI4Fl-XbVIvRrDHXpPHxoASSWHd5p2I5EJVFGjSp2VUaAoR8EALw_wcB

    • @SteveRaynerMakes
      @SteveRaynerMakes  ปีที่แล้ว

      I'm going to look into data logging some more and will probably do a video on that soon.

    • @saskiah3123
      @saskiah3123 ปีที่แล้ว

      That would be great! Looking forward to it 😊

  • @yr98yb42
    @yr98yb42 ปีที่แล้ว +1

    hi steve how do i make it so it saves the highest temp and lowest temp?

    • @SteveRaynerMakes
      @SteveRaynerMakes  ปีที่แล้ว

      I would introduce two new variables, called highest and lowest. Initialise them with the first reading we take. Each time we take a reading compare the new reading against the highest. If it's higher than the highest, then update the highest with this new value. Also compare the new reading with the lowest. If it's lower than the lowest then update the lowest with the new reading.

  • @nekelly123
    @nekelly123 2 ปีที่แล้ว +1

    Heard of the delay() function? 😉

    • @SteveRaynerMakes
      @SteveRaynerMakes  ปีที่แล้ว +1

      yeah, I should really add that to the end of the loop.

  • @scmmonkey1843
    @scmmonkey1843 ปีที่แล้ว

    Hello Steve,
    How do i make the logging of the tempature go slower so it tells me every few 5 seconds instead of every few milliseconds?

    • @SteveRaynerMakes
      @SteveRaynerMakes  ปีที่แล้ว

      just add a delay(5000); at the end of the main loop.

    • @adrianvalentin4281
      @adrianvalentin4281 8 หลายเดือนก่อน

      1sec is 1000 2sec is 2000......5sec is 5000 and so forth

  • @kalidalsoodany2321
    @kalidalsoodany2321 2 ปีที่แล้ว +1

    Hello, can you download the code for use?

    • @SteveRaynerMakes
      @SteveRaynerMakes  ปีที่แล้ว

      I've added a link to the source code in the video description

  • @michalganobis6699
    @michalganobis6699 2 ปีที่แล้ว +1

    hi can u share code for this tutorial

  • @extremeroom7u7
    @extremeroom7u7 2 ปีที่แล้ว +2

    int sensor;
    float temperature;
    void setup() {
    Serial.begin(9600);
    }
    void loop() {
    sensor = analogRead(A0);
    float tempfloat = (sensor / 1024.0) * 5.0;
    temperature = (tempfloat - .5) * 100;
    Serial.println(temperature);
    }
    a more simple way

    • @L1ttleJuic3
      @L1ttleJuic3 2 ปีที่แล้ว

      Thanks.

    • @timecubed
      @timecubed ปีที่แล้ว +1

      You could also do:
      float temperature, tempfloat;
      to skip a declaration in the loop. It's not that big of a difference but it saves a couple characters I guess

  • @SteveRaynerMakes
    @SteveRaynerMakes  ปีที่แล้ว

    Code for this project can be found here: github.com/srayner/tmp36/blob/main/tmp36.ino

  • @williamvanzyl5922
    @williamvanzyl5922 ปีที่แล้ว

    Hi Steve. Please your email (from TH-cam). Thanks. William Van Zyl

    • @SteveRaynerMakes
      @SteveRaynerMakes  ปีที่แล้ว

      My email can be found of the channel about page.