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!)

  • 2
    \$\begingroup\$ Powering the microcontrollers with 5 V over long conductors (up to 10 m or even more) is not recommendable. You may use a central 12 V supply and local regulators for 5 V close to the microcontrollers. For better efficiency use switching regulators instead of linear ones. \$\endgroup\$
    – Uwe
    Commented Dec 22, 2017 at 10:50
  • 1
    \$\begingroup\$ The DeviceNet specification includes a specification for a few standard cables that include conductors for CAN and power. \$\endgroup\$
    – kkrambo
    Commented Dec 22, 2017 at 15:16

3 Answers 3

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.

  • \$\begingroup\$ Thanks for your detailed answer! I edited part 2 of my question to hopefully make it conform to the rules. \$\endgroup\$
    – Winnie
    Commented Dec 22, 2017 at 15:26
  • \$\begingroup\$ +1 for the recommendation of 24 or 48 V instead of only 12 V. \$\endgroup\$
    – Uwe
    Commented Dec 22, 2017 at 16:47
  • \$\begingroup\$ @dim: Done. --- \$\endgroup\$ Commented Dec 22, 2017 at 20:16

For items 1 - 2, I would suggest local DC voltage regulation fed from the mains supply. Something like these depending whether you're into DIN rails or not:-

din psuamazon

You can get them from on line component suppliers like RS Components or Amazon. It's tempting to skimp on the mundane, but consider what a house builder would install. You want it to be reliable and most importantly safe. I'm not going to go into why you should distribute mains and locally regulate here. That would be simply repeating material very well covered in:-

Power grids : AC vs DC

Getting rid of AC/DC adapters

For items 3 -4, it's difficult to say but also consider what you'll be switching. The controllers won't be living in isolation. They need to control HVAC, lights or alarms. This is also another reason to run them off mains as they'll be switching mains. The list is endless so flexibility is required. You might want all of your lighting for a room switched centrally with relays. That requires mains cabling anyway. If you research domestic automation, you'll see that Ethernet cabling is most common. It allows power over Ethernet for some devices, and also audio /visual /data transmission. And it's cheapish - £100 /300m.

CANbus doesn't seem that popular for domestic automation however. Ethernet seems to dominate as there is a central controller in house projects and you can't easily get the internet down a CANbus cable. You'd then have to have a parallel system. Look at what everyone else does as automation is getting popular. Also look into MQTT for command and control. It's a broad subject.

One thing I would highlight is watchdog timers. Look into this so that the local control nodes are reliable. And on board watchdogs aren't always. A dodgy C pointer can play havoc with them. The Voyager space probe has seven of them, but you might want a few less for a house.

  • \$\begingroup\$ Thanks for your reply! When you suggest local DC regulation, would that mean putting a separate power supply at each microcontroller? It seemed to me ethernet was not a great option since the controllers are larger, more expensive, and consume more power, and I definitely don't need the bandwidth ethernet brings. I've looked at several projects where people were trying to use ethernet with microcontrollers, and they often complain that the ethernet chip draws something like 150ma. If I've got a dozen or more nodes, that's starting to add up. \$\endgroup\$
    – Winnie
    Commented Dec 22, 2017 at 15:50
  • \$\begingroup\$ @Winnie Granted it's more power. But still insignificant as consider: 12 x 150mA = 1.8A < 2 IP security cameras. And there are no CANbus controllers required which might cost more than Uno Ethernet shields. Plus you won't be able to take advantage of software like Domoticz or Openhab without writing your own libraries /drivers. Depends really on your control architecture I guess... \$\endgroup\$
    – Paul Uszak
    Commented Dec 23, 2017 at 3:35

You will have ugly spikes on the 117 volt lines inside the house, from microwave oven rectifiers.

Those 10 amp nominal currents become 100 amps at the sin peaks. The high voltages, say 1,000 volts to be rectified, across 1 diode junction that needs 0.026 volts for 2.718X current increase, cause enormous current slewrates.

Expect voltage slewrates at the rectifier of 1,000 vols * 377 = 377,000 volts per second. With only 0.026 volts needed for 2.718x increase, the time of turnon is 1 / (377,000 / 0.026) = 1 / (377,000 * 39) = 1/(15,000,000)

= 60 nanoseconds.

Your 117 volt wiring, ignoring line inductance, will have 100 amps surges with risetimes of 60 nanoseconds.

If you are 0.1 meter away from that wire, with PCB having 0.1 * 0.1 meter GND circuits, the induced voltage will ve

Vinduce = 2e-7 * 0.1 * 100 amps/60 nanoseconds

Vinduce = 2e-8 * 1,600,000,000 amps/second = 2e-8 * 1.6 e+9 = 32 volt.

Summary: expect 32 volts induced into anything near the wiring, when the microwave oven is working.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.