Arduino, Thermocouples, MAX6675 and SPI - The Fine Points

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 ก.ย. 2024

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

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

    Cannot even describe how helpful this video is. Thank you very much

  • @andymouse
    @andymouse 4 ปีที่แล้ว

    I came back to this one for a refresher!...Its a favorite because it has so much info about the module that is hard to find...cheers.

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

      As always, you're welcome!
      BTW I'm currently shooting an addendum to this and two other videos. It will focus on the additional current/power requirements for the digital isolation (of the MAX6675).

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

    Great video - 14k views and only 226 likes?? I don't get it - this was a wonderfully clear and helpful video - it should have at least 5000 likes by now.

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      Thanks for the praise! From what I'm seeing the ratio between view and likes is always very low on TH-cam (1% to 5%). But you're right, the video could have gotten more likes by now. Not quite 5000 but maybe 1000.

  • @nalinux
    @nalinux 4 ปีที่แล้ว

    I love your meter !
    I had the Dm27XL :)
    Worked correctly for 30 years before I lost it.

    • @robertssmorgasbord
      @robertssmorgasbord  4 ปีที่แล้ว

      Yeah, those Backman DRMs were not bad. And while they are no longer available, you can still get repair and calibration services for them.

  • @41_ahwaszargar73
    @41_ahwaszargar73 3 ปีที่แล้ว +2

    I really appreciate the time you have invested in making this video.Considering how very well written it was coupled with easy explanantion thank you Sir So much for this video it was a pure gold mine of information.I want to know How you came to the conclusion of choosing this particular formula for moving avergae because i have seen a different one for it .Also Sir why did u choose mov_avg =-100 in start

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      You're welcome - and thank you for praise! Regarding the moving average I used: I choose that modified moving average (MMA), aka running moving average (RMA) or smoothed moving average (SMMA), (see Wikipedia en.wikipedia.org/wiki/Moving_average) because it doesn't require an array to store past values. α = 1/N, so if you replace that in my formula you get NEW = (1/N)*VALUE + (1-(1/N))*OLD = (N*(1/N)*VALUE + N*(1-(1/N))*OLD) / N = (VALUE + N-1*OLD) / N, which might look more familiar to you. I initialized my moving average with an obviously invalid number (here -100), so I would see that it's not yet calculated correctly when I start the program. That was just my laziness. A better approach would have been to initialize average=NAN (not a number) and then use the expression (isnan(average) ? value : average) when accessing the average. My bad!

    • @41_ahwaszargar73
      @41_ahwaszargar73 3 ปีที่แล้ว

      Tysm for your reply It might seem a bit much to you But I have become your Fan After watching just a single video.I mean I loved how detailed the video was and so easy to comprehend.I remember Jordan Peterson saying "If its hard for you to understand something it means its the authors fault".Based on this how easy it was to comprehend I believe You Really Know your stuff

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      @@41_ahwaszargar73 Thank you again for the praise! I'm blushing here 😊 Anyway, it's very satisfying for me when people get something out of my video.

  • @niswanthskumar1608
    @niswanthskumar1608 2 หลายเดือนก่อน +2

    Sir, first of all thanks a lot for the video. Iam making a similar temp Data acquisition system with arduino. I have to measure 2.5m underwater. Should i use a thermocouple or thermistor? Please reply.

    • @robertssmorgasbord
      @robertssmorgasbord  2 หลายเดือนก่อน

      OK, when to use a thermocouple or a thermistor basically comes down to the temperature range you want to measure. Since you're talking about 2.5m under water, I guess you're measuring "normal" water temperatures between 0°C and a few dozen °C. Thermocouples a great for measuring very high temperatures (hundreds °C), but that's not really necessary in your application. So I would go with a thermistor. Anyway, if it fits your application you should consider using a digital sensor like the DS18B20/DS18S20 ( th-cam.com/video/XUm9RPWRBx8/w-d-xo.htmlsi=rNz_LZVcwO_D3_HV ). Here I'm using one to measure the temperature of a water bath: th-cam.com/video/EP1Lc-g3uY0/w-d-xo.htmlsi=2YE7tQAADdcGYFHu .

  • @andymouse
    @andymouse 5 ปีที่แล้ว

    This is fascinating to me as I have used this module myself for a homemade tandoor (oven) I also had to average out the data but my maths is rubbish, so I just added together 10 readings and divided it, also I only update my Oled display every couple of seconds this works fine for the oven (great chicken!) I have also run into the "ground" issue. Not using the library is something i'm gonna go away and play with Its quite simple the way you put it...cheers.

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

      Well, I gather the MAX6675 is good enough to cook some tandoori dishes then :-) Regarding the grounding issue you are in luck: In two weeks or so I will publish a video where I solve exactly that problem ;-)

    • @robertssmorgasbord
      @robertssmorgasbord  5 ปีที่แล้ว

      The video explaining how to overcome the grounding issue is out now: "Galvanic Isolation of SPI Devices (e.g. Arduino, MAX6675 and SI8631)" th-cam.com/video/6rEJh4yPekg/w-d-xo.html

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

    Great tutorial! Thank you!

  • @bintangaldoni3142
    @bintangaldoni3142 2 หลายเดือนก่อน +1

    Hi robert Thank you very much for the video its reallay give me a lot of new knowlade. i have a questions about the thermocouple with the max6675,now im in a project to make deep frying machine and i've used the thermocouple. everytimes the themocouple touching the survaces of this machine which is made by stainless steel its get failure for the thermocouple read the temperature.
    i hope you have any sugest or recommendations for it, should i do special methode for this thermocouple max6675 or i must to use other module for it?
    thanks, have a nice day

    • @robertssmorgasbord
      @robertssmorgasbord  2 หลายเดือนก่อน +1

      You're probably experience a problem related to the shorting issue I discussed in the video ( th-cam.com/video/qub3yzqEwek/w-d-xo.html ). I guess in your case the power supply of your microcontroller and MAX6675 has some (albeit small) potential to the housing / the stainless steel of your machine. This causes a current loop through the sensor into the MAX6675 which messes up the measurements. There are three possible solutions for that problem:
      1) Make sure your MCU and MAX6675 are galvanically isolated from the housing of the machine.
      2) Use an isolated thermocouple.
      3) Galvanically isolate the MAX667 (see th-cam.com/video/6rEJh4yPekg/w-d-xo.htmlsi=7D7Fo1dMdy6NBIwd ).

  • @NicedayNice-wp1bp
    @NicedayNice-wp1bp 2 หลายเดือนก่อน +1

    Hello, nice explanation. For detecting fire, what is the best sensor for arduino uno?

    • @robertssmorgasbord
      @robertssmorgasbord  2 หลายเดือนก่อน

      Thanks! And sorry, I haven't worked with fire detectors (neither smoke, nor heat, nor gasses like CO2) so far. So I can't really recommend any sensors.

  • @e.a.debeijer1376
    @e.a.debeijer1376 4 ปีที่แล้ว

    Thank you very much for this informative video. I am a NOOB when it comes down to electronics but i am able to apply "The science" when it has been shown to me :) This helps me a lot in further building my smoker temperature meter where i want to be able to measure the temperature in de the smoker as well as the core temperature of whatever i have in my oven at thst time. Now i am just looking for a way to connect an o-led display to show the values...

    • @robertssmorgasbord
      @robertssmorgasbord  4 ปีที่แล้ว

      You're welcome!
      And regarding the OLED display, try that video: th-cam.com/video/9tBxXPTLM6Y/w-d-xo.html

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

    Thank you so much for this tutorial. You much speeded up my project

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

      You're very welcome! I'm always happy when my videos are helpful to somebody 🙂

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

    Very valuable video! Thanks a lot!

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

    Great great explanation! Thanks

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

    The common mistake is a metal cover of thermocouple shold be grounding. It must be done for both max2765 and max31855. There will be lots of incorrect datas without it.

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

      Grounding the (from the thermocouple isolated) metal housing/cover of a sensor is of course always a good idea. BTW what is the MAX2765? Surely a typo.

  • @jamesmac6102
    @jamesmac6102 3 ปีที่แล้ว

    I don't know who is enjoying it more, you by making the video or me by watching your video :) How can I contact you regarding technical questions?

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      I'm happy you enjoyed the video :-) I certainly enjoy making those tutorials. Unlike in my project videos usually nothing goes wrong in my tutorial videos ;-) As for contacting me: The TH-cam comment section is currently the only way to communicate with me. TH-cam is just a hobby for me and for privacy reasons I don't give out any contact information.

    • @jamesmac6102
      @jamesmac6102 3 ปีที่แล้ว

      @@robertssmorgasbord I'm using Max31865, what do you think should I use ferrites to each wire of 3wires PT100?If so what type?

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

    Helpful video 👍

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

    Thank You for the video.
    So if you have multiple thermocouples you would have to insulate them from each other? It seems like that might effect the accuracy of the readings?
    Guess I would have to experiment with them to figure something out.
    Thanks again, great info on using the arduino and thermocouples.

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

      You're welcome! If you have multiple thermocouples you only have to isolate them when they are in contact with metal surfaces with different voltage potentials. E.g. you measuring the temperature of one heat sink that is connected to ground and another that is connected to your power rail. For isolation of thermocouples see the video "Galvanic Isolation of SPI Devices (e.g. Arduino, MAX6675 and SI8631)" th-cam.com/video/6rEJh4yPekg/w-d-xo.html (no loss of accuracy - the isolation happens on the digital side).

    • @patrickmclaughlin6013
      @patrickmclaughlin6013 4 ปีที่แล้ว

      @@robertssmorgasbord
      Thank You for the info and follow up reply.

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

      @@patrickmclaughlin6013 You're welcome :-)

  • @ovi_4
    @ovi_4 4 ปีที่แล้ว

    Hi, great video and very instructional as well. However, I wonder what modification in code as well as in hardware you need to do if you only have the MAX31855 modules instead? I have several but none of the MAX 6675.
    And by the way, my modules are 3.3V but the Arduino is 5V so, I'm thinking, I will probably need to use some sort of logic level shifter modules (bidirectional maybe? I'm not sure) to communicate with the MCU. Also, another question is what library? The Adafruit one or...is there any other I can use? It would be great if you could make a video with the above modules or perhaps some ideas on how I need to do it? Thank you.

    • @robertssmorgasbord
      @robertssmorgasbord  4 ปีที่แล้ว

      Hi, have a look at the Adafruit MAX31855 module: www.adafruit.com/product/269
      It's 5V compatible and they provide a schematic for that board ( learn.adafruit.com/assets/35637 ) so you can see how that's done: No need for logic level shifters, just two diodes and two resistors - though that technique won't work if you have other 5V SPI devices on the bus that actually receive data from the hots! You can probably use the 3.3V pin of an Arduino to supply the 3.3V - I don't see the need of an extra regulator.
      Using the Adafruit library for that module should be alright (haven't done any research regarding MAX31855 libraries).

  • @jamie3641
    @jamie3641 4 ปีที่แล้ว

    Great information. Well done. Thank you

  • @edgarinv
    @edgarinv 4 ปีที่แล้ว

    Great video! I wanted to read the temperature of 3 fermenting vesels using pt100's I think your video help me a lot. Is it similar when using multiple MAX31865 ?
    one other question, If I wanted to display the temperatures on an OLED screen will it work also with SPI ?

    • @robertssmorgasbord
      @robertssmorgasbord  4 ปีที่แล้ว

      In principle, yes. But ... The MAX31865 uses bi-directional SPI, so you will need an additional data line (MISO - Master In Slave Out, respectively, SDO - Slave Data Out. Of course you'll need a suitable Arduino library. Fortunately one is available from Adafruit: Adafruit_MAX31865.h. Connecting an OLED to the same SPI bus isn't a problem, because the slaves on a SPI bus are addressed by chip select pins (one for each slave).

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

    Thank you Sir!!!

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

    Hi Robert,
    The max6675 data sheet seems to indicate 3.3v to 5v can be used.
    The library was apparently written with 5v in mind ? I get correct temps when using 5v (comparing to a ds18b20).
    My readings using 3.3v are about 10-12 degrees Fahrenheit higher, but i'm not sure if simply subtracting this differential will give me a correct reading over a large temperature range.
    Your thoughts are appreciated. i hope it's as simple as subtracting, but usually things like this are much more complicated than they appear. thank you.

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

      Mhh ... The MAX6675 can indeed operate with a supply voltage down to 3V. However, the library (which one exactly?) doesn't care at all / is in no way affected by / can't be affected by the operating voltage of the MAX6675. The interface between the Arduino and the MAX6675 is purely digital (SPI). The analog-to- digital conversion of the thermocouple voltage happens inside the MAX6675, and the MAX6675 does take care of variations in the supply voltage using an internal reference. So ... maybe you've got a bad Chinese chip or something else is wrong with your MAX6675.

  • @Presso99
    @Presso99 3 ปีที่แล้ว

    screw type of thermocouple sensor as shown in this video has a very poor response time. I prefer the wire tip type, but wire tip type will get contaminated which gives you an error after it was used for sometime or contaminated with some materials or chemicals.

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      You're absolutely right. These screw type thermocouples are slow, much slower than the wire tip thermocouples. However, I didn't know that the wire tip thermocouples can develop an error when they are contaminated. So thanks for the info!

  • @matthewlynch5879
    @matthewlynch5879 3 ปีที่แล้ว

    Is it tru to say the short issue is only where a short exists between two or more sensors. For example, where thermocouples are probe type (floating in air or into food item let’s say in baking) but not screw in or attached with eyelet or set on conductive surface..... we will not experience that short problem affecting measurement.

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      Yes, that's true. As long as your thermocouples are not connected to some conductors that have different electrical potentials you are fine. So having them float in the air or sticking them into a bread in the oven is absolutely fine.

  • @spacetime8963
    @spacetime8963 3 ปีที่แล้ว

    awesome vid! thanks so much. one question: how did you claculate error of +-2.25C from LSD of +-9.0 thanks.

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      Thanks for the praise! And you're welcome! The error calculation is simple: 1 LBS is 0.25°C according to the datasheet. You can also calculate that by dividing the temperature range of 1024°C by the 12 bit resolution of 2^12 = 4096. So an error of ±9 LSB is an absolute error of ±9 LSB * 0.25°C per LSB = ±2.25°C.

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

    Thank you

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

    The Arduino code for your study is for the two MAX6675 modules.?

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

      Yes, the Arduino sketch is for two MAX6675. You can easily modify it by changing const byte max6675_num to another number, e.g. 1 if you only have one MAX6675.

  • @seo-para-ecommerce
    @seo-para-ecommerce 4 ปีที่แล้ว

    thank you! great explain

  • @saurmaruli7864
    @saurmaruli7864 4 ปีที่แล้ว

    How can this thermocouple with SPI be integrated with Modbus protocol so that the data log can be sent & processed in computer software like Artisan for coffee roasting temperature analysis?

    • @robertssmorgasbord
      @robertssmorgasbord  4 ปีที่แล้ว

      Well, I had to google "Modbus" first, so don't expect a finished solution from me ... Anyway, are we talking about Modbus over EIA/RS-485, EIA/RS-232 or Ethernet?

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

    Hello I have an electric oven that mounts a type K probe inside the chamber, then it must be connected to the controller (plc), do you think I can also connect the same probe to max6675?

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

      Yes you can - but not parallel to the build in controller. It's either connect it to your MAX6675 (but then your oven would stop working I guess) or connect it to the build in controller! Best to install a second thermocouple for your MAX6675. But watch out for that AC mains voltage, which can cause serious injury or death!

  • @paultestman606
    @paultestman606 4 ปีที่แล้ว

    would this be good for a gas convection oven? i plan to use 2 Thermocouples like you have there to measure the temperature inside the oven

    • @robertssmorgasbord
      @robertssmorgasbord  4 ปีที่แล้ว

      In general, yes, absolutely. But it depends on the maximum temperature in your oven ;-) You can buy type K thermocouples that are good for up to 1100°C (those Chinese I had probably won't).

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

    Where can i find a thermocouple with that flat thru-hole mount? Everything T see is k-type?

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

      I've got mine from eBay quite a while ago: th-cam.com/video/Q4XTfRTT3I4/w-d-xo.html
      K type thermocouples are by far the most prevalent (cheapest) type. You might get E, J and T types from distributors (not from the Chinese for cheap though). The rest are specialty items that are usually available directly from the vendors.

  • @rohitbhosle6521
    @rohitbhosle6521 3 ปีที่แล้ว

    Thanks for detailed video about module really helpful 🙏
    I want to measure temperature of copper pipe at 4 different location so if I connect 4 Thermocouples on pipe then I will experience short problem. Can you suggest any solution like Thermocouples whose tip is electrically isolated or something like that
    Thanks

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

      You're welcome!
      As long as your copper pipe(s) (I assume for warm water) are at the same electrical potential (according to the building codes in most countries they should be grounded) you don't need electrical isolation between your four thermocouples. E.g. I just measured the temperature on both ends of an aluminum profile (heating one end with a lighter) with two non-isolated thermocouples - no problem.

    • @rohitbhosle6521
      @rohitbhosle6521 3 ปีที่แล้ว

      @@robertssmorgasbord thanks for reply 🙏

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      @@rohitbhosle6521 You're welcome 😀

  • @engr.omitdebnath
    @engr.omitdebnath ปีที่แล้ว

    Hello, I hope you are well and safe now. Please make a video to control and monitor the temperature from Thermocouple with STM32 Microcontroller, Max6675 module, and keil uvision software, and also share the programming code of Keil Uvision software. It will be very helpful for me and other researchers.

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

      Hello, hope you're well and safe too. Unfortunately I never worked before with STM32 MCUs or the µVision IDE. So I'm probably the wrong person to ask. Sorry!

  • @bigshafe
    @bigshafe 5 ปีที่แล้ว

    Can you make the code available to try? Thanks for the videos, very informative and thorough.

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

      I'll try ;-) Though it could take a few of days until I come around to do that.

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

      I've made the code available on Google Drive: drive.google.com/open?id=1Jr1x3gAqk6qdJrtftl6BtrlDJwdOymKi
      Note that this code already includes the extensions from "Galvanic Isolation of SPI Devices (e.g. Arduino, MAX6675 and SI8631)" th-cam.com/video/6rEJh4yPekg/w-d-xo.html

  • @koplandavid
    @koplandavid 4 ปีที่แล้ว

    Have you thought about calibrating it ? Mine when put into an ice bath shows 4 deg C.

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

      Nope, haven't tried or thought about that ... but thanks for the suggestion! I'll probably try that when/if I'm coming back to thermocouples ...

    • @tonyfremont
      @tonyfremont 3 ปีที่แล้ว

      You could get a reading of boiling water and then use the map() function, assuming that the thermocouple is linear.

  • @tantularnurtono2555
    @tantularnurtono2555 5 หลายเดือนก่อน

    Why my results always 0 C? I have checked all the connections and code. Please help me. Thank you.

    • @PortableTaco
      @PortableTaco 5 หลายเดือนก่อน

      your speed...add a delay 200ms

    • @tantularnurtono2555
      @tantularnurtono2555 5 หลายเดือนก่อน

      @@PortableTaco thank you for your kind attention. I have added delay(1000).. however, it is still 0 C result.

    • @robertssmorgasbord
      @robertssmorgasbord  5 หลายเดือนก่อน

      Well, I love to help you, but it's basically impossible / pure guesswork, without seeing your setup / code. Sorry!

    • @robertssmorgasbord
      @robertssmorgasbord  5 หลายเดือนก่อน

      @@PortableTaco Thanks for chiming in!

    • @robertssmorgasbord
      @robertssmorgasbord  5 หลายเดือนก่อน

      @@tantularnurtono2555 Have you checked your wiring? Do you have another MAX6675 module? Maybe yours is defect.

  • @conradsinsua7415
    @conradsinsua7415 4 ปีที่แล้ว

    love the video and got it working but have difficulty under standing the averaging maths :(

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

      Thanks! And I'm glad you got it working! There is a Wikipedia about all that moving average stuff: en.wikipedia.org/wiki/Moving_average#Modified_moving_average Maybe that helps.

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

    how do i convert this code to 1 sensor and mqtt . please will someone help me with that?

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

      Sorry, can't help you with MQTT, never did anything with MQTT. As for using the code with only one MAX6675 (no MQTT though): Just set max6675_num to 1 and initialize all arrays for just one max6675. Or use the first version of the code for just a single MAX6675.

  • @mumbaiverve2307
    @mumbaiverve2307 3 ปีที่แล้ว

    Hi Robert,
    In a moving average as you have implemented, by choosing alpha=0.1, the sample size automatically becomes 10 ? So for eg, if i chose 0.01, would it mean i am averaging over 100 samples ? I am writing some code to calculate the average value of a mains voltage sine wave , so could i use something like this for that ?
    Thanks for your great videos :)

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      In principal yes. The equivalent sample size is indeed 1/alpha. However, the MODIFIED moving average behaves differently than the (normal) moving average. See en.wikipedia.org/wiki/Moving_average#Modified_moving_average and my video here th-cam.com/video/HK1JmZx7Swg/w-d-xo.html . If you're averaging just over the peak values of a 50Hz sine wave (using some peak detector, sample rate 50Hz or 100Hz) you can use either the modified moving average or the (normal) moving average. However, if you're really sampling the sine wave, like an oscilloscope would (so sample rate >> 100Hz) the modified moving average won't work. BTW you're welcome :-)

    • @mumbaiverve2307
      @mumbaiverve2307 3 ปีที่แล้ว

      @@robertssmorgasbord Thanks for clarifying. I am actually measuring the values of the entire (full rectified) sine wave and then averaging, to calculate Vavg. I guess " (normal) moving average" may be suitable ?
      Looking forward to your next video on the heater plate controller :-) !

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

      @@mumbaiverve2307 Your welcome! And yes, you should better use a normal moving average.

  • @robertssmorgasbord
    @robertssmorgasbord  5 ปีที่แล้ว +4

    The code shown in the video is now available on Google Drive: drive.google.com/open?id=1Jr1x3gAqk6qdJrtftl6BtrlDJwdOymKi
    Note that this code already includes the extensions from "Galvanic Isolation of SPI Devices (e.g. Arduino, MAX6675 and SI8631)" th-cam.com/video/6rEJh4yPekg/w-d-xo.html

  • @piyushsharma5205
    @piyushsharma5205 4 ปีที่แล้ว

    Sir can you please tell that ,19:22 will this method work if i want to have 8 max6675 modules and also want to add a 1602 lcd display shield on arduino mega 2560?
    when there will be a voltage problem?

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

      Will that also work with eight MAX6675 modules? Yes, no problem, just use six more pins for six additional chip select (CS) lines. Will it work with a 1602 LCD shield on an Arduino Mega 2560? Sorry, I can't say for sure. I don't know what kind of 1602 LCD shield you're using. Generally: As long as the shield allows you access to (and is not using itself) MOSI and at least eight more pins for the chip select (CS) lines there shouldn't be a problem.
      The power supply (voltage) will definitely not be a problem. These MAX6675 modules draw only a few mA.

  • @Dany1557
    @Dany1557 4 ปีที่แล้ว

    Hi Robert....do you know how I can modify your code to read the tempreature in Farenheit ??..thanks

    • @robertssmorgasbord
      @robertssmorgasbord  4 ปีที่แล้ว

      Simply use the .readFahrenheit() method instead of .readCelsius() ;-)

    • @Dany1557
      @Dany1557 4 ปีที่แล้ว

      Thanks Robert...but your code has not that "redCelsius()" line. You get the value with the sentence "value=max6675Read(max6675_cs_pins[i])"...how would you do it.??..thanks a lot..

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

      @@Dany1557 Ah, sorry, thought you referred to the original MAX6675 library and not to my modified version starting at 29:19 ...
      In my function
      "float max6675Read( int max6675_cs_pin )"
      replace
      "return (data >> 3) / 4"
      by
      "return (data >> 3) / 4 * 1.8 + 32"
      and everything will be in °F.
      Hope that helps

    • @Dany1557
      @Dany1557 4 ปีที่แล้ว

      @@robertssmorgasbord ..excellent!!..thanks a lot.!!!

    • @robertssmorgasbord
      @robertssmorgasbord  4 ปีที่แล้ว

      @@Dany1557 You're welcome ;-)

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

    How connect this with Voltcraft HPS 13030 and I need to give voltage of 8v to 10v from this Voltcraft machine to control the temperature!!! Can you help me with this?

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

      I don't quite understand the question. What temperature do you want to control? Are you using the Voltcraft power supply to power some heating element and you want to control the temperature of that heating element?

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

      @@robertssmorgasbord yes exactly you are correct, how can I do that?

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

      @@jeelpatel4511 Well, that's a larger project ...
      If you go down the digital route, you would measure the temperature using a thermocouple and and for example a MAX6675. Then you would have a MCU (e.g. Arduino) with some software. And that would drive a two channel DAC to generate the control voltages for your Voltcraft. I do have two videos about a suitable DAC:
      th-cam.com/video/bj57xuQS7L8/w-d-xo.html
      th-cam.com/video/BrZYVWQ-p3U/w-d-xo.html
      I hope that helps.

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

    скажите а на ESP32 ваш код будет работать сразу или надо его переделывать ?
    tell me , will your code work on ESP32 right away or do you need to redo it ?

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

      I never programmed an ESP32, so I can't say for sure. But I guess you'll have to make some changes to the code.

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

    Im connecting 8 thermocouples to my Arduino Uno and need to log the data to an SD card. The SD card cannot be initialised if the SO and SCK pins are connected. please help I can share my coding if u want.

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

      Sorry, I never worked with a SD card connected to an Arduino. To be honest I never used a SD card in any project to this date. So I unfortunately can't be of any help. Have you tried one of the Arduino's software SPI libraries to simply connect the SD card to other pins? ( github.com/MajenkoLibraries/SoftSPI , wiki.seeedstudio.com/Software-SPI/ )

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

      Ya i am using spi library. Can i use the non modified codng for 8 thermocouples ? I tried using that code but it wasnt giving me correct tempreture values.

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

      @@samintarajarujunan5995 I don't quite understand ... I was suggesting to use the hardware SPI (SPI.h, SPI object) for the MX6675s and the software SPI (SoftSPI.h) for the SDCARD.

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

      Cordial saludo, en este video te enseñaran a guardar datos en una memoria externa tipo SD, espero sea de su utilidad, y nos lo puede comentar en este foro, saludos.
      th-cam.com/video/0rKL5UWUAzk/w-d-xo.html&ab_channel=ElprofeGarc%C3%ADa

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

      @@hornos27hotmailcom Lo siento, pero mi español se basa únicamente en Google Translate. Así que realmente no puedo seguir ese video.

  • @SidneyCritic
    @SidneyCritic 5 ปีที่แล้ว

    Is there a way to run multiple non-isolated thermo-couples, ie; 4 TCs, with one in each cyl's exh of a 4 cyl.

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

      If I understand your question right: Yes. Add two more MAX6675 modules (without digital isolators of course) on two more chip select lines to the circuit. Modify the code (rough outline): Instead of one delay of 220ms in the loop() function, add a delay in the for-loop (1 to 4) of 55ms (220ms/4). Hope that helps.

    • @piyushsharma5205
      @piyushsharma5205 4 ปีที่แล้ว

      @@robertssmorgasbord Does it apply similarly for 8 thermocouples?
      I mean , 220/8 ?

    • @robertssmorgasbord
      @robertssmorgasbord  4 ปีที่แล้ว

      @@piyushsharma5205 Yes, it does. Generally speaking: You can either have one delay(220) statement at the start (or end) of the loop() function, or you can have a delay(220 / [number of sensors]) within the for() loop. In the first case you read all sensors in quick succession and then wait, in the second you read a sensor, wait a little, read the next sensor etc.

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

    How can I connect 14 thermocouple each with a max6675 to a multiplexer CD74HC4067 ??? pls help

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

      Short answer: Sorry, you can't.
      Long answer: A thermocouple produces maby a few dozens Microvolts (not millivolts) per Kelvin (including negative voltages at negative °C). It is hopeless to try to multiplex such signals with something as simple as an CD74HC4067 (it can't handle negative input voltages and the noise level is a few Millivolts (a few thousand Microvolts).
      The way you usually would go about it would be to use 14 MAX6675 (one for each thermocouple) and then multiplex them on the SPI bus.

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

      @@robertssmorgasbord thanks for answering, and how can I do that? do I need another multiplexer? and which one?

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

      @@danbam9018 If you have 14 free IO pins on your MCU you don't need any additional chip. Just use the IO pins to drive the SPI CS pins. If you have only 5 IO pins free, use a CD74HC154 4- to 16-Line Decoder/Demultiplexer. The Y0 to Y15 outputs go to the CS pins of the MAXs. The MCU selects the MAX using the A0 to A3 pin and sends the CS signal into the E1/E2 pins.

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

      @@robertssmorgasbord and How can I do the code to make it works? where can I find some examples? thanks

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

      @@robertssmorgasbord so i need to put E1/E2 in a SPI ? or those two goes to gnd?

  • @vvoranartsomnam5507
    @vvoranartsomnam5507 3 ปีที่แล้ว

    How to use thermocouple more bouble

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      Ah, "more bouble"?

    • @vvoranartsomnam5507
      @vvoranartsomnam5507 3 ปีที่แล้ว

      @@robertssmorgasbord sorry i mean more 2 or 3 thermocouple

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

      @@vvoranartsomnam5507 Ah, OK, you want to prevent the shorting issue when using multiple thermocouples? There's a video where I explain how to galvanically isolate the MAX6675 to prevent that issue: "Galvanic Isolation of SPI Devices (e.g. Arduino, MAX6675 and SI8631)" th-cam.com/video/6rEJh4yPekg/w-d-xo.html .

    • @vvoranartsomnam5507
      @vvoranartsomnam5507 3 ปีที่แล้ว

      @@robertssmorgasbord Thankyou so much, i can do it

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

      @@vvoranartsomnam5507 You're welcome :-)

  • @robertssmorgasbord
    @robertssmorgasbord  5 ปีที่แล้ว

    There is a video out now explaining how to galvanically isolate the MAX6675 (see 23:26 in this video) : "Galvanic Isolation of SPI Devices (e.g. Arduino, MAX6675 and SI8631)" th-cam.com/video/6rEJh4yPekg/w-d-xo.html

  • @robinkks7340
    @robinkks7340 3 ปีที่แล้ว

    fais du fortnite please

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      Désolé, mais je joue uniquement aux jeux de tir à la première personne.

  • @orhanyucel1800
    @orhanyucel1800 3 ปีที่แล้ว

    error is occurred @th line SPI.begintransaction(mX6675_SPİ);
    I have defined SPI library in the code
    Why did it occur the failure
    Could you please help me
    Iam very pleased the video thanks a lot

    • @robertssmorgasbord
      @robertssmorgasbord  3 ปีที่แล้ว

      Well, what error exactly (I'm assuming it's a compilation error) is occurring at "SPI.begintransaction(mX6675_SPİ)"? And can you upload somewhere the rest of your code? It's basically impossible to tell what's going wrong without the whole code.

    • @orhanyucel1800
      @orhanyucel1800 3 ปีที่แล้ว

      @@robertssmorgasbord
      #include
      //#include "max6675.h"
      //int i;
      //double value;
      //const int spi_miso_pin = 12; // spi master in slave out pin
      //const int spi_sck_pin = 13; // spi serial clock pin
      const byte max6675_num = 2; // Serial Clock am PIN 10
      const int max6675_cs_pins[max6675_num] ={10,9}; //max6675 chip select pins
      SPISettings max6675_spi(1000000, MSBFIRST, SPI_MODE1); // 1 Mhz SPI clock


      //MAX6675 max6675s[max6675_num] =
      //{
      // MAX6675 ( spi_sck_pin, max6675_cs_pins[0], spi_miso_pin ),
      // MAX6675 ( spi_sck_pin, max6675_cs_pins[1], spi_miso_pin )
      //};
      void setup()

      {
      int i;

      for (i = 0; i< max6675_num ; i++)
      {
      pinMode(max6675_cs_pins[i], OUTPUT);
      digitalWrite(max6675_cs_pins[i],HIGH);

      }

      SPI.begin();

      Serial.begin(9600); // Begin der Seriellen Kommunikation mit 9600 Baud


      }

      void loop() {
      const float mov_avg_alpha = 0.1;
      static float mov_avgs[max6675_num] = {-100 , -100};
      float value;
      float max6675Read(int max6675_cs_pin);
      int i;
      delay(220);
      for (i = 0; i < max6675_num; i++)
      {
      value = max6675Read (max6675_cs_pins[i]);

      if (mov_avgs[i] == -100) mov_avgs[i] = value;
      mov_avgs[i] = mov_avg_alpha * value + (1 - mov_avg_alpha) *
      mov_avgs[i];
      Serial.print(round(mov_avgs[i]));
      Serial.print("\t");
      }

      Serial.println();
      }
      unsigned int data;

      SPI.beginTransaction(max6675_spi);
      digitalWrite(max6675_cs_pin, LOW);
      data = SPI.Transfer16(0);

      digitalWrite(max6675_cs_pin, HIGH);

      SPI.endTransaction();


      if (data & 0*0004)
      {
      return NAN;
      }
      else
      {
      return (data >> 3) / 4;
      }
      }
      The code did not work because of the line which is "SPI.endTransaction(); " could you please help me? thank you very much. have a nice day. :)

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

      @@orhanyucel1800 You've made a typo at one point, forgot a function declaration and added a totally nonsensical line. This version of your code complies without errors:
      #include
      //#include "max6675.h"
      //int i;
      //double value;
      //const int spi_miso_pin = 12; // spi master in slave out pin
      //const int spi_sck_pin = 13; // spi serial clock pin
      const byte max6675_num = 2; // Serial Clock am PIN 10
      const int max6675_cs_pins[max6675_num] ={10,9}; //max6675 chip select pins
      SPISettings max6675_spi(1000000, MSBFIRST, SPI_MODE1); // 1 Mhz SPI clock


      //MAX6675 max6675s[max6675_num] =
      //{
      // MAX6675 ( spi_sck_pin, max6675_cs_pins[0], spi_miso_pin ),
      // MAX6675 ( spi_sck_pin, max6675_cs_pins[1], spi_miso_pin )
      //};
      void setup()

      {
      int i;

      for (i = 0; i< max6675_num ; i++)
      {
      pinMode(max6675_cs_pins[i], OUTPUT);
      digitalWrite(max6675_cs_pins[i],HIGH);

      }

      SPI.begin();

      Serial.begin(9600); // Begin der Seriellen Kommunikation mit 9600 Baud


      }

      void loop()
      {
      const float mov_avg_alpha = 0.1;
      static float mov_avgs[max6675_num] = {-100 , -100};
      float value;
      // float max6675Read(int max6675_cs_pin); !!!!!!!!!!!!!! THIS DOESN'T MAKE ANY SENSE !!!!!!!!!!!!!!!!!!!!!
      int i;
      delay(220);
      for (i = 0; i < max6675_num; i++)
      {
      value = max6675Read (max6675_cs_pins[i]);

      if (mov_avgs[i] == -100) mov_avgs[i] = value;

      mov_avgs[i] = mov_avg_alpha * value + (1 - mov_avg_alpha) *
      mov_avgs[i];
      Serial.print(round(mov_avgs[i]));
      Serial.print("\t");
      }

      Serial.println();
      }
      float max6675Read(int max6675_cs_pin) // !!!!!!!!!! YOU FORGOT THESE TWO LINES !!!!!!!!!!!!!!!!!!!!!!!
      { // !!!!!!!!!! YOU FORGOT THESE TWO LINES !!!!!!!!!!!!!!!!!!!!!!!
      unsigned int data;

      SPI.beginTransaction(max6675_spi);
      digitalWrite(max6675_cs_pin, LOW);
      data = SPI.transfer16(0); // !!!!!!!!!!! IT'S SPI.transfer16 NOT SPI.Transfer16 !!!!!!!!!!!!!!!

      digitalWrite(max6675_cs_pin, HIGH);

      SPI.endTransaction();

      if (data & 0*0004)
      {
      return NAN;
      }
      else
      {
      return (data >> 3) / 4;
      }
      }