CAN Nodes for Smart House
Good news everyone! I got two working CAN nodes that I hope to use for setting up a smart house network. I want to outfit my house with sensors and controls for various tasks such as data logging, HVAC control and as a reminder to not leave doors open all night. In a nutshell, CAN is a communication protocol first used in automobiles and more info is here. It’s features include collision detection, operation in noisy environment and being a single twisted-pair wire for easy install(I hope).
So far my two nodes both use the PIC 18F4580 microcontroller and MCP2551 CAN bus Driver, but different peripherals. The CAN engine built into the 18F4580 takes care of the bulk of the CAN protocol, like bit-stuffing, masks and filters, the different frames and all the other goodies in the spec. I had a class a couple years ago that covered it all and some other stuff that is already replacing CAN, so I didn’t actually read it(ha!). Anyways, the basic communications are demoed with the two nodes, press a button on Node1 to send a message to Node2, and Node2 periodically requests data from Node1 (a temperature sensor). This is my mock-up for the first phase of the smart house when I replace my ancient doorbell system of cloth-clad, solid wire to the twisted pair CAN bus, then expand by adding nodes.
As far as schematics and code, they are works in progress and yet to be released. I have a Sensor node schematic and board almost done, then an LCD/Info node following. As far as the code is concerned, I was disappointed in the Microchip ECAN Library, and found loading the appropriate registers following the datasheet to be easier. This was also the general theme coming from Microchip’s CAN forum. Also I’m getting a git hub together to share, so yeah.