Electronics-Related.com
Forums

I think this will work??

Started by rhor...@gmail.com December 22, 2023
Actually, I am fairly sure - but not certain - it will work, and I am a little less sure it will work well enough.  I have included a link to a schematic of the design below.  "Switch 1" is actually a GPIO output pin from an Arduino, and R5 is actually A Raspberry Pi.  The intent is to have the Arduino shut down the RPi when a certain variable is true and turn it back on when the variable is false.  The default will be for the RPi to be on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET.  I have run it in my simulator, and it works there, but there are a couple of catches.  The problem is , I am using  Micro-Cap 12.2, and it does not have exact matches for all of my components.

In particular, Optocoupler X5 does not have a BJT output.  I have a ton of H11F1 Optocouplers (read that: free) which I need to use, and they have symmetrical bilateral silicon photo-detectors as their outputs.  Micro-Cap does not have an exact match for this, but I think the FET output Coupler will work just fine to switch the P-Channel X4 MOSFET.  If anyone knows of any reason why an H11F1 Optocoupler will not work here, please let me know.

A bit more worrisome is the PC-Channel MOSFET.  Micro-Cap does not have an exact match for the  PMV28XPEAR MOSFET I need to use.  Again, I think it will work, but I am not certain.  I tried several different MOSFETs in the simulator, and some perform quite well, with less than 0.1V drop, but others have as much as 0.25V drop in the same situation, which is a bit too much. The  PMV28XPEAR has a quite low Rds of around 40 milliohms, but I am not at all sure a somewhat higher Rds is why some of the others I used in the sim are failing.  Increasing the value of R5 in the sim did not increase the output voltage.  Is anyone out there familiar with the  PMV28XPEAR, or know of a very low cost MOSFET that would be guaranteed to work?  My cost for the  PMV28XPEAR is $0.076 each.

http://siliconventures.net/images/Raspberry%20Pi%20Lighting%20HAT%20switch,jpg.JPG
On 23/12/2023 12:53 am, rhor...@gmail.com wrote:
> Actually, I am fairly sure - but not certain - it will work, and I am a little less sure it will work well enough. I have included a link to a schematic of the design below. "Switch 1" is actually a GPIO output pin from an Arduino, and R5 is actually A Raspberry Pi. The intent is to have the Arduino shut down the RPi when a certain variable is true and turn it back on when the variable is false. The default will be for the RPi to be on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET. I have run it in my simulator, and it works there, but there are a couple of catches. The problem is , I am using Micro-Cap 12.2, and it does not have exact matches for all of my components. > > In particular, Optocoupler X5 does not have a BJT output. I have a ton of H11F1 Optocouplers (read that: free) which I need to use, and they have symmetrical bilateral silicon photo-detectors as their outputs. Micro-Cap does not have an exact match for this, but I think the FET output Coupler will work just fine to switch the P-Channel X4 MOSFET. If anyone knows of any reason why an H11F1 Optocoupler will not work here, please let me know. > > A bit more worrisome is the PC-Channel MOSFET. Micro-Cap does not have an exact match for the PMV28XPEAR MOSFET I need to use. Again, I think it will work, but I am not certain. I tried several different MOSFETs in the simulator, and some perform quite well, with less than 0.1V drop, but others have as much as 0.25V drop in the same situation, which is a bit too much. The PMV28XPEAR has a quite low Rds of around 40 milliohms, but I am not at all sure a somewhat higher Rds is why some of the others I used in the sim are failing. Increasing the value of R5 in the sim did not increase the output voltage. Is anyone out there familiar with the PMV28XPEAR, or know of a very low cost MOSFET that would be guaranteed to work? My cost for the PMV28XPEAR is $0.076 each. > > http://siliconventures.net/images/Raspberry%20Pi%20Lighting%20HAT%20switch,jpg.JPG
Do you actually need the opto-isolation? The switch would drive an NPN transistor into saturation when it closed, or a small N-MOSfet. You'd need a pull-up resistor to +5V to get the voltage swing you want, but it's much the same circuit with less to go wrong. -- Bill Sloman, Sydney
On Fri, 22 Dec 2023 05:53:24 -0800 (PST), "rhor...@gmail.com"
<rhorerles@gmail.com> wrote:

