[{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eMy house got a new HVAC system this summer. I noticed in the literature that it uses CAN bus for communication among the thermostat, controller, heat pump, and furnace.\u003c/p\u003e\n\u003cp\u003eThere is a bit of information for installers to show wiring but nothing about the data on the bus itself.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003e\u003ca href=\"https://elibrary.tranetechnologies.com/public/residential-hvac/Literature/Installation/18-HD98D1-1C-EN_08102023.pdf\"\u003eTrane® Link UX360 Smart Thermostat Installation Guide\u003c/a\u003e page 8 gives some detail on the CAN bus wiring (wire colors)\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/007/original/ksnip_20251018-104410.png?1760802268","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eCAN voltages are referenced to GND but none of the wires is labeled as GND.\u003c/p\u003e\n\u003cp\u003eRed measures as 27VAC relative to the body of the furnace which is presumably grounded. So: Red is power (but not good for microcontroller power!), while blue is GND. This is within the 18-30VAC range specified by the thermostat.\u003c/p\u003e\n\u003cp\u003eAbout 2.6VDC is measured from furnace body to DH/DL lines, within the 2-4V expected.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eThe connector\u003c/h2\u003e\n\u003cp\u003eIt appears to be a \u003ca href=\"https://www.digikey.com/en/products/detail/jst-sales-america-inc/VHR-4N/608626\"\u003eJST VHR-4N connector\u003c/a\u003e with 1.56mm pitch. The crimp contacts are \u003ca href=\"https://www.digikey.com/en/products/detail/jst-sales-america-inc/SVH-21T-P1-1/26213076\"\u003eSVH-21T-P1.1\u003c/a\u003e. Digikey has a MOQ of 100 for the latter.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/002/008/original/Screenshot_2025-10-18_14-40-56.png?1760816486","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eI monitored the \"DH\" line with my scope. This seems a bit slow for canbus but it's what I measured:\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003eBit time: 20µs\u003c/li\u003e\n\u003cli\u003eBit rate: 50kHz\u003c/li\u003e\n\u003c/ul\u003e\n      \n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eI built a receiver from the MCP2351 featherwing, an ESP32-S3 Feather TFT, and the above-linked connectors. The DH/DL markings in the manual were accurate. And, I could sniff packets off my furnace's CANBUS.\u003c/p\u003e\n\u003cp\u003eI used the following simple program:\u003c/p\u003e\n      \n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"import time\nimport board, microcontroller, canio, digitalio, adafruit_mcp2515\nmcp_can_spi = board.SPI()\nmcp_can_cs = digitalio.DigitalInOut(board.D5)\nmcp_can_int = digitalio.DigitalInOut(board.D6)\nbaudrate = 50_000\n\ncanbus = adafruit_mcp2515.MCP2515(mcp_can_spi, mcp_can_cs, baudrate=baudrate, silent=True)\nlistener = canbus.listen(timeout=30)\n\nwhile True:\n    try:\n        msg = listener.receive()\n        if msg is not None:\n            data = \" \".join(\"%02x\" % b for b in msg.data)\n            print(f\"Received message {msg.id=:8x} {data=}\")\n    except Exception as e:\n        print(e)","metadata":{"language":"auto","linenums":false,"filename":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n        \u003cp\u003eNext, I need to actually log the messages and analyze them to find out what's going on.\u003c/p\u003e\n      \n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n        \u003cp\u003eHere are some manually transcribed messages I logged: (clearly I need to log them other than to the squintingly tiny TFT!)\u003c/p\u003e\n      \n\n","metadata":{}},{"element_type":"code","content":"msg.id =      420 data=00 00 00 00 28 00\nmsg_id =      4b0 data=00 00 01 04 00\nmsg.id =      318 data=00 60 22 3f ad 01 d0 01","metadata":{"language":"terminal","linenums":false,"filename":""}}]