Maker Pro
Maker Pro

Changing strobe pattern?

peter.s

Dec 18, 2014
37
Joined
Dec 18, 2014
Messages
37
Hey Kris, you are beginning to sound a bit like Bob ;-)

That sounds like "famous last words"...

How did you know? It seems I spoke too soon. Within an hour of writing my last post I realised that I have to change my initial idea to incorporate a third LED! So now I need three LEDs flashing in turn with a pause between them. Looks like this will be too messy to do with ICs, so I think a controller is on the cards after all... bugger!

Oh well, as you pointed out Kris, this is an excellent project to learn about microcontrollers and I probably will find uses for them in future projects.

Cheers.
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
It's not "too messy" to implement with discrete logic; it's just "quite messy". But if you're interested in learning about microcontrollers, that's great!
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
The Microchip PIC is very popular, although I think the architecture is pretty horrible. But that doesn't really have much practical effect; the compiler takes care of the needed workarounds. It's available in a wide range of variants with different built-in peripherals. The 8-bit core is available in three main levels of complexity; the lowest level ("baseline") would be ample for this application.

PIC10F200 (baseline) in a 6-pin SOT-23 (SMT transistor package with six leads) has an internal oscillator and three output-capable I/O pins - just what you need for your current requirements.

PIC12F1571 (mid-range) in an 8-pin SOIC (SMT IC package) has five output-capable I/O pins if you want future expandability.

Microchip have a selection guide at http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=1013


The Atmel AVR is also popular. The relevant family is the ATtiny, and the ATtiny13 is available in 8-pin and larger sizes. See http://www.atmel.com/devices/ATTINY13.aspx


The 8051 architecture was developed by Intel in the 1970s and is still widely used. Atmel make several 8051 variants, and NXP has (or at least had) a huge range, mostly larger than what you need.


Those are the commonest 8-bit device families I guess, but there are lots to choose from. Digi-Key's selection is at http://www.digikey.com/product-sear...d-microcontrollers/2556109?stock=1&quantity=1 and they have 13,000 devices listed! Even when you filter to just 8-bit devices there are 6,000 devices.

