Unfortunately we are still awaiting the release of the MEP protocol from NES (Networked Energy Services) as mentioned in previous blog entries. This will release us from the Non-Disclosure Agreement (NDA) keeping all this a secret to you.
…but while we wait, we could introduce you to our hardware prototype.
In our first few attempts we got the connector totally wrong.
Apparently the footprint we used while doing our PCB design numbered the pins 2 columns in 3 rows, while NES numbered them with 3 columns in 2 rows:
Naturally we messed that up! Luckily we actually did some sanity testing before just inserting this prototype into the meter, and we did discover the error and simply connected with some wires to quickly fix it.
We wrote about the pin connections previously, but just to recap:
Pin 1: Ground
Pin 2: Enable. Set to +5VDC or +12VDC to tell the meter the MEP interface is active
Pin 3: TXD (meter’s serial receive pin)
Pin 4: RXD (meter’s serial transmit pin)
Pin 5: Power. +24 or +26VDC (max 1W) from meter
Pin 6: Not used / no connection
Note: It depends on the hardware model of the meter if pin 5 supplies 24 or 26VDC.
Due to the wires, we could move on with the software… While awaiting a new prototype PCB from JLCPCB… But let us explain a bit about the hardware prototype:
The ideas behind this hardware are quite simple:
- The ESP32 is a 3.3VDC device, it needs the voltage from the meter reduced in an efficient way as we need the 1W it can deliver (we use a Chinese buck converter to keep it simple).
- We need to be able to program the ESP32 in circuit (so we don’t need to program it before soldering it / de-solder it if something goes wrong). So the primary serial interface of the ESP32 is routed to the unpopulated 6 pin connector at the edge of the print.
To program the ESP32 we need to put it in programming mode. The resistors and capacitor next to it is for that…
Luckily the ESP32 also have a second serial interface we can use to communicate with the meter now we use the first one for debugging and in circuit programming.
- The meter is RS232, the ESP is 3.3VDC TTL – so how do you convert that? A Max3232 can do just that, it is 3.3VDC too (it got a Max232 brother that is 5VDC). It has a built in boost converter that boosts the 3.3VDC back up to the signals level of RS232.
The capacitors surrounding it is for this boost converter.
- The meter also requires a Enable pin to be set high. Luckily the Max3232 got a second receive/transmit logic. We can just use the second transmit logic to make an Enable pin controlled by the ESP32. Only problem is that is should probably not go negative (like RS232 will), but we fix that with a diode.
Not much to it – or is it really this simple?
Stay tuned for an update on the next hardware version of ESP32 MEP…. Coming to www.dabbler.dk real soon now…