Gas station without pumps

2016 February 4

Kitchen lighting

Filed under: Data acquisition — gasstationwithoutpumps @ 19:43
Tags: , , , ,

My wife has been unhappy with the lighting in the kitchen for many years now, so I finally got around to designing a new lighting solution for the kitchen and hiring  a contractor to install it.  We previously had rather ugly fluorescent tube fixtures over the stove and over the sink. The over-sink lighting looked like it was done in the 60s and had 2 20-watt tubes; the stove lighting was a replacement in the 1980s and had 2 40-watt tubes.  The lighting on the countertops was never very good, and nothing illuminated the interior of the cabinets.

My wife thought that can lights in the ceiling might be a good solution, but I didn’t care for putting that many holes in the already poor insulation, nor for the very high price of can lights. Instead, I proposed a series of little LED pucks along the series—the sort of puck lights that are usually used for spot illumination under kitchen cabinets.

LED pucks are available in a wide range of prices, and I tried out three different ones to see which gave the best light and looked least offensive.  Then I didn’t buy more of those, because the lighting store wanted $40 per puck, not including the non-standard connectors needed for wiring it up.  Those pucks claimed to have 240 lumens output, and I wanted about 3500 lumens for the kitchen, which would have meant 15 pucks ($600).

Instead I went with a cheaper set that was easier to wire up but only had 165 lumens per puck, needing 22 pucks. I bought 8 sets of 3 LED pucks from TorchStar through Amazon for a total of about $240.  I printed a bunch of circles the same diameter of the pucks and laid them out on the ceiling, adjusting the spacing and the distance from the walls to avoid shadows. After we’d lived with the paper circles for a week, I called in my favorite contractor to install the pucks. (Of course, the labor charges for patching the old holes in the ceiling from the previous lights, repainting, installing the new lights, and replacing the wooden soffit panel where one light was removed far exceeded the cost of parts.)

 

There are 11 pucks on each side of the narrow kitchen, lined up across from each other.

There are 11 pucks on each side of the narrow kitchen, lined up across from each other.

I did not use the power supplies that came with the pucks, which are only adequate to power 3 or 4 pucks each, and which seem to be very cheaply made (and likely unreliable).  The provided power supplies take 2.5W for lighting one puck, 4.5W for 2 pucks, and 0.3W when not providing any power.

I replaced the power supplies with 2 MeanWell SGA40U12-P1J 12V power supplies each on a separate wall switch and each powering 11 LED pucks.  MeanWell claims an efficiency of 86.5% for the power supplies on their data sheet and considers these supplies “high reliability” supplies. Each power supply takes 21.7W  with a 48% power factor, according to my KillAWatt meter. A 48% power factor is pretty low, but seems common for small switched power supplies—larger supplies often have power factor over 0.9, but that requires more expensive circuitry. The 21.7W/11 pucks means that each puck accounts for 1.97W from the AC supply.

Each puck supposedly puts out 165 lm with 3000°K color, for a total illumination of 3630 lm for the kitchen, which I find a bit too bright, but which my wife finds about right—she’d like the light to be a bit yellower, though. I couldn’t find 2700°K LED pucks that were well made at a reasonable price, so we had to go with these 3000°K lights, which are OK, but not as soothing as 2700°K lights.

If the rated light output is correct, then we’re getting 83.6 lm/W, which is a pretty good efficiency—according to Epistar, these would be their premium chips (120 lm/W), not their standard chips (100 lm/W), if the system efficiency is over 80 lm/W.  (Of course, I’m having to trust TorchStar about how bright the chips are—I don’t have a calibrated illuminance meter.)

The pucks each have  18 Epistar 3528 SMD chips—in 6 chains of 3 LEDs each with a 150Ω current-limiting resistor on each chain. I was interested in characterizing the I vs. V curve for the pucks, and (with a little computation) for the individual SMD chips.

I measured the voltage and current at a number of operating points by hand with a cheap DT-9205A multimeter, and set up a circuit for measuring the current and voltage using a Teensy board and PteroDAQ.

The first circuit I tried was not successful—the LED puck would not turn all the way off! I looked at the waveforms for the voltage and for the current with PteroDAQ, and determined that there was 60Hz pulsing when the LED was supposed to be off. I think that I had a ground loop problem among the three power supplies that was amplified by the bipolar transistor.

