Skip to main content
Patrick’s Preoccupations
  • Contact
  • Notes
  • Projects
    • Hedgehog Camera
      • Powering the router

Hedgehog Camera contents

  • Hedgehog Camera
    • IR illuminator
    • Powering the router
    • Installing OpenWRT
    • Video capture
    • USB flash drive power
    • PIR motion detector
    • Webcam unreliability
    • Better automation
    • USB flash drive failure
    • Footage

Powering the Router and Illuminator

By Patrick Wigmore, May 2020, published: 16 July 2023, updated July 2023

Having decided to put a BT Home Hub 5a in the garden to record videos of hedgehogs, I needed a way to power it.

I didn’t want to spend money on a massive battery or solar panel. The most obvious strategy, then, seemed to be to extend the router’s DC power cable, so that the power adapter could be plugged in indoors and a long cable run outdoors to the router.

Unfortunately, the router uses a DC barrel jack with non-standard dimensions. I couldn’t find a matching plug or socket for sale anywhere online, let alone an extension cable fitted with them.

Instead, I made do with cutting the router’s power cord in two and fitting a standard DC barrel plug and socket to the cut ends. I bought a DC power extension cable, marketed for CCTV purposes, which could then be connected between the two ends of the modified power cord.

A DC power cord, modified so that it pulls apart with a DC barrel plug and socket in the middle.
The Home Hub with extended power cord. The modified cord has been pulled apart and a long, coiled extension cable has been connected in between the two parts.

Router USB current limit

On the page about the IR illuminator, I mentioned that the IR illuminator breaks the rules, because it doesn’t ask the USB host for permission before pulling its full 380mA current.

Well, it turns out that one of the shortcomings of the BT Home Hub 5 Type A is that its USB port can’t supply very much power. In fact it can’t even supply 100mA reliably, as required by the standard, so it, too, breaks the rules!

To solve this problem, I bought a small DC to DC buck converter module and installed it inside the router. I rewired the USB port to take its 5V supply from the new converter instead of from the main board.

A circuit board with components on it has a smaller circuit board glued to the side of one of the connectors on the main circuit board. Wires connected to the small circuit board are running neatly along the edge of the main circuit board and disappearing behind it.
On the rear of the same circuit board, the wires are seen to connect to some existing connection points on the board.

With hindsight, supergluing the buck converter to the side of the WAN port was a mistake. I thought I’d been clever and found a nice neat space to fit it into, but then I realised it was too big and it proved impossible to unglue it without damaging anything. I had to cut a hole in the case to get it to fit back together again.

The main circuit board has had its case fitted and a hole has been cut around the glued-on small circuit board, next to the hole for the connector it was glued to.

The buck converter is powered directly from the incoming 12V supply. The router only uses about two thirds of the supply’s capacity, so there was plenty of headroom to power the IR illuminator.

It’s a bit ironic that I went out of my way to build a 5V IR illuminator and then ended up having to convert 12V to 5V in order to run it.

Voltage drop in the supply cable

It is difficult to determine the resistance of random DC barrel jack extension cables from eBay, prior to purchase. Mine turned out to have a resistance of 1.2Ω per wire, for a 2.4Ω round trip.

The resistance of a cable causes voltage drop when a current is drawn through it. This is just Ohm’s Law. If the load draws I amps, and the cable has resistance R, then the voltage drop in the cable is V=IR. So, if 1 amp is drawn through cable having a total resistance of 2.4Ω, the voltage drop in the cable will be 2.4 volts. If the supply voltage is 12V, this means that the load at the end of the cable will only see 9.6V.

Voltage drop under constant power

The router, with the camera and the IR illuminator plugged into it, takes something in the region of 4 to 6 watts. Let’s say it’s 6 watts.

But the router has what’s known as a “constant power” characteristic, and that changes the calculations. As the external supply voltage reduces, the router ends up pulling more current to compensate, consuming the same total power overall. This is caused by the use of switching converters to generate the router’s internal voltage rails.

