DIY Offgrid Project – Batteries

A couple of years ago I bought a Tesla and put vanity plates on it that say OFFGRID.

Ever since then I have been trying to make the dollars make sense to install some batteries, an inverter and a bunch of solar panels in an attempt to charge my Tesla and keep my pool clean with free solar electricity.

About five readers are about to leave a comment that I don’t need a battery to achieve that and indeed I don’t but why have a simple life when I can add technology?

Recently some associates found a stash of 460 AmpHour Lithium Iron Phosphate storage cells being disposed of and I managed to get 16 which means I now have a 52 volt, 460 Ah, 23kwh battery. You can cycle these cells to 80% discharge thousands of times. If you keep them between 20% and 80% State of Charge (SoC) they should last much longer. 60% of 23kwh is still 14kwh which is more than my overnight electricity consumption.

It seemed appropriate to put the batteries in the boot of my Tesla.

LiFePo4 cells are great technology. They don’t need water and don’t produce hydrogen gas. If you over charge them or allow the terminal voltage to exceed 4.2 volts you will damage the battery and the classic failure mode is to catch fire. If you over discharge the cell, to below 2.8 volts you will damage the battery and the classic failure mode is to catch fire. I’m obviously going to need some sort of battery protection or management system.

Before the project is finished I’m also going to need solar panels, mounting frames, isolating switches, fuses, circuit breakers, an inverter and some sort of overall monitoring and control system.

I’m going to try to do as much of it myself as I can but there are some parts which will need an electrician.

Welcome to my solar storage adventure!

Correlation implies causation?

Let me start by warning that this isn’t investment advice.

I found an interesting graph at the end of a article on mobile performance showing the falling cost per gigabyte of mobile data on what they described as flagship plans. I take that to mean approximately $50 per month which has been the popular Australian price point for Telstra SIM only mobile services.

The graph runs from October 2015 to October 2017 showing the $/GB every six months.

It reminded me of  how Telstra’s share price has fallen over the three years since Telstra launched 4G.

I wondered what the mobile retail price is at April 2018 so I looked at Telstra’s current pricing which has fallen to $2 per GB. Internode sold it’s flagship ADSL2+ service with a 40GB quota for $80 in 2006.

Now it’s May and Telstra have announced “Unlimited*” (* 40 gigabyte limit with 1.5 megabit speed limit thereafter) mobile data. They are trying raise revenue from $50 to $70 with it but it’s still well under $2 per GB, continuing the downward trend. Sadly for Telstra TPG have rained on their parade by offering $10 for 1 gigabyte per day which adds new line to the graph at around $0.33 per GB which must have caused a few folks at Telstra, Optus and Vodafone distinctly painful weekends.

TLS vs Mobile value

2016, 2017 and now 2018 show a remarkable correlation between Telstra’s share price (which can be a proxy for the investor view of Telstra’s future profits) and the “value” of Telstra’s flagship mobile product.

Why is there this correlation?

Telstra’s monthly average revenue per user (ARPU) for mobile and fixed line services remain largely unchanged in a decade so total revenue is directly a function of market share.

Really? Well yes, according to Telstra’s 2006 annual report their revenue from being a telco was $22,750 million and in 2017 the report stated $26,013 million which was largely unchanged from 2016 where it was $25,911 million.

So let’s come forward to May 14th when Income is forecast to be in the middle of the range $27.6 to $29.5 which is $28,550 million. It’s also stated NBN DA (“NBN Definitive Agreement” compensation) one off revenue is forecast to be in the “mid to upper” of the range $1.4 to $1.9 billion. Let’s assume it’s $1.9 billion.

That leaves Telstra’s telco revenue at $26,650 million which is only 2.4% more than last year and in line with inflation. If “middle” means slightly less than middle, revenue could be $26 billion for the third year in a row.

I think we have to accept that Telstra’s revenue is flat. It has been for the last three years and unless the entire industry plays the drinking game and just happens to decide to raise retail prices at the same time we aren’t going to see a shift upwards.

