In my prior blog, Smart Solar Lighting Project - Initial design ideas I discussed my initial design thoughts for my smart lighting project. In this blog, I will drill down deeper into the design, addressing each of my features.
First, here is my current schematic. This will be referenced as I detail the design choices and decisions that I made as I began to flush out the initial requirements:
Detailed design breakdown
1. Li-Ion charger, with programmable charging current level to find the maximum power point (as opposed to true power point, I will be stepping up the current as long as the solar panel voltage remains about the battery voltage).
The battery charging design is similar to the one that I have have documented here (i.e. Walky the Biped Robot - Power pack), with the addition of a programmable resistor in the charge programming path (PROG). The formula for computing the charging current for the MCP73882 (U1) is as follows:
The maximum current of the solar panel that I plan to use with this project is 187mA (short circuit) with specified current at maximum power point of 176mA. So for a simple starting point, I assumed a maximum charging current of 200mA. This yielded a minimum resistance of 5KΩ. Looking through the resistor ranges available with my chosen Digital Potentiometer (U2 - MCP4019), I found a 10KΩ part. With the two values (5KΩ and 10KΩ), the minimum current setting is ~66.7mA. With a current adjustment range of (200mA - 66.7mA) 133.33mA, and 128 steps, the adjustment step size is ~ 1mA. This should allow me adequate adjustment ability of the charging current.
As mentioned in the requirement, the idea is to have a background task that constantly adjusts the charging current (while the battery is charging), such that the current is as large as possible, while keeping the input of the battery charger above the current battery voltage. The Under Voltage Lockout voltage on this chip is 3.45V or Vbattery + 50mV, so I need to keep the voltage above that. In practice, I will try and keep the charging voltage at least 100mV above the battery voltage.
2. Li-Ion battery with a capacity of 840 mAh.
For this design I will again be using the Panasonic UR14500P battery (Li-Ion, 840 mAh). I have used this battery on a couple of projects (Walky the Biped Robot - A new hope (actually a new body and battery) ) and I have found it to be a reliable battery that performs as specified (don't mess with a good thing). The battery will be mounted into a battery holder, located on the top (front) side of the PCB, centered between the pairs of LEDs (one front facing, the other rear facing).
3. Four Warm LEDs (two facing towards the deck and two facing towards the stairs), providing 17 lm (at 30 mA each) of lighting at both faces (depending on diffuser losses). This capacity should be sufficient to provide ~ 7 hours of illumination, but I plan to run considerably shorter light schedules to hopefully handle a cloudy day or two.
In this design, the normal operation is for the LEDs to be powered directly from the battery (no power regulation). This means that the LEDs will see any where from 4.2V to ~2.8V. In order to achieve a consistent illumination, I need to define a current limiting scheme that takes into account both the minimum and maximum voltages. The idea to set the current limiting based on the highest voltage (4.2V), but to make sure that the lowest voltage provide some current through the LEDs. Using the current vs. voltage curves, I worked out a current limiting resistance of ~10Ω (based on a Vdiode of ~3.55V at 65mA, giving me (4.2V - 3.55v) / 0.065mA = 10Ω). Working through the rest of the Battery voltage levels (using an iterative method to find an approximation of the forward voltage drops), I came up with the following approximation of LED current for a given Battery voltage. Wanting to keep the illumination curve as flat as possible, I also calculated a PWM duty cycle to be applied for LED currents greater than 30mA (Eff LED I is the product of the current and the duty cycle, showing the effective current through the PWM driven LED.
4. Real time clock (super capacitor backup) to track time of day and allow programmable light schedules.
I am using the TI, BQ32000 (U5), Real Time Clock (RTC) to provide a time-of-day value to allow programming an on time for the LEDs. Given that this clock has a calendar function, I could also allow for a seasonal adjustment of the start time to allow the unit to roughly follow the sundown times. The RTC is backed up with a 3.3V, 200mF supercapacitor to allow the unit to run through multiple cloudy days. The RTC will be settable (synchronized) via a radio command from the EnOcean transciever, allowing to correct for drift or to reset after a total power fail.
5. Enocean transceiver to allow communications to a PC-based application providing data collection and time of day synchronization and limited interaction with Enocean switches (semi on-demain lighting).
For this design I will be using an EnOcean, TCM310U, a 902MHz Tranceiver Module U7 - upper right hand corner of page of the schematic). This module will be used to send commands to and receive data from the Solar lighting system. Due to the rather hefty current draws of this module (33mA receive/24mA transmit), it will spend most of its time sleeping. It will be set to periodical awake from deep sleep, during which time it can send or receive data. After a period of inactivity it will be commanded into deep sleep (more on this in the next requirement).
6. Power saving electronics to periodically sleep the Enocean transceiver (quite power hungry for a battery powered application).
To power the EnOcean transceiver to its deepest level of sleep and to prevent current flow to its I/O pins, a analog switch is placed between the Radio and the microprocessor. I am using a 74HC4006, quad bilateral switch (U6), to isolate the TX, RX, Reset and Read Enable lines, while the device is sleeping. Opening the data lines to the device to "avoid the reverse currents and minimize accordingly the system current consumption", according to Using TCM 310 transceivers in bidirectional low power applications, EnOcean's application note 409.
The process here is to command the radio to sleep for a given time. Then the switch will be commanded to isolate and a timer will be started. When the timer expires, the switch will be commanded to connect and the Radio will remain active for a short interval. I am currently thinking about having the radio active for 100 mS, every 10 Seconds (for a duty cycle of 0.01 and an average current draw of 33µA).
7. LED current monitoring to adjust lighting based on changes in battery voltage.
In order to track and fine tune the current flow through the LEDs, I have added a pair of current monitors to each pair of the LEDs. The current monitors are fairly heavily filtered (~2.5Hz, compared to the PWM rate of 1-2KHz, TBD). The microprocessor can measure the currents and adjust the PWM rate to keep the illumination constant. (Note: I had initially thought of using a constant current driver, but decided that a PWM scheme would be more efficient, avoiding the power loss of the MOSFET in an active region, controlling the current.)
8. Provisions for solar voltage cut off if unloaded voltage rises above the battery charger maximum input (not needed for the initial design as the selected solar panels are within the safe range on the charger).
The solar panel that I selected (IXYS SM451K10L) has an open circuit voltage of 6.91V. This is slightly below the maximum input voltage of the battery charger chip. Should I need to change the solar panel to open with a high open circuit voltage, I thought I might need an input isolation circuit. If needed I can populate F1 and R3 (PMN52XP and 10KΩ) to provide an inline switch to protect the charger. For now, I will leave those components off and place a 0Ω resistor in the R23 position to bypass the switch.
9. Provision for using the LEDs as a load to the solar panels for characterizing the solar panels prior to final initialization.
To characterize the solar panels, I plan to route the solar panel input to the LEDs and load the panels by turning on LEDs and if necessary, use PWM to control the on times. This will likely be done with a partially populated board, or at least isolating the battery charger (to avoid current flow to the battery while testing). To accomplish this, I added to resistor pads (R21 and R22) to select the LED driver power source (Vbat or V+, i.e. solar panel input).
PCB Design
Based on the above schematics, I decided to pull the plug and order some PCBs. First I needed to come up with a design. The following is my initial (and hopefully final) design:
The boards are 1" by 5". The battery holder is placed in the middle of the board on the top side of the board, with the radio and microprocessor underneath the battery. The batter charger and power regulator are to the left and the current monitors and the RTC to the right. The LEDs are 0.5" from either end of the board (4" apart), with LEDs mounted on both sides to the board. The mounting holes with allow me to come up with a mounting strategy, along with mounting for diffusers for the LEDs (likely a pair 1.25" x 1.0" sheets of plexiglass, positioned 0.5" above the LEDs). This will require a bit of experimentation and likely several 3D prints to perfect the lighting.
Enough for now. I have boards and parts on order and I will fill in more data as I start building boards and get some results.
Update 8/15/2020:
Added BOM for this design.