Requesting design sense check

Thread Starter

_Agent86_

Joined Feb 18, 2012
20
Hi all,

I’d like to ask you all for help doing a quick sense-check on a very basic design - probably a lot less complex than you're all used to.

Background: Following reading a Hackaday about some extremely cheap mcus I decided to try making a basic decorative product, to develop design skills (electronic, manufacturing, and designing for commercialising). I’m a Civil Engineer/Project Manager, been reading and experimenting for several years so skills and knowledge are on the medium level of self-taught.

I've written it up in a google doc at https://tinyurl.com/yy3t2l4t - all comments and advice welcome!

Cheers
 

Thread Starter

_Agent86_

Joined Feb 18, 2012
20
Hi Eric - sure - pasted from the doc:

_____________


Design intent:
  1. Flip-flops using 5 software-debounced tactile switches to toggle five blue LEDs.
  2. LEDs software dimmable using PWM.for “heartbeat” effect.
General:

  1. Chip selected is PFS154-S16 (https://datasheet.lcsc.com/szlcsc/1812131724_PADAUK-Tech-PFS154-S16_C317613.pdf)
  2. Power source selected as single LiFEPO4 size 10440.
    1. Max voltage 3.65v, rated 3.2v, min 2.0v (but blue LEDs typically 2.9v so considering design voltage range as voltage as 2.9v-3.7v)
    2. Maximised battery life by putting chip to sleep and waking on any pushbutton input.
Inputs - Pushbuttons
  • Five identical circuits as below - Fig. 1 and Fig. 2
  • SW_Interrupt is connected to the only interrupt-enabled pin on PFS154 (PA0) via diode so any button can trigger it independently. I’ve since learned that the mcu can be brought out of sleep by pin change on any input, but kept that in. Might be able to use it for common software debounce.
  • I’ve elected to use a 10K pull-up. PFS154 datasheet shows pull-high resistance Rph of 200kOhms @ Vdd=3.3v. PFS154 has internal pull-ups so this can be dropped.

Fig.1: Prototype/Template for switch input

upload_2019-7-21_23-4-2.png

Fig.2:Common Interrupt connection - all switch IO pins to common interrupt IO pin (PA0) (Updated 21/07)


Outputs - LEDs

  • Five identical circuits of Fig.3
  • One common circuit of Fig.4 for PWM dimming
  • Each output pin for LEDs pulled down with 10K to ground
  • (DELETE - Invalid) Simulated in LTSpice - peak 19mA @ design max voltage of Vdd=3.7v, falling to 14mA @ 2.9v design minimum voltage.
  • Due to LED Vfwd, added voltage boosted supply for LEDs to provide min 10mA max 20mA. to be dimmed to correct level programmatically by PWM.

upload_2019-7-21_23-2-38.png

Fig.3: Prototype/Template for LED output (Updated 21/07)

upload_2019-7-21_23-8-2.png

Fig.3.1 Voltage doubler circuit - Added 21/07


upload_2019-7-21_23-3-12.png

Fig 4. Common ground connection for LED circuits - switched by PWM for dimming (Updated 21/07)





Fig 5. LTSpice simulation circuit


Fig. 6: (REMOVED - Invalid) LTSpice waveform - current through LED @ Vdd=2.9v and 50% duty cycle

PCB Design

In progress.
  • DRC based on greater than 8mil track width and spacing, single layer. Trace width check shows >100mA for 8mil in air @40degC, 1degC rise.
  • All components 0805/SOT23 or larger.

upload_2019-7-21_23-5-49.png

Fig. 5: PCB Layout in progress (Updated 21/07)
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,850
hi,
Thank you, that makes it easier for members to help.
BTW: Lots of LTSpice user here, you can also post LTS asc files.
E
 

Thread Starter

_Agent86_

Joined Feb 18, 2012
20
Thanks Eric - didn't include as it was only to show the circuit was behaving as expected (that doc is kind of like my design diary on this) - but attached now.
 

Attachments

ericgibbs

Joined Jan 29, 2010
18,850
hi A86,
I get the same result in LTS as you, but you have not specified the LED type.
As you may know they have differing forward voltage drops, depending upon colour.
The Vfwd will change the LED current, so R3 will need changing.
E

BTW: With a White LED, and a 2.9Vbatt it will not work.
 

Thread Starter

_Agent86_

Joined Feb 18, 2012
20
Many thanks Eric, that's a real good point - I've selected a blue LED with min Vfwd 2.8v - Lite-On LTST-S220TBKT
https://datasheet.lcsc.com/szlcsc/Lite-On-LTST-S220TBKT_C160471.pdf

I've found https://forum.allaboutcircuits.com/threads/fyi-led-vf-in-ltspice-models.105083/ and other resources on the internet so I'll give it a go making a SPICE model for it this week and tune R3.

If the discharge curve for the LiFEPO4 follows the ones I've seen even roughly it should be a decent amount of time before it falls too low to drive a blue (intended to operate about 5mins per day). Nevertheless I've separated out the supply (LEDVCC as in diagram) so I can investigate using a charge pump to drive it with lower Vbatt.

Cheers
 

ericgibbs

Joined Jan 29, 2010
18,850
hi,
I think you will have a problem with a LED at 2.8.Vfwd
Look at this sim with a blue LED. [User a 10R in series]
E

BTW: the Vn001/002 plot is across the LED...

A_Blue.PNG
 

Thread Starter

_Agent86_

Joined Feb 18, 2012
20
Hmm, I see. Can I have your blue LED model? I won't be able to figure out how to make the SPICE model before work tomorrow (nearly bedtime).

Dev
 

ericgibbs

Joined Jan 29, 2010
18,850
Hi,
Open standard.dio in the lib/ cmp folder and paste these as required into that standard.dio,,, use a text editor to do that.
After you have saved it, restart LTS.
E
.MODEL DLED_IR D (IS=93.5P RS=84M N=2.63 BV=5 IBV=10U CJO=2.97P VJ=.75 M=.333 TT=4.32U Iave=35m Vpk=5 mfg=GaAs)
.MODEL DLED_RD D (IS=93.2P RS=42M N=4.3 BV=4 IBV=10U CJO=2.97P VJ=.75 M=.333 TT=4.32U Iave=35m Vpk=5 mfg=GaAs )
.MODEL DLED_GN D (IS=93.1P RS=42M N=4.61 BV=4 IBV=10U CJO=2.97P VJ=.75 M=.333 TT=4.32U Iave=35m Vpk=5 mfg=GaAs)
.MODEL DLED_BL D (IS=93.1P RS=42M N=7.47 BV=5 IBV=30U CJO=2.97P VJ=.75 M=.333 TT=4.32U Iave=35m Vpk=5 mfg=GaAs)
.MODEL DLED_WH D (IS=93.1P RS=42M N=7.0 BV=5 IBV=30U CJO=2.97P VJ=.75 M=.333 TT=4.32U Iave=35m Vpk=5 mfg=GaAs)


UPDATE:
Look thru this link for standard.xxx models

http://ltwiki.org/?title=Components_Library_and_Circuits
 
Last edited:

Thread Starter

_Agent86_

Joined Feb 18, 2012
20
Thanks Eric - not sure what's going on but they don't appear in the list - edited standard.dio as administrator, restarted LTSpice. Will continue to troubleshoot (there's never just one problem to solve at a time, eh?)

Dev
 

ebeowulf17

Joined Aug 12, 2014
3,307
Two other ways to improve efficiency (and therefore battery life) might be:

1) Replace BJTs with appropriate logic level MOSFETs. I don't have a specific part in mind, but you should be able to find parts with low enough Rds-on values to deliver lower voltage drop than your current choices (less power gets wasted as heat dissipation at the transistor this way.)

2) Instead of using one output for PWM timing and other outputs for LED activation, requiring the use of two transistors in series, simply apply the PWM you want to each LED output pin. This will cut your transistor-based voltage drop in half, making the design more efficient.
 

