Coder Social home page Coder Social logo

mathompl / aqualed Goto Github PK

View Code? Open in Web Editor NEW
31.0 12.0 8.0 34.02 MB

Arduino Dimmable PWM DIY LED Light for Marine/Reef/Freshwater Aquarium controller with Nextion LCD support and temperature/cooling fans control (3 sensors/fans)

License: GNU General Public License v3.0

C 24.06% C++ 75.94%
ds18b20 arduino nextion aquarium led pwm temperature drivers dimmable reef marine diy rtc moon-phase sunrise sunset controllers light lightning illumination

aqualed's Issues

Compile problem

Hello, tanks for sharing your project!
I´m testing it right now, and I´m loving it...
I have a problem when I uncomment the line #define NO_BLUETOOTH for activating the bluetooth module
The arduino IDE return me a few errors ( I´m not a programming expert :P )

My current setup is:

  • lights with 3 channels controlled by pwm
  • 3 temperature sensors DS18B20 (Water, Leds, pwm drivers)
  • 8 relay board for 230V switch, 4 currently in use (Heater, Filter, CO2, Skimmer)

I´m electronic technician , and my programming skills are limited for now, a help is much appreciated !

Thanks in advance!

request about led

Hello,

really nice project. I have one question. Can I use WS2812B LED strip´s for as light. If yes I´m limitted to the number of leds?
Regards
Tobias

[ask] Issue on RTC library

Hi, nice work!!

i have problem on RTC lib version
look like i cannot find rtcSetup, getMoonPhase , readTime, adjustDST and others function
have try to install low version to latest version from https://github.com/adafruit/RTClib with no luck

iam using Arduino Mega Atmega2560 on Arduino IDE

Thanks before

C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Aqualed.ino: In function 'void setup()':
Aqualed:43:9: error: 'rtcSetup' was not declared in this scope
         rtcSetup ();
         ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Aqualed.ino:43:9: note: suggested alternative: 'setup'
         rtcSetup ();
         ^~~~~~~~
         setup
Aqualed:45:9: error: 'getMoonPhase' was not declared in this scope
         getMoonPhase ();
         ^~~~~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Aqualed.ino:45:9: note: suggested alternative: 'moonPhase'
         getMoonPhase ();
         ^~~~~~~~~~~~
         moonPhase
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Aqualed.ino: In function 'void loop()':
Aqualed:66:9: error: 'readTime' was not declared in this scope
         readTime ();
         ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Aqualed.ino:66:9: note: suggested alternative: 'currTime'
         readTime ();
         ^~~~~~~~
         currTime
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino: In function 'boolean handleTestSlider(int, byte)':
Nextion:190:38: error: 'mapRound' was not declared in this scope
         pwmRuntime[i].valueCurrent = mapRound ((long)t, 0, 100, 0, PWM_I2C_MAX);
                                      ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino:190:38: note: suggested alternative: 'round'
         pwmRuntime[i].valueCurrent = mapRound ((long)t, 0, 100, 0, PWM_I2C_MAX);
                                      ^~~~~~~~
                                      round
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino: In function 'void handlePWMPage(byte)':
Nextion:279:48: error: 'mapRound' was not declared in this scope
                 pwmSettings[i - 1].valueProg = mapRound (pwmSettings[i - 1].valueProg, 0, 100, 0, PWM_I2C_MAX);
                                                ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino:279:48: note: suggested alternative: 'round'
                 pwmSettings[i - 1].valueProg = mapRound (pwmSettings[i - 1].valueProg, 0, 100, 0, PWM_I2C_MAX);
                                                ^~~~~~~~
                                                round
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino: In function 'void handleSetTimePage(byte)':
Nextion:351:17: error: 'readTime' was not declared in this scope
                 readTime ();
                 ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino:351:17: note: suggested alternative: 'currTime'
                 readTime ();
                 ^~~~~~~~
                 currTime
Nextion:352:17: error: 'adjustDST' was not declared in this scope
                 adjustDST ();
                 ^~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino: In function 'void handleConfigPage(byte)':
