ESP12E Based Computer Temperature Monitor
by UtkarshBhartariya in Circuits > Wireless
83 Views, 0 Favorites, 0 Comments
ESP12E Based Computer Temperature Monitor

This ESP12E based Computer Temperature Monitor is an external device that connects over WiFi to fetch the temperature and utilisation % of your CPU and GPU.
I know you can just display them on your screen but that is not cool, so I decided to make one myself. The concept of the code remains same you can attach various types of displays (LCD, OLED, TFT, etc) to suit your purpose.
I own a laptop and did not want to lose the ablility to view the temperatures when all my ports are full so I decided to switch it over to WiFi.
The concept is simple, it uses an open source software known as Libre Hardware Monitor that can measure the temperature of your CPU, GPU, RAM , storage, etc and broadcasts it over a web server, the ESP contacts the server to fetch the required information and then display it over the OLED.
OVERENGINEERING
Now you could just simply change the SSID, Password and private IP adress your router assigns to your computer in the code and re upload it, but that is too much work. In case the fetch request fails for over one minute due to any reason ESP falls back to create its own hotspot you can connect to and change the required info.
Supplies
- Node MCU ESP8266
- 0.96" OLED
- USB C Breakout board
- LED x1
- Tactile Switch x2
Setting Up LibreHardwareMonitor


- Download LibreHardwareMonitor from this link https://sourceforge.net/projects/librehardwaremonitor.mirror/
- Go to File → Hardware and select CPU,GPU or whatever else you want to display
- Go to Options and check the following options
- Start Minimized
- Minimize to System Tray
- Minimize on Close
- Run on Windows Startup
- Go to Options → Remote Web Server and click RUN by default it will run on port 8085. Change it only if you know what you're doing.
- Turn off authentication if you are on a private network.
Setting Up the ESP


This is a very basic connection (refer schematics)
- D1 on ESP to SCL on OLED
- D2 on ESP to SDA on OLED
- 3V on ESP to VCC on OLED
- G on ESP to GND on OLED
- D5 on ESP to LED via Resistor and other end to ground
- D6 on ESP to Switch(S1) and other end to ground
- D7 on ESP to Switch(S2) and other end to ground
- Connect VIN and GND on ESP to power supply if needed (make sure the voltage remains between 5V and 12V if supplied to VIN)
Code
Required Libraries
- ESP8266WiFi.h
- ESP8266HTTPClient.h
- ArduinoJson.h
- Wire.h
- Adafruit_GFX.h (if you are running OLED)
- Adafruit_SSD1306.h (if you are running OLED)
Downloads
Dry Run







Booting it up first time
- Trying WiFi shows on the screen, device does not find "/wifi.txt" hence switches to AP mode and displays the IP
- Connect to the WiFi (default SSID: ESP-SETUP password:12345678) and in your browser type the IP displayed (mostly it would be "192.168.4.1")
- It will open a form page enter the SSID and password your computer is connected to (in case it is not connected start your own hotspot) and also enter your computer's IP (if you don't know your private IP for your computer, open command prompt or terminal and type "ipconfig" and "ifconfig" for windows and linux respectively) click Submit
- The setup form is mobile-friendly, so you can connect using your phone as well.
- Your ESP will restart
Now it has the ssid, password and IP saved in a file at /wifi.txt
- Trying WiFi shows up
- Connecting to WiFi shows up
- SSID password and IP address of ESP shows up
- Normal Functioning
- The screen will cycle between a.[CPU temperature, GPU temperature, and GPU Hotspot temperature] and b.[CPU utilisation and GPU utilisation]
- Press and hold Switch S1 to freeze the screen, if you want to choose between Temperature or Utilisation. When the screen is frozen LED on D5 lights up. Press and hold S1 again to resume cycle
- Press and release Switch S2 to open Custom UI, it shows just CPU and GPU temperature, you can change it to whatever you want in the code. Press and release again to switch to normal view.
- In case the temperature of your CPU is more the than Tj_max (here 95) or GPU Hotspot is more than its Tj_max (here 100) the LED on D5 will blink.
- To edit Tj_max open the code search for
"#define TJMAX_CPU"
and edit the value and simlilarly edit for GPU Hotspot
3D Printing


I recently learnt 3D modelling and decided to 3D print for the first time. Here are the files.
The hole on the base is for LED and the hole on the side is to pass wires for the switches.
Further I did not want to power the whole board with microUSB on the Node MCU board so I added a USB C breakout board, the port on the top is for the USB C breakout board and the port on the bottom is for microUSB for debugging or uploading new code.
NOTE-
- The screw holes for OLED were not properly aligned, I have added the fusion360 file you can edit according to your display.
- If you have your own 3D printer you can print the logo and the text, commercial printers will make a mess so you can remove it.
- Upload th .stl files for printing
If you do not wish to 3D print you can just design a basic MDF cover which I was going to do initially.
How It Works

LibreHardwareMonitor starts its own server at port 8085 and sends a JSON file named "data.json" that contains the file you can access it from your computer, open your browser and type in "localhost:8085".
Our ESP sends a fetch request to fetch this data.json and searches the file for the required labels and displays the appropriate utilities.
FALLBACK
The ESP stores a file wifi.txt in its EEPROM in the following format
If this file is present it tries to connect to WiFi with the SSID and password saved in the memory and then tries to fetch from the IP, if it can not connect to the WiFi it switches to AP mode to which you can connect and save the new SSID PASSWORD and IP. In case the IP is invalid or a server is not running at port 8085 of the IP it will delete the wifi.txt file and restart the ESP in AP mode
Errors
"File Error" - ESP can not write to the file "/wifi.txt"
"JSON Error" - ESP can find the labels in the received "data.json" file
"Fetch Failed" - ESP can not find the web server, router has assigned a different IP to your computer or LibreHardwareMonitor is not running, your WiFi router is not funtioning. After a minute ESP restarts in AP mode to let you edit the SSID, PASSWORD and IP.
Blinking LED - on D5 indicates your Temps are above your Max set limit
IDE errors - make sure you have all the libraries downloaded and the board manager set.
Futher debugging can be done via serial monitor
Final Assembly




I made some mistakes in modeling, and the printing company made some in printing. But here’s how it turned out!