GithubHelp home page GithubHelp logo

dalgibbard / lightcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benjaf/lightcontroller

0.0 3.0 0.0 198 KB

An Arduino controller for Aquarium lighting

License: BSD 2-Clause "Simplified" License

C++ 28.87% Arduino 71.13%

lightcontroller's Introduction

This is a Revised Version of benjaf's Aquarium Lighting Controller.

This version has the following modifications:

  • Modified for running the Arcadia Classica OTL LED Unit Range (4 Channels, limited to 80% PWM Duty Cycle)
  • Prints debug to Serial (Time/Date + Channel Power Output in %)
  • Detects and traps RTC "165" error.
  • Error LED Config.

Future Additions:

  • LCD Output
  • PCB Generation, and Schematics + Notes on programming the chip, and restting the Clock.
  • LED per Output Channel to show "On"
  • Power/Running LED.

Tested On:

  • Arduino Leonardo

To Test:

  • Arduino Uno
  • Atmega328P-Pu (Breadboard/PCB)

This is an 'advanced' 24 hour light scheduler designed for DIY Aquarium lighting

It allows for easy creation of pretty much any 24 hour light schedule imaginable within the limitations of the Arduino used. This was done to provide easy support for moonlight, sunrise/sunset, siesta etc.

Limitations:

  • Schedule cannot exceed 24 hours (no handling of differences based on weekday, time of year etc.)
  • Max number of channels: Defined by the number of PWM pins available on the Arduino used
  • Max number of on/off cycles during a day: Any
  • Precision:
    • PWM duty cycle: 0-255
    • Time-to-PWM precision: 1 second (making the shortest fade timespan in which full PWM resolution is used 255 seconds)

This is not intended to be a complete aquarium or light controller, it merely provides you with the code to handle light scheduling!

You will need to download and install "RTClib" (https://github.com/adafruit/RTClib) for this to work.

I have NOT included any code for interfaces (Serial, LCD, etc.), nor any delays. That would make the sketch more context-specific because these things depend on the users actual setup. Communication via Serial is easy to find documentation on elsewhere. It should be noted that this code contains no delays! If you start sending data (i.e. via Serial) you might want to make sure this is only done at apropriate intervals.

This version uses 2 PWM pins because I only have 2 channels in my setup. Fore more advanced changes, the user (you) should have basic understanding of programming. This includes:

  • For-loops (and break conditions)
  • Objects

As is probably evident from the code, I am not that experienced with writing software for microcontrollers. I have written this code from an Object Oriented point of view to make it more aesily understandable. Several optimizations are possible, but I tried to shoot for at least some degree of readability.

lightcontroller's People

Contributors

benjaf avatar dalgibbard avatar

Watchers

 avatar  avatar  avatar

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.