logo elektroda
logo elektroda
X
logo elektroda

Adding a DHT22 Temperature Sensor to T34/BK7231N for Room Heating Control

Tilator 
Modified Tuya relay controller with attached DHT22 sensor.
Hello,

There seems to be multiple different layouts available of this device.

My need was to add a temperature sensor in it to make possible to measure room temperature and use the relay to connect heating on and off.

Smart switch Tuya with DIY modification, label view.

There is S1 and S2 connectors for external switch. I used those to connect DHT22 sensor. S1 is ground and S2 ic connected to GPIO P14, which is pin11 on the CPU. I just took the NC pin off the sensor. All three other pins are at suitable distance from each other to fit the connector.

There is a pullup resistor and capacitor between this P14 and VCC. I took them both off. They are located near the relay under marking BC8.

Modified Tuya relay controller with attached DHT22 sensor.

Only VCC to the sensor needs to be addeb by jumper.

I did not desolder the CPU to flash it. One UART wire can be soldered to the BR4 resistor at the end near number 4. For the second one I used a big and sharp normal knitting needle from my wifes reserves. I holded it at the plase simply by hand. It's easier to keep it on the right spot if it is sharp enoug.

DHT22 sensor gives right values right away. I did try a DHT11 too and it seems to need some dividers to give correct value.

Here is what it looks like:

Web interface of the BK7231 controller with DHT22 sensor information

Here is configuration:

Screenshot of pin configuration settings for BK7231N/BK7231T controller.

DHT22 is where originally should be BTN_TGL_ALL to act as external on/off switch.

Related T34 topic (flashing method): https://www.elektroda.com/rtvforum/topic4036975.html
For more info, see: https://www.elektroda.com/rtvforum/find.php?q=T34

About Author
Tilator wrote 90 posts with rating 11 , helped 2 times. Been with us since 2023 year.

Comments

p.kaczmarek2 25 May 2024 18:13

Yes, this is a good idea. With OBK , such modifications are very easy. We've did similiar thing with DHT11 on our YT channel: https://www.youtube.com/watch?v=KEjOPuYd3CE The second modification that... [Read more]

Tilator 25 May 2024 18:42

You are right and I'm aware of it. The cap you can see is only there to demonstrate the connection. Final installation needs some glue between the parts. Can you tell me is it possible to read the temperature... [Read more]

p.kaczmarek2 25 May 2024 18:52

I think our OBK channels command should work: http://192.168.0.163/cm?cmnd=channels Please try it out and let me know if it works for you. [Read more]

Tilator 25 May 2024 19:01

Thanks. [Read more]

Tilator 04 Aug 2024 10:38

Hello again, There seems to be DS18B20/DS1820 support available now. Thank you again. This was good add on it. I have not tested it yet, but will do it as soon as I have a bit spare time. [Read more]

p.kaczmarek2 04 Aug 2024 23:34

I'm eager to hear some feedback! Please try and let know. PS: Don't use PowerSave 1 with it. [Read more]

divadiow 12 Sep 2024 07:51

@tilator does your DHT22 give readings still with the latest builds? I don't suppose you ever took a pic of the PCB inside the casing? I'm just curious about my one which doesn't seem to work with OBK... [Read more]

Tilator 12 Sep 2024 08:22

At least version version 1.17.661 works fine. Pictures are available if they anyhow help you. [Read more]

Tilator 24 Sep 2024 00:29

Now I had time to try it, but DS18B20 sensor does not come available. There are at least two different physical configurations to install this sensor. Which one should I use? I installed it by connecting... [Read more]

divadiow 24 Sep 2024 10:11

I've always done it like this: https://obrazki.elektroda.pl/7110850100_1727165493_thumb.jpg seen in my pic here https://www.elektroda.com/rtvforum/viewtopic.php?p=21158431#21158431 [Read more]

Tilator 24 Sep 2024 15:44

I did try that too without good outcome. I have this T34 SOC and I try to use GPIO 11 which is UART TX. Might there be some setting wrong related to that? Added after 5 [hours] 11 [minutes]: Seems... [Read more]

p.kaczmarek2 24 Sep 2024 16:43

So, to sum up, you are using GPIO 11 which is UART TX and: - DHT22 works there - LED (to blink it, as Rel role or LED role) works as well - but DS18B20 doesn't work? Added after 34 : Maybe you... [Read more]

Tilator 24 Sep 2024 18:15

Yes, and on top of thet GPIO 9 works with DHT22 too but not with DS18B20. How can I find out if it's on? [Read more]

divadiow 24 Sep 2024 18:35

I thought powersave 1 was OK now with DS1820? https://www.elektroda.com/rtvforum/viewtopic.php?p=21190145#21190145 @max4elektroda [Read more]

Tilator 24 Sep 2024 20:39

Can you tell does the driver give sensor enough power by pulling GPIO line up or does it still need other external power and pull up resistor? [Read more]

Tilator 25 Sep 2024 11:51

I took one of those mini relays having BK7231N and connected DS18B20 to it using GBIO 9. Still no temperature reading. If I add sensor usin WEB UI there happens nothing. No loaded driver listed on front... [Read more]

divadiow 25 Sep 2024 12:07

still requires external power afaik so, 3.3v, gpio and ground. 4.7kohm between data and vcc. [Read more]

Tilator 25 Sep 2024 12:08

Thanks. A bit new info: I got some readings from BK7231N device and the tric was to give it a bit higher voltage. 4,75V. Even thogh the values it gove were a bit high somewhere above 33 C while actual... [Read more]

Tilator 14 Dec 2024 23:16

What's this in log: Info:SENSOR:DHT start, pin is 6 Info:SENSOR:DHT checksum failure! it keeps repeting about once every second. [Read more]