Reading boiler temperature with Raspberry Pi using camera

In digital systems we usually use digital temperature sensors or somehow integrate analog sensors by using ADC. But if you want to modernize existing system where analog gauges are used, this may be tricky. You may think of adding additional sensor that would be easy to read with MCU. But there may be more interesting but challenging approach. Seb decided to implement Raspberry Pi based setup which would read gauge image with camera and try to read its arrow position with simple image processing algorithm.

So first of all he attached simple circuit to Raspberry Pi GPIO – a simple transistor driven relay that switches boiler heater. Then pointed RasPi camera to temperature gauge, then he focused on software part. He implemented email driven control protocol where several python scripts reads specially constructed email messages and gives command to turn heater on or off. Then comes part to read if temperature reached desired level. He uses openCV package to work with captured images. The trick of reading gauge is rather simple. He captures image then selects white region and cunts red pixels that indicate presence of red arrow. If no red pixels are detected, then temperature is bellow threshold. This is quite smart workaround which can be used in other cases as well.

[..Source link..]

Bookmark the permalink.

Comments are closed.