NeonHorizon / lipopi

Guide to setting up LiPo batteries on the Raspberry Pi
GNU General Public License v3.0
416 stars 62 forks source link

GPIO 14 does not stay high on power up (Pi Zero W version 1.1) #32

Closed svenyonson closed 6 years ago

svenyonson commented 6 years ago

I have disabled the serial port, although the raspi-config menu has changed for Raspberry Pi W version 1.1. Instead of Advanced, you have to use Interfacing Options->Serial.

Testing by leaving EN unconnected and inserting the battery to turn on the Pi W, and with a voltmeter on GPIO 14 ( pin 8), the pin goes to 3.3v as soon as it powers on, but then goes low again after a second or two. So, when the power up/down circuit is implemented as described in the README, it does not latch in the power up state. I'm looking at the meter now, after the Pi has been running for about 5 minutes, and the voltage is .75 volts.

svenyonson commented 6 years ago

Raspbian version 9 (stretch)

svenyonson commented 6 years ago

Ok, testing now, but it appears that UART RX stays high when powered up. I will reimplement the power up/down circuit using GPIO 15 and see if it works. The pin is constant at 2.47v which seems enough to keep EN happy.

NeonHorizon commented 6 years ago

Does RX go low again after shutdown though? If it doesn't the circuit wont work.

Unfortunately they keep messing with the serial port settings and its almost impossible to keep up. I would keep trying different combinations until you find one that makes TX go high. Did you try the enable_uart boot setting?

svenyonson commented 6 years ago

Hmmm, nope it doesn't, so it doesn't work. I don't know about the enable_uart setting, I'll have a look.

On Apr 18, 2018, at 5:28 PM, Daniel Bull notifications@github.com wrote:

Does RX go low again after shutdown though? If it doesn't the circuit wont work.

Unfortunately they keep messing with the serial port settings and its almost impossible to keep up. I would keep trying different combinations until you find one that makes TX go high. Did you try the enable_uart boot setting?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeonHorizon/lipopi/issues/32#issuecomment-382560775, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWlLuBFonTYdRJ2NooWoCB_n6SYipPMks5tp8wtgaJpZM4Ta4pt.

svenyonson commented 6 years ago

Great, thanks Daniel. enable_uart fixed the problem. Might want to add that to the README.

Thanks again,

Steve

On Apr 18, 2018, at 5:28 PM, Daniel Bull notifications@github.com wrote:

Does RX go low again after shutdown though? If it doesn't the circuit wont work.

Unfortunately they keep messing with the serial port settings and its almost impossible to keep up. I would keep trying different combinations until you find one that makes TX go high. Did you try the enable_uart boot setting?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeonHorizon/lipopi/issues/32#issuecomment-382560775, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWlLuBFonTYdRJ2NooWoCB_n6SYipPMks5tp8wtgaJpZM4Ta4pt.

NeonHorizon commented 6 years ago

It is in the README? Step2 in the software setup.

svenyonson commented 6 years ago

Ah, I see. I was just using README.power_up_power_down.md as a reference. I should have read both of them.

Another question: On my Pi, it takes about 8-10 seconds for UART0 TX to hold steady, which is a long time to hold the power switch.

I'm not very adept at electrical engineering, but do you think this addition of an RC network would work to latch the power without pressing the switch for so long?

With a 2M resistor and a 4.7uf cap, I think the delay is around 9 seconds. image

On Apr 19, 2018, at 4:09 AM, Daniel Bull notifications@github.com wrote:

It is in the README? Step2 in the software setup.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeonHorizon/lipopi/issues/32#issuecomment-382682435, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWlLmgB1wjFU7NAB0cjsdJfGeizT71Rks5tqGJ2gaJpZM4Ta4pt.

NeonHorizon commented 6 years ago

Ahhh sorry, I didn't realise you were looking at the power up/down version, thanks for the tipoff I've updated it.

I had a look at your circuit, I have to say I'm not great at RC networks either and there's a lot going on in that circuit so I couldn't say for sure if it would work but I can't see any harm that could come from trying?

The only possible issue I could see is theoretically there could be infinite current from bat through push button and diode to the capacitor during initial charging of the 4.7u. Its a small enough cap that it likely wont matter though but if you wanted to be really cautious you could put a small resistor, say 100 ohm between bat and the pushbutton just to keep it under control.

svenyonson commented 6 years ago

Well, worth a try, but no luck. The 2M (actually 1.8M) is to much resistance to be an effective pull down resistor, and so EN never goes low. Somehow I need a way to isolate the RC network from EN such that it holds it high for the required period without letting the cap prematurely discharge through the 100K pulldown.

svenyonson commented 6 years ago