The first circuit I tried was not successful—the LED puck would not turn all the way off! I looked at the waveforms for the voltage and the current with PteroDAQ, and determined that there was 60Hz pulsing when the LED was supposed to be off. I think that I had a ground loop problem among the three power supplies that was amplified by the bipolar transistor.

My second attempt used the transistor in a different amplifier configuration:

Here the emitter voltage follows the base voltage, and I had no problems with ground loops—there is no voltage gain from the NPN transistor, just current gain.

Here the emitter voltage follows the base voltage, and I had no problems with ground loops—there is no voltage gain from the NPN transistor, just current gain.

I did have to play around with the voltage swing on the function generator, as the base current was larger than I expected and the 50Ω output impedance of the function generator did seem to matter. I changed the 20Ω resistor to different values to get different current ranges—from 0.5Ω (which resulted in data too noisy to be useful) to 10kΩ.

Here are the I vs. V curves for the puck as a whole:

On a log scale, the different ranges of measurement for the different current sense resistors can be clearly seen. I cut off the low-voltage end of each set of measurements, where the noise got to be too large.

On a log scale, the different ranges of measurement for the different current sense resistors can be clearly seen. I cut off the low-voltage end of each set of measurements, where the noise got to be too large.

On a linear scale, the difference between the hand-held multimeter and PteroDAQ measurements is visible, and the roughly linear increase in current with voltage over a threshold is also clear.

On a linear scale, the difference between the hand-held multimeter and PteroDAQ measurements is visible, and the roughly linear increase in current with voltage over a threshold is also clear.

I can rescale these plots to remove the effects of the serial and parallel connections and of the 150Ω current-limiting resistors, to get an approximate average I-vs-V plot for a single Epistar SMD chip:

The operating point for these chips on the puck is 24mA, which means that the chips must be the "premium" Epistar line, which goes up to 30mA. To get 30mA, we'd need 2.93V, making these chips 88mW chips.

The operating point for these chips on the puck is 24mA, which means that the chips must be the “premium” Epistar line, which goes up to 30mA. To get 30mA, we’d need 2.93V, making these chips 88mW chips.

 

Going back to the puck as a whole, at 12V the current would be about 139mA, for a power of  1.66W, which means that the power supply is operating at an efficiency of about 84%, slightly lower than the rated 86.5%. But the current-limiting resistors are causing a voltage drop of about 3.475V, so the puck is only 71% efficient.  The combined efficiency of the electronics is about 60%.  If the 165 lm output of the puck is correct, then the individual chips would be putting out about 140 lm/W, which is pretty impressive—I suspect that the 165lm is a slight exaggeration, as it is difficult for the customer to measure and complain about.

 

2016 January 16

Smoother I vs V plots for LED

Filed under: freshman design seminar — gasstationwithoutpumps @ 14:30
Tags: , ,

Yesterday I posted I vs V plots for the orange LED WP710A10ND and commented that “one can see the crude quantization of the bad DAC in the FG085 function generator, as banding in the line.”

 

Today I tried to improve the plots by using a 470µF capacitor across the function generator outputs.  Since the FG085 has an approximately 47Ω output impedance (nominally 50Ω, but see FG085 function generator output impedance), a 470µF capacitor would give a low-pass filter with a time constant of about 22ms, or a corner frequency of 7.3Hz.  I was doing a triangle wave sweep with a period of 9 s, so the 256-step DAC makes for about 57 steps/s or 17.6ms/step.  Having a time constant about the same duration means that the steps will be converted into ramps and we’ll avoid most of the quantization artifacts.

WP710A10ND_logI_V

The curves are indeed much smoother in this plot, and lack the obvious steps of previous plots. If I zoom way in on the plots with gnuplot, I can still see some clustering at the steps, but there is a lot of data between the steps.

Interestingly, I can see some hysteresis on the linear plot.

I had two conjectures about the source of the hysteresis:

  • The 32× averaging takes some time, so the voltage and current measurements are not precisely synchronized, and the current-before-voltage measurement would give different systematic errors depending whether the voltage and current were rising or falling.
  • The properties of the LED change because of heating and cooling effects.  The upward leg has a cooler LED than the downward leg.

