Help with a switching a circuit with a "soft" power on button

BTW

  • If we were a purist, this is how the gate resistors should be connected.
    Either way will work though.

2024-05-15_14-15-27

Why would I use a buck/boost instead of a buck? My source is never going to output lower than the circuit's minimum Vin requirement, so will never need to boost.
[/quote]

Before connecting my converter I've adjusted it using a benchtop supply and multimeter. I was intending on applying a drop of glue/nail polish onto the pot once set, but I do like your SMD resistor idea.

I'm using one of these (I have a handful in my parts drawer):
Mini-360-Buck-DC-DC-Converter-Step-Down-Module-4.75-23V-to-1-17V-s

I thought you might say that. Will see if I can get it right and post a new schematic later today.

  • That type of potentiometer is open to the surrounding, adding glue/polish will probably destroy it.

  • These potentiometers can be sealed as you suggest though.

I have three TeensyLC boards lying around unused. They're not available any more, so if I didn't already have them I would've chosen a different MCU.

I'm using a WaveShare 1.69" LCD (https://www.waveshare.com/1.69inch-lcd-module.htm).
It's either 3.3v/5v, but the power suppy and operating voltage need to be the same, which is why is why I'm powering from 3.3v out on the Teensy.

I realise that I mentioned I'm regulating Vin to 5.2v. That's a mistake, I've actually set it to 4.2v. Teensy Vin is 3.7-5.5V. I don't know how tolerant that spec is, but with potentially supplying 6.6V from two fresh batteries, I don't want to risk it.
Although given that the Teensy has a regulator onboard, I only need to drop from an input range of 6.6v (new cells and 5.4v (depleted cells) to an input range of 3.7v and 5.5v, a voltage divider at a 4:1 ratio should also do the job?

It's very much at breadboard stage at the moment! And given I only intend to make one of these, I was going to try and get it all as neatly as possible on protoboard for the final product. If I was going to make more, I would definitely get a PCB printed. I would also choose a more readily available MCU!

FYI

Or a couple of diodes in series to drop 1.4v?
When the cells are new, 6.6V - 1.4V = 5.2V.
When they are almost depleted, 5.4V - 1.4V = 5V.
Which is always within the TeensyLC's Vin range.

Updated schematic changing the 2N3904 for an AO3401. Also moved R3 to other side of R2 as suggested.

  • Say we put the two CR123 in parallel (with series Schottky ORing diodes).
  • The output would be fed to the Buck/Boost converter set to the required voltage.
    example: 3V3
  • We could also use a boost converter. ex. MT3608

I know I suggested putting the CR123 in parallel, but I went towards series because conventional wisdom says not to combine two potentially different power sources in parallel. Eg, one old and one new cell.

In general, is it "better" (more efficient?) to buck a battery configuration that ranges 5.4v through 6.6v down to 4v, or to configure them to boost a range of 2.7v thru 3.3v?

I also have a handful of MT3608 boards lying in my parts drawer. The MINI-360 has a much smaller footprint than MT3608, so it has that going for it too. So both are an option.

(Aah, it just clicked that you included schottkey ORing diodes).

Question still remains. Is it more efficient to boost a lower voltage, or buck a high one?

  • IMHO, Boost is better, however, Buck/Boost covers everything.

  • Battery voltage decreases (internal resistance increase) as the battery drains, the Boost converter takes this in stride.
    We can squeeze every last electron out of the battery.
    i.e. the MT3608 can go down to about 2V.

This has a head room of 0.7V which probably not enough. :thinking:

However, for every problem there are 12 solutions.

:sunglasses:

Only 12?!

Thought I'd drop in to give an update, and in doing so I've noticed what I think is a bug in my circuit - diode D2 is used to pull a GPIO pin low when the power switch is pressed. However, while the switch is open, the input is floating. Shouldn't there be another resistor (10k?) pulling the input high?

In the flurry of posts, @LarryD I missed your helpful post about protoboard techniques, but in the meantime I've realised that I was way optimistic thinking that I'd be able to fit everything onto a protoboard that's small enough for the space I have to work with.

This is the 3D printed case I'm working with. Yes, I could make the case bigger, but I like the form factor. I've included a TeensyLC for scale. You can also see the cutout for the 1.69" LCD. So not a lot of space in there!

So these past few days has been a bit of a learning curve. I've downloaded Kicad, designed my (well, your :slight_smile: ) schematic, using stackable pin headers for a double-decker circuit. Teensy and power circuit on the main board, and ADS1115 and connectors on the daughter board.

I'm sure there's plenty of room for improvement or efficiencies in my Kicad use and PCB design, but I'm pretty happy where I've ended up. I'm still waiting on deliver of the mosfets, so haven't got it working on a breadboard yet, so haven't submitted the PCBs for printing yet.

And the PCB layouts (I need to change out the IDC connector currently used for the LCD cable to something a bit more suitable like a JST)

Nevermind, there is an internal pull-up. My brain is obviously fried and it's time to go to bed :grin:

And another update for anyone following along at home, or for anyone who comes across this post in the future. I find it frustrating when I come across a forum post that is left incomplete because the OP worked out a solution themselves or otherwise moved, leaving an open ended discussion!

So even though this is diverting somewhat from my initial post, here's hoping this post can help someone else in the future.

The past couple of weeks have been a bit of a learning experience - drawing on my forgotten electronics knowledge from years gone by, to pushing myself beyond a passing interest in PCB design to actually doing it.

So this latest schematic is essentially the same as my previous post, but with two differences:

  1. I worked out how to use labels in Kicad to clean up the mess of connectors!
  2. I decided that having a double-stacked circuit board was still too tight a fit in my enclosure, so I've removed the Adafruit ADS1115 breakout board, instead opting to just use the IC. Hopefully my PCB design is clean enough for a reasonable input at 16x gain (measuring 0-25mV) and my hand steady enough and my magnifier strong enough to solder a TSSOP-10 package.

And not so much the schematic, but the PCB design, if I'm going to hand solder a TSSOP and three SOT-23 components, I might as well use all SMD passive components. I've kept the Mini360 DC-DC buck converter as-is, rather than trying to add to the main PCB.

2 Likes

I haven't been following the thread, so this may have been covered. But I'm curious about the purpose of R4. That's the resistor in series with the output of the buck converter. Doesn't seem you would want a resistor there.

Also, did you decide not to include a charger?

Q1 is backwards, R4 is not necessary/troublesome.

Thankyou for point that out. I can't recall why I put that there and that is something that I should've picked up.

Yes, I've ended up going with 2xCR123 cells in series. I've decided that the usage patterns are probably such that I'd prefer to be able to throw new batteries in rather than have to charge it up.

Thanks @LarryD, I've switched Q1 back around the proper way and removed R4.

And now for the next modification for you to correct me on @LarryD :grin:

I wasn't happy with the power control for the LCD display. It worked OK, but wasn't as smooth as it could be. I found this schematic for the LCD module that shows the backlight control with an internal 10k pull-up resistor. Pulling the BL pin low turns the backlight off, which reduces the power consumption to negligibly more than the brute force approach of cutting power to the LCD, but still appearing to the user that it is powered off.

image

So I made this change to the LCD part of my circuit:

So now, when the circuit powers on, the LCD backlight is immediately pulled low because R13 closes the mosfet. When MCU pulls LCD_BL low, the mosfet is opened, allowing the LCD controller's internal pull-up resistor to turn the backlight on. The result is a hundred times better, because I don't see the power-up artifacts that are shown on the screen.

Startup process is starting to get pretty slick.

  1. Hold power down button. The very first commands in my setup() are to pull PWR_Hold and all the LEDs high. This takes a couple of hundred milliseconds. Once all LEDs are on, that indicates that power is on, and the power button can be released. I may include an additional timer so that the power-on processing only begins after holding the power button for a bit longer (maybe 1sec)

  2. Now initialise the TFT library, clear the display and initialise it with the startup screen. Then turn off the the FN1 and FN2 LEDs, leaving the Power LED on, then pull LCD_BL low, turning the LCD backlight on and device is ready to use. This process takes about 800ms to complete (or about 1500ms if I also initialise the USB Serial library for debugging)

  3. The power off process is a little odd, because if I hold the power button to turn off, the act of holding the power button will keep the circuit turned on! So after holding the power button for 1sec, all LEDs are turned off and the LCD backlight is turned off, giving the impression that the device is turned off. Then releasing the power button will turn it off properly.

And not that this picture helps anything, but power and button/LED circuit all bread-boarded up and working nicely. Might almost be ready to push the button on PCB fab.