Pages: [1]   Go Down
Author Topic: Filtering out erroneous data  (Read 361 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Greetings,

I am fighting a very strange problem and I need a bit of help.

I made a controller for a reef tank with a Mega. Everything works very well with the exception of the metal halide lights. Whenever I command that relay on the ballast is messing up the reading on I2C from the DS1307 and makes it sending garbage time values. In hardware I have done all I knew to do (mechanical relay, snubber, etc.) Nothing worked with this ballast.

Now I am down to software. Is there a way of filtering out garbage time values ? They are popping up for a second and then dissapear for a few minutes. Everything is random.

If filtering is not an option, is there a way to start a counter based on Arduino time ?

Many thanks,
MaLi
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1284
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It depends on what you mean by 'garbage' values.

Time is a very linear thing, so one time value will aways be bigger than the previous time value. I would have thought that in the software you should be able to ignore values that differed from the previous one by more than a certain amount as being 'in error', and anything less than previous reading as being definitely wrong.

IMO
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Offline Offline
Jr. Member
**
Karma: 0
Posts: 52
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Marco. Sometimes the time goes briefly to 00;00 sometimes to 45:XX or any combination. I have two ballasts. One is triggering the odd behaviour in a few seconds the other one every tweny , thirty minutes.

cheers,
MaLi
Logged

Sydney, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1284
Big things come in large packages
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino is not accurate as a clock over a long time. However, as you are in control of the lights, maybe when the lights come on you can just use the Arduino time to work out the current time. The sort of logic I am thinking of would be that is the lights are not energised, use the external clock (I2C) and if the lights are on, use the last reading and add on the time elapsed from the Arduino. When the lights are turned off the Arduino can resync to the external clock.

If it is RF interference, then maybe position the electronics further away from the lights? Or change the lights to something else :-).
Logged

Arduino libraries http://arduinocode.codeplex.com
Parola hardware & library http://parola.codeplex.com

Pages: [1]   Go Up
Jump to: