{"id":505,"date":"2021-11-14T12:00:00","date_gmt":"2021-11-14T12:00:00","guid":{"rendered":"https:\/\/www.dabbler.dk\/?p=505"},"modified":"2022-02-27T14:47:09","modified_gmt":"2022-02-27T14:47:09","slug":"echelon-nes-smart-meters-dabbling-the-hardware-v1-01-v1-02-and-v1-03","status":"publish","type":"post","link":"https:\/\/www.dabbler.dk\/index.php\/2021\/11\/14\/echelon-nes-smart-meters-dabbling-the-hardware-v1-01-v1-02-and-v1-03\/","title":{"rendered":"Echelon\/NES Smart Meters \u2013 dabbling the hardware v1.01, v1.02 and v1.03"},"content":{"rendered":"\n<p>As mentioned in our previous post, we f***ed up the connector to the meter&#8230;<\/p>\n\n\n\n<p>Moving on and with a few other hardware versions that never got produced, we ended up having a version 1.03 prototype where the connector is fixed and that kind of works most of the time in some meters:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"418\" src=\"https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Front-1024x418.jpg\" alt=\"\" class=\"wp-image-496\" srcset=\"https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Front-1024x418.jpg 1024w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Front-300x122.jpg 300w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Front-768x313.jpg 768w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Front-1536x626.jpg 1536w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Front-2048x835.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>MEP ESP32 version 1.03 &#8211; front<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"449\" src=\"https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Back-1024x449.jpg\" alt=\"\" class=\"wp-image-497\" srcset=\"https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Back-1024x449.jpg 1024w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Back-300x131.jpg 300w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Back-768x336.jpg 768w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Back-1536x673.jpg 1536w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/Prototype_MEP_1_03_Back-2048x897.jpg 2048w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>MEP ESP32 version 1.03 &#8211; back<\/figcaption><\/figure>\n\n\n\n<p>Note: jumper for disconnecting power (while adjusting the buck converter) was introduced. And also a &#8220;Set ESP32 in programming mode&#8221; jumper replaced something we tried to do that never worked :-). The unpopulated 6 pin connector is matching a standard FTDI USB to TTL Serial 3.3v Adapter and can be used to flash or debug the ESP32.<\/p>\n\n\n\n<p>Now we have something kind of working, but are struggling with stability. Which was actually quite a surprise for us. We acknowledge we are mostly software guys, but this hardware is soooo simple &#8211; what can really go wrong?<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>It seems Maxim Max3232 ICs are quite commonly faked in China &#8211; and since we buy most of our components in China, we have been struggling with 50 ICs that simply did not work (we got a full refund) and multiple batches that are just misbehaving a bit.<\/p>\n\n\n\n<p>Apparently most of these Maxim Max3232 fakes seems to kind of work, but sometimes when they are powered on and the RS232 pins are connected, the build in boost converter will go haywire. The communication will not work and they will get VERY hot.<\/p>\n\n\n\n<p>If you disconnect, leave the IC to cool off a bit and then reconnect. It will sometimes fail and sometimes work. In some meters it will fail more than in others&#8230; A quite  intermittent and confusing problem&#8230;<\/p>\n\n\n\n<p>You can google this problem &#8211; it is quite easy to find others with problems like ours and even with solutions that fixed it for them. We are working on trying out which solution will fix it for us &#8211; but this takes time when it sometimes works&#8230; And when you think you nailed it, it comes back and bite you in the b**.<\/p>\n\n\n\n<p>Note: If you have any info. on how to fix this issue or issues like this, please let us know by writing a comment. We are for sure NOT electrical engineers and will probably end up creating some kind of software solution for this if everything else fails ;-).<\/p>\n\n\n\n<p>The right (also morally right) solution would off cause be to buy genuine Maxim Max3232 and don&#8217;t support the Chinese companies producing fake chips. But the genuine Max3232s  are actually quite expensive for &#8220;poor&#8221; tinkeres like us :-). Let&#8217;s see if we can design around this flaw and make something that simply works &#8211; even if you use semi working fake chips. After all &#8211; it is just another challenge and we started this project to push the limits in the first place&#8230;<\/p>\n\n\n\n<p>So for sure, if you want to create hardware from the current design, it is on your own risk. Note: the final solution will also be at your own risk, but this prototype is just even more unreliable than what we usually create :-).<\/p>\n\n\n\n<p><strong>Disclaimer: We cannot be held liable for anything written on this site &#8211; even if you set your meter, yourself or your building on fire!<\/strong><\/p>\n\n\n\n<p>Off cause you also won&#8217;t have much use for it before the MEP documentation or our software is released.<\/p>\n\n\n\n<p>Anyway &#8211; the current unpopulated prototype PCB looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"360\" src=\"https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-1024x360.png\" alt=\"\" class=\"wp-image-498\" srcset=\"https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-1024x360.png 1024w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-300x106.png 300w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-768x270.png 768w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-1536x541.png 1536w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP.png 1543w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>ESP32 MEP in KiCad&#8217;s PCB Layout editor<\/figcaption><\/figure>\n\n\n\n<p>As we chose to use thru hole components we are kind of &#8220;out of space&#8221; (which is defined by the size of the &#8220;drawer&#8221; in the meter). So we are considering pushing our soldering skills and going to SMD components to get more space&#8230; Maybe in a future prototype?<\/p>\n\n\n\n<p>The current schematic (without any fixes for fake Max3232s) looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"780\" src=\"https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-schematic-1024x780.png\" alt=\"\" class=\"wp-image-499\" srcset=\"https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-schematic-1024x780.png 1024w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-schematic-300x228.png 300w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-schematic-768x585.png 768w, https:\/\/www.dabbler.dk\/wp-content\/uploads\/2021\/10\/ESP32-MEP-schematic.png 1165w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>ESP32 MEP in KiCad&#8217;s Schematic Layout editor<\/figcaption><\/figure>\n\n\n\n<p>Warning: The schematic still have the wrong pin numbers for the MEP connector, so don&#8217;t trust those! The wiring is correct, but the pin numbers shown are not!<\/p>\n\n\n\n<p>The Max3232 is more or less setup like the reference diagram in it&#8217;s datasheet. So not much to explain there (the capacitors are used for the build in boost converter converting the 3.3VDC to the +\/- DC voltages needed for RS232 signals).<\/p>\n\n\n\n<p>A Max3232 got two sets of receive\/transmit logic. We currently use the first set for the actual communication with the meter, and (mis-)use the second set to set the Enable pin high towards the meter (it might not be exactly +5VDC or +12VDC, but it works). To prevent the Max3232 from setting the Enable pin negative, we have a diode in there (not that we know for sure it is needed \ud83d\ude42 )&#8230; We currently have no use of the receiver part of the second set of the Max3232 receive\/transmit logic, so it is just grounded on the RS232 side to prevent it from oscalating.<\/p>\n\n\n\n<p>The resistors connected to the ESP is just to make the initial flashing through the J5 connector work. <\/p>\n\n\n\n<p>Nothing real fancy going on in the schematic as far as we are aware :-), but as mentioned a few stability issues with some meters&#8230; So we are trying out different solutions for that.<\/p>\n\n\n\n<p>Btw: if anyone need a copy of the current KiCad project while we wait for something better, feel free to e-mail us. We&#8217;ll be happy to share it, but prefer not to put it up for download until we have sorted out the hardware bugs&#8230;<\/p>\n\n\n\n<p>Unfortunately the software is covered by the NDA, so we cannot share that yet&#8230; So you really have no use for the hardware at this point in time&#8230;<\/p>\n\n\n\n<p>As soon as we are released from the NDA with NES, our plans are still to make both hardware and software fully available to you &#8230; on this dabbler.dk-blog.<\/p>\n\n\n\n<p>Stay tuned!<\/p>\n\n\n\n<p>Let us finish with a sneak preview of a few decoded meter answers from our software:<br>Note: <em>Our added comments are formatted with italic<\/em>. L1 L2 and L3 is the name of the 3 phases measured by the meter. *&#8217;s are replacing the stuff we are not allowed to share yet due to the NDA:<\/p>\n\n\n\n<p><strong>0x** Invalid sequence number (this is normal for 1st request)<\/strong><br><em>The meter returns the sequence number to use for the following requests with this error<\/em><br><br><strong>0x** Successful response<\/strong><br><em>This is some initial reading of the meters setup. It is required to decode some of the other messages correctly.<\/em><br>Flags 0: 0b00000011<br>Flags 1: 0b00001100<br>No. of Self-reads: 12<br>No. of Summations: 11<br>No. of Demands: 0<br>No. of Coincident Values: 0<br>No. of Occurrences: 0<br>No. of Tiers: 0<br>No. of Present Demands: 0<br>No. of Present Values: 55<br><br><strong>0x** Successful response<\/strong><br>Manufacturer: ELON<br>Model: 83331-3I<br>Version: 58.134<br><br><strong>0x** Successful response<\/strong><br><em>This response is about aggregated consumptions.<\/em><br><em>The meter&#8217;s display was showing: 115921 kWh when this was received.<\/em><br><em>This household is NOT producing electricity, so the 201Wh might be from when the meter was initially tested?<\/em><br><em>This response contains far more values than the ones we chose to decode.<\/em> <br>Fwd Active Wh L1L2L3: 115921469<br>Rev Active Wh L1L2L3: 201<br><br><strong>0x** Successful response<\/strong><br><em>This response tell us about the current consumptions etc.<\/em><br><em>This response contains far more values than the ones we chose to decode.<\/em><br>Fwd Active W L1L2L3: 701<br>Rev Active W L1L2L3: 0<br>Import Reactive VAr L1L2L3: 139<br>Export Reactive VAr L1L2L3: 0<br>RMS Current (mA) L1: 1536<br>RMS Current (mA) L2: 1874<br>RMS Current (mA) L3: 139<br>RMS Voltage (mV) L1: 232591<br>RMS Voltage (mV) L2: 233879<br>RMS Voltage (mV) L3: 234387<br>Frequency (mHz): 50000<br>VA L1L2L3: 822<br>Power Factor L1 (1\/1000): 875<br>Power Factor L2 (1\/1000): 836<br>Power Factor L3 (1\/1000): 837<br>Fwd Active W L1: 311<br>Fwd Active W L2: 366<br>Fwd Active W L3: 25<br>Rev Active W L1: 0<br>Rev Active W L2: 0<br>Rev Active W L3: 0<br>RMS Voltage (mV) L1 &#8211; Continuous: 232507<br>RMS Voltage (mV) L2 &#8211; Continuous: 233922<br>RMS Voltage (mV) L3 &#8211; Continuous: 234246<br>RMS Voltage (mV) L1 &#8211; Average: 232185<br>RMS Voltage (mV) L2 &#8211; Average: 232990<br>RMS Voltage (mV) L3 &#8211; Average: 234229<br>Average Fwd Active W L1L2L3: 701<br>Average Rev Active W L1L2L3: 0<br>Average Fwd Active W L1: 311<br>Average Fwd Active W L2: 366<br>Average Fwd Active W L3: 25<br>Average Rev Active W L1: 0<br>Average Rev Active W L2: 0<br>Average Rev Active W L3: 0<br><br><strong>0x** Successful response<\/strong><br>Utility Serial Number: 4080<em>******(digits removed manually on this blog for security reasons)<\/em><br>Image CRC: 55331<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As mentioned in our previous post, we f***ed up the connector to the meter&#8230; Moving on and with a few other hardware versions that never got produced, we ended up having a version 1.03 prototype where the connector is fixed and that kind of works most of the time in some meters: Note: jumper for &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.dabbler.dk\/index.php\/2021\/11\/14\/echelon-nes-smart-meters-dabbling-the-hardware-v1-01-v1-02-and-v1-03\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Echelon\/NES Smart Meters \u2013 dabbling the hardware v1.01, v1.02 and v1.03&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":503,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,40,6,5],"tags":[49,36,38,58,50],"class_list":["post-505","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-esp32","category-hardware","category-software","tag-electronics","tag-esp32","tag-espressif-systems","tag-multi-purpose-expansion-port-mep","tag-smart-meter"],"_links":{"self":[{"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/posts\/505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/comments?post=505"}],"version-history":[{"count":5,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/posts\/505\/revisions"}],"predecessor-version":[{"id":525,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/posts\/505\/revisions\/525"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/media\/503"}],"wp:attachment":[{"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/media?parent=505"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/categories?post=505"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dabbler.dk\/index.php\/wp-json\/wp\/v2\/tags?post=505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}