Microcontroller or the analog way?

Thread Starter

cagriaksu

Joined Jun 7, 2010
20
Thanks for the answer Sarge!

First of all, this is not my car or motorcycle's tail/brake light conversion project, I've already done that a year ago to be more bright in the night, and explained how I did it in your "Ok, where are we now in automotive lightning" thread. I had two accidents on a motorcycle(not because of my brake/tail lights), I almost end up dead, so I know what are you talking about. I really do.

By the way, I'm no liar (and not telling you that you called me a liar:) ) so if it was a car project, there is no shame to tell that. But this is something very close to that when you look at the circuit way.

I do understand why are you thinking like that, and I know it sounds like a auto project, but as I said before, the very first circuits I've tried to accomplish was also tail/brake circuits which I got from this forum. I searched for the keywords of my project and end up finding that circuits.

My personal belief is, if security is involved, I should clearly know what I am doing. Not only for car modifications for every single thing that is dangerous in such a way. It can be a project like, doing your own RS232 contoller and adding it to your PC.

Anyway, my concern about the 9v -12v difference is because of the instant voltage drops here. I may use a UPS but it wont be very healty cause I need an online one of them, and they do cost too much instead of the line-interactive ones.

My basic idea about feeding the system is like,
- regulate the voltage from the dc source to 9Volts.
- use a couple of cap's to make sure leds wont die in long (1sec) power outages.
- regulate the voltage and current so the uC nor the leds will die frequently.

I don't wanna repair a part of the system everyweek, I want to build something reliable, won't die in the middle of the show.

I appreciate your concerns Sarge, and I agree with you. If you were to see how the cars modified in our county you wouldnt believe your eyes. People run on fog lights instead of headlights at the night. You dont notice them well and these things frequently cause accidents in Turkey. They use strobing tail lights, (they strobe all the time) strobing headlights, fake police light inside the radioator panel etc... So you and I have the same anticipation about these non-responsible people.

Anyway, I presumed that we will have 1A for each channel because I still didnt see the table I am going to integrate with leds. There may be more or less I dont know, because of that, I want to take this into count as high as possible so there shouldnt be any problems after completing the circuit and running it for a couple of hours.

I had to be sure that no contestant will catch fire ;) just kidding...

Thats why I want to drive the leds over mosfets. In case of we need higher currents in the circuit, I will just change the mosfets and caps and move on right?

Anyway, If you need any specific elements for your circuits, I can try to find here in Turkey. As I said before, I'm very lucky to have my office very near to the electronics store's street, so I just walk for 5 minutes and find myself in heaven :)
 

SgtWookie

Joined Jul 17, 2007
22,230
First, you need to decide upon the LEDs that you wish to use.

Specifications are needed; typical Vf @ current.

We can deal with the power loss problem using rechargeable batteries to "carry you through" the outages. Arbitrarily reducing 12v to 9v using linear regulators represents throwing away over 25% of the power usage unnecessarily.

So, decide how many and what kind of LEDs that you are going to use. I want to see datasheets for the LEDs before we go any further.
 

Thread Starter

cagriaksu

Joined Jun 7, 2010
20
Ok, sorry for the delay. We are kinda busy here, business is good for these days, so I couldnt make free time for the project until now ;)

Sarge, I talked to my LED supplier, and gave me these spec's:

1.8 volts to light up the led
2.0 volts to use it regularly
2.4 volts to burn it ;)

The current is 20mA for the moment, but they are importing new type of leds, and they will be more brighter, (so they say) but they don't know the exact spec's for the new leds cause they will arrive in a few days.

And for the amount of the leds, I still didnt have the chance to see the table, so let's say, 100 leds for the name panel, and another 100 divided into 2 sections for the strobing ones. I don't know if it is safe for the leds,I want to have your opinion:

Name panel will be lit using pwm on 2.0 volts and 20ma. when the contestent presses and holds the answer button name panel leds will be full on using 2.2 volts 20ma. Since they have to hold the button when answering, and the longest answer will take 10 seconds (I assume) this will not have a very shorting effect on leds life. or not? :)

