In the first part I’ve shown how a WiFi-power plug from Amazon can be easiely equipped with an own firmware to connect it via MQTT to the own home automation server. The manufacturer cloud is no longer needed in this case. A nice feature of the described model is a free extension pin of the integrated controller which can be used for own extensions. I want to use it to add a temperature sensor.
The WiFi power plug I’ve bought under the trade mark “Arrinew”. In the meantime it is no longer available but the same model is shown under various other names: Expower, Horsky, Elegiant, Allomn, Mopoin… Sure, other will follow. There are chinese companies which rent cloud services for such gear, and in principle, every dealer can order hundertthousands of these play tools under an own brand. This business model makes me some headache. If the dealer won’t (or cannot) continue it’s business the cloud is closed and the WiFi powerplug is useless. Of course, this don’t bother us because we use our onw firmware without beeing forced to any cloud.
But back to the main topic: We use a Dallas DS18B20 digital temperature sensor which is available as TO-92 (housing with wires) or as encapsulated wired sensor. The chip measures the temperature and provides it as a digital word on a so called on-wire bus signal. The one-wire bus protocol allows acessing more sensors with only one signal wire. That’s perfect for our application.
The sensor needs beside the data lione also a supply voltate (3..5V) and ground. The following picture shows how it can be wired in the WiFi-powerplug.
Because I have connected the sensor to the 5V supply (because the 3.3V seems to be less powerfull in this case) I added also a protection resistor (about 470 ohms, not so critical) in the data wire.
Measuring the air temperature is a somewhat more complicated thing as it first assumes. The temperature in a room is different in different places and not so stable (height over ground, distance to materials with different temperature, air movements…). So, it makes no sense to try to be very precise. OK, 1K accuracy is not too much. And for a possible precise measurement the external version of the sensor is a must because it can be placed free in the room on an interesting place. For me, it was too much effort, I want a possible simple temperature measurement. so I decided to place the chip sensor on top of the plug housing.
This is a bad trap to step into, the place I selected first becomes relatively warm, too warm to make a sensefull measurement. The sensor shows constant over 30°. I moved it than from the button area to a possibly cold area beside the plug. There it works well, compared with other sensors in the same room.
Who needs it? First, it’s always a good feature in the home automation to know a room temperature. Especially usefull is such a measurement, if the plug is used to control any form of a room heater.