Note that these two hypotheses are distinguishable by experiment.  If I slow down the ramps, then the time discrepancy results in smaller voltage and current discrepancies, and the effect should diminish.  But the LED gets hotter if it is run at maximum current for longer, so the thermal effect should be greater.

I tried using a 33s period instead of a 9s period, and the two curves moved further apart (from about 0.4mA to 0.6mA at near the max separation), consistent with the thermal theory, but not the time-bias theory.  (I leaned toward the thermal theory initially anyway, since the two curves are further apart than one step of the DAC in the FG085.)

The hysteresis makes it clear why manufacturers don’t try to specify the I-vs-V characteristics very precisely—not only can there be variation from component to component, but the parameters are temperature dependent.

2016 January 15

I vs V plots for LED

Filed under: freshman design seminar — gasstationwithoutpumps @ 22:54
Tags: , ,

In the class earlier this week, I had shown students the I vs. V plot from the datasheet for the orange LED WP710A10ND (which is not the LED they will be using—I want them to look up the specs for the LEDs they will have available, and not rely on the worked example in class).  I had also made the claim that the current is roughly exponential with voltage around the voltage at which the diode starts conducting, but there was no evidence in the data sheet to support this claim, and the plot did not look particularly exponential.  Of course, people are terrible at recognizing the shape of rapidly increasing functions—straight lines are about all we can understand visually for graphs.

Tonight, I decide to actually measure the I-vs-V graph to see whether I could demonstrate the exponential.  The circuit was simple: the LED in series with a current-sense resistor, driven by my FG085 function generator with a very slow triangle wave (about a 9 second period), with the two voltages monitored by a Teensy 3.1 board running PteroDAQ. I added a 10µF capacitor across the output of the function generator, to get rid of some of the high-frequency noise from the steps in the function generator output. I didn’t use differential inputs to the Teensy, but did the subtraction to get the voltage across the LED in gnuplot.

Using a linear scale, I get a plot that shows fairly slow growth of the current with forward voltage, looking almost linear above 1.8V.

Using a linear scale, I get a plot that shows fairly slow growth of the current with forward voltage, looking almost linear above 1.8V.

The linear plot is reasonably similar to the plot in the data sheet, which shows around 14mA at 2V and a fairly straight-line increase from 1.8V to 2.05V (where it reaches 20mA). In this plot one can see the crude quantization of the bad DAC in the FG085 function generator, as banding in the line.  One can add a straight-line fit for 1.9V and up can get that the current is about 75 mA/V (VF–1.8V).  That is, the LED can be treated almost like a 13.4Ω resistor in series with a 1.8V voltage source at high voltages (and an open circuit at low voltages).

With a log scale for current, we can see the exponential behavior from about 1.4V to 1.7V.

With a log scale for current, we can see the exponential behavior from about 1.4V to 1.7V.

The log scale opens up the region where the LED is turning on or turning off, and we can see the subthreshold exponential behavior that I had told the class to expect.  Below about 0.3µA, the plot is very noisy—I could probably get cleaner results by using a still larger sense resistor in this range. (I trimmed out of the plot the similarly noisy part of the plot below 30µA for the 30Ω sense resistor.)

The subthreshold exponential growth of current with voltage is about what I would expect, but the current grows a little more slowly than I had expected above the threshold.  I thought it would grow proportional to (VF–1.8V)2 rather than linearly.

2015 December 27

Theater lights

Filed under: Uncategorized — gasstationwithoutpumps @ 00:02
Tags: , , , ,

My son and I have started on his summer project while he is home for winter break—to build a moderately bright, adjustable color theater light for WEST Performing Arts, the children’s theater troupe he has worked with for the past 11 years (including the two years before they split off from Pisces Moon).

The design is still very much in flux (we’re on our third processor choice already), and we haven’t done any parts ordering or physical prototyping yet, just thinking about circuits, parts, and layout.  We are currently planning an RGBW light with DMX control, with 20W each of red, green, and blue LEDs, and 40W of warm white LEDs, all mounted in a PAR-38 can (using an old can from WEST, rather than buying a new can).  The light will be a simple flood, which is easier to construct than a fresnel or spot light, because we don’t have to concentrate all the light into a small spot for manipulating with lenses.  Currently WEST uses 75W or 100W incandescent bulbs in their PAR cans, so the LED light should be three or four times brighter.  There are RGBW lights from China that are about the same brightness as we’re aiming for, but they are larger and more expensive—we’re aiming for a budget of about $100 a light for parts.  (We’d not be able to sell them any cheaper than the commercial lights—this is just a hobby project to make one or two lights for the theater.)

