Hello, I'm wondering if anyone has been able to read the SPI bus with node red. I am trying to read the output of a MAX6675 which is a thermocouple digitiser with 12 bit resolution. The only possible method that I can think of is to use a picaxe 08M2 to handle the SPI function and send the data to the PI over the serial bus.
Any suggestions, how ever wild would be appreciated.
Cheers Keith.
As far as I know, there is no SPI node for Pi yet. Your method is one way to do it. Another way is to write your own node for MAX6675 with Node js, which has support for the SPI interface. It may take quite some effort.
Have you looked at node-red-contrib-pi-max31865? Max31865 is for RTD temperature measurement and has a higher accuracy than MAX6675. MAX31865 plus RTD cost a little bit more but may get even if you add other costs. The last update of the node is more than a year ago. I have not used this node so there is no guarantee that it works now.
BTW, use 3.3V for the VCC of MAX6675 not 5V. Otherwise, it can damage Pi.
Thanks for that Davidz, I'm certianlly heading down the track of writing my own node. However in the meantime i have got a routine working using python and spidev. There could well be a shortcut here using the pythonshell node.
The issue that I have with the MAX6675 module is that it seems to be returning the temperature in Fahrenheit not Celsius, even though the data sheet clearly reads degrees Celsius. Has anyone else experienced this problem or am I missing something very basic? If I use a Fahrenheit to Celsius conversion in my python routine, the result is really quite accurate.
Are you sure that the python script is not converting it?
Rather than use pythonshell you might be better an exec node to call the python script. Some have had problems with the python node.
First things first, the MAX6675 was returning degrees Celsius, after reading the data sheet a few more times, I realized the converted temperature was in .25 degree increments. My Mistake.
I now have a working solution, I have a working python function and I can call it from Node Red using the EXEC node. I have attached both the python function and the test flow if it helps anyone.
GetMAX6675.py.txt (1.6 KB)
nodered python thermo.txt (2.7 KB)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.