Tuya CB3S Temperature Meter with OBK 1.18.177: Pin Mapping for LDR, Temp Sensor, and LCD Display Access
User question
i have flashed tuya temperature meter with obkversion 1.18.177 it has a display the board is cb3s theree is also display and ldr how can i findout the port for temp,for ldr and how acces the display
Artificial Intelligence Response
Direct answer to the question
- First determine whether your thermometer is a TuyaMCU design (a small local MCU drives the LCD and reports temp/ldr over UART) or a direct‑wired design (sensors and LCD wired to CB3S).
- If it is TuyaMCU (very common for LCD thermometers), you do not “find ports” for temp or LDR on CB3S; you map Tuya datapoints (dpIDs) to OpenBeken channels, and the LCD remains under the local MCU’s control.
- If it is direct‑wired, find the pins by:
- LDR: probe ADC‑capable pins (BK7231N/CB3S typically P23–P26) and look for value changes while covering/uncovering the LDR.
- Temperature: identify whether it’s an ADC NTC (same ADC pins), an I2C sensor (scan I2C after assigning SDA/SCL), or a 1‑wire/GPIO sensor.
- Display: identify the display IC/interface (HT1621 3‑wire LCD, TM1637 7‑segment, I2C LCD, etc.) and assign the matching driver/pins in OpenBeken.
Detailed problem analysis
- Two hardware architectures exist in Tuya LCD thermometers:
1) TuyaMCU architecture:
- A small 8/32‑bit MCU on the main board reads the temp/ldr, drives the LCD, and talks to the Wi‑Fi module (CB3S) over UART with Tuya protocol.
- CB3S pins are only RX/TX (plus power), not connected to sensors or the LCD.
- In OpenBeken (OBK), you run the TuyaMCU driver and map dpIDs to channels: temperature, humidity, light/brightness, battery, etc.
- Result: You will see values in OBK but cannot directly control or “access” the LCD; it is owned by the local MCU.
2) Direct‑wired architecture:
- Sensors and display are wired to CB3S pins. OBK drivers (ADC/I2C/TM1637/HT1621/etc.) talk to hardware directly.
- You must identify which CB3S pins go where and assign “Pin Roles” and drivers in OBK.
How to identify which you have
- Visual: open the case. If you see a second microcontroller aside from the CB3S and an LCD driver bonded to glass or a chip marked HT1621, it is very likely TuyaMCU. If all routes run to the CB3S and there is no other MCU, it is likely direct‑wired.
- Software hints:
- After flashing and booting OBK 1.18.177, open the Web UI → Logs/Console. If you see periodic binary/ASCII packets on a UART pin or “TuyaMCU” messages once you set RX/TX, that’s TuyaMCU.
- If nothing shows and no Tuya traffic, try scanning I2C and trying ADC pins (see below).
Pin capabilities to keep in mind (BK7231N / CB3S, typical)
- ADC inputs: commonly P23, P24, P25, P26. Use only these for analog sources (NTC, LDR).
- I2C: any two GPIOs can be used by OBK as software I2C, but many boards route I2C‑friendly pins (e.g., mid‑range port numbers).
- UART for TuyaMCU: two GPIOs wired as RX/TX to the local MCU (the board often labels them or routes them as a pair).
Discovery procedures in OBK (no soldering first)
- LDR (analog):
1) Web UI → Pins/Roles. Assign one candidate pin at a time to role “ADC.”
2) Watch the live value shown next to the pin or on the Channels page; cover/uncover the LDR with your finger/flashlight.
3) The correct pin shows a moving reading with light changes. Keep that pin as ADC and link it to a channel of type “illuminance” (or “analog” if you will post‑process).
- Temperature:
- If it is an NTC: same method as LDR (ADC). You’ll see a slow drift with touch/heat. Later convert using an NTC equation or calibration offset/scale in OBK/script.
- If it is I2C (e.g., AHT20/SHT3x/CHT8305):
1) Pick two unused GPIOs, set roles to I2C_SCL and I2C_SDA.
2) Run an I2C scan from the Web Console. If a device appears (e.g., 0x38, 0x44, 0x70…), start the matching sensor driver and assign those two pins permanently.
- If it is 1‑wire/GPIO (rare on these Tuya thermometers): experiment by assigning a “DHTxx” role on candidate GPIOs and watch for valid readings in logs.
- Display:
- Identify the display type first. Common cases:
- HT1621 (glass LCD segments): 3‑wire interface (CS/WR/DATA). Many Tuya units use a local MCU to talk to HT1621; CB3S is not connected. If directly wired to CB3S, OBK’s HT1621 driver can drive it once you find the three lines.
- TM1637 (4‑digit 7‑seg): two pins (CLK/DIO). If your front looks like 4 big digits with a colon/dots, try TM1637.
- I2C text LCD (2×16) is uncommon in small battery thermometers.
- If TuyaMCU: you cannot talk to the display from CB3S; you leave it to the local MCU.
- If direct‑wired: assign the appropriate driver (HT1621 or TM1637), set its pins, and test by printing a value.
TuyaMCU mapping (if your unit is TuyaMCU)
- Assign two pins to Tuya RX/TX roles that match the board’s UART wiring. Try common pairs until logs show clean Tuya frames (usually 9600 baud; sometimes 115200).
- Start the TuyaMCU driver and set baud. In the TuyaMCU page/map:
- Map temperature dpID to channel type “temperature_div10” (many Tuya temps are reported in 0.1 °C units).
- Map humidity to “humidity”, light/ldr/brightness (if present) to an “illuminance” or “raw” channel, battery to “battery.”
- Watch the Logs to see which dpIDs change when you heat/cool or cover the sensor; assign those dpIDs accordingly.
- LCD access: not available from CB3S in TuyaMCU mode; the local MCU updates it.
Direct‑wired calibration
- LDR: Once the ADC pin is found, create a channel and decide scaling. Optional: convert to lux with a two‑point calibration; otherwise publish as a 0–1 or 0–1023/4095 normalized value.
- NTC: Determine the resistor divider values. Then convert ADC to temperature using Steinhart–Hart or β‑model in script. A quick two‑point (ice water ~0 °C and room ~25 °C) gives a decent β estimate.
Current information and trends
- Many recent Tuya LCD thermometers with CB3S are TuyaMCU‑based: CB3S only provides Wi‑Fi/MQTT, while a low‑power MCU handles sensors and the LCD. Expect to map dpIDs rather than wiring pins.
- OBK 1.18.x has solid TuyaMCU channel mapping, flexible software I2C, and display drivers (e.g., HT1621/TM1637) when hardware is direct‑wired.
- The “Charts/Script” facilities in current OBK builds allow on‑device scaling/formatting so you can calibrate ADC sensors and periodically update supported displays.
Supporting explanations and details
- Why ADC pins matter: only ADC‑capable GPIOs can read analog voltages from an LDR/NTC divider. Non‑ADC pins will always read digital 0/1.
- Why you often cannot access the LCD: in TuyaMCU designs the LCD signals never reach CB3S; they are connected to the local MCU or LCD driver. CB3S only exchanges Tuya protocol frames over UART.
- Identifying I2C: SCL/SDA lines typically run in parallel with pull‑ups to VCC; an I2C scan detects devices if the lines reach CB3S.
Ethical and legal aspects
- Safety first: if your unit has or once had mains inside (wall plug, power supply), disconnect from mains and respect creepage/clearance. For battery devices, avoid shorting coin‑cells during probing.
- Radio compliance: modifying firmware does not change RF HW, but ensure output power/regulatory settings remain default for your region.
- Privacy: after MQTT integration, secure your broker and disable open AP mode once configured.
Practical guidelines
- Minimal, systematic workflow:
1) Decide: TuyaMCU or direct‑wired (inspect PCB; check logs).
2) If TuyaMCU:
- Find RX/TX pins, set baud (try 9600 first), enable TuyaMCU driver.
- Heat sensor / cover LDR; note which dpIDs change; map to channels.
3) If direct‑wired:
- Test ADC pins P23–P26 for LDR/NTC.
- Try I2C scan with two pins as SCL/SDA; if found, start the matching sensor driver.
- For LCD, try HT1621 or TM1637 with candidate pins and see if test text shows.
- Useful OBK actions (names may differ slightly by build):
- Pins/Roles page: set Pin Role = ADC, I2C_SCL, I2C_SDA, TuyaRX, TuyaTX, TM1637_CLK, TM1637_DIO, HT1621_DATA/WR/CS, etc.
- Drivers page: start/stop drivers (TuyaMCU, HT1621, TM1637, AHTx0/SHT3x).
- Console: run i2c_scan; watch logs for Tuya frames and sensor detections.
- Startup script examples (direct‑wired, TM1637):
- Every 5 s, print temperature channel CH1 on the display:
- setInterval 5 "tm1637_print $CH1"
- MQTT: publish discovered channels to Home Assistant; name them logically once mapped.
Possible disclaimers or additional notes
- Pin numbering silkscreens differ; CB3S pad numbers are not the same as OBK “Pxx” GPIO numbers—use OBK’s GPIO names (P23…).
- Some boards connect the LDR to the local MCU only; CB3S will never see it directly. In that case, only a TuyaMCU dpID will expose “brightness.”
- Battery devices often power‑gate CB3S; you may see Tuya data only periodically to save power.
Suggestions for further research
- Look up your exact model in the OpenBeken device templates list and community forum; many CB3S thermometers already have dpID maps or full pinouts published.
- If you share clear PCB photos (both sides) and current OBK Logs output, we can usually tell you the exact pins/dpIDs within one or two iterations.
- If it is HT1621 and direct‑wired but unresponsive, trace the three LCD lines with a multimeter to confirm continuity from CB3S pins.
Brief summary
- Determine architecture first. If TuyaMCU, map dpIDs to channels; you cannot directly access the LCD from CB3S. If direct‑wired, LDR and NTC use ADC pins (try P23–P26), I2C sensors show up on scan after assigning SDA/SCL, and the LCD is likely HT1621 or TM1637 which OBK can drive once you find the correct pins. Provide PCB photos/logs if you want exact pin/dpID assignments for your unit.
Disclaimer: The responses provided by artificial intelligence (language model) may be inaccurate and misleading. Elektroda is not responsible for the accuracy, reliability, or completeness of the presented information. All responses should be verified by the user.
User question
display ic gnv 1792s how to adress this in openbeken
Artificial Intelligence Response
Direct answer to the question
Key points
Detailed problem analysis
Current information and trends
Supporting explanations and details
Ethical and legal aspects
Practical guidelines
Possible disclaimers or additional notes
Suggestions for further research
Brief summary
If you can share board photos or which pins you’ve already tried for TuyaRX/TuyaTX, I’ll help you finish the exact OBK configuration.