AVR-DB: emonTx V4, new hardware in progress

Hello @dBC good to hear from you and thanks!

Nice! where did you go?

We are planning to use the internal 1.024V reference voltage - calibrated using an analog reading from a precision voltage reference. Unfortunately the external analog reference supported by the chip cannot be lower than 1.8V, we’d be throwing away quite a bit of resolution if we used 1.8V directly with the 333mV sensors.

The first iterations of this design are intended to keep things simple as we have a relatively tight turn around on this. The intention is to evolve this design in future to include things like a buffered bias and potentially the op-amp based input conditioning circuit developed by @Robert.Wall and @danbates in the STM32 design, that would both allow direct use of an external analog reference and reduce phase errors a bit further on the ZMPT101’s.

Without the AC-DC power supply module, the current consumption of each ZMPT101 is in the 1-2mA range.

Great!

From Qld to Sydney and beyond to Royal National Park and the Illawarra. It was my first chance to do a proper roadtrip in the EV since the state borders opened up post COVID. With 350kW ultra-rapid chargers every 200km along the A1, charging was never an issue.

From memory those internal band gap references are very stable but not particularly accurate, so your solution sounds perfect. Do you just self-calibrate each time you boot?

That would be well suited to hooking up to a calibrator should you ever wish to do a spot-check on your accuracy.

If possible, it might be worth keeping the AC-DC supply sourced from its own terminal that you can just loop to one of the Line inputs at installation time. Have a look at the photo here and the description here, to see what I mean.

An earlier version of that meter had the power supply internally hardwired to L1 and that caused grief when trying to put L1 on the calibrator as the calibrator’s voltage signal (20 mA limited) got distorted when the SMPS did its thing. Breaking them out like that makes installation ever so slightly more complex (one more loop) but means in the lab you can power the SMPS directly from the mains and point the calibrator at the ZMPT101.

Sounds like a great trip! Envious of your 350kW charging, still on max 50kW on my leaf!

Credit to @Robert.Wall for this solution, when it’s sampled to be determined.

Interesting, perhaps a jumper link of some kind? that could be removed and connected seperatly during calibration… ?

Actually, the chargers can do 350 (reportedly) but my car can only do 110, but I regularly saw it sucking 109 kW so things were pretty quick.

Yeh, that’d work. Your design is such that it probably won’t need per-device calibration (other than the stuff it does internally via the reference voltage). So you probably don’t want to pollute it too much to make it calibrator-ready, but if it’s easily achievable it would allow spot-checks to see just how accurate it is. Send one to me and I’ll happily hook it up :wink: - but only if I can drive the V inputs separately from the power supply. I learnt that the hard way with the earlier version of that meter referenced above.

2 Likes

Actually, we’d need some sort of link on both Line and Neutral, like in the pic referenced above. I can’t connect the calibrator output to anything that’s connected to the grid. So the grid would drive the Line/Neutral pair running to the power supply, and calibrator would drive the Line/Neutral for L1, L2, L3.

1 Like

Perhaps rather than complicate the design it might be easier to provide a voltage sensing unit without the power supply and then a separate unit with just the power supply for calibration purposes?

Will the voltage sensing input be rated to 440 V (=415 +6% or 230 × √3 + 10%) ?

I can foresee somebody wanting to measure Line-Line voltages while running the power from line-neutral. I can’t quite see why they’d need to do that, if the voltage processing is sufficiently versatile, but I can see the question being asked.

And of course for the Norwegians with 3-wire 230 V, all 3 voltage monitors will need to be connected in delta. (Though in this case, connecting the voltage monitors in star should give accurate whole-house line currents and per-line powers, I’m not sure what that would mean and how useful it would be in practice.)

I like it. Effective and simple.

1 Like

I thought a major (selling) point was a combined monitor/power ‘box’ - at least for single phase users - that had one mains plug, not the two that the present emonPi needs. Unless you go to a mechanically complicated piggy-back arrangement, doesn’t this mean internal links much like @dBC 's meter?
I had something like that in mind as soon as the concept was mentioned. It could be sold pre-wired for single phase with a UK, EU or AU plug and lead, or with no lead for hard-wiring into any - single phase, split-phase or 3-phase - installation.

I don’t like the idea of two hanging-off boxes, potentially with two leads and two plugs requiring two mains sockets.

Agreed, but I think that was only intended for lab work - i.e. allowing me to drive the V inputs from the calibrator, while letting something else power the box. Everyone else would use the single external box that drives both the power supply and the V inputs.

In the latest iteration of my meter, we’ve gone for 3 external (L,N) pairs, one for each phase. There’d be a 4th pair for the power supply, but we moved to PoE for that. So it’s effectively 3 single phase meters, completely isolated from each other. The end user can then decide whether to tie their Neutrals together via loops at the screw terminals.

1 Like

OK, but then there are the 3 variations that I alluded to above:

  1. Single phase plugged.
  2. US split phase wired.
  3. UK/EU 3-phase wired, or maybe plugged.

