Requesting design sense check

Discussion in 'General Electronics Chat' started by _Agent86_, Jul 14, 2019 at 3:21 AM.

  1. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    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
     
  2. ericgibbs

    Moderator

    Jan 29, 2010
    7,854
    1,595
    hi A86,
    Welcome to AAC.
    Please post your circuit diagram to this Thread.
    E
     
  3. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    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.
    [​IMG]
    Fig.1: Prototype/Template for switch input

    [​IMG]

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


    Outputs - LEDs

    • Five identical circuits of Fig.3
    • One common circuit of Fig.4
    • Each output pin for LEDs pulled down with 10K to ground
    • Simulated in LTSpice - peak 19mA @ design max voltage of Vdd=3.7v, falling to 14mA @ 2.9v design minimum voltage.
    [​IMG]

    Fig.3: Prototype/Template for LED output

    [​IMG]

    Fig 4. Common ground connection for LED circuits - switched by PWM for dimming



    [​IMG]

    Fig 5. LTSpice simulation circuit

    [​IMG]

    Fig. 6: 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.

    [​IMG]

    Fig. 5: PCB Layout in progress
     
  4. ericgibbs

    Moderator

    Jan 29, 2010
    7,854
    1,595
    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
     
  5. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    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.
     
  6. ericgibbs

    Moderator

    Jan 29, 2010
    7,854
    1,595
    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.
     
  7. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    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
     
  8. ericgibbs

    Moderator

    Jan 29, 2010
    7,854
    1,595
    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
     
  9. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    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
     
  10. ericgibbs

    Moderator

    Jan 29, 2010
    7,854
    1,595
    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: Jul 14, 2019 at 7:37 AM
  11. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    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
     
  12. ericgibbs

    Moderator

    Jan 29, 2010
    7,854
    1,595
    hi,
    Are you using LTS XXVI or XXVII version, the latter has the CMP in the Documentation files in Win 10.

    E
     
  13. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    Ah, that was the missing link. Solved and got similar results. Will have to do a little thinking on this...

    Dev
     
  14. ericgibbs

    Moderator

    Jan 29, 2010
    7,854
    1,595
    hi,
    Thats good, lets know how it goes.
    Eric
     
    Last edited: Jul 14, 2019 at 10:45 AM
  15. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    I thought about it a bit before bed and decided to boost LEDVCC to 5v from VCC - probably using something like the HX4004 switched capacitor voltage doubler https://lcsc.com/product-detail/DC-DC-Converters_HX4004_C172355.html.

    Chosen by the rather unscientific method of cheapest part given high enough voltage and current and with English datasheet, lol.

    Will implement and update.

    Dev
     
  16. ebeowulf17

    Distinguished Member

    Aug 12, 2014
    2,873
    603
    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.
     
  17. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    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
     
  18. ebeowulf17

    Distinguished Member

    Aug 12, 2014
    2,873
    603
    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.
     
  19. ericgibbs

    Moderator

    Jan 29, 2010
    7,854
    1,595
    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
     
  20. _Agent86_

    Thread Starter New Member

    Feb 18, 2012
    11
    0
    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 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 .
     
Loading...