Will be great to share with us the results about when received & tested.
Happy breadboarding,
TJ.
Available on Tindie: https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/
Explore... Chat... Share...
rpav wrote:I've ordered new module form Aliexpress and will report to this thread if it helps. I hope it will.
-- MAX31855 to ESP8266 connection
-- Signal IO index ESP8266 pin
-- HSPI CLK 5 GPIO14
-- HSPI /CS 8 GPIO15
-- HSPI MISO 6 GPIO12
-- !!! WARNING !!! GPIO15 _must_ by HW PULL-DOWN by 4k7 resistor.
-- !!! If you do not do it, esp will not boot and you can see something like:
-- ets Jan 8 2013,rst cause:2, boot mode:(7,6)
--
-- waiting for host
-- Init SPI
spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, 32, 16, spi.HALFDUPLEX)
-- Thermocouple temperature
str1=""
temp1=0
-- Internal temperature
str2=""
temp2=0
-- err=""
function measure()
-- do transaction & read data from buffer
spi.transaction(1,0,0,0,0,0,0,32)
data = {spi.get_miso(1, 0, 1, 32)}
-- print(table.concat(data))
-- check error(s)
if data[16]==1 then -- error
err="ERROR: "
end
if data[30]==1 then -- error
err=err.."Short to VCC "
end
if data[31]==1 then -- error
err=err.."Short to GND "
end
if data[32]==1 then -- error
err=err.."Open Circuit "
end
-- read data for Thermocouple temperature
str1=table.concat(data,"",2,14) -- concat 13 bits to table, first is sign bit
t1=tonumber(str1,2) -- convert table of binaries to decimal number
if data[1]==1 then -- sign bit on, the number is negative, compute it
t1=t1-8192 -- sign binary, 1111111111111 = 8191
end
t1=t1*.25 -- step for Thermocouple temp is 0.25
str1="Thermocouple temp is: "..t1.."'C"
-- read data for Internal temperature
str2=table.concat(data,"",18,28) --concat 11 bits to table, first is sign bit
t2=tonumber(str2,2) -- convert table of binaries to decimal number
if data[17]==1 then -- sign bit on, the number is negative
t2=t2-2048 -- sign binary, 11111111111 = 2047
end
t2=t2*.0625 -- step for Internatl temp is 0.0625
str2="Internal temp is: "..t2.."'C"
end
tmr.alarm(1,10000,tmr.ALARM_AUTO,function()
measure()
print(err);
print(str1);
print(str2);
print("");
end)
It takes about 20-25 seconds for home assistant c[…]
I tried to upgrade tof my sonoff basic R2 with the[…]
a problem Perhaps you want to define "Probl[…]
Rebooting your router will not give you a faster I[…]
There are no other notifications from esptool.py i[…]
Using the Arduino IDE, you'll learn how to set up […]
In this project, you will post to Twitter using an[…]
In this project, we will build a water level contr[…]
I guess I'm late, but I had the same problem and f[…]
Last night I received my first D1 Minis for a lear[…]
Although I am aware that this is an old post, I fe[…]