01/04/2016 at 14:45 •
The prototype design for Lys Bright is finished and is already in the mail from OSH Park. 12$ for three boards was a nice price indeed. They measure about 5x3cm. Parts are also under way from Farnell for both this project, the Heartbeat Logger. and a third more unique project related to this one that will be unveiled later.
The aim of the prototype is first and foremost testing how well a cheap linear regulator works at charging the battery from a solar panel together with a micro controller, and getting the primitive MOSFET LED driver working.
Can't wait to have these purple puppies arriving in the mail!
01/17/2016 at 13:11 •
The first time you're holding a PCB can be a little moment of truth. The PCB arrived less than a week ago, and without starting soldering, I could already see three mistakes that I'd made.
- The footprint for the LED is impossible to solder by hand. I need to borrow a reflow oven. I could have extended the anode and cathode pads outside the component, but instead I followed the datasheet's recommendation without thought.
- The soldering mask is exposing a thin line of the ground copper layer around each pad. Need to be careful here. We're talking maybe a tenth of a milimeter.
- The pin header and the barrel jack pads are covered by solder mask on the bottom side. It isn't entirely clear for me why they are like that in the final files of KiCad, but I can see the problem in 3D view...
Some lessons learnt here.
The Lumileds LXH7-FW50 <1A 5000K LED. At $1.5 - $2 each, they're a wee bit expensive.
My former colleague at www.elsykkelbutikken.no who's working on improving ebike batteries sponsored the project with Samsung 29E li-ion cells (thanks, mate!) and the 5V 240mA solar cell was bought off a seller on AliExpress. I also bought some 4V (nominal) solar cells to see if they provide sufficient voltage at lower currents to charge the li-ion cells to 4.0V + the dropout of the "charger".
02/29/2016 at 13:46 •
After a couple of hours searching for a reflow oven or station in Trondheim's hacker community and several hours of trying to solder the Lumileds LED to the PCB, I hereby declare the component too impractical for this project.
NTNU at Kalvskinnet (or HiST as they were called when I studied there) was kind enough to let me borrow their reflow oven. Thank you very much! Shame it was all to no avail.
Here's the problem child through the lenses of an old Russian microscope.
Thing is, power LEDs get hot. As a rule of thumb, only 30% of the energy driven into a LED will be converted to light, which means that 70% of it will be converted to heat. For our 3W LED, about 2W of heat needs to be dissipated while keeping the junction temperature of the LED below the rated 85 degrees C max. The thermal pad underneath the LED with an incredibly low thermal resistance helps it accomplish this, as long as the heat has somewhere else to easily dissipate. Large copper areas and heat sinks are of great help here.
The application note of the Cree LEDs describes using thermal vias on the footprint to lower the thermal resistance to the large ground plane underneath. There might be a danger of doing so, though, because the solder might be drawn from the pad and down into the via during soldering, which can leave air gaps between the pad and the component. The application note states that this problem is avoided as long as the vias are kept to 0.3 mm in drill diameter or less.
The Lys Bright PCB was designed with 0.3 mm vias, but as I later discovered, OSH Park only supports via drill sizes down to 0.33 mm. I guess they adjusted the size up to 0.33 mm. It's not much of a difference, but enough for solder to start drawing into the vias. Not only that, I found out that the vias weren't connected to the ground plane on the back side at all, so when I tried bridging the vias to the ground plane with large amounts of solder, it went through the vias and pushed on the LED on the other side so that the anode and cathode lost contact with their respective pads.
Too much of an hassle, and requires reflow equipment. That's why I'm moving to larger, hand solder friendly LEDs, and another way of connecting the thermal pad to the PCB.
03/02/2016 at 12:23 •
In the search of something more handsolder friendly, I stumbled across these kinds of LEDs offered by various sellers on Aliexpress and Alibaba. They are similar to this, but the sellers claim they will output over 100 lumens per watt, some even claim up to 190 lm/W. While I still find it hard to believe even for cold colour temperatures, I ordered some in the range 2700-6000K to give a spin.
The LEDs have a huge thermal pad, or slug, underneath which should be easy to either solder to the PCB or connect with thermal paste. The pad underneath was electrically insulated from the cathode and the anode on the first set of samples. I may or may not have ordered a new set of PCBs based on that, so fingers crossed for the second set of samples :)
If only I had an integrating sphere...
03/03/2016 at 12:57 •
The second prototype for the Lys Bright project will incorporate four of the 1W LED beads, plus some additional changes. It measures 4.1 x 6.9 cm and costs $15 for five at Seeedstudio. I expect them to be here in a couple of weeks.
This time, some proper consideration for the thermal management is done. Although I did not intend more than three of these 1W LED beads, I tossed in another one, because why the hell not? They might run a little cooler at the same luminuous output as three LEDS, and the opportunity is there to blast all four for a short amount of time. The LEDs has a large thermal pad which will connect directly with the ground plane of the PCB on the top layer, and through a myriad of 0.3 mm thermal vias to the full ground plane on the bottom layer. There, a large exposed copper area can, and should, be mounted to a heat sink to absorb the 2-3 W of heat from the LEDs.
Other changes are
- The ability to connect external LEDs instead of the internal ones
- Hard on/off switch
- Connector for the ESP8266 wifi module or the HC-06 bluetooth module (optional, solder on the crystal for that)
- Connector for any external module which outputs an analogue or digital signal to the Lys Bright (still optional)
- JST connectors for battery and solar cell
And now I will direct my attention to the Heartbeat Logger project.
03/08/2016 at 17:56 •
Microcontrollers, LED drivers, inductors etc. + a Picoscope USB oscilloscope.
.... with no probes included in the box. And then there's the classic waffle tray for microcontrollers, here with the Heartbeat Logger's remaining micros.
I ought to make some pastry in these.
Now there's only the PCBs remaining, and hopefully a luminance test of the Chinese LEDs.
04/15/2016 at 10:48 •
PCBs arrived a while ago, nice and crisp.
Since debugging the Heartbeat Logger proved harder than thought, I took the time to solder up the Lys Bright board (who could retain themselves anyways?), and then butchered it a bit to measure the current through the LEDs. I preferred the 15cm JST SM connectors a lot over having 2mm JST connectors onboard, as these are seven times easier connecting and disconnecting from the battery and the solar panel.
Well, did it work? A little yes, mostly no. It turns out you should do at least some basic maths on boost converters before you slap them onto the board, not just examine the datasheet and stick your finger in the air ;)
I used a single li-ion battery on this and had four 350mA LEDs in series. Max allowed switch current of the LED driver was 650mA. Wanna guess why this didn't work? :)
05/21/2016 at 20:20 •
The second revision took form and arrived in me mail a while ago. Apart from going back from the boost LED driver to the filtered PWM MOSFET approach, I'm also adding two more LEDs and a heatsink on the back. The Atmega 168 has 6 PWM channels and at least 6 ADCs, so there is no reason not to! Each one of these LEDs are tested to about 150 lumen at 350mA, so that is going to be 900 lumen in total.
On the board above you can see the PWM RC filters on the left and the MOSFETs with the sense resistors on the right. The RC filters will make the PWM signal into a smooth analog signal to control the MOSFETs, but more on that later.
06/02/2016 at 18:15 •
Here's the problem: Lys runs on a single li-ion cell, providing a nominal voltage of 3.7V, down to 3.3V where the regulator for the microcontroller and peripherals stops regulating. I need to run six 350mA LEDs with a forward voltage of ~3.1V, but no cheap buck-boost nor boost converters were appropriate, and a buck topology would require one driver for each LED. Linear LED drivers in that current and voltage range are also way too expensive.
I could drive the LEDs with a simple resistor in series to limit the current, but then the light output would vary with the battery voltage, as the resistor value is constant... Unless there was a way to vary the resistance in the path of the LED. And yes, there is!
By applying a signal to the gate of a MOSFET, it adjusts the voltage across its drain and source. In effect we can see it as a voltage controlled resistor. Then we need a analogue signal to control the transistor, which cannot be supplied directly from the AVR, but can be created by passing a PWM signal through a RC filter. The Atmega168 has six PWM channels, just the right amount.
Now that we can control the current, we need to get some sort of feedback into our system by placing a current sense resistor in the path, and measure the voltage across it with the ADC. A PID controller can take care of the rest in software.
There you go, the 10 cent low dropout 350mA+ LED driver. Make sure the transistor of your choice can handle the power.
09/09/2016 at 12:02 •
Kinda. The 10 cent LED driver as described in this post works out okay. Using a PID regulator, it can drive the LED at rough current intervals up to its max rating, 350mA, and even further if I wanted to. Here's a gif of the Lys Bright casting its light upon our garbage bins, using all the 6 LEDs at 250mA, which is 70% of its potential output:
Well. The drawback using this design is that the current has to be constantly regulated in some way or another. Why? If the current through one LED is set to 350mA using a given duty cycle of the PWM and sensed by the current sense resistor, what happens if there is a drop of voltage on the +BATT rail? With a MOSFET transistor, we're essentially adjusting the voltage across the transistors drain and source, meaning with a voltage drop across the entire rail, less voltage will be present across the LED, and if we recall the i-v characteristics of a diode, this will have a substantial impact on the current in the circuit. Remember that a diode is driven using a "constant current" source. So that means while it is easy to set the current with a stable supply voltage with this MOSFET driver, things start to get tougher when you take into account that the battery voltage will drop as it is discharged, and large current loads of neighbouring LEDs will cause voltage sag from the copper traces, wires and within the battery cell itself.
Yes, a PID regulator or smart programming can to some extent compensate for this, but there are way easier ways of regulating the current efficiently.
Just remember this: You can view the MOSFET as a voltage controlled voltage amplifier, and the BJT transistor as a current controlled current amplifier.
There we have it. A BJT will try to amplify the current no matter what the voltage at the rail is, providing constant current through the LED as the voltage varies. It should have been obvious from the start! So let's update the design:
Here I chose a random NPN BJT transistor I had lying around and wired it up on my breadboard:
Sure enough, adjusting the voltage of the rail up and down hardly affects the current at all. Excellent! The LEDs on the board will be rock steady, unaffected by any battery voltage and voltage sag. As an added bonus, there is no need for constant regulation, meaning that adjusting the output of each LED should be as fast as the RC filter at the transistor allows it.