Nextion:503:21: error: 'discoverOneWireDevices' was not declared in this scope
                 s = discoverOneWireDevices ();
                     ^~~~~~~~~~~~~~~~~~~~~~
Nextion:522:26: error: 'listContains' was not declared in this scope
                 idxLed = listContains (settings.sensors[LED_TEMPERATURE_FAN]);
                          ^~~~~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino:522:26: note: suggested alternative: 'isControl'
                 idxLed = listContains (settings.sensors[LED_TEMPERATURE_FAN]);
                          ^~~~~~~~~~~~
                          isControl
Nextion:540:50: error: 'mapRound' was not declared in this scope
                         setValue (NX_FIELD_N0+i, mapRound (pwmRuntime[i].valueCurrent, 0, PWM_I2C_MAX, 0, 100));
                                                  ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino:540:50: note: suggested alternative: 'round'
                         setValue (NX_FIELD_N0+i, mapRound (pwmRuntime[i].valueCurrent, 0, PWM_I2C_MAX, 0, 100));
                                                  ^~~~~~~~
                                                  round
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino: In function 'void handlePWMListPage(byte)':
Nextion:615:31: error: 'mapRound' was not declared in this scope
                 tmax = (byte) mapRound (pwmSettings[cid - 1].valueDay, 0, PWM_I2C_MAX, 0, 100);
                               ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino:615:31: note: suggested alternative: 'round'
                 tmax = (byte) mapRound (pwmSettings[cid - 1].valueDay, 0, PWM_I2C_MAX, 0, 100);
                               ^~~~~~~~
                               round
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino: In function 'double getPercent(byte)':
Nextion:867:16: error: 'mapDouble' was not declared in this scope
         return mapDouble((double)pwmRuntime[i].valueCurrent, 0.0, (double)PWM_I2C_MAX, 0.0, 100.0);
                ^~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Nextion.ino:867:16: note: suggested alternative: 'double'
         return mapDouble((double)pwmRuntime[i].valueCurrent, 0.0, (double)PWM_I2C_MAX, 0.0, 100.0);
                ^~~~~~~~~
                double
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\PWM.ino: In function 'void setupPWMPins()':
PWM:24:35: error: no matching function for call to 'init(int)'
         pwmController.init(B000000); // Address pins A5-A0 set to B000000
                                   ^
