logo elektroda
logo elektroda
X
logo elektroda

OpenBeken setup for hot air testing - MAX6675, logging temperature and power via HTTP

p.kaczmarek2 
Type K thermocouple with MAX6675 A/D converter module on a breadboard.
Here I will show my setup for testing hot air stations - two OpenBeken devices, first used to measure hot air temperature with MAX6675, and second used to measure power - both reporting measurements to my HTTP server, so I can use them for futher processing. Of course, my setup was made on stock OpenBeken with no hardcoding - all reporting is done by scripts. So, let's see how I scripted them.

First device - my WB3S dev board - MAX6675 temperature measurement
MAX6675 can measure very high temperatures and is actually very easy to use - it can be attached to any three GPIOs. MAX6675 is using SPI protocol, but in this case SPI transaction is very simple and requires only reading just a single 16-bit word.
K-type thermocouple with MAX6675 A/D converter module, kit.
So, in this case, any OBK device could be easily used.
Here is a screenshot from my panel, and I know, it's very messy, most of the stuff is not related to this project:
Screenshot of the BK7231T_FourRelays user panel.
The more important part is in autoexec.bat in LittleFS, see here how to make one:



Here is my script:

startDriver MAX6675 24 26 6 1

again:

SendGET http://192.168.0.169:8002/log.php?temperature=$CH1
delay_s 0.5

goto again

Let's break down what happens here:
- first you have MAX6675 init and pins setup, the syntax is:

MAX6675 CS CLK MISO targetChannel

- then you have a loop, every 0.5s the temperature is sent (to be more precise, channel 1 value) to my custom HTTP server, where a log.php script processes it futher

Second device - Mycket Power Metering Socket - power measurement
Here is some information on the second device I used:
Mycket Smart Outdoor Socket PE-01E IP44 with energy measurement
Screenshot of the OBK delay script panel with measurement data.
However, any power-measuring socket should be good for this purpose.
My script here is sending voltage/current/power measurements to my script every 0.5 seconds:

again:

SendGET http://192.168.0.169:8002/log.php?voltage=$voltage¤t=$current&power=$power
delay_s 0.5

goto again


My logging script
My logging script is actually pretty smart - it does not have any hardcoded variable names, it just saves what was received via GET. Futhermore, a timestamp is added:
https://github.com/openshwprojects/hotair/blob/main/log.php
The following solution may not be perfect in some cases, for example because the saved time is the time when measurement was received and not the time when it was taken, so there may be some small discrepancies, but they are acceptable for my project.

The following setup allowed me to create those graphs:
https://openshwprojects.github.io/hotair/350c.html
https://openshwprojects.github.io/hotair/450c.html
Of course, the measurements required some futher postprocessing (removing double entries and merging) but it's out of the scope of this topic.
Futhermore, it would be obviously possible to merge my two scripts into one single device and connect MAX6675 to the power metering socket itself, but I didn't want to open the Mycket case again. Anyway, that's all for now. So far, I've used my setup to test 8 hot air stations, so stay tuned for more! Let me know if you have any questions or suggestions.

About Author
p.kaczmarek2
p.kaczmarek2 wrote 11912 posts with rating 9979 , helped 571 times. Been with us since 2014 year.

Comments