Here’s the first permanent board for a node that is intended for the kitchen.The bell doesn’t work yet, but the rest of the circuit is there, including everyone’s favorite feature, a clock! This is a copy of the breadboard Node #2 and its program, so just receives the message from Node #1, but not the sensor reading. The RTC is provided by the DS1305 to the right of the PIC and uses the crystal hidden inside the blue shrink tube below (it was an SMD part).
Since this circuit is going up on the wall, I tried to make it look nice. The paint scheme is all the 99¢ spray variety as usual, gloss black for the piece of pine board and flat black for the perf board. To hold the LCD, I drilled undersized pockets (about the width of the flats) for the #4 nuts and stamped the hex with a rubber mallet and punch. After painting they were glued in with superglue. The circuit board and bell is similar, but are size #6 and the nuts are on the bottom.
The bell seems original to my house, but was terrible sounding when I first bought the place. I though it was wall papered over, but was just painted close to a hundred times. Once I stripped off the paint it rang instead of clattered. It rings fine from a nice beefy power supply, but sagged the puny wall wart and browns out the microcontroller. Guh, so I’ll have to get real readings and shit to get that going. Anyways, here’s what is looks like inside.
So this concludes the physical portion of the design. The MCP2551 and the ECAN engine in the PIC18F4580 takes care of that for the most part. So now I’m on to software development.
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.