In practice, the basic method assuming constant resistance is fine if you just want rough idea of whether or not the cable is going to melt, and whether the router has any chance of running on the remaining voltage at the other end. At the end of the day, I was still going to have to plug it in and see what happened, to find out what kind of voltage range the router would tolerate.

But I thought it would be interesting to calculate the voltage drop under constant power, so I had a go anyway.

Calculating voltage drop under constant power: recursive solution

One way to work out the voltage drop under constant power is to apply the basic Ohm’s Law method recursively. Work out the current, work out the voltage drop, work out the current, work out the voltage drop, and so on. Eventually it’ll converge on a value you can use.

Calculating voltage drop under constant power: algebraic solution

It’s also possible to reach a solution algebraically:

Formula for current: I=P/VloadI=P/V_{\text{load}} I=P/Vload​

Formula for voltage seen at the load: Vload=Vsupply−RIV_{load}=V_{supply}-RI Vload​=Vsupply​−RI

Substitute the formula for I into the formula for the voltage at the load: Vload=Vsupply−RPVloadV_{load}=V_{supply}-\frac{RP}{V_{load}} Vload​=Vsupply​−Vload​RP​

Multiply both sides by V~load~: Vload2=VsupplyVload−RPV_{load}^2=V_{supply}V_{load}-RP Vload2​=Vsupply​Vload​−RP

Subtract VsupplyVload−RPV_{supply}V_{load}-RP Vsupply​Vload​−RP from both sides, giving: Vload2−VsupplyVload+RP=0V_{load}^2-V_{supply}V_{load}+RP=0 Vload2​−Vsupply​Vload​+RP=0

This equation is recognisable as a quadratic in the form ax2+bx+c=0ax^2+bx+c=0 ax2+bx+c=0 where x=Vloadx=V_{load} x=Vload​ , a=1a=1 a=1 , b=−Vsupplyb=-V_{supply} b=−Vsupply​ and c=RPc=RP c=RP , which can be solved using the quadratic formula: x=−b±b2−4ac2ax=\frac{-b\pm\sqrt{b^2-4ac}}{2a} x=2a−b±b2−4ac​​

This gives two solutions, which turn out to correspond to the voltage drop in the cable and the voltage at the load.

Vdrop=Vsupply−Vsupply2−4RP2V_{drop}=\frac{V_{supply}-\sqrt{V_{supply}^2-4RP}}2 Vdrop​=2Vsupply​−Vsupply2​−4RP​​

and

Vload=Vsupply+Vsupply2−4RP2V_{load}=\frac{V_{supply}+\sqrt{V_{supply}^2-4RP}}2 Vload​=2Vsupply​+Vsupply2​−4RP​​

Substituting in the known values

Vsupply=12V_{supply}=12 Vsupply​=12 , R=2.4R=2.4 R=2.4 and P=6P=6 P=6

Gives

Vdrop=12−122−4×2.4×62≈1.35V_{drop}=\frac{12-\sqrt{12^2-4\times2.4\times6}}2\approx1.35 Vdrop​=212−122−4×2.4×6​​≈1.35

and

Vload=12+122−4×2.4×62≈10.65V_{load}=\frac{12+\sqrt{12^2-4\times2.4\times6}}2\approx10.65 Vload​=212+122−4×2.4×6​​≈10.65
Graph of the quadratic y=x²-12x-14.4, which is equal to zero at (1.352,0) and (10.648,0). The function x²-12x-14.4=0 is also plotted, which produces two vertical lines intersecting the quadratic at those two points.
Graph of algebraic solution

In other words, I could expect the router to see about 10.7V for its supply when it is connected to the end of the long cable.

This voltage drop wastes about 0.8 watts of power in the cable.

Practical consequences of voltage drop

In this case, it turned out that the router worked perfectly well on what was indeed about 10.7V, so there was no real problem.

0.8 watts over the length of the cable is not a major issue, especially given that it’s used outdoors and not coiled up.

Had the router not enjoyed running on a reduced voltage, I probably would have installed a boost converter at the router end of the cable, to bring the voltage back up to 12V, rather than trying to find a different cable with a known, lower resistance.

© 2017-2023 Patrick Wigmore