5 years, 2 months ago.

Making a LED pulse for a desk lamp

Hello: I am currently doing an experiment to check the alertness in people working with certain light scenarios. I need to add to a convenitonal desk lamp a BLUE LED light pulsing at:

Rate of 1milisecond ON and 9miliseconds OFF With a power of 12micro watts / cm2. At 1KHZ.

My first test LED light will be a Optosupply 6W MCPCB (OSTCXBCBCIE) LED.

Later I want to upgrade the output LED to a conventional LED desktop lamp connected to a typical plug to the wall.

Right now my power supply is 9V.

I have the mbed LPC 1768 and a CL6807 LED driver kit, but as I am NOT an electronics guy AT ALL, I just dont understand how to program this and how to wire the mbed to the driver kit. Can anyone help me?

I am sorry if I sound to ignorant, but yes, I am, but I need to learn that for my experiment.

Thanks in advance for your time reading my post. If needed I can provide external email contact.

Carlos

Comment on this question

2 Answers

5 years, 2 months ago.

From a software point of view this is very simple:

#include "mbed.h"

DigitalOut ledControl(p18);

main () {
  while (true) {
    ledControl = 1; // turn on
    wait_ms(1);
    ledControl = 0; // turn off
    wait_ms(9);
  }
}

There are lots of other more elegant ways to get the same result but unless you need the LPC to also do some other task at the same time you may as well keep it simple and it doesn't get much simpler than the code above.

On the electronics side: Do you have a CL6807 demo board with the LED on or just the chip? If it's just the chip then you need to add external parts (it looks like a capacitor, a resistor, an inductor and a diode are needed as a bare minimum), if it's a demo board set up for the LED then that's one less thing to worry about. If it's a demo board for the chip but not correctly setup for the LED then it should just be case of setting the LED current resistor to the correct value (about 0.2 Ohms or larger for your LED from what google tells me).

If you need more help in connecting the LED to the driver then let us know exactly what you have and we'll go from there.

Connect the 9V supply to the Power in on the LED board and also to the Vin pin (pin 2) on the mbed. Connect the ground pins of the power supply, the LED board and the mbed (pin 1) together. Connect the control signal (p18) to the ADJ pin on the LED board.

That should be it.

Note: any IO pin would work fine for the code above. The reason for using p18 is that that pin can also be used as an analog output. The LED driver allows two different ways to control the brightness, you can use a PWM signal to control the brightness (a digital signal that constantly turns on and off quickly, the percentage of time it's on sets the brightness) or you can give it an analog voltage between 0.25 and 2.75V. If you wanted to use PWM then you'd use a PWM output capable pin on the LPC1768(p21-p26) however analog is probably a little more intuitive to use.

To use the analog out to control brightness the code becomes:

#include "mbed.h"

AnalogOut ledControl(p18);

main () {
  while (true) {
    ledControl = 0.5; // turn on ~50% brightness
    wait_ms(1);
    ledControl = 0; // turn off
    wait_ms(9);
  }
}

Given the range limits on the driver IC anything below 0.085 will be off and over 0.915 will be on full. Also keep in mind that the relationship between LED power and the human eyes perception of brightness is not linear, 0.9 will not look twice as bright as 0.45.

Thanks a lot I will work on it and let you know. Really THANK YOU!!

posted by Humanomics ChibaDai 02 Oct 2014

By the way, I have the CL6807 demo board withOUT the LED on. I have a separate LED which is LED light will be a Optosupply 6W MCPCB (OSTCXBCBCIE). I will work on connecting everything and let you know. Thanks for the advice.

posted by Humanomics ChibaDai 02 Oct 2014

Hello again, well I follow all of your kind recommendations but now my LED lights up, only the RED colour, if I connect the BLUE or the Green they just dont lit up. I dont know if this is because of some missing lines on the programming or because my LED needs to be wired differently or maybe the resistor I am using is not the propper one for the mbed output signal.

Also by reading your explanation I think I should go th PWM way as I need the LED to be constantly flashing at the rate I showed you for at least 10 minutes as I will use it in a homework task as a desk lamp, and this also brings me the problem of how to assign the BLUE colour to which PWM output pin.

The LED i am using is a "6W powerfull colour RGB" it looks like a star (OSTCXBCBC1E). I hope you can help out again, I am sorry for the inconvenience this may cause. Thanks

BTW The resistor I am using are 5.1 ohm / 5 W and 5.0 ohm / 10 W for what I understood in an internet calculator for resistors.

Thanks again. Carlos

posted by Humanomics ChibaDai 16 Oct 2014

How have you connected the red, green and blue LEDs up? If you just connect them all in parallel to the same drive signal you'll only get red because red uses a lower voltage. If you connect them all in series and your driver can supply at least 9V then they will all light up. But since they all have the same current the end result will probably look green since your eyes are most sensitive to green.

To get white then you need to control the brightness of each color independently. The blue and possibly green you will need to be able to drive up to at least 3.2V.

Beyond that it's hard to be more specific without knowing exactly what you have and how it's connected.

posted by Andy A 16 Oct 2014

Thanks Andy, I wired the mbed as you showed me and I have been connecting only one LED at a time, testing if the signal lits up each one separately. The LED i have has the same mA values for the red and the blue and the green, DC Fwd of 600mA and Pulse Fwd of 800mA with a Reverse Voltage of 5. I wonder if the LED is to big for the mbed output. So far i have been using only the Analog output on Pin 18 as you instructed me with only the red one lighting up, (and really bright, as the LED has a power of 6Watts). Would like to send you pictures of my arrangement but how can that be done? I dont want to blow the LED, i just want it to pulse while is on. Thanks for your time. Carlos

posted by Humanomics ChibaDai 17 Oct 2014

What voltage is the power supply to the LED driver chip? Red needs a lower voltage than green or blue so if your power supply isn't high enough voltage then only the red will work.

Pictures can help, a schematic would be better. If you don't have that sort of software handy then draw what your circuit is on a piece of paper, take a picture and email it. I'll message you with my email address.

posted by Andy A 17 Oct 2014

Hi Andy, I have the power supply from the wall that gives me a 9V output, I connect this 9v to both, the LPC1768 and to the LED controller board, this one is CL6807. I will send you what I have in pictures, thanks a lot. Carlos

posted by Humanomics ChibaDai 20 Oct 2014
5 years, 2 months ago.

<<quote>Rate of 1milisecond ON and 9miliseconds OFF With a power of 12micro watts / cm2. At 1KHZ.<</quote>> 1ms on and 9ms off gives 10ms that's 100Hz. It is just higher than the persitence of vision. For the common people this will just dim the LED level.

Good point, I will review it as I think I wrote it wrong about the KHZ, thanks a lot for your time. BUt in did, the idea is that the person does not percieve the flickering, but, the pupil and the brain does, and it is actually the reason of the experiment to review the pupil reaction and the brain reaction. But I will double check on that number to avoid problems affecting others. REALLY THANKS FOR THE OBSERVATION!!!.

posted by Humanomics ChibaDai 02 Oct 2014

You need to log in to post a question