4 channel temperature logger based on the DS18B20 sensors

Поделиться
HTML-код
  • Опубликовано: 23 июн 2020
  • In this video I show you my recent build which is a 4 channel temperature logger based on the DS18B20 sensor. The full system consists of an Arduino Nano, a micro SD card slot, 4x DS18B20 thermometers, a toggle switch and a 128x32 OLED display. It was relatively easy to build and program the circuit, however, I was struggling a bit with the boxing. It was a bit too crowded in the enclosure due to the large amount of cables.
    If you liked the content, please subscribe!
    Source code and wiring diagram: curiousscientist.tech/blog/ds...
    If you want to support my work, please consider buying the parts using my affiliate links:
    curiousscientist.tech/tools
  • НаукаНаука

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

  • @squidben5780
    @squidben5780 Год назад +1

    Very nice video, and detailed diagram. Thanks

  • @SITelemark
    @SITelemark 2 года назад +2

    Hi, this is really cool stuff! I will try to replicate as I do want to build a similar data logger with three sensors - hope to manage and also try to exchange the OLED by a 4x20 I²C LCD. Thanks for your video!

    • @CuriousScientist
      @CuriousScientist  2 года назад +1

      Hi and thank you! The exchange should be very simple, the 4x20 LCD has relatively good libraries. I have other projects where I use that specific LCD, so maybe you can merge the information of that project with this one and work out the use of the LCD. I used the above mentioned LCD in this project: ruclips.net/video/XjDAgLEsuhU/видео.html

  • @prezbenny7842
    @prezbenny7842 2 года назад +2

    nice! very detailed. Thanks and keep it up.

  • @E2ESolutionsDIY
    @E2ESolutionsDIY 4 года назад +1

    Great work Dear 👍

  • @saturdayscience5540
    @saturdayscience5540 8 месяцев назад

    Good to see a project so well explained and packaged in a box. May I suggest two improvements? If you run the unit as a stand alone logger (i.e. without inspecting the serial port) and the Arduino doesn't connect to the SD card then you have no idea until you plug the SD card into your computer and try to download the data. You use '0' for not logging and 'W' for writing to the SD card. When initialising the SD card you use a global flag to indicate a fail to connect e.g. 'X'. Likewise when writing to the card if file is false you could use 'X'. Then you would print '0', 'W' or 'X' to the OLED and you could avoid a wasted logging session.
    The second improvement would be to hard code the DS18B20 ID numbers to the relevant channel. Currently there is no link between Red, Black, etc DS18B20 and T1, T2, etc. No matter my comments, still an excellent video and project.

    • @CuriousScientist
      @CuriousScientist  8 месяцев назад

      Thank you! I am always open to improvements! In fact, one of the ("selfish") purposes of uploading my projects here is to get them peer-reviewed. Sometimes I learn a lot from feedback from the viewers, so appreciate the constructive suggestions!
      The SD-card-related flag is a great suggestion. When I wrote this code, I was not super experienced with coding, and I also did not prioritize user-friendliness. So, this is a great suggestion and I will keep it in mind for future projects where I use an SD card. Regarding the sensors, it is a good idea, too! I had the links in my notes, but not in the code.
      Also, here is another temperature logger project I finished recently: ruclips.net/video/CK_s86k92HQ/видео.html
      This also deals with an SD card and multiple sensors (however, they are NTC thermistors). But you might like the project nevertheless.

  • @dariyabaiko9401
    @dariyabaiko9401 3 года назад +3

    Great tutorial! Many thanks! I have just finished building this project but with a 16x2 LCD screen instead of OLED. I struggled with making the toggle switch work (it was constantly having it ON no matter the position of the toggle). The solution for me was to connect middle pin to the GND instead of 5V, and the toggle resistor to 5V instead of GND. Idk if this is something specific to my wiring or maybe there is an error in the schematic (?) but I just wanted to post this here in case someone else needs this hint for a possible fix.

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

      And I forgot to mention one more thing I did: For the toggle pinMode, I changed INPUT to INPUT_PULLUP

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

      Thank you for the detailed feedback. At that time when I created the circuit in Fritzing, I could not find the the ON-ON toggle switch, so I replaced it with this other type of switch which might not work in the same way as the ON-ON switch. Nevertheless, the wiring on the pins is the same, it it just the switch that differs. Sorry for the confusion! The INPUT_PULLUP can be omitted if you use pullup resistors, but otherwise it is a good idea.

    • @shadiedalati3662
      @shadiedalati3662 2 года назад

      the same for me with toggle switch.

  • @isidoromaich7226
    @isidoromaich7226 4 года назад +1

    Pretty neat! very professional. At 21:10 maybe you could use a pin with a toggle switch with a if routine to toggle between continuos writing or split file

    • @CuriousScientist
      @CuriousScientist  4 года назад +1

      Thanks and also thanks for the idea! Maybe I will implement it in an updated version of the software. My original idea was to always open a new file whenever I start a new measurement. It would be easy to increment the value of a variable, add it to the end of the string and have something like "Filename_1.txt", "Filename_2.txt"...etc. But then I did some research on the format of the filename and it looked a bit meticulous for the first glance, so I left it for now because I just wanted something working. You have to create an array of characters and work with that because for some reason, Arduino does not like string or concatenated string as a type for the file name if it is something complex...

    • @isidoromaich7226
      @isidoromaich7226 4 года назад +1

      @@CuriousScientist You can always use the date and time as a filename and it will be different every time. This also serves as an quick visual indicator when searching in the folder. Just my 2 cents

    • @CuriousScientist
      @CuriousScientist  4 года назад +1

      I do not use RTC to keep track of the date and time. And when I use the box, for example while recording the video, it is only connected to a power supply (mobile charger), so I cannot even send the date and time to it via the serial port. Actually, if I would use my STM32 units, they have built-in RTCs, and I could use the date and time.

  • @gerbenzeinstra1395
    @gerbenzeinstra1395 3 года назад +3

    Very nice presentation and elaboration! I'am interested in the format of the sd data. It would be nice to be able to plot graph based on excel data.

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

      Thank you! It is a simple tab or comma separated values. Actually, if you download the source code, you will see the format of the data that ends up on the SD card. You can customize it as you want. I always generate tab or comma separated values into a simple .txt file and then I plot them with Qtiplot or process them in Excel.

    • @gerbenzeinstra1395
      @gerbenzeinstra1395 3 года назад +1

      @@CuriousScientist Thanks for the quick response. I have a VMA 202 shield and will try to implement it in your source code.

    • @CuriousScientist
      @CuriousScientist  3 года назад +1

      Great! That shield looks nice with that built-in real-time clock. I have an older video about building an RTC-based watering system. You should check the source code, it might be useful.

    • @gerbenzeinstra1395
      @gerbenzeinstra1395 3 года назад +1

      @@CuriousScientist Tried to merge a VMA 202 based temperature logging sketch with your sketch. So far no success; lot of program issues. So I will find me a coach.

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

      Please write me an email with your source code. The address is on my website.

  • @Accessgp
    @Accessgp 2 года назад +2

    Hi, I liked your video and it is a very nice project. I also want to use it for the same purpose which is to work with peltiers. My question is can we use maybe 6 or 8 sensors instead of 4 that you used and will this same project with little tweaks to the code work?

    • @CuriousScientist
      @CuriousScientist  2 года назад

      Hi and thanks! You can hook up dozens of these DS18B20 sensors on the same bus. They use the so-called 1-wire communication bus system which allows you to connect a lot of devices. It should work with a slight modifications of my code with any reasonable number of devices.

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

      @@CuriousScientist Hi, I am only able to get a 128x64 display here in my local shops. Can I use with this project without doing anything to the code? If I need to tweak the code then Please suggest some ideas because I am at ground zero when it comes to programming.
      I have managed to get 6 sensors because I wanted to monitor all the peltiers separately to see which one is underperforming, so what do I need to tweak in your code?
      Thanks in Advance 🙂

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

      Unfortunately, the resolution of the display doesn't tell too much to me so I cannot answer the question. Is it an oled display or an LCD? What driver chip is used in the display? Typically, each display has its own library, so you might need to do some extra coding to load the proper library and then to put everything on the display and fit the numbers. If it is an ssd1306, then maybe you just need to redefine the resolution.

  • @lauraallen8518
    @lauraallen8518 3 года назад +1

    Hi there m thanks for putting this out ! I'm real new to this & I can't tell from teh code does this read in C or in Fahrenheit ? Do I need to change anything to get it to display in F ?
    thank you

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

      Hi and you're welcome! The unit is Celsius degrees. The formula to convert from Celsius to Fahrenheit is F = 32 + (9/5 * C).

    • @lauraallen8518
      @lauraallen8518 3 года назад +1

      ok, thank 's for putting this out @@CuriousScientist

  • @shadiedalati3662
    @shadiedalati3662 2 года назад

    Hello,
    Is this setup save data on SD card? I used standard SD card slot and card. Everything is working and I see temp. On LCD But nth is saved on SD card. Can you help me out?

    • @CuriousScientist
      @CuriousScientist  2 года назад

      Hi,
      It works for me very well, I've been using this gadget for a while without issues.

    • @SITelemark
      @SITelemark 2 года назад

      Hi, Did you manage to have the sketch run with LCD display successful?

  • @phil4000n
    @phil4000n 2 года назад

    Hello how did you make the casing box and wire. FYI: MAC addressing is safer

    • @CuriousScientist
      @CuriousScientist  2 года назад

      Hi! I bought the casing, then I cut some holes on it.

    • @phil4000n
      @phil4000n 2 года назад

      ​@@CuriousScientist Can you give box references and show the inside, could be interesting to see the soldering. Thanks

    • @CuriousScientist
      @CuriousScientist  2 года назад

      The wiring is shown and explained in the video from 10:20. I soldered everything together according to the wiring I showed. Regarding the box I don't remember where I bought it, so I cannot provide any product number or similar, sorry.

    • @phil4000n
      @phil4000n 2 года назад

      @@CuriousScientist I meant the physical components soldering, not the Fritzing view

    • @CuriousScientist
      @CuriousScientist  2 года назад

      Sorry, but I won't disassemble the box and take pictures of it. All resources are already made available in this video and in my website.

  • @billknight7442
    @billknight7442 2 года назад

    How is the segregation handled when sensors are in parallel to the same pin?

    • @CuriousScientist
      @CuriousScientist  2 года назад

      Each chip has its own burnt in code. Check the datasheet.

    • @billknight7442
      @billknight7442 2 года назад +1

      @@CuriousScientist Thank you for taking the time answering and explanation details. Do you think expanding your design to 8 sensors on one input would work ok as well? Or two inputs of 4 would be better?

    • @CuriousScientist
      @CuriousScientist  2 года назад

      You're welcome! If I am not wrong, one line can take even 64 sensors.

  • @shadiedalati3662
    @shadiedalati3662 2 года назад +1

    Hello Thanks a lot for your videos, I learned a lot. I am trying to replicate it but I get "-127" degree for all sensors on OLED display. I'm new to this field and tried to follow all you mentioned except I used standard SD card slot instead of micro (I'm not sure if is possible!) and I did not find SSD1306AsciiAvrI2c.h library in Arduino IDE to download but the code is verified and uploaded without that.
    Thanks for your help in advence

    • @CuriousScientist
      @CuriousScientist  2 года назад +1

      Hi and welcome! Unfortunately, I don't know what is the issue. The SD card slot does not matter, it is just an SPI device at the end of the day, so it should be alright. Also, I do not think that the header file should cause troubles if the code compiles. Did you add the 4k7 pull-up resistor to the circuit? The value -127 suggests that the Arduino is not able to communicate with the sensor(s).

    • @shadiedalati3662
      @shadiedalati3662 2 года назад +1

      @@CuriousScientist thanks a lot for your fast reply 🙏 Yes I have the resistor. I will check all sensor connections once more

  • @Organ18
    @Organ18 2 года назад

    Is it possible to do energy meter 12v instead of temperature sensors ?? to check in the evening how much electricity was used by the device during the day ??

  • @IOwnedME
    @IOwnedME 4 года назад +1

    For data logging i found the following program from another youtube creator upgrdman.
    ruclips.net/video/C1m6CvgjcSc/видео.html
    You can view real-time data in visual form and easy export of excel data for further analysis and no need for SD cards.
    I am using 2 ADS1256 boards for data acquisition. An esp32 sketch ruining data processing on 1 core and real time wifi UDP packet stream to the logging program. I must say i am impressed by his program as i ran the thing for 10h+ with zero problems and data sets of many million transmissions.
    As for your testing and characterization of peltiers i think an interesting aspect would be delta heat flux capacity of peltier modules at certain delta T. The way i would go about doing that is having constant mass flow of your water cooling system and recording delta T in both sides of the peltier. SO delta T on hot and delta T on cold.
    Might require a lot more hardware on the water-cooling loop side tho.

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

      My workbench and my computer are located in two different rooms. So, I have to save the data to some storage first as I do not have any devices nearby. Writing the data is pretty reliable too, I am pretty much OK with it. If you saw my earlier videos, I also wrote a realtime datalogger/visualizer software, but thank you for the suggestion!
      Regarding the testing, at this point I do not want to add any extra features. I do these stuff as a hobby, so I only want to invest in those things which are interesting enough for me. I spent crazy amount of money on these things, so I want to stop with the spending for a while.