The theater has a few 15W RGB lights with DMX control, the American DJ Mega Tripar Profile, but they are only 5W per channel (not really bright enough) and it is not clear what functionality the DMX controller for them has (we didn’t look at it or find out the model number).  Because the set was a very cheap lighting set, it probably can’t handle the greater functionality we’re planned for the RGBW lights, so we’ll probably have to find or design a simple DMX controller that can be run from a Mac laptop. There are some open-source DMX controller projects on the web, but their user interfaces may be a bit too complicated for the kids (or non-techy staff) running the light booth for WEST. It is not clear whether we can design a simpler interface for a small number of lights that provides easy access to all the functionality of the lights.  There is also the question whether a traditional control board with sliders or an all-virtual laptop-based controller is a better interface for beginning lighting techs.

We might even want to look at an iPad-based controller, like Luminair ($90), LightingPad (discontinued), and RunTheShow (free, but limited to controlling their particular hardware). LightingPad says that they have pulled the product until they can update for iOS8, which was released over a year ago—since iOS9 has come out before they updated to iOS8, it seems unlikely that they will ever be able to keep up with the churn in the iPads (a complaint I’ve heard from other iPad app developers—Apple makes it very difficult for older apps to keep running, requiring a full-time developer just to keep up with Apple breaking things on each release).  Hmm, I seem to have talked myself out of developing an iPad app, but we probably should make sure our hardware can run with controllers like Luminair.

For laptops, there are open-source projects like Elios and WhiteCat.  Elios is an open-source project in Java, but it hasn’t been updated for a couple of years, so may be a dead project.  WhiteCat seems rather complicated, based on the screenshots at http://www.le-chat-noir-numerique.fr/index_eng.html, and most of the documentation is in French, which neither my son nor I reads.

Since we’re mainly interested in running on MacBooks, the OS-X-only code from LightKey may be usable.  They have a free version with 24 channels that might be usable, though upgrading to more channels gets into an expensive subscription model.

The controls we are planning for the RGBW light were 16-bit PWM on each of the 4 channels, plus a strobe frequency (in units of 0.1Hz, with 0–5 and 250–255 having special meanings—probably always off and always on).  Because the DMX512 protocol only has one byte per channel, the light would need 9 channels, and the free version of LightKey could only control 2 such lights.

The Tripar Profiles can be configured as anywhere from 1 to 7 channels:

  1. choice of 16 preset colors (“color macros”);
  2. 16 colors plus 1-byte dimmer;
  3. RGB;
  4. RGB plus master dimmer;
  5. RGB, dimmer, color macros;
  6. RGB, color macros, strobing, master dimmer;
  7. RGB, color macros, strobe or program speed, preset programs, master dimmer.

The preset programs are mainly for running the light as a standalone light show without a DMX controller, so we would not want to emulate that.  The 4-channel RGB,dimmer function is intended as a workaround for the low resolution of 8-bit PWM control—you pick the color at full brightness, then multiply by the dimmer setting to get the overall effect.  Since we are planning to use 16-bit PWM, we can get more precise color control even at dim light settings.  If we mix our light with the Tripar Profiles, we would probably use the Tripar Profiles in 4-channel mode (unless we needed strobing, in which case we’d use 6-channel mode).

I mentioned above that we’d been through three different processor choices.  At first we thought of using a Teensy board, because we’re familiar with ARM programming, the Teensy boards are easy to program, and they can be treated like a through-hole part for doing prototyping (by adding some header pins).  But the boards are a bit large, and a bit expensive ($11.65 for a Teensy LC), so we next considered using an ATtiny2313A processor (again, the ATtiny is easily programmed and I have some experience with the ATtiny13, which I used for the PWM on my desk lamps).  Unfortunately, the ATtiny2313A provides only 2 16-bit PWM channels (plus 2 8-bit channels), which is not really adequate.  Using two ATtiny2313A chips would work, but for less money and less board real estate, we can use a PIC32MX110F016B-I/SP and get 16-bit PWM on a 40MHz clock for a 610.4Hz PWM frequency.  The flexibility of the pin remapping on the PIC32 is attractive here, as it can simplify the routing of the board.