Here's a better list with some unsuitable devices filtered out. I removed all the "no-lead" and BGA (ball grid array) devices because they're difficult to prototype with, and included only ones that use Flash ROM for code storage, so they can be reprogrammed in-circuit. (Most modern devices are available with this feature and it's pretty much required except for huge quantity runs.)

I included devices with up to 16 pins and at least three I/O pins, and an internal oscillator, and either power-on reset or brown-out detector (one or both is needed to ensure the device starts up reliably). That's all you need for this project.

Filtered selection guide is here
 

KJ6EAD

Aug 13, 2011
1,114
Joined
Aug 13, 2011
Messages
1,114
If you filter for through hole components only, the list probably gets very small. I did this recently for op amps on Digikey and the list went from 30k+ parts to 6 suddenly. ;)
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
If you filter for through hole components only, the list probably gets very small. I did this recently for op amps on Digikey and the list went from 30k+ parts to 6 suddenly. ;)
Yes, and Digi-Key's (and Mouser's) stock of THT is shrinking all the time :-(

I wish they would distinguish leaded SMT packages, which aren't too hard to prototype with, from no-lead and BGA packages, which are. I have to go through the package field in the filter and deselect the unsuitable packages one by one :-(
 

peter.s

Dec 18, 2014
37
Joined
Dec 18, 2014
Messages
37
Ok, assuming I settle on the ATTINY45 (or something similar), and assuming I manage to write the code, would this schematic be sufficient to run the LEDs?

Remember there are now 3 banks of LEDs (probably 30w/bank), running off 12v.

LED Strobe MCU_schem.png
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
That's a good start. You need to change the MOSFET drive circuitry, and you will need some kind of current limiting for the LEDs, unless that is built into the LED bank. If it is, you shouldn't show the LED bank as an LED - show it as a black box, or as an array of LEDs with a current limiting resistor.

Also, is this for automotive use? If so, you may need more protection from surges and spikes.

30W per bank at 12V is 2.5A per bank, or 7.5A total. That's a significant amount of current and it has implications for the layout - the high-current paths should be kept off the breadboard, if you're using one, and the low-current control circuitry should connect into that circuit at just two points, so the heavy current flow is kept separate.

MOSFET gates have significant capacitance (relative to the source). To make a MOSFET switch quickly and cleanly, you need to provide significant current (positive to turn ON, negative to turn OFF) into the gate.

Also, MOSFETs work best when their gates are driven with about 12V. MOSFETs are available with the "logic-level gate" feature; these are specified to operate with gate-source voltages (VGS) of 4.5V and less, but they still conduct harder with higher voltages. MOSFETs are now available with extremely high performance at low gate voltages, but they are intended for use in portable electronics, so they are physically very small and hard to work with, and easily damaged by overvoltage, so not suitable for this project.

I think you would be best to use a "standard" MOSFET as these are a lot more rugged. A good option in TO-220 (through-hole) is http://www.digikey.com/product-detail/en/FQP13N10/FQP13N10-ND/1053774 or http://www.digikey.com/product-detail/en/PSMN027-100PS,127/568-5775-5-ND/2296342 (lower RDSon). Suitable SMT devices are http://www.digikey.com/product-detail/en/DMN10H099SK3-13/DMN10H099SK3-13DICT-ND/4948449, http://www.digikey.com/product-detail/en/BUK7Y41-80EX/568-10966-1-ND/4486620, http://www.digikey.com/product-detail/en/PSMN017-60YS,115/568-5581-1-ND/2531059, again in order of increasing price and decreasing RDSon.

The upshot of all this is that I recommend you use a gate driver IC. These are powered from your 12V rail and have logic-level inputs that can be driven directly by the MCU. A good choice is the TC4467/8/9 from Microchip (which is a second source of the MIC4467/8/9 from Micrel). The data sheet is at http://www.microchip.com/mymicrochip/filehandler.aspx?ddocname=en011589

These devices have four "low-side" MOSFET drivers and come in 14-pin DIP and 16-pin SOIC packages. They're fairly cheap - USD 3~4 in 1-up quantity from Digi-Key. The 4467, 4468 and 4469 are all suitable; the differences are in the input configuration. All other factors being equal, I recommend the 4469 with the "B" inputs tied to 0V. The "A" inputs will then be active-high LED enable signals. Use pulldown resistors (e.g. 10 kΩ) on these.
 

peter.s

Dec 18, 2014
37
Joined
Dec 18, 2014
Messages
37
You need to change the MOSFET drive circuitry, and you will need some kind of current limiting for the LEDs, unless that is built into the LED bank.

Is this what you had in mind? I took a stab at the value for R6, I figure I will work that out once I have selected the LEDs I will use. I like the idea of using the 4469 - it simplifies it a lot.

I think I understand what you are saying about the MOSFET. I will read up on that some more. However, unfortunately, I am unable to get a FQP13N or PSMN027 where I am - would an IRF620 do?. In fact I can't get the TC4467/8/9 either... Hmmm.

The LED banks (including MOSFETs) are intended to be separate units to the controller - connected by about 3 metres of wire. It will be easy enough to keep the power supply separate.

Also, is this for automotive use? If so, you may need more protection from surges and spikes.

Yes it is intended for use in a vehicle - what would you suggest as extra protection?

I know 30W per bank is quite high. To be honest I am not sure if 30W will be necessary (it will likely be less, maybe 20W), but I have been using it as a starting point so that I don't end up under-designing it.

LED Strobe MCU_schem2.png
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes, that's the idea. You need to ground pins 8 and 9 of the TC4467/8/9, and pin 10 isn't used.

Why did you choose such a high value for R4? I would use something like 12Ω or 22Ω to limit the peak current to about 0.5~1A to protect the TC4467/8/9 but still switch the MOSFET quickly.

Quick switching minimises power dissipation in the MOSFET, because it doesn't dissipate any power when it's OFF (no current flow through it), and it dissipates very little power when it's ON (low RDSon means very little voltage drop across it); it only dissipates significant power during the change from OFF to ON and vice versa, so you want to minimise the duration of the change. This is more important when you're driving really big loads, but you have a good MOSFET driver there; you might as well use it!

You need decoupling capacitors on all of your ICs (and two on the regulator). It's best to draw them in now, so you don't forget them!

The IRF620 has a guaranteed ON-resistance (RDSon) of 0.8Ω, at least ten times higher than most of the devices I recommended. This means it will dissipate much more power. In the worst case, 100% duty cycle with 2.5A drain current, its maximum power dissipation will be:

P = I2 × R
= 2.52 × 0.8
= 5W.

A TO-220 package can dissipate around 0.5~1W without a heatsink. So you would need heatsinks if you use the IRF620. Not huge heatsinks; something with a thermal resistance of around 10 °C/W on each MOSFET would limit the rise to 50 °C above ambient. This will change somewhat if your panels draw less than 2.5A. The devices I suggested would not need heatsinking.

If you can't get the TC4467/8/9, try the Micrel MIC4467/8/9. There are a few other options as well. Who is your preferred supplier over there?

As for separating things out, that's a bit tricky, especially in an automotive environment. I think I would keep the MOSFETs with the controller if possible, with a cable to the LED panels, or put the controller in the LED panels along with the MOSFETs. Are either of those options feasible?

Re protection, I think this is what you should do. Keep the varistor at the +12V input to the circuit. Supply the LED panels directly from that rail. Include one power diode, e.g. 1N5404, reverse-connected across the series string of LEDs, to protect the LEDs themselves from negative voltages. Feed that rail through another 1N5404, in series this time, and a low-value fusible resistor e.g. 2.2Ω 2W (something like http://www.digikey.com/product-detail/en/ERX-3SJ2R7A/P2.7W-3CT-ND/4079736 or http://www.digikey.com/product-detail/en/FKN2WSJR-73-2R2/2.2DYCT-ND/2813222), to a 1000 µF/25V smoothing capacitor to 0V, and into the TC4467/8/9 power supply and the input of the 5V regulator. That should give you good protection.
I know 30W per bank is quite high. To be honest I am not sure if 30W will be necessary (it will likely be less, maybe 20W), but I have been using it as a starting point so that I don't end up under-designing it.
Good. That's my initial approach too.
 

peter.s

Dec 18, 2014
37
Joined
Dec 18, 2014
Messages
37
As for separating things out, that's a bit tricky, especially in an automotive environment. I think I would keep the MOSFETs with the controller if possible, with a cable to the LED panels, or put the controller in the LED panels along with the MOSFETs. Are either of those options feasible?

My preference would be to keep the controller independent and have the MOSFETs with the LEDs, but I hear your concerns and I'm prepared to keep the MOSFETs with the controller and cable out to the LEDs. Are you suggesting that the MOSFETs will perform better if they are kept close to the 4467/8/9?

Who is your preferred supplier over there?

My preferred supplier is: http://www.gmelectronic.com/electronic-parts-and-components

I am prepared to order parts from the US or UK if I can't find suitable alternatives locally. There may be other suppliers I haven't found yet, so I will look around to see what my other options are.

I think I have I have incorporated all of what you are suggesting with the power protection. I wasn't sure about the diode across the series string of LEDs, but I think I got it in the end? See attached.

You need decoupling capacitors on all of your ICs (and two on the regulator). It's best to draw them in now, so you don't forget them!

Yes - good advice!! You've reminded me on this a few times now... I should have remembered by now.

Oh, and thank you for the explanation of power dissipation in MOSTEFs - and pushing my learning curve higher :)

LED Strobe MCU_schem3.png
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yes, definitely you want to minimise the distance between the 4467/8/9 and the MOSFETs. High current spikes flow through those signals and the loop area should be minimised. MOSFETs can be damaged by voltage spikes on the gate. Also, the signals from the MCU to the 4467/8/9 are low-voltage, high-impedance signals connecting two small and sensitive devices, and should be kept short.

The signals from the MOSFETs to the LEDs carry high current but the devices at both ends are pretty robust. If you can't put the controller, driver, MOSFETs and LEDs all together, that's the best place to split them.

Here are some suitable MOSFETs from that supplier, in order of increasing RDSon, and decreasing cost (except the last one). Even the last one, the cheapest THT part, will dissipate less than 0.5W at 2.5A steady drain current, so it won't need a heatsink. It will get pretty warm though at 100% duty cycle. The first one will dissipate only 0.05W so it won't even get warm. Your call.

IRF3205 TO-220 (THT) €0.79 55V 8 mΩ http://www.gmelectronic.com/unipolar-transistor-irf3205-p213-189
IRLZ34N TO-220 (THT) €0.59 55V 35 mΩ http://www.gmelectronic.com/unipolar-transistor-irlz34n-p213-181
IRLR024N DPAK (SMT) €0.35 55V 65 mΩ http://www.gmelectronic.com/unipolar-transistor-irlr024n-smd-p915-044
IRFZ24N TO-220 (THT) €0.44 55V 70 mΩ http://www.gmelectronic.com/unipolar-transistor-irfz24n-p213-208

That diagram looks good but for the LED protection diodes, I would connect the cathodes to the other side of the 10Ω resistors, so the resistors will limit the fault current.
 

peter.s

Dec 18, 2014
37
Joined
Dec 18, 2014
Messages
37
Thank you so much... I will probably go with either of the first two on the list.

I'm still chasing a 4467/8/9, but can get every thing else. Except maybe the 2.2Ω 2W fusible resistor. I can get this: http://www.gmelectronic.com/rr-w2-e002-2-p114-102 or http://www.gmelectronic.com/rr-w2-e002-7-p114-112 but they are not fusible (I don't think).

I'm attaching the diagram again to be sure I am clear on the diode/resistor placement for the LEDs and to illustrate the cable connections. If you have a moment please take another look.

Cheers.


LED Strobe MCU_schem4.png
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Sorry, I forgot to look into MOSFET driver options from GM Electronic. Here's what I found.

If you can use SMT devices, options 1 or 2 would be best but they're not in stock and I doubt GM Electronic would buy a reel of 2000 of them just so they could sell you two. You could email them and ask though.

If you can use SMT, option 3 is the most compact (three 8-pin SMT devices).

If you want to use THT devices, you'll have to use option 4, three 14-pin DIP through-hole devices.

Or of course you could order a single TC4469 in SMT (16-pin) or THT (14-pin) from Digi-Key, but check their shipping costs!


1. The Microchip TC4427 is a two-channel low-side driver in an 8-pin package. You would need two of these. They only list the SMT version, and it's NOT IN STOCK :-( http://www.gmelectronic.com/tc4427coa-so8-microchip-p329-035 €0.93

2. The International Rectifier IR4427 is a two-channel low-side driver in an 8-pin package. You would need two of these. They only list the SMT version, and it's NOT IN STOCK either :-( http://www.gmelectronic.com/ir4427-smd-p213-229 €1.54

3. The IR2101 is a single-channel high-side and low-side side driver in an 8-pin package. You would need three of these. The drive current is only 130 mA high, 270 mA low, which will slow down the switching slightly. The high-side drivers aren't needed in this application. Listed in SMT (IN STOCK) http://www.gmelectronic.com/ir2101s-p955-053 €1.10, and THT (NOT IN STOCK). http://www.gmelectronic.com/ir2101-dip8-international-rectifier-p399-142 €1.61

4. IR2110 and IR2113 (interchangeable in this application) is a single-channel high-side and low-side driver avalilable in a 14-pin DIP (THT) package. You would need three of these. The drive current is 2A in each direction. The high-side drivers aren't needed in this application. IR2110 DIP-14 IN STOCK http://www.gmelectronic.com/ir2110-dip14-international-rectifier-p399-080 €1.89
IR2113 DIP-14 IN STOCK http://www.gmelectronic.com/ir2113-dip14-irf-p399-184 €1.81
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
In reply to your last post. Yes, that schematic looks good.

Yes, GM Electronic don't have a 2.2Ω 2W fusible resistor. They do have 10Ω 0.5W fusible resistors at http://www.gmelectronic.com/mrr-10r-fus-p119-384 and you could connect four of these in parallel. I haven't seen fusible resistors connected in parallel before and my gut feeling is there might be a problem with it, but I Googled it and didn't find any advice to the contrary. So that's my suggestion, unless someone here can provide a convincing objection.

Does ANYONE HERE know of any reason why fusible resistors (four of the same type) shouldn't be connected in parallel?

I just realised that the MOSFET driver should have more than 0.1 μF of decoupling capacitance, because of the heavy currents it generates, so you should replace the 0.1 μF ceramic with a larger value. If you're using SMT, use a 4.7 μF multi-layer ceramic (http://www.gmelectronic.com/cks1812-4-7u-50v-x7r-hit-10-p905-200). If you're using THT, you can use http://www.gmelectronic.com/mks2-4m7-50v-p121-363.
 

peter.s

Dec 18, 2014
37
Joined
Dec 18, 2014
Messages
37
Or of course you could order a single TC4469 in SMT (16-pin) or THT (14-pin) from Digi-Key, but check their shipping costs!

I had a look to see what the shipping costs would be to the Czech republic - $60 !!!!!!!! For a $3 part you can slip into an envelope. After I got myself up off the floor I had another search and found another supplier which is a little more local.

From this local supplier I can order the TC4469, but they list a TC4469EPD or TC4469CPD and the price is slightly different. Judging from the generic data sheet I don't think there is any difference, but I thought I should check just in case?

As for the fusible resistor, I can get a 4.7Ω 2W. That should do, shouldn't it?

Thanks for picking up on the capacitor value for the MOSFET driver, and thank you again Kirs for all your generous help!!!! I've thoroughly enjoyed the journey and I'm thrilled to see how this project has evolved into a neat little product. :) :)
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
Yeah, their shipping charges are excessive.

From the TC4467/8/9 data sheet:

TC4467-8-9 part numbering system.png
So the CPD and EPD suffixes are both through-hole packages, with different temperature ranges. Actually according to that document, the EPD doesn't exist, because the E temperature range applies to the ceramic DIP (JD) only!

Yes, 4.7Ω 2W fusible should be fine I think. You might want to get some spares, and if they start failing, have a look at what the automotive supply is doing.

You're welcome :) But don't thank me until it's all up and running!
 

peter.s

Dec 18, 2014
37
Joined
Dec 18, 2014
Messages
37
I must have missed that part of the data sheet... Seeing as I'm in central Europe with winters usually dipping below -10˚C (although one wouldn't think it this winter) I will go with the EDP.

I'm now having trouble getting the diode 1N5404. Would the 1N5401 or 1N5402 do? I've had a look at the data sheet and it seems that the last number is by 100V, so the ..04 is rated 400V and the ..02 is rated 200V.

But don't thank me until it's all up and running!

Ok - I'll thank you again later :)
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
I'm now having trouble getting the diode 1N5404. Would the 1N5401 or 1N5402 do? I've had a look at the data sheet and it seems that the last number is by 100V, so the ..04 is rated 400V and the ..02 is rated 200V
Yes but I would go for one higher than the 1N5404 such as the 1N5407 (1000V). If you can't get one higher than 1N5404 the 1N5402 would do at a pinch. You want plenty of protection from voltage surges.
 
Top