Who wants a cheap, simple, Arduino-based LED controller?

No extensive electronics experience, but have built a few small projects without using boards. Many years of software experience. Time for me to get started. Want to build a Typhon for my BC8 lighting upgrade. Next project will be Hydra for my 28. Anyone have an extra board?
 
To all experts out here.

I know that its been asked several times if 48D will work with PWM. And its also mentioned that indeed it worked.

Infact, Im doing it right now... but here is my question. The dimming part of the 48D with PWM is not as linear as the 48P version.

So here are the values of my PWM with arduino.

Typical 0-255 or 0%-100% with regular 48P.

Here is the 48D...
10% = 1
20% = 2
30% = 5
40% = 8
50% = 12
60% = 28
70% = 27
80% = 44
90% = 80
100% = 255


Now how do I make this into a sketch...
 
Last edited:
If anyone has any leftover PCB boards, I would love to purchase one from you. Just PM me.

Or if someone could send me the file I would need to upload to BatchPCB.com to order some myself. :)

Thanks again.
 
Ok I finished putting to typhon together and have a newbie question. Will I get anything on the lcd display if I havnt uploaded anything to it?
 
Ok I finished putting to typhon together and have a newbie question. Will I get anything on the lcd display if I havnt uploaded anything to it?

Ok contrast was too high. I now have the top row of 16 blank squares lit up should I be concerned with the bottom 16 unlit prior to uploading the sketch?
 
katchup, something like

Code:
//Note I changed 27 to 37 and added the 0 point
int Percentages[11] = { 0, 1, 2, 5, 8 ,12, 28, 37, 44, 80, 255 };

// ramp up the lights
for (int i = 1, i < 11, 0)
{
  setLEDLevel(Percentages[i];
  delay
}

delay for daylight

// ramp down the lights
for (int i = 10, i > 0, i--)
{
  setLEDLevel(Percentages[i];
  delay
}

delay for night
ok I forgot my overall while loop (and the C is iffy), but I think this gives you what you need
 
Fishman thanks, I will try it tonight.

Shout out to all users of Mean Well ELN60-48D and 48P drivers.

You cannot use the same arduino sketch on both 48D and 48P. The PWM (48P) version is perfectly linear with arduino 0-255 steps...

But the 48D is not linear. You have to have a different call function for your 48D within your sketch. This will save you a lot of headaches and wondering why the dimming or ramp is not as smooth and predictable. Just to clarify my values above...

10% = 1 pwm
20% = 2 pwm
30% = 5 pwm
40% = 8 pwm
50% = 12 pwm
60% = 28 pwm
70% = 37 pwm
80% = 44 pwm
90% = 80 pwm
100% = 255 pwm

From 0-80%, this happens very fast. Then very slowly reach the last remaining 10%. So this means that if you have a ramptime of 60 minutes. Within 20 minutes you will reach 80%, and the remaining 10% will be spread for the next 40 minutes.

Just FYI. Good thing I have that resistor inline (Kcress) to check every step of the way.
 
Last edited:
katchup you still have a problem at 70% should that be 37? Also what increase 10% the current or the light output? I was thinking light, but that last statement makes we wonder.
 
katchup you still have a problem at 70% should that be 37? Also what increase 10% the current or the light output? I was thinking light, but that last statement makes we wonder.

Yes you are correct, 27 should be 37, typo.

About the current? Correct me if Im wrong, but I thought that the current (amps) in our driver is linear with light intensity? Assuming im running 1 amp on my XP-G's, then that means that 0 amp = 0 intensity and 1 amp = 100% intensity. Thus 50% = 500 ma or 0.5 amps?????

Is this assumption correct?
 
Last edited:
Anyone have a Mouser part number for the Digikey CP-102A-ND, which is the 2.1mm center positive DC Jack. Too many choices for me to be sure I can pick the one that matches the holes in the board.

So far, plan to order everything but the ATMEGA238P from Mouser. Total with shipping, about $40. Looks like the grand total will be a bit less than $60 by the time I add a Typhon board, AVR, and USB-TTL cable.

I have an old Nokia phone cable, so I'm going to try the USB-TTL hack.

Still looking for a Typhon board. PM me if you have an extra one. If needed, I'll order 10 in a few days, and then share the extras.
 
Ok I finished putting to typhon together and have a newbie question. Will I get anything on the lcd display if I havnt uploaded anything to it?

Display will be blank or just solid squares, the Arduino is not sending any data to the display pins yet.
 
It is not quite linear. According to the chart on page 6 of the data sheet (or as I read it).
- 0000 ma current 0 output
- 0350 ma is 100%
- 0500 ma is 140%
- 0700 ma is 180%
- 1000 ma is 250%
Also at the higher current you will loose more since the junction temperature will be higher. The real question is does it look OK to the eye and/or represent a true sunrise. I am not sure it matters that much, but just wanted to make sure of what was being said.

By the way thanks for posting the numbers. If your code is going into the general repository you might want to do something like this:
Code:
//#define ELN_D
//#define ELN_P
#ifdef ELN_D
   int Percentages[11] = { 0, 1, 2, 5, 8 ,12, 28, 37, 44, 80, 255 };
   #define ELN_PERCENTAGED_DEFINED
#endif
#ifdef ELN_P
   int Percentages[11] = { 0, 25, 50, 75, 100, 125, 150, 175, 200, 225, 255 };
   #define ELN_PERCENTAGED_DEFINED
#endif
#ifndef DEFINED
   You must define either ELN_D or ELN_P
#endif
Then all the next person needs to do is remove the comments from the ELN_X type they are using and magically (after knocking on wood and crossing your fingers) the code works for either version. The last ifndef just will generate an error which might be easier to understand. Otherwise they will just get undefined varialbe Percentages.
 
thanks fishman, its like looking at nothing. No matter how I look at it, it does not compute, my problem not yours lol.... I will try it now...
 
Back
Top