And 2.2 volts 20ma is applied to the strobing leds at the same time, since they wont be on for more than 10 seconds.

I want to first build a testing only circuit on the workbench with just a few leds, like 3 and a resistor for a section. Then design the whole leds, and calculate the mosfets or whatever we are going to use, again to feed the whole system.
 

retched

Joined Dec 5, 2009
5,207
You will really need a solid number for the amount of LEDs you want to use. The power supply size is dependent on it.

Also, you may want to consider using LED bars or strips. They will have the resistors built in, and will be much easier to fabricate into your required needs.


They can be dimmed or flashed with PWM, so you would still be in good shape.
 

eng1ne

Joined Dec 4, 2009
97
At 20 mA that is 4 A.

At 12 V you will need 200 12/20e-3 = 600 Ω resistors - see if you find some resistor packs of 10, then you only need 20 actual parts.

My concern for you is the reasonably steep learning curve surrounding the microcontroller.

Can I assume you know how to program in C?

Have you selected a microcontroller? i.e. PIC, AVR? You then need to investigate how you will program it - a programmer of course, but which one? That should drive your progress.

Retched made a good suggestion by the way.
 

Thread Starter

cagriaksu

Joined Jun 7, 2010
20
ok, the power supply is not a problem, it can be changed to anything else, I want the logic to be like,

Power to the controller, power to the mosfets, and the mosfets will be run by the contoller. So only thing we will need to change (in order to obtain the required current) is the mosfets and the power supply right?

I quite remember howto program in C but I will need help indeed.

Can someone draw a simple circuit about this project?
 

Thread Starter

cagriaksu

Joined Jun 7, 2010
20
Sorry for the bad drawing, but I believe it will give you an idea about the logic I wanted for the circuit.

PS: I wrote "A,B,C is mosfets" :) I mean they ARE mosfets LOL :)
 

Attachments

Last edited:

eng1ne

Joined Dec 4, 2009
97
Hi Cagriaksu.

Hopefully your effort will be recognised and we will help you through this project - most people seem to want everything handed on a plate!

What you have done is what I'd call a block diagram, and I would say reasonably accurate!

What I suggest you do now is replace the 'blocks' with actual component symbols and label the pins (you need to decide what microcontroller you are going to use) - basically a diagram that someone could build from

From there, we can make specific suggestions, such as filtering capacitors etc. which you are unlikely to account for!

I think with your motivation you might get this done in a reasonable time scale - but don't forget, SAFETY FIRST!

Salient points from your diagram - you will need a regulated 5 V (probably 5 V) supply for your microcontroller. It is worth separating the digital, i.e. microcontroller ground and the analoge, i.e. LED ground.

So... find some LED arrays that are accessible and within your budget; select a microcontroller to go with - I would say PIC but I am biased and draw a circuit! Also have a look for some MOSFETs that meet your requirements, current, switching times etc.

Good luck!
 

Markd77

Joined Sep 7, 2009
2,806
Most microcontrollers run at 5V or less so you would need a low power voltage regulator for that, but the LEDs can be run from 9V if you wire them up in strings with the right resistor.
The important thing is to get logic level MOSFETs, which are designed to be controlled by 5V or less. Standard MOSFETs will not be put into their lowest resistance "on state" with only 5V.
If you have doubts, post a link to the datasheet and someone can check.
 

Thread Starter

cagriaksu

Joined Jun 7, 2010
20
Ok then, first let me figure out something, do I need to seperate power supplies in order to seperate the LED's ground from the controllers Ground? Or is there any other way to do it?

If we need two seperate power supplies it wont be a huge problem but, if it is possible with just 1 of them, it will be more practical for me. (In case one of them dies, it will take a little time to figure out which one has gone and needs to be replaced.)

If we can use a single power supply, I can limit the voltage feeding the controller to 5volts using a LM317T. And for the LED's protection I can use another LM317 for the current limitation. I do remember that, there is another version of LM317 which can handle up to 5 amperes, instead of the 1.5a that LM317T can handle.

I can use a single Switch Mode short circuit protection integrated 12v 5A power supply to run the whole system.