The processor not only has to interpret the DMX commands and provide PWM outputs, it also has to support the RDM (remote data management) protocol of modern DMX devices (the Tripar Profiles don’t, but there is no real excuse for not supporting RDM these days).

Here is a rough block diagram of the current design:

Each LED here is nominally a 10W LED module.

Each LED here is nominally a 10W LED module.

We’ve given some thought to the heat sink, fan, and mounting brackets for everything, but there is still more work to be done to make sure that we can really dump all the waste heat and keep the LEDs sufficiently cool.  We’re currently looking at about $80 in parts for the light (not including the can, which we’ll get from WEST) plus another $15 to make a USB-DMX interface that can handle the RDM protocol.  Those numbers may change a fair amount as we play with the design.

The two boards are each about 10cm by 5cm, which cost only $12 (for 10 copies) from Smartprototyping.  My son has done preliminary layouts of them, to see how big the boards would be and determine any mechanical problems we might encounter.

2015 August 21

LED I-vs-V curves

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 18:41
Tags: , , ,

I was interested in looking at the forward voltages for the various LEDs that I have on hand, to see if there was an easy way to convert the single numbers given on the spec sheets into typical curves.

I used a very simple setup:

  • LED with series resistor (resistor size changed for different current ranges)
  • PteroDAQ (using Teensy 3.1) to record the voltage across the LED (A11) and across the resistor (A10-A11), 32x averaging 1kHz sampling.
  • JYEtech FG085 function generator to drive LED+ resistor (3.2Vpp, +1.6V offset, 1Hz)

I recorded a several seconds of data for each resistor size I used (47Ω, 150Ω, 1kΩ, 12kΩ, 220kΩ).  For a couple of the LEDs, I also tried 3.3MΩ, but the noise in the ADC for that high an impedance source was too much—I would have needed to add unity-gain buffers to be able to read the signal reliably.

I found that the differential inputs were rather noisy below about 100mV, so I only used the larger signals.  I should figure out how to use the programmable gain amplifiers on the Teensy 3.1 and integrate that into PteroDAQ, so that I could read small voltages more reliably. Here are the I-vs-V curves for the identifiable LEDs I had on hand (I have some other “grab-bag” LEDs that I didn’t bother measuring):

The "twinning " of the line for the orange LED at the high end probably comes from measuring different LEDs—I had not included the 47Ω in the first round of tests, and when I tested the orange LED again, I may have gotten a different one from the bag.

The “twinning ” of the line for the orange LED at the high end probably comes from measuring different LEDs—I had not included the 47Ω in the first round of tests, and when I tested the orange LED again, I may have gotten a different one from the bag.

The low-end of the I-vs-V curve for each resistor is noticeably noisier than the high end—even after I trimmed off the results with differential inputs lower than 100mV.  With the 220kΩ series resistor, the single-ended voltage measurement was poor—the high-impedance source causes problems removing the noise injected by the sampling circuitry. This is not such a problem with the differential measurement, since the differential amplifier provides a low-impedance source to the sampling circuitry.  There is a second differential channel on the K20 chip, but one of the pins for it is A13, which is only available as a surface-mount connection on the back of the Teensy board—not accessible for PteroDAQ.

The IR emitters have a much lower forward voltage, and a much higher maximum current (50mA instead of 25mA).  The IR LED has a 1.6V max and 1.2V typical specified forward voltage at 20mA—I got 1.199V at 20mA, which is closer that I have any right to get to the typical value, since I didn’t even measure the 47Ω nominal resistor.

Each of the non-IR LEDs has a slightly different forward voltage spec, but they all have a max forward voltage spec of 2.5V  at 20mA, and typical values ranging from 2V to 2.25V.  The green and red curves (the two on the right) were indeed the two LEDs with the highest typical values. None of the non-IR LEDs got up to high enough voltages in this test to see whether the forward voltage at 20mA was measured correctly.  I should be able to do that with a smaller series resistor.

Bottom-line:  the typical forward voltage at 20mA does give a fair idea of the I-vs-V curves, though the max current is also important for getting a good shape to the curve—the curve switches from straight-line exponential behavior to the gradual saturation at about 1/5th of the max current.

« Previous PageNext Page »

%d bloggers like this: