Electronic – Implementation details of a home microcontroller network

microcontrollerpower supplywiring

I'm currently building a house, and thinking of adding some home automation features. I was thinking of putting one or two microcontrollers in each room (housed in a junction box), and connecting them to a central hub using a CAN network. I know how to do the interesting stuff like programming the microcontrollers and making the necessary circuitry, but there are some more mundane things I don't know how to best do:

  1. The first issue is how to power the microcontrollers. I don't want to deal with batteries. Having a separate AC/DC converter for each microcontroller seems inefficient. Since I'm not using ethernet, power over ethernet seems inconvenient. So I'm thinking of having a central DC power supply (or maybe one for each floor), and then running wires from it to each microcontroller. Does this sound like a good option?

  2. I don't know anything about power supplies, in terms of what different kinds are available. Are there points I should keep in mind when selecting one?

  3. I need to run the CAN bus and power to each microcontroller. Is there a standard cable for doing this? (Something that has two pairs of wires with appropriate shielding and twisting, I suppose.) It'd be nice if I could just have a single cable going to each microcontroller.

  4. Some of the sensors might be several feet away from the microcontrollers they connect to, so I'll need to run some wires in the wall between them. Can I just use whatever cable I have for this, or are there any special considerations that need to be made? (Sorry if this is too general, but any advice would be appreciated!)

Best Answer

The first issue is how to power the microcontrollers.

I would use a central power supply someplace, then bus around DC along with the CAN wires.

Keep in mind that CAN is a linear bus with two distinct ends. You therefore put the power supply someplace near the middle. I'd use 24 V minimum. I've done similar things and used 24 V and 48 V in different instances. 48 V is as high as you can go and not get into regulatory issues.

Higher voltage is more efficient since there will be less current for the same power. Each node would have a buck converter that produces the internal low voltages from the higher bus voltage.

For example, let's say a node uses 100 mA at 5 V internally, the buck switcher is 85% efficient, and the bus is at 48 V. The node would only draw a bit over 12 mA from the bus. If the bus were at 24 V, then the node would draw 25 mA.

Drawing less current causes less voltage drop across the cable resistance. Note that this is not only a issue for power, but also for ground. CAN is tolerant of some common mode noise (what a ground offset would look like to the CAN bus), but you can't go too far.

If you find too much sag at one end of the cable, you can always add another power supply at that end. Due to the cable resistance, the multiple power supplies should not fight each other. Still, I'd put a Schottky diode in series with each supply. This system is scalable, since you can add more supplies later if the voltage sags too much at some points. Unless you are doing something unusual, a single 48 V supply in the middle is probably good enough. Start with that and see where you're at.

is there a particular model

We don't do that here. Read the rules. There are many many off the shelf 48 V supplies. Suggesting a particular one would be silly anyway.

Is there a standard cable for doing this?

I haven't found any. I wish there was. I started talking to a cable manufacturer about this a while ago, but got distracted with other things.

... sensors ... Can I just use whatever cable I have for this

That obviously depends on the requirements of the sensor, and what exactly the cable is. This is something you'll have to analyze each case.