I don’t know if a L-N-L + PE US plug exists, @Bill.Thomson will no doubt tell us.

When I lived in the US, I’m pretty sure my dryer plug was a 4-pin arrangement.

They do, but the L-N-L sans PE connector, is used here as well.
image

Typical use for these are clothers dryers and stoves/ovens.
Other examples: mains powered arc welder, recreational vehicle (caravan), pottery kiln.

In general, 240 Volt loads that require a 30 or 50 Amp circuit.

They’re not usually found in an environment where natural gas is used for cooking and
space/water heating. (No electric stove/oven, space/wather heater or laundry dryer, so no 240 V circuit)

OK, thanks for that.

So it would be possible for a user in N.America to have such a socket installed, to use for both power and voltage monitors, instead of permanently wiring it in.

It would be possible. But said socket might already be in use by a dryer, stove, etc.

One problem would be its location. i.e. it’d be in a laundry room or kitchen,
behind a large appliance and likely not near the CT attachment point.

Given we don’t have the equivalent of “meter tails” as you do, the CTs will more than likely be
installed inside of the load center. (consumer unit) That being the case, making the connection to
neutral and the two hot legs inside the load center, would be much simpler than trying to use a cable with one of the connectors pictured above. Said cable would have to be inside of conduit, or higher than six feet off the floor, or otherwise inaccessible. e.g. inside a wall or attic. (electrical code safety reasons)

I understand the reasoning WRT avoiding a “permanent connection,” but over here, hardwiring a device is an accepted and prefereable method. The method with which that connection can be done is quite easy.

The “problem” is making those connections means working around high voltage.
But attaching the CTs to the appropriate wires involves work in the same HV environment.

I was working on the assumption that it wouldn’t normally be case that the user would want a plug-and-socket connection, and the normal method of installation would be hard-wired. However, I wouldn’t want to see a possible option locked out solely through ignorance.

I once got sneered at for referring to 240 V as “high” voltage. No, it was low voltage. It turned out, they were used to working on 132 kV and above. I don’t know how your 120 V would rate in their eyes.

Understandable WRT to the ignorance part.
For those who live in an all gas residence, it’s quite likely they won’t have that option anyway.

Point taken. But both can kill. Perhaps the word lethal would’ve been a better choice.

All of the linemen, electricians and technicians I’ve ever spoken with all say essentially the same thing:

More deaths occur from working with the mains vice working with what is typically thought of as
high voltage. In effect, complacency is the real killer.

2 Likes

This might be a bit late, but it might be worth considering using a modern part, rather than an old 8bit AVR. The AVR architecture is a dead end, and you are of course locked into Microchip only parts which they then charge a premium for. Modern Cortex-M parts offer much better value for money, better targets for programming (8bit AVR is not a nice C target), standardised programming interfaces and debug, tooling, etc etc…

While the performance required for this application isn’t high, the datasheet for the AVR128DB48 is very sparse on the specifications around the ADC (which is important). I would strongly recommend moving to a 32bit ARM based micro for future designs. In particular, the Microchip SAMD series are ideal (I actually had a full design built around the SAMD11, but then another child arrived…). They have all the features you’ve mentioned for the newer AVR part, and a lot more.

Three in particular worth looking at - they are in the same family so migration is fairly straightforward and there are a variety of pin counts available in each series. Unit cost is currently from Farnell:

Baseline: ATSAMD1x (from £1.12) - Cortex-M0+, available in SSOP, 5 12bit ADC channels
Midrange: ATSAMD2x (from £1.78) - Cortex-M0+, 32-64 pin
High end: ATSAMD5x (from £3.57) - Cortex-M4 (much higher performance), big gain here is dual ADCs so V and I measurements can be synced.

If people are interested, I can share the files for the board I put together (I also have a couple of bare boards and parts if anyone would like them…).

2 Likes

Thanks @awjlogan looks interesting and certainly worth considering for future versions - it is too late for this version. We were working on a STM32 based design but have had to postpone that due to the chip availability, availability for the ATSAMD range look low/non existent at the moment as well, but that will of course change hopefully in the next year.

The AVRDB range gives us a welcome upgrade on the ATmega328 and a core goal of the new designs is to improve on many of the non-micro specific items as well, such as using voltage output CT’s and precision AC voltage sensing. With these improvements made we always have the option to explore other micro’s in future.

If you are happy to share any more details about your designs, if you could open a new topic that would be great! Thanks for letting us know about them.

1 Like

Hi @TrystanLea - yes, all understood, very reasonable upgrade path right now :slight_smile: The ATSAMs are generally quite a bit cheaper than the equivalent ST parts (usually ST is approximately 150-200% of the ATSAM price), so definitely worth looking at for future revisions. I’ll post up my board later; I ran out of time to finish off the firmware but the basics are there if anyone wants to take it on. Look forward to seeing the progress on this.

2 Likes