In file included from C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\PWM.ino:9:0:
C:\Users\yusuf\Documents\Arduino\libraries\PCA9685-Arduino-1.2.15\src/PCA9685.h:204:10: note: candidate: void PCA9685::init(PCA9685_OutputDriverMode, PCA9685_OutputEnabledMode, PCA9685_OutputDisabledMode, PCA9685_ChannelUpdateMode, PCA9685_PhaseBalancer) <near match>
     void init(PCA9685_OutputDriverMode driverMode = PCA9685_OutputDriverMode_TotemPole,
          ^~~~
C:\Users\yusuf\Documents\Arduino\libraries\PCA9685-Arduino-1.2.15\src/PCA9685.h:204:10: note:   conversion of argument 1 would be ill-formed:
C:\Users\yusuf\Documents\Arduino\libraries\PCA9685-Arduino-1.2.15\src/PCA9685.h:211:10: note: candidate: void PCA9685::init(PCA9685_PhaseBalancer, PCA9685_OutputDriverMode, PCA9685_OutputEnabledMode, PCA9685_OutputDisabledMode, PCA9685_ChannelUpdateMode) <near match>
     void init(PCA9685_PhaseBalancer phaseBalancer,
          ^~~~
C:\Users\yusuf\Documents\Arduino\libraries\PCA9685-Arduino-1.2.15\src/PCA9685.h:211:10: note:   conversion of argument 1 would be ill-formed:
PWM:30:9: error: 'getCurrentTime' was not declared in this scope
         getCurrentTime ();
         ^~~~~~~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\PWM.ino:30:9: note: suggested alternative: 'getPercent'
         getCurrentTime ();
         ^~~~~~~~~~~~~~
         getPercent
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\PWM.ino: In function 'void pwm(byte)':
PWM:262:31: error: 'mapRound' was not declared in this scope
                         val = mapRound(val,  PWM_I2C_MAX, PWM_I2C_MIN,  0, 255);
                               ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\PWM.ino:262:31: note: suggested alternative: 'round'
                         val = mapRound(val,  PWM_I2C_MAX, PWM_I2C_MIN,  0, 255);
                               ^~~~~~~~
                               round
PWM:264:31: error: 'mapRound' was not declared in this scope
                         val = mapRound(val, PWM_I2C_MIN, PWM_I2C_MAX,  0, 255);
                               ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\PWM.ino:264:31: note: suggested alternative: 'round'
                         val = mapRound(val, PWM_I2C_MIN, PWM_I2C_MAX,  0, 255);
                               ^~~~~~~~
                               round
PWM:279:39: error: 'mapRound' was not declared in this scope
                                 val = mapRound(val, PWM_I2C_MAX, 0.0, PWM_I2C_MIN, PWM_I2C_MAX);
                                       ^~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\PWM.ino:279:39: note: suggested alternative: 'round'
                                 val = mapRound(val, PWM_I2C_MAX, 0.0, PWM_I2C_MIN, PWM_I2C_MAX);
                                       ^~~~~~~~
                                       round
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\PWM.ino: In function 'void pwm()':
PWM:336:17: error: 'getCurrentTime' was not declared in this scope
                 getCurrentTime ();
                 ^~~~~~~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\PWM.ino:336:17: note: suggested alternative: 'getPercent'
                 getCurrentTime ();
                 ^~~~~~~~~~~~~~
                 getPercent
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Temperature.ino: In function 'void fansControl()':
Temperature:56:25: error: 'fansSwitch' was not declared in this scope
                         fansSwitch (i, settings.maxTemperatures[i]);
                         ^~~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Temperature.ino:56:25: note: suggested alternative: 'relaySwitch'
                         fansSwitch (i, settings.maxTemperatures[i]);
                         ^~~~~~~~~~
                         relaySwitch
In file included from C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Aqualed.ino:3:0:
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Temperature.ino: At global scope:
C:\Users\yusuf\Documents\Arduino\libraries\DS18B20-master/DS18B20.h:9:20: error: expected initializer before '-' token
 #define TEMP_ERROR -273.15f
                    ^
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Temperature.ino:72:1: note: in expansion of macro 'TEMP_ERROR'
 TEMP_ERROR = 40
 ^~~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Time.ino: In function 'void readTime()':
Time:30:9: error: 'adjustDST' was not declared in this scope
         adjustDST ();
         ^~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Time.ino: In function 'void adjustDST()':
Time:47:17: error: 'getMoonPhase' was not declared in this scope
                 getMoonPhase ();
                 ^~~~~~~~~~~~
C:\Users\yusuf\Arduino\Project\AquaLed-master\Aqualed\Time.ino:47:17: note: suggested alternative: 'moonPhase'
                 getMoonPhase ();
                 ^~~~~~~~~~~~
                 moonPhase
exit status 1
'rtcSetup' was not declared in this scope

Random arduino crashes

I'm experiencing random arduino crashes/lockups after ca. 4 years of lamp operation.

Most of the wirings, arduino, pwm controller and rtc modules were replaced. PCB looks mostly good with some oxidation.

Causes - I think related to possible electrical noise caused by hardware age, tough working environment (salt water, moisture) and maybe to aging led drivers:

  1. In function nxTouch() there wasn't check on array lenght when writing. In some situations (noise on serial line) this might result in writing out of array boundaries - fixed, lockups still occur.
  2. There might be a problem with Wire library and potential endless loop in function endTransation (). This issue is well documented, the updated library has a new method setWireTimeout() for avoiding this. Again - this may be the case with noise on i2c lines. Timeout added - in testing.
  3. There might be a problem with OneWire - again electrical - testing on the way.
  4. There is a slight possibility of damaged transistors controlling the relays, and current backflow to gpio - i have to get into that.

Arduino's watchdog doesn't reset the board.

I will publish patches after testing for a few days.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.