Thread Starter

_Agent86_

Joined Feb 18, 2012
20
Two other ways to improve efficiency (and therefore battery life) might be:

1) Replace BJTs with appropriate logic level MOSFETs. I don't have a specific part in mind, but you should be able to find parts with low enough Rds-on values to deliver lower voltage drop than your current choices (less power gets wasted as heat dissipation at the transistor this way.)

2) Instead of using one output for PWM timing and other outputs for LED activation, requiring the use of two transistors in series, simply apply the PWM you want to each LED output pin. This will cut your transistor-based voltage drop in half, making the design more efficient.
Hi ebeowulf - cheers for reviewing. I'll investigate the MOSFET option tonight, can't remember why I went transistor (I think it was threshold voltage) but that seems like a good idea, I'll look for a part tonight with a low threshold.

The common PWM was because I only have 2 PWM outputs for five LEDs and don't need independent dimming - but if there's a more efficient way I'm definitely keen on hearing!

Dev
 

ebeowulf17

Joined Aug 12, 2014
3,307
My MOSFET recommendation was based on the assumption that your transistor Vce drop is probably 0.2-0.3V, because that seems to be unavoidable in my experience with BJTs so far. However, I don't see a specific transistor part number in your drawings, and I certainly don't know all the BJT options out there, so my assumption could be wrong.

Anyway, assuming that's true, it's not hard to do better with a well-chosen MOSFET. I did a very rough DigiKey search just to get in the ballpark, and it only took three tries to find something that looks like it has a lot of potential. Here's the search:
https://www.digikey.com/products/en...-products/transistors-fets-mosfets-single/278

