{"id":327,"date":"2012-02-04T12:59:21","date_gmt":"2012-02-04T17:59:21","guid":{"rendered":"http:\/\/fll-freak.com\/blog\/?p=327"},"modified":"2025-04-21T00:54:36","modified_gmt":"2025-04-21T04:54:36","slug":"ade7763-part-6-first-real-test","status":"publish","type":"post","link":"https:\/\/fll-freak.com\/blog\/?p=327","title":{"rendered":"ADE7763 Part-6 (first system test)"},"content":{"rendered":"<p>Just started the first system testing of the ADE7763. What I mean is rather than just working on the SPI or other subsystems, I am using the chip as it would be in real life. I have the voltage and current channels of the ADE7763 connected to real sensors.<!--more-->In the case of voltage, it is a simple voltage divider from the 12 volt end of a transformer. This gives me a +- 0.250 VAC signal to the ADE. For the current, I am using a 30 Amps CT I purchased from Sparkfun some time ago. On a scope, the voltage and current inputs look very nice. There is some high frequency noise, and as per the datasheet I will be adding a low pass filter to remove this fuzz.<\/p>\n<p>So the first tests were very positive. The Vrms register stays fairly constant over time. There is some ripple but I think that is because I have yet to implement measurements at the zero crossing points. The Irms register also has some ripple, but tracks very closely to the load I put on the CT. I have a 200 and a 150 watt light bulbs I can switch in and out. Even at 350 watts the current is only about 3 amps or only 10% of the CT&#8217;s range. Yet, the linearity of the watts to register value are very nice.<\/p>\n<p>Testing started to go down hill went I went to read the power (watts) register and discovered that there was none. To read the watts, you need to select that point in the processing chain for Sample Mode. I set the bits for that location and read the Sample register and &#8230; nothing. Re-read the datasheet and found that you need to set a bit in the Interrupt Enable Register to enable sampling. But when you do that you start to get hammered by a steady 3.5K interrupts per second at the lowest sample rate you can select. That rate is well beyond what my little Arduino can deal with.<\/p>\n<p>So I disabled interrupts and simply read the waveform register to get the watts value. I think I can have interrupts enabled for other things and simply enable the sample mode from the main loop and than inside the ISR turn it off again. That way I can avoid the firestorm of interrupts.<\/p>\n<p>The watts value also looked good with the 0, 150, 200, and 350 watt test values. And then I went to look at the energy register. This is the time integration of watts to give you your kilowatt-hour value that is used as a measure for paying your electric bill. What I found was a negative value!<\/p>\n<p>Not sure how the ADE can determine what is positive (outlet feeding the bulbs) or negative (bulbs sending power to the utility). Since the voltage and current are in phase, the product of V and I will be positive. Integrating a positive number should result in a positive number, but in my case it does not.<\/p>\n<p>Some magic is going on here as the datasheet clearly indicates that you can get a negative energy. I have sent a query of to Analog devices to get some input from them.<\/p>\n<p>Of course this is not the end of the world. I could simply multiply by negative one and the problem would be solved, but mysteries like this drive me nuts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just started the first system testing of the ADE7763. What I mean is rather than just working on the SPI or other subsystems, I am using the chip as it would be in real life. I have the voltage and &hellip; <a href=\"https:\/\/fll-freak.com\/blog\/?p=327\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[],"class_list":["post-327","post","type-post","status-publish","format-standard","hentry","category-home-power-monitor","category-projects"],"_links":{"self":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=327"}],"version-history":[{"count":4,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/327\/revisions"}],"predecessor-version":[{"id":1050,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/327\/revisions\/1050"}],"wp:attachment":[{"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=327"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=327"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fll-freak.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}