Every smart home heating system needs to accurately monitor temperature at different points and with different requirements. Unlike off-the-shelf sensors, a custom-built temperature sensor is tailored to meet unique requirements, offering a high degree of precision and versatility. These sensors are crafted to cater to a wide range of industries, including industrial automation, environmental monitoring, healthcare, and scientific research. Customization allows for the selection of sensor types, materials, and form factors that best suit the intended use, ensuring optimal performance and reliability.

In particular, I used 3D printer technologies to build custom enclosures in order to integrate whatever sensor I needed such as to perfectly integrate the actual house electrical system with the Home Assistant in-silico representation.

Custom software or smarter options?

As I described in previous articles, like in Control Unit of a Solar Thermal System, I built several versions of custom temperature sensors based on the NodeMCU platform and DHT22 or DSB18B20 sensors. I write the code myself to read temperature (and humidity) and host a web server to read it and pars it into the Home Assistant entities. However, after some experience, several issues come out:

  • The wireless connection is unstable and I need to re program an automatic way to reset the connection once the link is broken
  • I may need to add/remove sensors without re-writing all the firmware (converting a DHT22 into DSB18B20 is very annoying due to the need to re-write the firmware).
  • I may need to change settings withouth accessing the device (after changeing wi-fi passows it was very annoying to manually change firmware code for each sensor).

I could theoretically add all these features but I discovered a smarter way to do it. Why do I need to build and write code for such a complex system when I can simply use Tasmota?

Tasmota firmware

Tasmota is an open-source firmware designed to empower and enhance the capabilities of smart home devices. In the rapidly expanding world of home automation, Tasmota plays a crucial role in enabling users to take control of their smart devices, making them more versatile and secure.

Temperature sensor
The sensor with the Tasmota firmware exchanges information through the MQTT broker

Tasmota meets all my requirements and it is easy to install and update. In addition, it is very versatile and allows me to integrate whatever sensor I need and also to write my own code for custom integration. It contains also a prebuilt integration for MQTT such as very easily pushing data into my Home Assistant server. More info on that in the article about my network.

Cloud data storing

However, with respect to my custom design, I lost a functionality: I can’t push data into my remote cloud anymore. With the previous devices I was using an HTTP request to pars data into a remote database and I can’t do it anymore. But this is not a problem because I am currently storing all the home automation data within a single system: Home Assistant, and from it I can backup this information whatever I want. It is more secure and based only on LAN, so I can access it remotely using my VPN avoiding storing data on external services.


Software installation became very easy, just download Tasmotizer, connect your devices and install the lastest version of the firmware. After that, push the Wi-Fi setting and you can connect to the devices web server to customize your configuration.

As an illustrative example, for the DHT22 it is sufficient to make the connections like VCC, ground and the data pin with the 4.7 kΩ pull up resistor. Then, just select the data pin as the AM2301.

Enclosure design

Due to the very easy to setup firmware, the software section is less interesting with respect to the enclosure design. With 3D printing, we can produce any design we want and integrate it with colors and materials of the environment. For all the following prototypes I used the Polylactic Acid (PLA) for several reason:

  • Ease of Use: It adheres well to print beds and has minimal warping, making it a good choice for beginners and experienced 3D printing enthusiasts alike.
  • Biodegradable: PLA is made from renewable resources such as cornstarch or sugarcane, making it an environmentally friendly choice. It is biodegradable, which means it will naturally decompose over time.
  • Low Odor: PLA filament emits less odor and fumes during printing compared to some other materials like ABS (Acrylonitrile Butadiene Styrene), making it more suitable for indoor use without the need for special ventilation.
  • Wide Color Selection: PLA comes in a vast array of colors and finishes, including standard colors, metallics, and even glow-in-the-dark options. This variety allows for creative and colorful 3D prints.
  • Good Detail and Surface Finish: PLA can produce prints with fine details and a smooth surface finish. This makes it a good choice for decorative or artistic projects.
  • Affordability: PLA filament is typically more affordable compared to some other 3D printing materials, making it an economical choice for prototyping and general-purpose printing.
  • Compatibility: PLA is compatible with my 3D printer as well as with most Fused Deposition Modeling (FDM) 3D printers, so it’s a versatile choice for many different machines.

And the main limitation of the PLA related to the very low melting point, is not a problem since I’m using such devices at room temperature.


A first prototype came out by trying to reduce the size and compact both the Wemos D1 and the sensor inside a single case. However, this leads to a first temperature issue since the Wemos heat may alter the temperature reading. During Wi-Fi communications, it reaches more than 25°C on the chip and antenna surface with consequent heating of the air inside the case. Then, the sensor accuracy is totally destroyed.

So, I came out with a second design placing the sensor beside the Wemos board. The case is easily 3D printable as is a snap-on lid to close everything together. A little bit of wiring and the sensor is ready.


Once the devices we need are fixed, the design can also be adapted to the electrical system transforming the external case into a cover for the electrical boxes of the home system. This design also needs a buck converter to power the Wemos 5V from the 220V AC source.


And with the same basic project, we can extend this device to whatever design we want. Just 3D-model it and print it!

Have you ever seen a rocket temperature sensor?


Notch for the alimentation

Or it is also possible to adapt the design for a shutter overlooking the garden to read the outdoor temperature.

Wall thermostat

As well as we can also create an indoor device matching the wall color and room design to read the room temperature and enable a thermostat entity with Home Assistant smart home control.

Despite appearing very large it follows a flat design for two main reasons: (1) to avoid temperature problems due to the Wemos self-heating as for the other devices, and (2) it will be covered by a TV with a flat mount system.

Raw data for temperature and humidity. Clearly, both reading sets need to be post processed taking into account also sensor sensitivity and time span.

Smart home

Through the MQTT broker, all the sensors are included in the Home Assistant system in order to accurately monitor the environmental temperature for each room. This allows the optimization of the heating system for energy saving while still maintaining an ideal comfort. We'll come back on this in a future article focused on the heating plant and control unit.

Wall mounted tablet with Kiosk browser showing Home Assistant dashboard for rooms temperature
Home Assistant mobile application in dark mode showing temperature for rooms and thermal system

Final remark

In conclusion, why not buy a consumer pre-built temperature sensor available on the market? The main reason is related to the necessity of custom integrability. Despite a lot of sensors showing plugins for the integration in the Home Assistant ecosystem, they mostly rely on a proprietary cloud system. With this custom sensor, I only rely on my LAN network without requiring internet access. Furthermore, several sensors show battery which translates into the necessity of substitution and limits in terms of reading per minute due to the energy saving.

Moreover, this custom design allows for a unique design to be built to perfectly match the design of the room and the single user's preferences. The design is also very cheap with a cost of less than 5€ per sensor, excluding the 3D printed material (that is also relatively cheap due to reduced size).

Despite being a simple example of a custom design, these tailored sensors empower businesses to meet specific environmental monitoring needs, ensuring accuracy and reliability in diverse applications. With advancements in technology, the ability to customize temperature sensors not only enhances efficiency but also opens doors to innovation in fields ranging from healthcare to manufacturing. As we continue to push the boundaries of sensor customization, the future holds promise for more nuanced and specialized solutions, driving progress in temperature monitoring across industries.

All the designs shown are available for free on my Grabcad.com page.