And here's the MOSFET I thought looked promising:
https://www.digikey.com/product-detail/en/on-semiconductor/NTA4153NT1G/NTA4153NT1GOSCT-ND/687114
http://www.onsemi.com/pub/Collateral/NTA4153N-D.PDF

RDS-on for this unit is <0.25ohm with only 2.5Vgs (which I assume your controller should be able to easily provide.) With 0.25ohm at 20mA, you'll only be losing 5mV across the MOSFET, instead of 200-300mV. Of course that also translates into less wasted power, 0.1mW instead of around 5mW. I don't know if these little differences will really matter or not in your application, but I thought they were worth considering. There are probably even better MOSFET options, considering how little effort I put into my search. This one is just an example of what's possible.

As for my PWM suggestion, it may not matter, especially if you switch to MOSFETs that only lose 5mV each. Still, if you do want to try it, you can probably write your own PWM dimming code and just switch the outputs on and off rapidly to achieve the PWM effect. I suppose it depends on what else your microcontroller is busy doing. I would expect that in a 5-button, 5-light circuit, there's probably not a lot of super-complicated code tying up the processor and that you could squeeze it in. In this case, it wouldn't matter that they weren't dedicated PWM pins. On the other hand, if there's a negligible difference in resulting performance, it may not be worth the effort. I was just brainstorming and imaging possibilities when I suggested it.
 

ericgibbs

Joined Jan 29, 2010
18,850
hi A86,
Have you chosen a particular Blue LED type, as you may know off the shelf, their forward voltage drops have a typical spread.
E
 

Thread Starter

_Agent86_

Joined Feb 18, 2012
20
My MOSFET recommendation was based on the assumption that your transistor Vce drop is probably 0.2-0.3V, because that seems to be unavoidable in my experience with BJTs so far. However, I don't see a specific transistor part number in your drawings, and I certainly don't know all the BJT options out there, so my assumption could be wrong.

Anyway, assuming that's true, it's not hard to do better with a well-chosen MOSFET. I did a very rough DigiKey search just to get in the ballpark, and it only took three tries to find something that looks like it has a lot of potential. Here's the search:
https://www.digikey.com/products/en...-products/transistors-fets-mosfets-single/278

And here's the MOSFET I thought looked promising:
https://www.digikey.com/product-detail/en/on-semiconductor/NTA4153NT1G/NTA4153NT1GOSCT-ND/687114
http://www.onsemi.com/pub/Collateral/NTA4153N-D.PDF

RDS-on for this unit is <0.25ohm with only 2.5Vgs (which I assume your controller should be able to easily provide.) With 0.25ohm at 20mA, you'll only be losing 5mV across the MOSFET, instead of 200-300mV. Of course that also translates into less wasted power, 0.1mW instead of around 5mW. I don't know if these little differences will really matter or not in your application, but I thought they were worth considering. There are probably even better MOSFET options, considering how little effort I put into my search. This one is just an example of what's possible.

As for my PWM suggestion, it may not matter, especially if you switch to MOSFETs that only lose 5mV each. Still, if you do want to try it, you can probably write your own PWM dimming code and just switch the outputs on and off rapidly to achieve the PWM effect. I suppose it depends on what else your microcontroller is busy doing. I would expect that in a 5-button, 5-light circuit, there's probably not a lot of super-complicated code tying up the processor and that you could squeeze it in. In this case, it wouldn't matter that they weren't dedicated PWM pins. On the other hand, if there's a negligible difference in resulting performance, it may not be worth the effort. I was just brainstorming and imaging possibilities when I suggested it.
Hi ebeowulf, your brainstorming is appreciated!

Your assumption on the BJT seems sound, that's around the characteristics of the parts I was looking at. I hadn't got around to fully spec'ing that part, but on the basis of a very cheap SOT-23-3 MOSFET I'll be modelling on 2N7002 - (https://datasheet.lcsc.com/szlcsc/Guangdong-Hottech-2N7002_C181082.pdf). That's got a high Rds(on) but I envision this device will only be operating for about 5 minutes per day max and will be rechargeable - if it proves unworkable I'll swap out for another SOT23 MOSFET and adjust the resistors in later production.
I'd like to retain use of the hardware PWM for now, as it adds a little flexibility - you're right, it's not going to be super complicated code but this way I can latch on the PWM output and manipulate the individual LEDs, if I don't end up needing all the execution cycles or RAM. At the moment I'm looking at running the chip off the internal ~50kHz ILRC rather than the 8MHz IHRC which cuts the power consumption tenfold.

hi A86,
Have you chosen a particular Blue LED type, as you may know off the shelf, their forward voltage drops have a typical spread.
E
Hi Eric - as above, I've selected a blue LED with min Vfwd 2.8v - Lite-On LTST-S220TBKT
https://datasheet.lcsc.com/szlcsc/Lite-On-LTST-S220TBKT_C160471.pdf .
 
Top