I will draw another (and proper) circuit, with my electronics knowledge. If I make mistakes (I will probably do :) ) please correct me, and please keep in mind that I'm a newbie at these things with basic knowledge.

For the microcontroller, I really dont have any knowledge about them, so please can someone suggest me some models, that suits my circuit. I don't know which languages they are using, but I do have a little knowledge in C. I can learn more, that is not a problem. But choosing an advanced controller, (I mean more control pins than I require.) should be more accurate, cause the table or the design may change in the future, so only the led arrays and the programming may change a bit and it will be ready to go again.
 

Markd77

Joined Sep 7, 2009
2,806
The grounds NEED to be connected so 1 power supply is fine. You could use a lower power regulator like the LM78L05 for the Micro because it won't use much power.

In your diagram you have the switch going to 12V - the micro won't like that so better if that switch can go to 5V with a 10K pull-down resistor to ground (or to ground with a pull-up resistor) so the pin isn't floating with the switch open.

I don't know much about C so I can't really make any recommendations but pretty much any micro has the capability to run this program.
 

SgtWookie

Joined Jul 17, 2007
22,230
I talked to my LED supplier, and gave me these spec's:

1.8 volts to light up the led
2.0 volts to use it regularly
2.4 volts to burn it ;)

The current is 20mA for the moment, but they are importing new type of leds, and they will be more brighter, (so they say) but they don't know the exact spec's for the new leds cause they will arrive in a few days.
OK.
When you get the specifications for the new LEDs, report back as to what is the typical Vf (forward voltage) at their rated continuous current.

LEDs are not controlled by voltage; they are controlled by current. However, in order to control the current economically using resistors, you need to know what the Vf will be, so you can calculate how many that you can operate in a series string.

And for the amount of the leds, I still didnt have the chance to see the table, so let's say, 100 leds for the name panel, and another 100 divided into 2 sections for the strobing ones. I don't know if it is safe for the leds,I want to have your opinion:

Name panel will be lit using pwm on 2.0 volts and 20ma. when the contestent presses and holds the answer button name panel leds will be full on using 2.2 volts 20ma. Since they have to hold the button when answering, and the longest answer will take 10 seconds (I assume) this will not have a very shorting effect on leds life. or not? :)
That is not how it works.
You use resistors to limit the maximum current flow through the LEDs.
Then you apply PWM to control the brightness.
If you are using, for example, a 12v supply using LEDs rated for Vf=2v @ 20mA (typ), you could have 5 LEDs per series string with a 100 Ohm current limiting resistor.

Then you use your PWM circuit to control what the ON-time duration is.
 

Thread Starter

cagriaksu

Joined Jun 7, 2010
20
whatever the LEDs spec is, I can always design a string of leds with the proper resistance to limit the string's voltage to 12volts right? Then with the right programming of the uC, leds current can be adjusted right?

So for designing the basic's we really dont need to know how many leds are we going to use, and what will be their specs right? Cause we can adjust the mosfets max A by changing them in order to fit our led string design? Am I right or not?
 

SgtWookie

Joined Jul 17, 2007
22,230
Please don't PM me within minutes of making your post.

This is NOT an interactive forum. If you don't get a reply back after a few days, then "bump" your thread by adding a reply.

If you are going to be using PWM and passive resistors, then you need to select the correct value of resistance to limit the current through the LEDs.

Using a regulated voltage supply, you subtract 1 volt or 8%, whichever is greater.
Divide the result by the typical Vf of the LEDs at the desired current, discarding any fraction. The integer portion is the number of LEDs that you can have in a series string.

Then:
Rlimit >= (Vsupply - (Vf_LED * #_of_LEDs)) / Desired_Current
You select a standard value of resistance greater than or equal to the result of the above equation.

Then you calculate the power requirement for the resistor.
Wattage Rating Requirement >= Desired_Current^2 * Rlimit * 2

In this manner, you can run the circuit with 100% duty cycle and not burn the LEDs up.
 

Thread Starter

cagriaksu

Joined Jun 7, 2010
20
Thanks sarge, but I believe this is the second part...

We haven't build up a circuit yet to consider these calculations...

And nobody suggested nothing...
 
Top