# reef-pi Guide 5: Light Controller

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/063/967/medium800/adafruit_products_0B9F2045-66DA-4C70-A7F5-7027B7352A15.jpeg?1540180530)

Welcome to the fifth guide in the&nbsp;[reef-pi series](https://learn.adafruit.com/search?q=reef-pi).

In this guide, we'll use reef-pi to automate a reef aquarium lighting.&nbsp;This guide assumes you have read through the first guide in this series, if not please go through it [here.](https://learn.adafruit.com/reef-pi-installation-and-configuration?view=all)

Lighting is one of the most critical aspects of reef keeping. Corals feed on light. Although corals are animals (thus they cannot do photosynthesis),&nbsp;they have zooxanthellae&nbsp;(a type of algae) in their tissue that forms a symbiotic relationship with them. The algae provide&nbsp;nutrition&nbsp;to the host coral via photosynthesis, while the corals provide the entire habitat for the algae. Tropical corals can survive solely on photosynthesis, though they can also do filter feeding from the water column.

![](https://cdn-learn.adafruit.com/assets/assets/000/062/600/medium800/adafruit_products_acanthastrea_lordhowensis.jpg?1538030619 Acan coral in a reef aquarium - Photo courtesy Vincent Le Goff)

Light controllers in reef keeping are used to mimic natural reef environment. We'll be using reef-pi to automate the dawn to dusk daylight cycle.&nbsp; Light controllers are also used during the introduction of new corals in the aquarium. Corals are very sensitive to changes in general, and when new coral is introduced in reef aquariums, it is helpful to set up proper light acclimation where light intensity is slowly ramped up to target levels, to reduce the new coral's stress and increase the chance of survival and reduce accidental bleaching.

Sometimes, moonlight or UV lights are used to simulate the lunar cycle. Coral spawning (sexual reproduction of corals by releasing spores) is closely linked with the lunar cycle. Corals contain fluorescent pigments which glow under UV lights. Often times, reef keepers will use UV lights for their viewing pleasure, outside the daylight cycle time.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/966/medium800/adafruit_products_BEF6A61D-B799-4CCC-ADAC-B982023B7EFF.jpeg?1540180512)

In the reef aquarium, lighting requires a light source of a specific&nbsp;wavelength (around 460 nm) and intensity (50-200 PAR). Typically reef aquariums require 3-5 watts of light per gallon. There are a number of popular LED lights available for reef aquariums. It is also possible to build a light from scratch using appropriately chosen diodes (generally Cree or Luxeon). In this guide, we'll build a controller for one of the popular LED lights, Kessil, as the main light and an actinic LED strip for moonlight. Although the example circuits are for these specific lights, they should be fairly useful for a host of other commercially available light controls.

Due to the various requirements of light controls and diverse nature of LED lights, reef-pi's&nbsp;light control features are extensive compared to other reef-pi modules. To explore reef-pi light control features, we'll build a dedicated light controller as part of this guide. This controller will automate three Kessil lights (A80, A160, A360) as the main light source for the reef aquariums and a single moonlight strip from TrueLumen, which is mostly used for viewing pleasure, during night time when the main light (kessil) is off. This build is very much customized for my tanks, as shown below, but the technique should be fairly applicable to most other reef tank setups.

# reef-pi Guide 5: Light Controller

## Parts

For one part of the build, we'll extend our previous&nbsp;reef-pi build to control Kessil lights (A360, A80 or A160),&nbsp; Kessil allows controlling the spectrum and intensity of the light using 10V pulse width modulation (PWM). We'll use Raspberry Pi's hardware timers as a 3.3V PWM source which will be then converted to a 10v PWM using an NPN&nbsp;transistor. We'll use a couple of LM2596 modules to generate 5V (for Raspberry Pi) and 10V (for NPN&nbsp;transistor source) power source from a single 12V power source.

For the other build, we'll aim to control multiple Kessil lights as well as a moonlight from coralife. We'll need 7 (3x2 +1) PWM channels for this build. We'll use a new Pi Zero along with Adafruit PCA9685 breakout board (since the Raspberry Pi has only two hardware based PWM channels, while PCA9685 has 16 PWM channels)

This parts list does not include the actual lights (Kessil or Coralife).&nbsp;

### NPN Bipolar Transistors (PN2222) - 10 pack

quantity: 8
[NPN Bipolar Transistors (PN2222) - 10 pack](https://www.adafruit.com/product/756)
Transistors are powerful little electronic switches, and we really like these NPN transistors whenever we need to control medium-power electronics such as small motors, solenoids, or IR LEDs. We find them so handy, they come in a pack of 10!

Each transistor is a general-purpose...

In Stock
[Buy Now](https://www.adafruit.com/product/756)
[Related Guides to the Product](https://learn.adafruit.com/products/756/guides)
![Ten transistors scattered.](https://cdn-shop.adafruit.com/640x480/756-03.jpg)

### Through-Hole Resistors - 10K ohm 5% 1/4W - Pack of 25

quantity: 8
[Through-Hole Resistors - 10K ohm 5% 1/4W - Pack of 25](https://www.adafruit.com/product/2784)
ΩMG! You're not going to be able to resist these handy resistor packs!&nbsp;Well, axially, they&nbsp;do all of the resisting for you!

This is a **25 Pack of 10K Ω Resistors.** More specifically, they are **carbon film** , through-hole...

In Stock
[Buy Now](https://www.adafruit.com/product/2784)
[Related Guides to the Product](https://learn.adafruit.com/products/2784/guides)
![Angled shot of 25 Through-Hole Resistors - 10K ohm 5% 1/4W.](https://cdn-shop.adafruit.com/640x480/2784-00.jpg)

### Through-Hole Resistors - 2.2K ohm 5% 1/4W - Pack of 25

quantity: 8
[Through-Hole Resistors - 2.2K ohm 5% 1/4W - Pack of 25](https://www.adafruit.com/product/2782)
ΩMG! You're not going to be able to resist these handy resistor packs!&nbsp;Well, axially, they&nbsp;do all of the resisting for you!

This is a **25 Pack of 2.2K Ω Resistors.** More specifically, they are **carbon film** , through-hole...

In Stock
[Buy Now](https://www.adafruit.com/product/2782)
[Related Guides to the Product](https://learn.adafruit.com/products/2782/guides)
![Angled shot of 25 Through-Hole Resistors - 2.2K ohm 5% 1/4W.](https://cdn-shop.adafruit.com/640x480/2782-00.jpg)

### Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface

[Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface](https://www.adafruit.com/product/815)
You want to make a cool robot, maybe a hexapod walker, or maybe just a piece of art with a lot of moving parts. Or maybe you want to drive a lot of LEDs with precise PWM output. Then you realize that your microcontroller has a limited number of PWM outputs! What now? You could give up OR you...

In Stock
[Buy Now](https://www.adafruit.com/product/815)
[Related Guides to the Product](https://learn.adafruit.com/products/815/guides)
![Adafruit 16-Channel 12-bit PWM/Servo Driver with I2C interface](https://cdn-shop.adafruit.com/640x480/815-05.jpg)

### Raspberry Pi Zero W

[Raspberry Pi Zero W](https://www.adafruit.com/product/3400)
If you didn't think that the Raspberry Pi Zero could possibly get any better, then boy do we have a pleasant surprise for you!&nbsp;The new **Raspberry Pi Zero W** offers all the benefits of the Pi Zero v1.3, but with one big difference – **built-in...**

In Stock
[Buy Now](https://www.adafruit.com/product/3400)
[Related Guides to the Product](https://learn.adafruit.com/products/3400/guides)
![Angled shot of Raspberry Pi Zero W computer.](https://cdn-shop.adafruit.com/640x480/3400-06.jpg)

### Adafruit Perma-Proto Half-sized Breadboard PCB - Single

[Adafruit Perma-Proto Half-sized Breadboard PCB - Single](https://www.adafruit.com/product/1609)
Customers have asked us to carry basic perf-board, but we never liked the look of most basic perf: it's always crummy quality, with pads that flake off and no labeling. Then we thought about how people **actually** prototype - usually starting with a solderless breadboard and...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1609)
[Related Guides to the Product](https://learn.adafruit.com/products/1609/guides)
![Angled Shot of the Adafruit Perma-Proto Half-sized Breadboard PCB - Single](https://cdn-shop.adafruit.com/640x480/1609-03.jpg)

### Adafruit Perma-Proto Small Mint Tin Size Breadboard PCB - 3 pack

[Adafruit Perma-Proto Small Mint Tin Size Breadboard PCB - 3 pack](https://www.adafruit.com/product/1214)
Making a project that will fit into an "Altoids Smalls" Mint Tin? Or maybe you just need a small amount of prototyping space and a larger breadboard size is too big? Put down that PCB shear and pick up a Perma-Proto in the new exciting shape!

Customers have asked us to carry...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1214)
[Related Guides to the Product](https://learn.adafruit.com/products/1214/guides)
![Overhead shot of three perma-protos.](https://cdn-shop.adafruit.com/640x480/1214-06.jpg)

### Part: Enclosure
quantity: 1
Enclosure for the circuit
[Enclosure](https://www.amazon.com/dp/B0723DW8JM)

### Part: Power adapter
quantity: 1
12V 2A regulated power supply
[Power adapter](https://www.amazon.com/dp/B01LSETT30)

### Rugged Metal On/Off Switch with White LED Ring

[Rugged Metal On/Off Switch with White LED Ring](https://www.adafruit.com/product/917)
These chrome-plated metal buttons are rugged and look real good while doing it! Simply drill a 16mm hole into any material up to 1/2" thick and you can fit these in place, there's even a rubber gasket to keep&nbsp;water out of the enclosure. On the front of the button is a flat metal...

In Stock
[Buy Now](https://www.adafruit.com/product/917)
[Related Guides to the Product](https://learn.adafruit.com/products/917/guides)
![Angled shot of Rugged Metal On/Off Switch with White LED Ring - 16mm White On/Off.](https://cdn-shop.adafruit.com/640x480/917-00.jpg)

### N-channel power MOSFET

[N-channel power MOSFET](https://www.adafruit.com/product/355)
When you need to switch a lot of power, N-channel MOSFETs are best for the job. These FETs can switch over 60A and 30V and are TO-220 packages so they fit nicely into any breadboard or perfboard. Heat sinking is easy with TO-220's, but because of the very low Rds(on) of down to 0.009 ohms...

Out of Stock
[Buy Now](https://www.adafruit.com/product/355)
[Related Guides to the Product](https://learn.adafruit.com/products/355/guides)
![N-channel power MOSFET in TO-220 package](https://cdn-shop.adafruit.com/640x480/355-02.jpg)

### Part: Male-male audio cable
quantity: 1
Cable to connect Kessil lights with controller
[Male-male audio cable](https://www.amazon.com//dp/B00R10DWWK)

### Hook-up Wire Spool Set - 22AWG Solid Core - 6 x 25 ft

[Hook-up Wire Spool Set - 22AWG Solid Core - 6 x 25 ft](https://www.adafruit.com/product/1311)
Perfect for bread-boarding, free wiring, etc. This box contains **6** spools of **solid-core** wire. These&nbsp;spools of solid-core wires are&nbsp;easily soldered to,&nbsp;keeps its shape pretty well when bent&nbsp;and is rated 80C and 300V (UL AWM style 1007). We...

In Stock
[Buy Now](https://www.adafruit.com/product/1311)
[Related Guides to the Product](https://learn.adafruit.com/products/1311/guides)
![Hook-up Wire Spool Set in box with 6 colorful wires coming out](https://cdn-shop.adafruit.com/640x480/1311-04.jpg)

### Panel Mount 1/8" / 3.5mm TRS Audio Jack Connector

quantity: 3
[Panel Mount 1/8" / 3.5mm TRS Audio Jack Connector](https://www.adafruit.com/product/3692)
What _is_ this TRS bit? **T** urtle **R** ock **S** tudios? **T** ransmission **R** aman **S** pectroscopy? Not quite, more...

In Stock
[Buy Now](https://www.adafruit.com/product/3692)
[Related Guides to the Product](https://learn.adafruit.com/products/3692/guides)
![Panel Mount 1/8 inch / 3.5mm TRS Audio Jack Connector](https://cdn-shop.adafruit.com/640x480/3692-01.jpg)

### White Nylon Machine Screw and Stand-off Set – M2.5 Thread

[White Nylon Machine Screw and Stand-off Set – M2.5 Thread](https://www.adafruit.com/product/3658)
Totaling 420 pieces, this **White Nylon&nbsp;M2.5 Screw Set** &nbsp;is a must-have smörgåsbord for your workstation.&nbsp;You'll have more than enough screws, nuts, and hex standoffs to construct&nbsp;your maker projects&nbsp;for days on end! M2.5 screws fit nearly...

In Stock
[Buy Now](https://www.adafruit.com/product/3658)
[Related Guides to the Product](https://learn.adafruit.com/products/3658/guides)
![White Nylon Screw and Stand-off Set with M2.5 Threads, kit box](https://cdn-shop.adafruit.com/640x480/3658-00.jpg)

### 5.5 / 2.1mm Barrel Connector - DC Power Plug

[5.5 / 2.1mm Barrel Connector - DC Power Plug](https://www.adafruit.com/product/3310)
DIY? How about D-I-Wire! This barrel jack plug is great for adding a common power connector to the end of your wires. The&nbsp;jack is compatible with 5.5mm barrel jacks that have a 2.1mm center pole diameter. The outer shell unscrews to reveal solder terminals and a crimp strain relief....

In Stock
[Buy Now](https://www.adafruit.com/product/3310)
[Related Guides to the Product](https://learn.adafruit.com/products/3310/guides)
![Angled shot of 5.5 / 2.1mm DC barrel jack connector.](https://cdn-shop.adafruit.com/640x480/3310-00.jpg)

### Part: Female panel mount barrel jack
quantity: 1
Barrel jack connector for the main controller power source
[Female panel mount barrel jack](https://www.amazon.com/dp/B073TS9H3S/)

### Part: LM2596 Buck Converter
quantity: 2
tep Down Module Power Supply DIP Output 1.25V-30V 3A
[LM2596 Buck Converter](https://www.amazon.com/Zixtec-LM2596-Converter-Module-1-25V-30V/dp/B07VVXF7YX?th=1)

# reef-pi Guide 5: Light Controller

## Circuit Construction

![](https://cdn-learn.adafruit.com/assets/assets/000/063/724/medium800/adafruit_products_Screen_Shot_2018-10-19_at_12.23.24_AM.png?1539933858)

A light in reef-pi is composed of one or more **channels**. Each channel is controlled by a **jack** , a type of connector (similar to outlets or inlets) that represent a DC current source with PWM capability. The lighting circuit in reef-pi determines how many jacks are available and their&nbsp;supported&nbsp;voltage/current range. For our light controller, we are aiming for 3 Kessil light controls and a blue actinic led strip for moonlight. Each of the kessil&nbsp;light control requires two 10V PWM control signals and the blue actinic led strip will require one more, which makes our total number of required jacks at 7.

We'll be using Adafruit PCA9685 breakout board which offers 16 channels, more than enough for our use.&nbsp;For each channel, we'll use a basic circuit where the 5V PWM signal will be generated by the PCA9685 IC and then a transistor will be used to convert that PWM signal to an appropriate voltage and current for the specific light.&nbsp; Kessil lights have dedicated 10V PWM control inputs which are different from the actual power source, which makes the control signal current requirement fairly low (under 20ma). We'll use a common NPN transistor 2N2222A for this. There will be six total transistors&nbsp; to&nbsp;support all 3 Kessil lights, each with two channels.&nbsp; For the actinic LED strip we'll use a&nbsp;[TrueLumen actinic LED strip](https://www.amazon.com/dp/B003XXAE84)&nbsp;and&nbsp;dim it by controlling&nbsp;its power source directly using a power MOSFET.

Here is an overall schematic of the wiring. We'll use a single 12V 2A power supply to power the entire project. Two LM2596 modules will be used to generate 5V (for Raspberry Pi & PCA9685 breakout board) and 10V (for Kessil circuit) power source from a single 12V rail. The 12V rail will be used to feed the actinic strip as well, connected via a 2.1mm barrel jack connector.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/725/medium800/adafruit_products_Screen_Shot_2018-10-19_at_12.23.42_AM.png?1539934192)

Notice there are two perma proto boards used in this build. A half size perma&nbsp;proto board has the Kessil&nbsp;control circuit, which involves one NPN transistor for each channel, the PWM output from PCA9685 IC is connected to the transistor base (green wire) with a 10K resistor in series.&nbsp; While the 10V rails are connected to the collector pin (blue wire) of the transistor with a 1K resistor in series. The emitter pin of the transistor is connected to GND.

The power MOSFET based control circuit for the 12V actinic LED strip is mounted on a small Mint Tin size perma&nbsp;proto board. A common N channel logic level power MOSFET is used, with the PCA9685 PWM output connected to the Gate pin (green wire), the Source pin connected to the -Ve end of the LED strip (blue wire) and the Drain pin connected to GND.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/978/medium800/adafruit_products_Screen_Shot_2018-10-22_at_12.29.47_AM.png?1540193520)

Start with preparing all the connectors. We'll need two barrel jack connectors, one for the incoming 12V 2A power source and another for powering the actinic LED strip.&nbsp; We'll also use an SPDT switch for convenient power up or power down of the controller.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/659/medium800/adafruit_products_0ADBF07E-C963-4D8E-9F38-0040634CAF46.jpeg?1539842846)

Prepare three panel mount female audio jacks by soldering female jumper wires on them.

&nbsp;

We'll use each one of them to control one Kessil&nbsp;light. We'll need three such connectors for this build.

![adafruit_products_BE644E50-0127-4AF4-959A-C4AB4C0FB82C.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/061/338/medium640/adafruit_products_BE644E50-0127-4AF4-959A-C4AB4C0FB82C.jpeg?1539933918)

We'll need two LM2596 modules. For this build, I am using the&nbsp;LM2596 module with female jumper wires soldered on them directly.&nbsp;

![adafruit_products_38AFD4F9-D894-4EE8-AA12-0440845716D9.jpeg](https://cdn-learn.adafruit.com/assets/assets/000/063/155/medium640/adafruit_products_38AFD4F9-D894-4EE8-AA12-0440845716D9.jpeg?1539926882)

Always tin the connectors and the jumper wires before soldering.&nbsp;

Next, build the Kessil control circuit on the half size&nbsp;Perma Proto Board. I have used color-coded male header pins and jumper wires to make it easy to understand the circuit. The green header pins represent inbound 5V PWM signal from PCA9685. They are in pairs, since each Kessil light has two controllable channels. The blue header pins are for 10V PWM that will be generated by the transistor. Each of the light control signal involve two 10V PWM channels and a GND.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/938/medium800/adafruit_products_53B6931B-C86B-40D8-A77A-C47AB7C859E5.jpeg?1540111131)

Add NPN transistors and resistors.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/939/medium800/adafruit_products_7321BE89-5F05-4728-87AB-EFE8542B2B4A.jpeg?1540111158)

Then solder the jumper wires and male header pins for power rails. I use 22AWG solid core wires for this. The upper power rail is used for 5V and the lower power rail is used for 10V.

Warning: 

![](https://cdn-learn.adafruit.com/assets/assets/000/063/940/medium800/adafruit_products_3C7C1F2D-2C40-499F-8F28-E33EFA0A16FF.jpeg?1540111184)

Next, build the actinic LED strip control circuit on the Mint Tin size Perma Proto Board. This board will also provide a 12V that is used to power the LM2596 modules.

![](https://cdn-learn.adafruit.com/assets/assets/000/061/339/medium800/adafruit_products_CC28123F-93D9-4C3C-B836-5819198C227F.jpeg?1536544428)

The actinic LED strip comes with bare wires. Connect with a 2.1 mm male barrel connector.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/970/medium800/adafruit_products_moonlight.jpeg?1540184223)

# reef-pi Guide 5: Light Controller

## Building the Housing

Start with drilling holes for all the connectors. I prefer to mount connectors at the bottom of the panel. Note the barrel jack connector holes (the first two on the left) are little bit bigger than the holes for 3.5mm audio jacks (right three holes).

![](https://cdn-learn.adafruit.com/assets/assets/000/063/664/medium800/adafruit_products_F1B6F87E-180C-4907-A8C7-56BE780A1C5E.jpeg?1539872881)

Drill a hole for the SPDT switch that will be mounted on the side panel and proceed to mount the electronics. I start with the PCA9685 breakout board. All the breakout boards, Pi and Perma Proto boards are mounted using nylon standoffs. I tend to place them inside the enclosure first, then mark down their PCB holes and then drill the enclosure on those spots to screw fit the standoffs.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/667/medium800/adafruit_products_7504E543-8D66-4EA2-852F-11C07435ABA9.jpeg?1539873125)

The LM2596, Pi and the Perma Proto boards are mounted. SPDT switch, power source and LM2596 input power pins are all connected.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/969/medium800/adafruit_products_A8C51CD4-37A0-4EF0-993A-130F0F560EEE.jpeg?1540183979)

The rest of the pins are then connected with female-female jumper wires. I sometimes resize them by manually stripping them off and connecting dupont&nbsp;female connectors of the appropriate length.&nbsp; I also use color-coded&nbsp;heat-shrink tubes just to group similar connections. In this build, the PCA9685 PWM outputs are connected with jumper wires in the yellow heat-shrink&nbsp;tube and the 10V PWM outputs are grouped in the&nbsp;green heat-shrink&nbsp;tube. The blue heat shrink tube groups the i2c jumper wires (SDA, SCL) that connects Raspberry Pi with the PCA9685 breakout board. Use the&nbsp;[adafruit guide on PCA9685](https://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi) to get started with this versatile chip if you are not familiar with it.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/968/medium800/adafruit_products_5CB6FF80-4391-4755-8173-39B8FD12F528.jpeg?1540183939)

That's&nbsp;it, our reef-pi light controller is built. Here is a side view of the controller from showing the SPDT switch

![](https://cdn-learn.adafruit.com/assets/assets/000/063/663/medium800/adafruit_products_8D279F2B-4C6C-4453-AF1B-1A63B9346C40.jpeg?1539872859)

And this is the bottom side view, showing all the connectors. Left most is 12V&nbsp;2A power input, then 12V PWM power output for actinic LED strip and then three 3.5mm audio jack connectors for Kessil lights, each having two 10V PWM control signals.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/660/medium800/adafruit_products_27EBC08A-09D6-4398-BE70-CFEED4547062.jpeg?1539842884)

Next, we'll power up this build and learn how to use reef-pi software features to automate the lights

# reef-pi Guide 5: Light Controller

## Configuration & Testing

Before powering up the entire build (the Raspberry Pi in particular), make sure the LM2596 modules are correctly tuned to generate exactly 5 and 10V output. Crosscheck with a multimeter the power rails on half size Perma Proto board&nbsp;(5V above, 10V down) as well as the mint tin size Perma Proto board&nbsp;(12V) are as expected.

Once everything is as expected, connect the Raspberry Pi power pin (Pin 2) at the end and power up reef-pi.

Once reef-pi is running, go to the UI and declare **jacks** &nbsp;under the **Connectors** section in **Configuration** tab to represent all four connectors. There are three Kessil connectors, J1 to J3, connected to pin 0, 1 and 2,3 and 4,5 respectively. Make sure to choose pca9685 as the driver. I am using the PCA9685 pin 12 to control the power MOSFET.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/676/medium800/adafruit_products_light-jacks.png?1539876099)

Next, create lights and associate the relevant jacks with the lights.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/722/medium800/adafruit_products_Screen_Shot_2018-10-18_at_9.29.03_PM.png?1539923638)

Next, create four lights to&nbsp;test all the connectors. I am declaring three of my Kessil lights, for example.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/723/medium800/adafruit_products_Screen_Shot_2018-10-18_at_9.35.36_PM.png?1539923759)

Once created each light can be controlled independently using **profile** s.

The **fixed** profile allows running lights in a constant brightness or color. This is generally useful for creating on-demand moonlights or during photo shoots of the tank.&nbsp;

![](https://cdn-learn.adafruit.com/assets/assets/000/063/935/medium800/adafruit_products_Screen_Shot_2018-10-19_at_11.03.20_PM.png?1540015425)

The **diurnal** profile allows users to simulate daylight cycle by an exponential ramp up and ramp down with most of the time operating at maximum PWM value. The diurnal profile cannot be visualized in the reef-pi dashboard itself, but if you have adafruit.io integration enabled, then you can observe the diurnal profile generated PWM values in your adafruit.io dashboard. Here is an example from my build:

![](https://cdn-learn.adafruit.com/assets/assets/000/063/679/medium800/adafruit_products_diurnal-cycle.png?1539876141)

The **auto** profile allows users to set a specific light intensity throughout the day at two hours interval. reef-pi linearly increments/decrements the PWM values in between the two-hour intervals. This is an effective way to simulate the daylight cycle with finer control over how steep the PWM value ramp up/down will be.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/721/medium800/adafruit_products_Screen_Shot_2018-10-18_at_9.31.52_PM.png?1539923599)

We can configure the reef-pi dashboard to show the light profile in "auto", to visualize how individual channels will be ramped up or down throughout the day.

![](https://cdn-learn.adafruit.com/assets/assets/000/063/720/medium800/adafruit_products_Screen_Shot_2018-10-18_at_9.32.50_PM.png?1539923587)

![](https://cdn-learn.adafruit.com/assets/assets/000/063/979/medium800/adafruit_products_Screen_Shot_2018-10-22_at_1.31.24_AM.png?1540197104 reef-pi dashboard with three lights and health chart (cpu/memory))

This build guide covers Kessil and actinic led strip controller, but the basic circuitry should work for a variety of led light types. reef-pi community members have used raw power MOSFETs to a Meanwell&nbsp;LDD driver based control circuit for other proprietary/branded lights or cheaper (and often times not UL listed) black boxes&nbsp;or completely DIY lights made with Cree or Luxeon LEDs (3W).

This guide uses an Adafruit PCA9685 board, which gives up to&nbsp;16 PWM channels. If you need only two PWM channels (e.g. only one Kessil light controller) then you can just use the Raspberry Pi. reef-pi can use Raspberry Pi's hardware timers (GPIO pin 18 & 19) natively for PWM. Just remember Pi based PWM pins are limited to two and in reef-pi UI they are denoted as pin 0 and 1 for GPIO pin 18 and 19.

Thank you for reading through the light controller guide, we'll look into the pH monitoring module in reef-pi in our next guide.


## Guide Products

### NPN Bipolar Transistors (PN2222) - 10 pack

[NPN Bipolar Transistors (PN2222) - 10 pack](https://www.adafruit.com/product/756)
Transistors are powerful little electronic switches, and we really like these NPN transistors whenever we need to control medium-power electronics such as small motors, solenoids, or IR LEDs. We find them so handy, they come in a pack of 10!

Each transistor is a general-purpose...

In Stock
[Buy Now](https://www.adafruit.com/product/756)
[Related Guides to the Product](https://learn.adafruit.com/products/756/guides)
### Through-Hole Resistors - 10K ohm 5% 1/4W - Pack of 25

[Through-Hole Resistors - 10K ohm 5% 1/4W - Pack of 25](https://www.adafruit.com/product/2784)
ΩMG! You're not going to be able to resist these handy resistor packs!&nbsp;Well, axially, they&nbsp;do all of the resisting for you!

This is a **25 Pack of 10K Ω Resistors.** More specifically, they are **carbon film** , through-hole...

In Stock
[Buy Now](https://www.adafruit.com/product/2784)
[Related Guides to the Product](https://learn.adafruit.com/products/2784/guides)
### Through-Hole Resistors - 2.2K ohm 5% 1/4W - Pack of 25

[Through-Hole Resistors - 2.2K ohm 5% 1/4W - Pack of 25](https://www.adafruit.com/product/2782)
ΩMG! You're not going to be able to resist these handy resistor packs!&nbsp;Well, axially, they&nbsp;do all of the resisting for you!

This is a **25 Pack of 2.2K Ω Resistors.** More specifically, they are **carbon film** , through-hole...

In Stock
[Buy Now](https://www.adafruit.com/product/2782)
[Related Guides to the Product](https://learn.adafruit.com/products/2782/guides)
### Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface

[Adafruit 16-Channel 12-bit PWM/Servo Driver - I2C interface](https://www.adafruit.com/product/815)
You want to make a cool robot, maybe a hexapod walker, or maybe just a piece of art with a lot of moving parts. Or maybe you want to drive a lot of LEDs with precise PWM output. Then you realize that your microcontroller has a limited number of PWM outputs! What now? You could give up OR you...

In Stock
[Buy Now](https://www.adafruit.com/product/815)
[Related Guides to the Product](https://learn.adafruit.com/products/815/guides)
### Raspberry Pi Zero W

[Raspberry Pi Zero W](https://www.adafruit.com/product/3400)
If you didn't think that the Raspberry Pi Zero could possibly get any better, then boy do we have a pleasant surprise for you!&nbsp;The new **Raspberry Pi Zero W** offers all the benefits of the Pi Zero v1.3, but with one big difference – **built-in...**

In Stock
[Buy Now](https://www.adafruit.com/product/3400)
[Related Guides to the Product](https://learn.adafruit.com/products/3400/guides)
### Adafruit Perma-Proto Half-sized Breadboard PCB - Single

[Adafruit Perma-Proto Half-sized Breadboard PCB - Single](https://www.adafruit.com/product/1609)
Customers have asked us to carry basic perf-board, but we never liked the look of most basic perf: it's always crummy quality, with pads that flake off and no labeling. Then we thought about how people **actually** prototype - usually starting with a solderless breadboard and...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1609)
[Related Guides to the Product](https://learn.adafruit.com/products/1609/guides)
### Adafruit Perma-Proto Small Mint Tin Size Breadboard PCB - 3 pack

[Adafruit Perma-Proto Small Mint Tin Size Breadboard PCB - 3 pack](https://www.adafruit.com/product/1214)
Making a project that will fit into an "Altoids Smalls" Mint Tin? Or maybe you just need a small amount of prototyping space and a larger breadboard size is too big? Put down that PCB shear and pick up a Perma-Proto in the new exciting shape!

Customers have asked us to carry...

Out of Stock
[Buy Now](https://www.adafruit.com/product/1214)
[Related Guides to the Product](https://learn.adafruit.com/products/1214/guides)
### Rugged Metal On/Off Switch with White LED Ring

[Rugged Metal On/Off Switch with White LED Ring](https://www.adafruit.com/product/917)
These chrome-plated metal buttons are rugged and look real good while doing it! Simply drill a 16mm hole into any material up to 1/2" thick and you can fit these in place, there's even a rubber gasket to keep&nbsp;water out of the enclosure. On the front of the button is a flat metal...

In Stock
[Buy Now](https://www.adafruit.com/product/917)
[Related Guides to the Product](https://learn.adafruit.com/products/917/guides)

## Related Guides

- [Interactive Gift Box](https://learn.adafruit.com/interactive-custom-gift-box.md)
- [Robotic Xylophone with Adafruit Grand Central](https://learn.adafruit.com/robotic-xylophone-with-circuit-python.md)
- [reef-pi Guide 2: Power Controller](https://learn.adafruit.com/reef-pi-power-controller.md)
- [Adafruit LTC4311 I2C Extender / Active Terminator](https://learn.adafruit.com/adafruit-ltc4311-i2c-extender-active-terminator.md)
- [Using Crickit and Adafruit IO together](https://learn.adafruit.com/crickit-and-adafruitio.md)
- [Chilled Drinkibot](https://learn.adafruit.com/chilled-drinkibot.md)
- [Adafruit IO Basics: Analog Output](https://learn.adafruit.com/adafruit-io-basics-analog-output.md)
- [CircuitPython Sound Box](https://learn.adafruit.com/circuitpython-sound-box.md)
- [DC, Servo, Stepper Motors and Solenoids with the Pico](https://learn.adafruit.com/use-dc-stepper-servo-motor-solenoid-rp2040-pico.md)
- [DIY Desktop Calculator with CircuitPython ](https://learn.adafruit.com/diy-rpn-desktop-calculator-with-circuitpython.md)
- [Adafruit IO Basics: Servo](https://learn.adafruit.com/adafruit-io-basics-servo.md)
- [reef-pi Guide 6: pH Monitoring](https://learn.adafruit.com/reef-pi-guide-7-ph-monitoring.md)
- [micro:bit Lesson 4. Sensing Light](https://learn.adafruit.com/micro-bit-lesson-4-sensing-light-and-temperature.md)
- [IoT Filament Sensor](https://learn.adafruit.com/iot-filament-sensor.md)
- [Face Mask Efficacy Testing with SCIENCE!](https://learn.adafruit.com/raspberry-pi-camera-vision-face-mask-efficacy-testing.md)