Now I am heading into dangerous territory, as I only have a slight clue as to what I am doing.
lipopi_schematic_powerboost_q

NeonHorizon commented 6 years ago

Transistor is the wrong way around I think, should be pointing downwards.

svenyonson commented 6 years ago

Whoops, I was disoriented. Yes, upside down. I have the transistors on order, I'll try it out then.

svenyonson commented 6 years ago

Another suggestion I received on electronics.stackexchange does the EN pulldown through the UART. Not sure if this would work, but interesting idea: image

NeonHorizon commented 6 years ago

Yes that may well work.

svenyonson commented 6 years ago

No, don't think so. Powered off, there is 29M resistance between UART Tx and Gnd.

NeonHorizon commented 6 years ago

Yeah that sounds to high for the pulldown to be active, the integrated pull up/down resistors are like 50k I think.

svenyonson commented 6 years ago

I have a working solution. Very similar to your original, with the addition of a capacitor and I replaced the two diode voltage step down with a voltage divider - which actually reduced the component count because the 22K also serves the same purpose of the original 10K on GPIO 18.

So, press/release to power on. Capacitor keeps EN high for a bit more than 10 seconds so UART TX can stabilize. Press again to power off. After the Pi shuts down, EN keeps the powerboost on for an additional 8 seconds or so, but not an issue. lipopi_schematic_powerboost_final

NeonHorizon commented 6 years ago

Awesome! Would you be prepared to do a pull request to include it in the project?

svenyonson commented 6 years ago

Sure!

On Apr 24, 2018, at 1:51 AM, Daniel Bull notifications@github.com wrote:

Awesome! Would you be prepared to do a pull request to include it in the project?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeonHorizon/lipopi/issues/32#issuecomment-383837599, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWlLhAclenyrA0I1KSDRhXnKoJBWmxyks5trtl5gaJpZM4Ta4pt.

svenyonson commented 6 years ago

I have a branch to push for a pull request, but I don't have write access

NeonHorizon commented 6 years ago

Yes thats correct, I can't remember how you do it exactly but I think you commit it to your own repo then make a pull request or something?

svenyonson commented 6 years ago

The way I've always seen it done is that contributors create a branch (never commit to master) then push the branch, create a pull request for you to approve and merge into your branch. But that's always been in the context of a single organization, I haven't committed to someone elses repo or open source repo's before.

If I were just to commit to my own repo (which I already have) then you wouldn't ever be able to see the changes (on my machine). Somehow my branch needs to be pushed to a place where you can see it (and the diff with your master).

If it is easier, I can email you the image and updated readme and you can merge and commit yourself?

On Apr 25, 2018, at 3:11 PM, Daniel Bull notifications@github.com wrote:

Yes thats correct, I can't remember how you do it exactly but I think you commit it to your own repo then make a pull request or something?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeonHorizon/lipopi/issues/32#issuecomment-384435358, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWlLmrB2aTDABws5_hPgMiMgrTUnm7jks5tsOZogaJpZM4Ta4pt.

NeonHorizon commented 6 years ago

Does this help? https://help.github.com/articles/creating-a-pull-request/

svenyonson commented 6 years ago

Brilliant. I've learned something new!

You should see the pull request now.

On Apr 25, 2018, at 3:51 PM, Daniel Bull notifications@github.com wrote:

Does this help? https://help.github.com/articles/creating-a-pull-request/ https://help.github.com/articles/creating-a-pull-request/ — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeonHorizon/lipopi/issues/32#issuecomment-384445946, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWlLnefsGXP04FVnQ_U3U5wItpzmF1Tks5tsO_0gaJpZM4Ta4pt.

svenyonson commented 6 years ago

P.S. The "./" path changes in the readme are so you can see live preview of the markdown within your local editor. It shouldn't affect how it is displayed in GitHub. (I am using Sublime Text 3 for my editor, and the markdown plugin is MarkdownPreviewLive which gives you a nice side by side view.

On Apr 25, 2018, at 4:03 PM, Steve Johnson steve@svenyonson.com wrote:

Brilliant. I've learned something new!

You should see the pull request now.

On Apr 25, 2018, at 3:51 PM, Daniel Bull <notifications@github.com mailto:notifications@github.com> wrote:

Does this help? https://help.github.com/articles/creating-a-pull-request/ https://help.github.com/articles/creating-a-pull-request/ — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/NeonHorizon/lipopi/issues/32#issuecomment-384445946, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWlLnefsGXP04FVnQ_U3U5wItpzmF1Tks5tsO_0gaJpZM4Ta4pt.

NeonHorizon commented 6 years ago

Thanks for that! Sorry it took so long to reply I've had a crazy week. I'll also add you to the contributors list.