>Actually, I am fairly sure - but not certain - it will work, and I am a little less sure it will work well enough. I have included a link to a schematic of the design below. "Switch 1" is actually a GPIO output pin from an Arduino, and R5 is actually A Raspberry Pi. The intent is to have the Arduino shut down the RPi when a certain variable is true and turn it back on when the variable is false. The default will be for the RPi to be on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET. I have run it in my simulator, and it works there, but there are a couple of catches. The problem is , I am using Micro-Cap 12.2, and it does not have exact matches for all of my components. > >In particular, Optocoupler X5 does not have a BJT output. I have a ton of H11F1 Optocouplers (read that: free) which I need to use, and they have symmetrical bilateral silicon photo-detectors as their outputs. Micro-Cap does not have an exact match for this, but I think the FET output Coupler will work just fine to switch the P-Channel X4 MOSFET. If anyone knows of any reason why an H11F1 Optocoupler will not work here, please let me know.
Should be OK.
> >A bit more worrisome is the PC-Channel MOSFET. Micro-Cap does not have an exact match for the PMV28XPEAR MOSFET I need to use. Again, I think it will work, but I am not certain. I tried several different MOSFETs in the simulator, and some perform quite well, with less than 0.1V drop, but others have as much as 0.25V drop in the same situation, which is a bit too much. The PMV28XPEAR has a quite low Rds of around 40 milliohms, but I am not at all sure a somewhat higher Rds is why some of the others I used in the sim are failing. Increasing the value of R5 in the sim did not increase the output voltage. Is anyone out there familiar with the PMV28XPEAR, or know of a very low cost MOSFET that would be guaranteed to work? My cost for the PMV28XPEAR is $0.076 each. > >http://siliconventures.net/images/Raspberry%20Pi%20Lighting%20HAT%20switch,jpg.JPG
That has to work. Maybe delete R3. Any low-threshold, low Rds-on pfet will work.
On Friday, December 22, 2023 at 8:53:29&#8239;AM UTC-5, rhor...@gmail.com wrote:
> Actually, I am fairly sure - but not certain - it will work, and I am a little less sure it will work well enough. I have included a link to a schematic of the design below. "Switch 1" is actually a GPIO output pin from an Arduino, and R5 is actually A Raspberry Pi. The intent is to have the Arduino shut down the RPi when a certain variable is true and turn it back on when the variable is false. The default will be for the RPi to be on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET. I have run it in my simulator, and it works there, but there are a couple of catches. The problem is , I am using Micro-Cap 12.2, and it does not have exact matches for all of my components. > > In particular, Optocoupler X5 does not have a BJT output. I have a ton of H11F1 Optocouplers (read that: free) which I need to use, and they have symmetrical bilateral silicon photo-detectors as their outputs. Micro-Cap does not have an exact match for this, but I think the FET output Coupler will work just fine to switch the P-Channel X4 MOSFET. If anyone knows of any reason why an H11F1 Optocoupler will not work here, please let me know. > > A bit more worrisome is the PC-Channel MOSFET. Micro-Cap does not have an exact match for the PMV28XPEAR MOSFET I need to use. Again, I think it will work, but I am not certain. I tried several different MOSFETs in the simulator, and some perform quite well, with less than 0.1V drop, but others have as much as 0.25V drop in the same situation, which is a bit too much. The PMV28XPEAR has a quite low Rds of around 40 milliohms, but I am not at all sure a somewhat higher Rds is why some of the others I used in the sim are failing. Increasing the value of R5 in the sim did not increase the output voltage. Is anyone out there familiar with the PMV28XPEAR, or know of a very low cost MOSFET that would be guaranteed to work? My cost for the PMV28XPEAR is $0.076 each. > > http://siliconventures.net/images/Raspberry%20Pi%20Lighting%20HAT%20switch,jpg.JPG
Scrap that archaic and unnecessary power hog opto. Use this instead: https://www.amazon.com/Chanzon-N-Channel-Bipolar-Junction-Transistor/dp/B083TNW1M1/ref=sr_1_1_sspa?th=1 If 1.8R is representative of the RP circuit, which is nearly 3 Amps, then you have to stay with the PMV28XPEAR, a great part for the application. RDS max is 38mR, making power dissipation 3^2 x 0.038= 350 mW which with a max Rtheta,j-a in standard footprint, makes for .350 x 245 K/W= 83oC junction temperature rise. Tjmax of 175oC means your max operating environment is 175-83= 91oC= 200oF, which should be okay, unless it's under a car hood or something like that. Just don't put it near anything that can be damaged by the heat- like the circuit board.
On 12/22/2023 6:53 AM, rhor...@gmail.com wrote:
> Actually, I am fairly sure - but not certain - it will work, and I am a > little less sure it will work well enough. I have included a link to a > schematic of the design below. "Switch 1" is actually a GPIO output pin > from an Arduino, and R5 is actually A Raspberry Pi. The intent is to have > the Arduino shut down the RPi when a certain variable is true and turn it > back on when the variable is false. The default will be for the RPi to be > on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, > which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET.
*Why* do you want to remove power from the rPi? Are you trying to *conserve* power? Ensure a "restart from POST"? Deactivate the rPi regardless of what it may be doing at the time? etc. If trying to conserve power, have you looked at total power consumption when the rPi is running vs. held in reset? If trying to ensure a restart or unconditionally deactivate the rPi, forcing reset can also do the trick. Be sure to consider the case where the Arduino is powering *up* and the GPIO(s) will likely be indeterminate (e.g., external pullup in input mode -- causing your rPi to be OFF until the Arduino can successfully start, set the GPIO to output mode AND drive it low (to enable the rPi). Also, if the rPi is doing something of value, consider any synchronization issues that may be part of the Arduino interaction (e.g., if you just power it on/off, there is no guarantee it will "remember" particular data values correctly; memory and I/O cycles will be "abused")
fredag den 22. december 2023 kl. 19.45.55 UTC+1 skrev Don Y:
> On 12/22/2023 6:53 AM, rhor...@gmail.com wrote: > > Actually, I am fairly sure - but not certain - it will work, and I am a > > little less sure it will work well enough. I have included a link to a > > schematic of the design below. "Switch 1" is actually a GPIO output pin > > from an Arduino, and R5 is actually A Raspberry Pi. The intent is to have > > the Arduino shut down the RPi when a certain variable is true and turn it > > back on when the variable is false. The default will be for the RPi to be > > on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, > > which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET. > *Why* do you want to remove power from the rPi? Are you trying to > *conserve* power? Ensure a "restart from POST"? Deactivate > the rPi regardless of what it may be doing at the time? etc. > > If trying to conserve power, have you looked at total power consumption > when the rPi is running vs. held in reset? > > If trying to ensure a restart or unconditionally deactivate the > rPi, forcing reset can also do the trick. > > Be sure to consider the case where the Arduino is powering *up* > and the GPIO(s) will likely be indeterminate (e.g., external pullup > in input mode -- causing your rPi to be OFF until the Arduino > can successfully start, set the GPIO to output mode AND drive > it low (to enable the rPi). > > Also, if the rPi is doing something of value, consider any > synchronization issues that may be part of the Arduino > interaction (e.g., if you just power it on/off, there is > no guarantee it will "remember" particular data values > correctly; memory and I/O cycles will be "abused")
easy enough with linux on a PI, gpio-shutdown and gpio-poweroff are standard drivers with a gpio you signal to gpio-shutdown to do a shutdown, gpio-poweroff signals via gpio that turning off the power is safe
On 12/22/2023 12:08 PM, Lasse Langwadt Christensen wrote:
> fredag den 22. december 2023 kl. 19.45.55 UTC+1 skrev Don Y: >> On 12/22/2023 6:53 AM, rhor...@gmail.com wrote: >>> Actually, I am fairly sure - but not certain - it will work, and I am a >>> little less sure it will work well enough. I have included a link to a >>> schematic of the design below. "Switch 1" is actually a GPIO output pin >>> from an Arduino, and R5 is actually A Raspberry Pi. The intent is to have >>> the Arduino shut down the RPi when a certain variable is true and turn it >>> back on when the variable is false. The default will be for the RPi to be >>> on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, >>> which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET. >> *Why* do you want to remove power from the rPi? Are you trying to >> *conserve* power? Ensure a "restart from POST"? Deactivate >> the rPi regardless of what it may be doing at the time? etc. >> >> If trying to conserve power, have you looked at total power consumption >> when the rPi is running vs. held in reset? >> >> If trying to ensure a restart or unconditionally deactivate the >> rPi, forcing reset can also do the trick. >> >> Be sure to consider the case where the Arduino is powering *up* >> and the GPIO(s) will likely be indeterminate (e.g., external pullup >> in input mode -- causing your rPi to be OFF until the Arduino >> can successfully start, set the GPIO to output mode AND drive >> it low (to enable the rPi). >> >> Also, if the rPi is doing something of value, consider any >> synchronization issues that may be part of the Arduino >> interaction (e.g., if you just power it on/off, there is >> no guarantee it will "remember" particular data values >> correctly; memory and I/O cycles will be "abused") > > easy enough with linux on a PI, gpio-shutdown and gpio-poweroff are standard drivers > > with a gpio you signal to gpio-shutdown to do a shutdown, gpio-poweroff signals via gpio > that turning off the power is safe
The *Arduino* is the device that is directly controlling the power *to* the rPi. So, unless there is some other mechanism for the Arduino *tell* the rPi (not mentioned or shown in schematic) that it is about to pull the plug on the rPi, the rPi will just find power removed from under it...
fredag den 22. december 2023 kl. 22.20.36 UTC+1 skrev Don Y:
> On 12/22/2023 12:08 PM, Lasse Langwadt Christensen wrote: > > fredag den 22. december 2023 kl. 19.45.55 UTC+1 skrev Don Y: > >> On 12/22/2023 6:53 AM, rhor...@gmail.com wrote: > >>> Actually, I am fairly sure - but not certain - it will work, and I am a > >>> little less sure it will work well enough. I have included a link to a > >>> schematic of the design below. "Switch 1" is actually a GPIO output pin > >>> from an Arduino, and R5 is actually A Raspberry Pi. The intent is to have > >>> the Arduino shut down the RPi when a certain variable is true and turn it > >>> back on when the variable is false. The default will be for the RPi to be > >>> on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, > >>> which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET. > >> *Why* do you want to remove power from the rPi? Are you trying to > >> *conserve* power? Ensure a "restart from POST"? Deactivate > >> the rPi regardless of what it may be doing at the time? etc. > >> > >> If trying to conserve power, have you looked at total power consumption > >> when the rPi is running vs. held in reset? > >> > >> If trying to ensure a restart or unconditionally deactivate the > >> rPi, forcing reset can also do the trick. > >> > >> Be sure to consider the case where the Arduino is powering *up* > >> and the GPIO(s) will likely be indeterminate (e.g., external pullup > >> in input mode -- causing your rPi to be OFF until the Arduino > >> can successfully start, set the GPIO to output mode AND drive > >> it low (to enable the rPi). > >> > >> Also, if the rPi is doing something of value, consider any > >> synchronization issues that may be part of the Arduino > >> interaction (e.g., if you just power it on/off, there is > >> no guarantee it will "remember" particular data values > >> correctly; memory and I/O cycles will be "abused") > > > > easy enough with linux on a PI, gpio-shutdown and gpio-poweroff are standard drivers > > > > with a gpio you signal to gpio-shutdown to do a shutdown, gpio-poweroff signals via gpio > > that turning off the power is safe > The *Arduino* is the device that is directly controlling the power *to* > the rPi. So, unless there is some other mechanism for the Arduino *tell* > the rPi (not mentioned or shown in schematic) that it is about to pull > the plug on the rPi, the rPi will just find power removed from under it...
so you need two gpios and enabling two standard drivers
On 12/22/2023 4:24 PM, Lasse Langwadt Christensen wrote:
> fredag den 22. december 2023 kl. 22.20.36 UTC+1 skrev Don Y: >> On 12/22/2023 12:08 PM, Lasse Langwadt Christensen wrote: >>> fredag den 22. december 2023 kl. 19.45.55 UTC+1 skrev Don Y: >>>> On 12/22/2023 6:53 AM, rhor...@gmail.com wrote: >>>>> Actually, I am fairly sure - but not certain - it will work, and I am a >>>>> little less sure it will work well enough. I have included a link to a >>>>> schematic of the design below. "Switch 1" is actually a GPIO output pin >>>>> from an Arduino, and R5 is actually A Raspberry Pi. The intent is to have >>>>> the Arduino shut down the RPi when a certain variable is true and turn it >>>>> back on when the variable is false. The default will be for the RPi to be >>>>> on until the Arduino's GPIO pin goes high, producing a 3.3V signal at R4, >>>>> which energizes the X5 Optocoupler's LED and turns off the X4 MOSFET. >>>> *Why* do you want to remove power from the rPi? Are you trying to >>>> *conserve* power? Ensure a "restart from POST"? Deactivate >>>> the rPi regardless of what it may be doing at the time? etc. >>>> >>>> If trying to conserve power, have you looked at total power consumption >>>> when the rPi is running vs. held in reset? >>>> >>>> If trying to ensure a restart or unconditionally deactivate the >>>> rPi, forcing reset can also do the trick. >>>> >>>> Be sure to consider the case where the Arduino is powering *up* >>>> and the GPIO(s) will likely be indeterminate (e.g., external pullup >>>> in input mode -- causing your rPi to be OFF until the Arduino >>>> can successfully start, set the GPIO to output mode AND drive >>>> it low (to enable the rPi). >>>> >>>> Also, if the rPi is doing something of value, consider any >>>> synchronization issues that may be part of the Arduino >>>> interaction (e.g., if you just power it on/off, there is >>>> no guarantee it will "remember" particular data values >>>> correctly; memory and I/O cycles will be "abused") >>> >>> easy enough with linux on a PI, gpio-shutdown and gpio-poweroff are standard drivers >>> >>> with a gpio you signal to gpio-shutdown to do a shutdown, gpio-poweroff signals via gpio >>> that turning off the power is safe >> The *Arduino* is the device that is directly controlling the power *to* >> the rPi. So, unless there is some other mechanism for the Arduino *tell* >> the rPi (not mentioned or shown in schematic) that it is about to pull >> the plug on the rPi, the rPi will just find power removed from under it... > > so you need two gpios and enabling two standard drivers
The point is that you (the OP) has to THINK about whether or not the rPi can just be "unceremoniously" powered on/off.
On Friday, December 22, 2023 at 8:40:35&#8239;AM UTC-6, Bill Sloman wrote:
> > http://siliconventures.net/images/Raspberry%20Pi%20Lighting%20HAT%20switch,jpg.JPG > Do you actually need the opto-isolation? The switch would drive an NPN > transistor into saturation when it closed, or a small N-MOSfet. You'd > need a pull-up resistor to +5V to get the voltage swing you want, but > it's much the same circuit with less to go wrong.
I thought of using a transistor, but an NPN transistor or N-FET won't work the way I would prefer. I would have to drive the transistor ON in order to turn on the Raspberry Pi, assuming the collector / source is connected to the gate of the power FET. Connecting the emitter / drain to the gate would produce too much voltage loss, which is what I am trying to avoid. Of course, I could do that by using a bias resistor and then shut-down would be accomplished by taking the GPIO pin low. The only problem there is the GPIO pin is likely to be driven low on startup, or if the Arduino has some sort of failure. I could use two transistors, of course, to switch the polarity, but that also increases complexity, and as I said, the Opto-isolators are free. I would like to use them some time, so why not now? Note I am not married to the idea.