EmonTX not sending all the time creating wrong values in EmonCMS

Hello!

I've found a problem in my newest setup:

EmonTX compatible self-built, monitoring a solar panel (and also powered by this panel, so no power supply in the night). I monitor the DC values of a single 250W module, the voltage is measured by a voltage divider, the current via a ACS712 current sensor with 20A range.

Data relayed by Atmega328 with RFM12B module and groupRelay script from jeelabs.

RaspberryPi receiving the data.

 

When the power goes down or up the measurement shows high values, so Emoncms connects this data points, and also adds this to the generated Energy, so the values of generated energy are wrong (about 0,2kWh every night).

You can have a look at this problem there (time between 8 pm and 6 am): http://emoncms.org/jb79/Solar2

What can be done to solve this problem, a possible solution would be to add a small battery that is charged by the solar panel, or is there a possibility to do this in the EmonTX?

Mattia Rossi's picture

Re: EmonTX not sending all the time creating wrong values in EmonCMS

The easiest solution would be to modify the sketch in a way such it doesn't transmit the high or low values .. just set a minimum and maximum value the measurement must have, and if the current measurement doesn't fall into the interval just discard it instead of sending it ....

Dan Woodie's picture

Re: EmonTX not sending all the time creating wrong values in EmonCMS

It would appear that your readings read accurately until the generated power goes below about 2 W, and then they get spuriously high until it cuts off. The same when it first starts up. So I don't think thresholding the values will work, since it thinks it is measuring about 70 W just before it powers off. For the start up, you could have the sketch just wait a certain amount of time before transmitting any data, say 1 - 5 minutes after it powers up, so you know it will have enough power to give accurate measurements. The evening drop off is a bit harder to manage. You could have a thresholding function that says if the measured power is below a certain amount, say 3 or 4 W, to output a zero, and after a certain number of zeros, stop all output and wait for the long sleep of night. In the morning, as soon as it wakes up , the first output it does is zero, so the two connected points (last point the day before to the first point in the morning) will not integrate to any energy for the night. Then it waits the proper amount of time before putting out the first real power measurement.

Someone else who knows the Atmega328 might be able to suggest some method to measure the Vcc and be able to tell it to output zero if that is below some value. That would be another way to do it that might be more accurate.

Dan

Robert Wall's picture

Re: EmonTX not sending all the time creating wrong values in EmonCMS

A suggestion: use the d.c. voltage you're already measuring and only send data when it is above an acceptable threshold - enough to run the regulator that's feeding your emonTx. For good measure add some delay on a rising voltage but shut down immediately on a falling voltage. You might need to allow a margin so that there's enough voltage left to measure accurately and do an orderly shut-down before it falls over.

Petrik's picture

Re: EmonTX not sending all the time creating wrong values in EmonCMS

i used succesfully dc voltage threshold just below inverter threshold. this works most of the time with PV. there is a problem anyhow if the last transmissions does not go through as you can not quarantee that the last transmission does not collide in 868mhz network.

anyhow one of the recent (this spring) releases of emoncms introduced a problem you described that emoncms does show a line between two more or less arbitrary points on some screens (e.g. weekly view) and then when zoomed in it shows accurate values.

jb79's picture

Re: EmonTX not sending all the time creating wrong values in EmonCMS

I think I'll try Robert's solution and insert an if statement that switches off data transmission when the solar voltage is <12V.

It looks like the problem appears when the input voltage is lower than 8,5V, then the power supply of the circuit stops working correct.The 3,3V supply is not the problem but the 5V supply for the current monitoring is it. It consisting of a 7812 and a 7805 connected in series plus a 1N4001 diode, so it is able to handle up to 40V input from the solar cell but needs at minimum 8,5V input to give correct 5V output.

 

 

jb79's picture

Re: EmonTX not sending all the time creating wrong values in EmonCMS

After installing a modified script that only sends data when the solar voltage is greater than 12V it looks better. The only problem is that the actual power for AC and DC side are frozen, so they will count for the kwhd values.

Robert Wall's picture

Re: EmonTX not sending all the time creating wrong values in EmonCMS

That is a "feature" of emoncms. It joins the dots. To get around that, you need to send a manufactured final value of zero in the process of shutting down, and a manufactured first value of zero as you start up before sending true readings again.

jb79's picture

Re: EmonTX not sending all the time creating wrong values in EmonCMS

Ok when I dismount it next time, I'll try to insert something like this to ensure that I always get a clear 0 value in the time the voltage is below 12V from evening to morning and don't have to transmit and store 0's all the night:

if (actual_voltage >12V) send_values ();

else

{ if (old_voltage!=0)

  { old_voltage=0;

    actual_voltage=0;  // also set all other values to 0 before transmitting them, voltage is only the example.

    send_values ();

  }

   else old_voltage=0;

}

 

I know that the syntax isn't correct, this is only for a better understanding of the script!

Robert Wall's picture

Re: EmonTX not sending all the time creating wrong values in EmonCMS

And you need to make sure you send a zero first when waking up - I don't think what you have above will necessarily do that. The easiest place for that will be in setup( ) of course.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.