Is it capex? Telstra are forecasting capital expenditure of around $4.8 billion dollars for FY18. Last year they said they would spend $15 billion over three years which is all being depreciated. The FY17 depreciation figure was $4.4 billion so every $1 of revenue costs $0.17 of capital investment write down. But this is actually fairly flat so it’s not driving down Telstra’s profit.

So why is there this correlation? Good old fashioned “operating expenses”. It’s expensive to pay NBNCo, all those people, all that electricity and all that A grade rent. It’s an expense that rose 5.8% in FY17 and has probably risen faster than inflation in FY18 too. This drives a  margin crunch and at some point Telstra are going to need to find dramatically cheaper ways of delivering $26 billion of services.

Some of this will need to come from lower capital expenditure but that isn’t going to happen in a world where Chinese vendors are being banned on national security grounds. The rest will need to come from operations and that’s going to be very hard for an organisation that still sees itself commanding a premium price for premium service.

It’s going to be super hard when everyone pays NBNCo the same fixed price for the same services. It’s going to force Telstra off NBNCo for lower speed, lower volume users and the “unlimited” wireless products are an early shot over NBNCo’s bow.

Maintaining mobile revenue is also going to be super hard for Telstra now that TPG have announced $10 per month mobile data plans.

Ah, but Telstra just need to grow the $26 billion revenue, you say. Go read this article from 2016. It’s all the stuff Telstra CEO Andy Penn promised would grow revenue from $26 billion in FY16.

Tabulating the subsequent write-downs and write-offs is left as an exercise for the reader.

HW-655 ESP-01 Relay Board

HW-655 - 1



This is a HW-655 relay board designed to work with an ESP-01, the nifty tiny embedded WiFi device. It appears to be a clone of a China LC Technology ESP8266 5V WiFi relay module. I found some documentation here and some more details of a similar product from the same vendor here. I also found warnings that some clones did not have programmed STM8 micro controllers so they don’t work.

The missing element in trying to make this device work was the concept that you control the relay by transmitting serial characters from the ESP-01 rather than controlling an OUTPUT pin. There is a STM8 micro controller on the board. Why do this? I’m not sure but it does leave a couple of IO pins you can solder to. One theory is it ensures the relay doesn’t close without something quite deliberate happening in the ESP-01 which could prevent the ESP-01 crashing and leaving your controlled device powered.

The magic string is four bytes long.

A0 01 01 A2 causes the relay to CLOSE.

A0 01 00 A1 causes it to OPEN.

It’s probably a good idea to flush out any crud in the serial port before you send the string. I have noticed that A0 01 A0 01 01 A2 doesn’t cause the relay to CLOSE.

I wanted to test my relay module to see if it was programmed since it was obviously a clone. I couldn’t enter the four byte sequences in my terminal emulator so I wrote a bit of Perl on my Mac:

$| = 1;
sleep 1;
printf(chr(0xa0) . chr(0x01) . chr(0x01) . chr(0xa2) ); # close
sleep 1;
sleep 1;
printf(chr(0xa0) . chr(0x01) . chr(0x00) . chr(0xa1) ); # open
sleep 1;

And ran it like this:

perl < > /dev/cu.usbserial-A703EA9U

While monitoring the serial being sent like this:

cat /dev/cu.usbserial-A703EA9U | hexdump
0000000 43 6c 6f 73 65 a0 01 01 a2 4f 70 65 6e a0 01 00
0000010 a1 43 6c 6f 73 65 a0 01 01 a2 4f 70 65 6e a0 01

And it worked! (Actually the codes I found online were Open: A0 01 01 A2 and Close: A0 01 00 A1 which are backwards!)

The ESP-01 has an ESP8266 system on chip and some flash. It is also Arduino compatible so you can write C++ code that will execute directly on the device. The next problem is 00 is NULL and strings are terminated with a NULL in C languages so you have apply a bit of effort like:

void setup() {

void loop() {
 Serial.write("\xa0\x01\x01\xa2"); // CLOSE RELAY
 Serial.write("\xa0\x01"); // OPEN RELAY
 Serial.write(0x00); // null terminates a string so it has to be sent on its own

I compiled it for a board type of ESP8266 and uploaded it via my handy little ESP-01 programmer.

ESP-01 programmer - 1

Then plugged the ESP-01 into the HW-655, applied power and the relay will happily turn on and off every second forever.

ESP01 with relay

The ESP-01 is quite clever and can be loaded with some off the shelf firmware that does WiFi and can listen for a TCP connection so you could open a socket and send the four byte sequences from a machine on the same network. If you do some digging you will find some projects using some of Espressif’s IoT tools that let you control these devices from your mobile phone.

Note that there are two versions of the ESP-01. If you’re blowing $3 of your hard earned cash on one or five you should probably buy ESP-01S modules with 1MB of flash rather than the ESP-01 with only 512K of flash. You need the bigger memory for Version 1.5 of the AT “modem” firmware which can remember WiFi and TCP settings.

Other differences between ESP-01 and ESP-01S found online:

– blue PCB vs black
– 512kB flash vs 1MB
– Red power LED vs -No- power LED
– Blue LED on GPIO1 (TX) vs GPIO2 (and low = on)

The difference in LED may cause confusing when using BUILTIN_LED in the Ardunio IDE because the IDE expects the LED on GPIO1 (TX) and it’s inverted so OFF is lit and ON is dark.


What is the NBN for?

The NBN is primarily a machine for winning elections.

Conroy created it (I know the people who put the idea in his head but he did the political leg work) and used it to get Rudd elected.

Conroy then had to build it and he used it to get Julia elected.

It didn’t work a third time for Rudd because the slow progress of the NBN just confirmed the perception that the government were hopeless.

Abbott didn’t understand the NBN and told Turnbull to demolish it.

But Turnbull kept the NBN because he knew what it was really for and he eventually used it to help win his election.

Now Fifield has been given control of the machine with strict instructions to not touch anything.

I think Turnbull’s plan is to get millions of people migrated to the NBN then reduce the CVC charge in 2018 to ensure users are finally happy with the performance.

Late in 2018 he will announce a sale process and TLS shares will jump in value which will make a lot of Liberal voters happy.

Then he will have yet another go at riding the NBN machine to victory in 2019.

Or ScoMo or Dutton will.

Should NBNCo be scared of gigabit LTE?

I saw a media article today about Telstra demonstrating one gigabit LTE and claiming this was somehow superior to the NBN. I can’t let a claim like that go unchallenged.

First, some history. In the early days of analogue mobile phones (AMPS) operators broke their radio spectrum into 21 blocks of voice channels and designed their networks to services “cells” from three“base stations” connected to antennas with overlapping coverage on three towers or buildings.

Every cell could see one to three towers and this allowed for a “handoff” between towers. There was no data service. Every call required a channel and that channel would have little interfere from another call on the same frequency in a distant cell.

I found a picture that illustrates this:


(Source: )

The frequency reuse factor, k = 21 for this scheme. So you can use no more than 1/21 of the spectrum you bought in any one cell. By the end of AMPS carriers had dropped k to 7 at the expense of more interference but it improved the commercial yield on their spectrum investment by a factor of three. The CFO loved that. 

GSM, being digital, improved things such that nine or twelve sets of channels of digital data could form cells in a similar manner. Frequencies can be reused much more readily and the overlap doesn’t need to be so large. 114kbps data services can be delivered via this architecture from 200KHz data channels in 25MHz blocks. (You need 2 x 25MHz blocks, one for data UP and one for date DOWN.) You still need _relatively_ low interference so ironically this can work BETTER in a built up area where buildings block the interference. Combining two channels doubles the data rate and that is the service known as EDGE.



The reuse factor, k = 12 for this scheme so you can use 1/12 of the spectrum you bought to service customers in any cell. In practice this meant you could service 124 channels / 12 = ~12 X 114kbps or a bit over a megabit from each sector of your base station. This is why mobile tower backhaul was only 2 megabits! 2 megabits for an entire tower with three cells but given the theoretical maximum data was 124 / 4 = 31 X 114 = 4.4Mbps it wasn’t a bad contention ratio. 

3G introduced “spreading codes” or code division multiple access aka CDMA which encode data on a radio carrier by multiplying it by a random digital number at a much higher bitrate than the data. To decode a specific data stream you multiply the received signal by the same random digital number and get the original data back. It’s like black math magic but it works!



With 3G you can drive the frequency reused down to k=4. You take the 2 x 25MHz spectrum you bought for GSM and turn it into 2 x 4 x 5MHz. (2 x so you have UP and DOWN links.)

Data is transmitted on the entire 5MHz channel in frames that are 10ms long with 15 slots that contain data and control information directed towards users.

The 3G UMTS standard delivers 15 x 384Kbps data slots to the users in each cell. That’s a total of 5.8Mbps which was quite a thing from 5MHz of spectrum at the time.

HSDPA increases that to 7.2Mbps per user largely by squeezing more out of the 5MHz of spectrum  and joining a bunch of data slots together. Over the life of UMTS the modulation rate has been increased to get THREE times more bits out of the spectrum and to use spectrum from TWO towers so the pinnacle of 3G is DC-HSPA (Dual Channel / Dual Carrier HSPA) which is 42Mbps (six times the basic 7 Mbps service). That 7, 14, 21 or 42Mbps is shared by every user within a cell.

LTE is the logical evolution and convergence of these technologies.

Cell towers traditionally use three antennas per sector. Originally the strongest received signal from each user was selected. Then some beam steering was added to concentrate the signal to and from each user. This is called Multiple In and Multiple Out (MIMO). In LTE this beam steering is done for every user UP and DOWN continuously. 

The available spectrum is broken into numerous 180KHz channels (called resource blocks) with the maximum allocation being 100 blocks over 20MHz. These resource blocks are in turn modulated on subcarriers using orthogonal frequency division multiplexing which is rather like vectoring on VDSL2. It’s high-tech and it can carry 1 megabit over 180KHz which was theoretically impossible when I went to school but yields 100Mbps over 20MHz.

Together with MIMO,  LTE’s modulation technique you can set k = 1 i.e. you can use the same block of frequencies everywhere.

That’s “LTE”, a hundred megabits more or less shared by all the users receiving their service from a given sector (or cell) on a given tower.

What if you had lots of money and could buy lots of spectrum? Well you would find 5 lots of 20MHz blocks of spectrum and send the data in parallel over 500 resource blocks at once. That’s known as “LTE Advanced Cat15” and it delivers a gigabit shared by all the users receiving their service from a given sector (or cell) on a given tower.

Is this enough to scare NBNCo?

No! Because even using fibre to the node NBNCo can deliver a separate 100 megabits to each and every house served by a sector on a tower, potentially hundreds of houses, which would be tens of gigabits.

LTE off mobile towers and roof tops isn’t going to put the NBNCo out of business just yet.

What if you could make your cells quite small? What if they were mounted on power poles or on top of NBN Nodes, if you happened to own them?

Well that’s something that should scare NBNCo and I think it’s one of the NBN defeating or eating endgame options Telstra have in their kit bag.

BUT, all those basestations serving all those cells need backhaul and that needs gobs of fibre. Physically small LTE basestations will emerge as a fibre to the node or distribution point technology but at the same time fibre will always be able to drop infinite bandwidth to individual end users. This suggests that fibre to the premises will inevitably return to favour as bandwidth demands keep spiralling up. 

In the mean time mobility is the killer app and the mobile operators can charge a premium for it. LTE is going to satisfy low volume users but the price will be prohibitive for hundreds of gigabytes per month. That said, they are the very users NBNCo is counting on to cross subsidise the roll out. 

We live in interesting times.

20 amp 3 phase adaptor box for EVSE

So, you have a Tesla with dual chargers and an EVSE with a 32 amp three phase plug that can deliver the 23 or 32 amps your car can draw but the only three phase outlet you can find is 20 amp. This is a problem because the 32 amp plug does not fit in a 20 amp socket.

You could make an adaptor with a 32 amp socket and a 20 amp plug but that would be dangerous. You could make a mistake and trip the 20 amp breaker and that is probably behind a locked door. This leads to the 20 amp adaptor 3 phase adaptor box. It has the plug and the socket but adds a circuit breaker.

A word of warning: if you are not a licensed electrician or you do not have experience with mains electrical wiring don’t build this. If you get it wrong you may create a deathtrap or a fireball. Examples of “wrong” include any metallic path from inside the box to outside like a mounting or fixing screw, that a bare or burnt wire inside might contact that exposes someone outside to mains voltage. You have been warned! 

I bought the parts needed from ElectricianSupplies

  • 25mm CABLE GLAND (screws into mounting box and retains 16mm outside diameter cable)

The only difficult part is that the 3 module mounting base doesn’t have anywhere for the DIN rail to be attached. I cannibalised the 1 module base the socket came with and glued two pieces of plastic to the base of the 3 module base and screwed the DIN rail to that.


I drilled small pilot holes for the screws taking extreme care to not drill through to the outside. I didn’t take a photo but here is how it lines up in the original box.


Strip the length of the mounting box of the orange insulation and connect the wires to the socket. Green/yellow is Earth and brown is neutral. Remember to twist the copper and fold it over before inserting in the holes. Be careful to not over-tighten the screws.


Then line everything up and cut the red, white and blue wires to length to fit into the circuit breaker. Cut around the centre line of the circuit breaker. Do NOT cut the earth and neutral wires! They go around the circuit breaker.

Screw the cable gland into place. Use some PVC solvent to fix it.

Route the orange cable out through the gland. Originally I used a cable tie as extra protection for the cable. I have retrofitted a clamp now.

Attach all the wires remembering to twist the copper and fold it over.


Now clip the circuit breaker into place and put the black plastic bar in place in the mounting box. You can screw the socket into place now. Note how it is oriented. You might like to rotate it 90 degrees to avoid fouling the circuit-breaker cover. Don’t forget the black plastic bar! It is vital to keeping the box waterproof.


Position the breaker in the middle of the DIN rail and set the filler pieces on the cover with a half on each side.


Seal the unused ports on the mounting box with solvent. I happened to have some nice clear solvent for swimming pool plumbing.


Finally screw everything into place. You are going to need to find slightly longer screws for the circuit-breaker cover because it doesn’t really match the base. I used some screws I found in my big box of recycled screws but I think GPO mounting bracket screws would do the trick.

Wiring the plug is left as an exercise for the reader. If you don’t already know how to do it DON’T DO IT. My iPhone or iCloud ate the photos I took. The important things: the big nut where the cable goes into the plug unscrews and releases the rubber cable grommet. The plastic of the cable clamp is pretty rubbish on these cheap plugs. Remember to twist and fold the wire.


What you need to remember when you use this box is to either dial your EVSE box down to 20 amps or dial you car down to 20 amps. If you don’t the circuit breaker will trip but don’t depend on that because the breaker feeding the 20 amp outlet you are using might trip too!

Things I would do differently second time around:

  • Use an angled plug – they are easier to get in and out of the socket
  • Use a proper cable clamp (have already retrofitted original)

Good luck and happy EV motoring!

If you own or are buying a Tesla come visit the Tesla Owners Club page on Facebook.

Broadband Speed Claims

On July 27th Ry Crozier published an article about the ACCC consultation paper on Broadband speed claims. It contains a number of quotes from this short essay I wrote in response to some questions he put to me. I have edited that essay a bit and publish it here. It may form the basis for a response to the consultation paper. 

Over the more than twenty years I have been designing, building, operating and managing ISPs the constant demand from users has been “make it faster!”

The pinnacle of this fetishising speed was the National Broadband Network, which would deliver fibre, the thing everyone saw as synonymous with speed, to everyone’s home.

Sadly selection for one characteristic often comes at cost to another. While everyone obsessed with how many megabits or even gigabits of bandwidth would be delivered to their houses very few people listened to those of us who questioned what other parts of the network would cost to use and how they would be monitored and managed.

The NBN’s 121 points of interconnect added great cost and complexity to retail service provider networks as well as the duplication of cost during the migration from legacy networks to the NBN.

I believe the key issues for RSPs since NBNCo started designing and building it are:

  • The high cost of Concentrating Virtual Circuits per megabit creates a huge incentive to provision them scarcely.
  • The numerous points of interconnect scattered all over the country impose large standing costs with very few customers, certainly at first, again creating a huge incentive to provision them scarcely.
  • NBNCo refused visibility to the utilisation of their Passive Optic Network or their “transit network” but still insisted that RSPs didn’t need to see that information because they would manage it to suitable SLAs.
  • The worst case scenario would be that a change in NBN technology or project goals would see an RSP with customers spread across their own DSLAMs, wholesale DSLAMs, NBN FTTP and any other access technology in the same region, each with its own overheads.

We are seeing the effects of scarcity of NBN RSP POI backhaul and CVC bandwidth in many parts of Australia. For every example of an end user with a high speed port seeing slow downloads there is an example somewhere else of a user with brilliant performance. We are seeing the effects of the worst case scenario where few customers are downstream of a POI and the initial “free” 150 megabits of CVC hasn’t been exhausted. Those customers are the lucky ones! They have abundant bandwidth in their access network so their Internet experience is governed largely by the quality of their ISP’s network.

In my time as a regulatory manager for an ISP I had numerous arguments with the enforcement branch of the ACCC about “speed” claims. They hated “up to” and could not understand that ISPs had no visibility to the Telstra copper that would be used to provide the Telstra wholesale DSLAM service.

Readers may remember iiNet and Internode publishing line sync heat maps of Sydney and both organisations published network traffic graphs for much of their lives showing how hard the network was being used. Ironically those heat maps became one of the reasons the NBN came into existence and with the NBN there is no transparency to access network performance at all.

Readers may also want to ponder the limited availability of prawns and oysters at the all-you-can-eat salad bar.

While I have great sympathy for the ACCC’s position that ISPs should be able to inform customers of what “speed” their Internet service will work at even with an abundance of bandwidth in a private access network the entire global Internet is not under the ISP’s control and the performance of individual services on the Internet will vary massively. While this is not a reason for ISPs to not disclose their traffic management practices and utilisation it is certainly something that makes it a “wicked problem”.

Traffic shaping is all about picking losers. All that giving a packet “priority” means is it experiences less delay within the network. The least worst case for a packet is to be pushed back in time until a hole in the data stream can be found. This is like a spatula applying icing to a cake. The worst case for a packet is to be shaved off like a plane flattens a piece of wood by removing all the bits that aren’t flat. The effect of this on your Internet is to slow your page loads and file downloads, cause your video player to “buffer”,  your videoconference stream to break up and your voice over IP to stutter. It might even cause some applications to stop entirely or be unusable.

In our with-us or against-us world it is very hard to have a rational discussion about these issues. I’m not laying “blame” or suggesting any player is operating maliciously in the ecosystem.

Retail ISPs can buy global Internet access in capital cities for a few dollars per megabit. They have no incentive to create artificial scarcity in this layer. This isn’t the place to look for a problem with NBN performance.

Operators of legacy DSLAMs have some mixed incentives. Their entire network has been declared obsolete by the very existence of the NBN. There is little incentive to make capital expenditure on improving the backhaul capacity of those networks for the (hopefully) months of operation left before FTTN migration starts and relieves the demand.

NBNCo will doubtless claim that all the performance problems end-users have with RSPs would go away if only RSPs would purchase enough $15 to $17.50 per megabit CVC. Or should I say “up to $17.50”?

In politics you never have an inquiry unless you know the likely outcome. This review is going to make it plain that RSPs need to purchase more CVC. This is only affordable for them if retail ISP prices rise or if the NBN operating company reduce their charges.

Given Telstra warned earlier this year that NBN costs would reduce their Net Profit by around $2b pa once the NBN is rolled out this enquiry is likely the first phase of a plan that will see a significant rise in the price of NBN delivered ISP services in Australia.

It’s time for the NBN company to reduce the CVC charge significantly and to be more transparent about the link utilisation within its network. That will make it clear to consumers which RSPs have sufficient capacity.