GET https://kbin.spritesserver.nl/u/@Yonrak@feddit.uk/active

Security

Token

There is no security token.

Firewall

main Name
Security enabled
Stateless

Configuration

Key Value
provider security.user.provider.concrete.app_user_provider
context main
entry_point App\Security\KbinAuthenticator
user_checker App\Security\UserChecker
access_denied_handler (none)
access_denied_url (none)
authenticators
[
  "two_factor"
  "remember_me"
  "App\Security\KbinAuthenticator"
  "App\Security\FacebookAuthenticator"
  "App\Security\GoogleAuthenticator"
  "App\Security\GithubAuthenticator"
  "App\Security\KeycloakAuthenticator"
]

Listeners

Listener Duration Response
Symfony\Component\Security\Http\Firewall\ChannelListener {#723
  -map: Symfony\Component\Security\Http\AccessMap {#722 …}
  -logger: Monolog\Logger {#783 …}
  -httpPort: 80
  -httpsPort: 443
}
0.00 ms (none)
Symfony\Component\Security\Http\Firewall\ContextListener {#706
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage {#1017 …}
  -sessionKey: "_security_main"
  -logger: Monolog\Logger {#783 …}
  -userProviders: Symfony\Component\DependencyInjection\Argument\RewindableGenerator {#705 …}
  -dispatcher: Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher {#747 …}
  -registered: false
  -trustResolver: Scheb\TwoFactorBundle\Security\Authentication\AuthenticationTrustResolver {#780 …}
  -sessionTrackerEnabler: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage::enableUsageTracking(): void {#703 …}
}
0.21 ms (none)
Symfony\Component\Security\Http\Firewall\AuthenticatorManagerListener {#584
  -authenticatorManager: Symfony\Component\Security\Http\Authentication\AuthenticatorManager {#595 …}
}
0.00 ms (none)
Scheb\TwoFactorBundle\Security\Http\Firewall\TwoFactorAccessListener {#582
  -twoFactorFirewallConfig: Scheb\TwoFactorBundle\Security\TwoFactor\TwoFactorFirewallConfig {#842 …}
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -twoFactorAccessDecider: Scheb\TwoFactorBundle\Security\Authorization\TwoFactorAccessDecider {#581 …}
}
0.04 ms (none)
Symfony\Component\Security\Http\Firewall\AccessListener {#579
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -accessDecisionManager: Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager {#937 …}
  -map: Symfony\Component\Security\Http\AccessMap {#722 …}
}
0.00 ms (none)
Symfony\Component\Security\Http\Firewall\LogoutListener {#786
  -tokenStorage: Symfony\Component\Security\Core\Authentication\Token\Storage\UsageTrackingTokenStorage {#1018 …}
  -options: [
    "csrf_parameter" => "_csrf_token"
    "csrf_token_id" => "logout"
    "logout_path" => "app_logout"
  ]
  -httpUtils: Symfony\Component\Security\Http\HttpUtils {#841 …}
  -csrfTokenManager: Symfony\Component\Security\Csrf\CsrfTokenManager {#1015 …}
  -eventDispatcher: Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher {#747 …}
}
0.00 ms (none)

Authenticators

No authenticators have been recorded. Check previous profiles on your authentication endpoint.

Access Decision

affirmative Strategy
# Voter class
1
"Symfony\Component\Security\Core\Authorization\Voter\AuthenticatedVoter"
2
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
3
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
4
"Symfony\Component\Security\Core\Authorization\Voter\ExpressionVoter"
5
"App\Security\Voter\EntryCommentVoter"
6
"App\Security\Voter\EntryVoter"
7
"App\Security\Voter\MagazineVoter"
8
"App\Security\Voter\MessageThreadVoter"
9
"App\Security\Voter\MessageVoter"
10
"App\Security\Voter\NotificationVoter"
11
"App\Security\Voter\OAuth2UserConsentVoter"
12
"App\Security\Voter\PostCommentVoter"
13
"App\Security\Voter\PostVoter"
14
"App\Security\Voter\UserVoter"

Access decision log

# Result Attributes Object
1 DENIED ROLE_USER
null
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
ACCESS DENIED
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
2 DENIED moderate
Proxies\__CG__\App\Entity\Entry {#1591
  +user: Proxies\__CG__\App\Entity\User {#2459 …}
  +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
  +image: null
  +domain: Proxies\__CG__\App\Entity\Domain {#1630 …}
  +slug: "How-to-improve-my-battery-measurement-circuit"
  +title: "How to improve my battery measurement circuit?"
  +url: null
  +body: """
    I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is.\n
    \n
    My first idea was to use a simple voltage divider:\n
    \n
    ![](https://discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)\n
    \n
    I’ve chosen the resistor values so that:\n
    \n
    - the voltage at the measure output is `< 1.1V`, to be able to use the 1.1V internal reference of the atmega’s ADC\n
    - `R1 || R2 < 10kΩ`, since the atmega datasheet says “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”\n
    \n
    This is great and all, but what bothers me is that this circuit will constantly draw ~100µA from the battery.\n
    \n
    So, my next thought was to add a mosfet to the divider, to switch it on only while measuring:\n
    \n
    ![](https://discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)\n
    \n
    This is obviously bad, because now when the mosfet is off, the ADC input sees the whole battery voltage.\n
    \n
    To address that issue, I’ve added a second mosfet into the measure path:\n
    \n
    ![](https://discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)\n
    \n
    This works, and it does not draw any current, except while measuring.\n
    \n
    However, it’s quite a few parts. So I’m curious if anyone has an idea how to do this with just a single mosfet. It seems to me like it should be possible, but I haven’t figured out how.\n
    \n
    Oh, and if I’m doing something stupid here, please tell me :)
    """
  +type: "article"
  +lang: "en"
  +isOc: false
  +hasEmbed: false
  +commentCount: 11
  +favouriteCount: 17
  +score: 0
  +isAdult: false
  +sticky: false
  +lastActive: DateTime @1694781042 {#1715
    date: 2023-09-15 14:30:42.0 +02:00
  }
  +ip: null
  +adaAmount: 0
  +tags: null
  +mentions: null
  +comments: Doctrine\ORM\PersistentCollection {#1629 …}
  +votes: Doctrine\ORM\PersistentCollection {#1626 …}
  +reports: Doctrine\ORM\PersistentCollection {#1625 …}
  +favourites: Doctrine\ORM\PersistentCollection {#2370 …}
  +notifications: Doctrine\ORM\PersistentCollection {#2371 …}
  +badges: Doctrine\ORM\PersistentCollection {#1708 …}
  +children: [
    1 => App\Entity\EntryComment {#1549
      +user: App\Entity\User {#265 …}
      +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
      +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
      +image: null
      +parent: Proxies\__CG__\App\Entity\EntryComment {#1692 …}
      +root: App\Entity\EntryComment {#1709
        +user: App\Entity\User {#265 …}
        +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
        +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
        +image: null
        +parent: null
        +root: null
        +body: """
          Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?\n
          \n
          Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
          \n
          Switch it with an NFET\n
          \n
          The micro will see 0V or divided/clamped battery voltage on the measurement pin.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 3
        +score: 0
        +lastActive: DateTime @1692955883 {#1439
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#1579 …}
        +nested: Doctrine\ORM\PersistentCollection {#1577 …}
        +votes: Doctrine\ORM\PersistentCollection {#1578 …}
        +reports: Doctrine\ORM\PersistentCollection {#1571 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1574 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1667 …}
        -id: 26779
        -bodyTs: "'0v':70,117 '2':7 'add':30,62 'also':76 'anoth':63 'batteri':22,120 'clamp':100 'control':67 'could':1 'current':89 'default':45 'diagram':6 'diod':94 'divid':29,105 'divided/clamped':119 'ensur':39 'fet':14,19,41 'first':24 'gate':32,51 'higher':84 'instead':9,95,103 'limit':72,88 'll':58 'measur':56,124 'micro':48,114 'much':82,83 'n':13 'n-fet':12 'need':60 'nfet':112 'p':18 'p-fet':17 'pin':68,125 'potenti':28 'probabl':59 'pull':33,49 'realli':87 'resistor':25,35,64,98 'robust':107 'second':97 'see':116 'similar':4 'sourc':37 'switch':108 'take':54 'two':79 'use':15,91 'valu':85 'voltag':74,102,121 'zener/tvs':93"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://feddit.uk/comment/2185380"
        +editedAt: DateTimeImmutable @1692969047 {#1435
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#1436
          date: 2023-08-25 10:03:15.0 +02:00
        }
        +"title": 26779
      }
      +body: """
        > Not sure I understand this point. Which resistor would you replace with a diode?\n
        \n
        Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).\n
        \n
        Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).\n
        \n
        The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.\n
        \n
        I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692955881 {#1673
        date: 2023-08-25 11:31:21.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#1691 …}
      +nested: Doctrine\ORM\PersistentCollection {#1680 …}
      +votes: Doctrine\ORM\PersistentCollection {#1683 …}
      +reports: Doctrine\ORM\PersistentCollection {#1702 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1596 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1613 …}
      -id: 26782
      -bodyTs: "'3':137 'abl':122 'actual':42 'best':103 'comment':107 'control':48,66,124 'diod':14,109 'divid':143 'drive':92 'due':73 'either':133 'end':57,118 'exist':135 'fet':41,70,83,126,149 'gate':76 'go':154 'head':26 'high':61,87 'isn':100 'like':45 'll':34,44 'micro':97 'microcontrol':114 'n':148 'n-fet':147 'need':46 'nfet':53 'nonesens':21 'option':136 'otherwis':54 'p':40 'p-fet':39 'pfet':50,139 'pin':67,115 'point':6 'practic':104 'protect':112 'pullup':77 'push/pull':94 'realli':102 'replac':11 'resistor':8 'sorri':15 'still':56 'sure':2,32 'switch':144 'talk':20 'think':17,132 'threshold':89 'understand':4 'unless':78 'upstream':140 'use':81 'vgs':88 'via':145 'voltag':63 'way':130,152 'woke':29 'work':35 'would':9"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://feddit.uk/comment/2186641"
      +editedAt: DateTimeImmutable @1692956099 {#1560
        date: 2023-08-25 11:34:59.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692955881 {#1568
        date: 2023-08-25 11:31:21.0 +02:00
      }
      +"title": 26782
    }
    0 => App\Entity\EntryComment {#1709}
  ]
  -id: 1944
  -titleTs: "'batteri':5 'circuit':7 'improv':3 'measur':6"
  -bodyTs: "'/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':152 '/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':188 '/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':53 '1.1':69,77 '10':107 '100µa':127 '10kω':88 '5v':5 '9v':12 'abl':73 'ad':178 'adc':85,95,165 'add':137 'address':173 'analog':99 'anyon':213 'approxim':106 'arduino':7 'atmega':83,91 'atmega328p':9 'bad':156 'batteri':28,130,170 'block':13 'bother':118 'buck':16 'chosen':56 'circuit':123 'clone':8 'constant':125 'convert':17 'curious':211 'current':197 'datasheet':92 'discuss.tchncs.de':52,151,187 'discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':150 'discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':186 'discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':51 'divid':50,142 'draw':126,195 'except':198 'figur':239 'first':42 'full':38 'get':33 'great':113 'haven':237 'howev':201 'idea':35,43,216 'imped':104 'input':166 'intern':79 'issu':175 'kω':108 'less':110 'let':22 'like':230 'm':210,246 'measur':26,66,149,184,200 'microcontrol':6,24 'mosfet':139,161,181,225 'next':133 'obvious':155 'occasion':25 'oh':242 'optim':97 'output':67,103 'part':207 'path':185 'pleas':251 'possibl':234 'power':3 'quit':204 'r1':86 'r2':87 'refer':80 'resistor':58 'say':93 'second':180 'see':167 'seem':227 'signal':100 'simpl':48 'sinc':89 'singl':224 'someth':248 'stupid':249 'switch':144 'tell':252 'thought':134 'use':10,46,75 'v':70,78 'valu':59 've':55,177 'voltag':29,49,63,171 'want':20 'whole':169 'work':190"
  +cross: false
  +upVotes: 0
  +downVotes: 0
  +ranking: 1693029637
  +visibility: "visible             "
  +apId: "https://discuss.tchncs.de/post/2309537"
  +editedAt: DateTimeImmutable @1692947232 {#1693
    date: 2023-08-25 09:07:12.0 +02:00
  }
  +createdAt: DateTimeImmutable @1692947137 {#1740
    date: 2023-08-25 09:05:37.0 +02:00
  }
  +__isInitialized__: true
   …2
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS DENIED
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
3 DENIED edit
Proxies\__CG__\App\Entity\Entry {#1591
  +user: Proxies\__CG__\App\Entity\User {#2459 …}
  +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
  +image: null
  +domain: Proxies\__CG__\App\Entity\Domain {#1630 …}
  +slug: "How-to-improve-my-battery-measurement-circuit"
  +title: "How to improve my battery measurement circuit?"
  +url: null
  +body: """
    I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is.\n
    \n
    My first idea was to use a simple voltage divider:\n
    \n
    ![](https://discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)\n
    \n
    I’ve chosen the resistor values so that:\n
    \n
    - the voltage at the measure output is `< 1.1V`, to be able to use the 1.1V internal reference of the atmega’s ADC\n
    - `R1 || R2 < 10kΩ`, since the atmega datasheet says “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”\n
    \n
    This is great and all, but what bothers me is that this circuit will constantly draw ~100µA from the battery.\n
    \n
    So, my next thought was to add a mosfet to the divider, to switch it on only while measuring:\n
    \n
    ![](https://discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)\n
    \n
    This is obviously bad, because now when the mosfet is off, the ADC input sees the whole battery voltage.\n
    \n
    To address that issue, I’ve added a second mosfet into the measure path:\n
    \n
    ![](https://discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)\n
    \n
    This works, and it does not draw any current, except while measuring.\n
    \n
    However, it’s quite a few parts. So I’m curious if anyone has an idea how to do this with just a single mosfet. It seems to me like it should be possible, but I haven’t figured out how.\n
    \n
    Oh, and if I’m doing something stupid here, please tell me :)
    """
  +type: "article"
  +lang: "en"
  +isOc: false
  +hasEmbed: false
  +commentCount: 11
  +favouriteCount: 17
  +score: 0
  +isAdult: false
  +sticky: false
  +lastActive: DateTime @1694781042 {#1715
    date: 2023-09-15 14:30:42.0 +02:00
  }
  +ip: null
  +adaAmount: 0
  +tags: null
  +mentions: null
  +comments: Doctrine\ORM\PersistentCollection {#1629 …}
  +votes: Doctrine\ORM\PersistentCollection {#1626 …}
  +reports: Doctrine\ORM\PersistentCollection {#1625 …}
  +favourites: Doctrine\ORM\PersistentCollection {#2370 …}
  +notifications: Doctrine\ORM\PersistentCollection {#2371 …}
  +badges: Doctrine\ORM\PersistentCollection {#1708 …}
  +children: [
    1 => App\Entity\EntryComment {#1549
      +user: App\Entity\User {#265 …}
      +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
      +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
      +image: null
      +parent: Proxies\__CG__\App\Entity\EntryComment {#1692 …}
      +root: App\Entity\EntryComment {#1709
        +user: App\Entity\User {#265 …}
        +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
        +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
        +image: null
        +parent: null
        +root: null
        +body: """
          Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?\n
          \n
          Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
          \n
          Switch it with an NFET\n
          \n
          The micro will see 0V or divided/clamped battery voltage on the measurement pin.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 3
        +score: 0
        +lastActive: DateTime @1692955883 {#1439
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#1579 …}
        +nested: Doctrine\ORM\PersistentCollection {#1577 …}
        +votes: Doctrine\ORM\PersistentCollection {#1578 …}
        +reports: Doctrine\ORM\PersistentCollection {#1571 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1574 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1667 …}
        -id: 26779
        -bodyTs: "'0v':70,117 '2':7 'add':30,62 'also':76 'anoth':63 'batteri':22,120 'clamp':100 'control':67 'could':1 'current':89 'default':45 'diagram':6 'diod':94 'divid':29,105 'divided/clamped':119 'ensur':39 'fet':14,19,41 'first':24 'gate':32,51 'higher':84 'instead':9,95,103 'limit':72,88 'll':58 'measur':56,124 'micro':48,114 'much':82,83 'n':13 'n-fet':12 'need':60 'nfet':112 'p':18 'p-fet':17 'pin':68,125 'potenti':28 'probabl':59 'pull':33,49 'realli':87 'resistor':25,35,64,98 'robust':107 'second':97 'see':116 'similar':4 'sourc':37 'switch':108 'take':54 'two':79 'use':15,91 'valu':85 'voltag':74,102,121 'zener/tvs':93"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://feddit.uk/comment/2185380"
        +editedAt: DateTimeImmutable @1692969047 {#1435
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#1436
          date: 2023-08-25 10:03:15.0 +02:00
        }
        +"title": 26779
      }
      +body: """
        > Not sure I understand this point. Which resistor would you replace with a diode?\n
        \n
        Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).\n
        \n
        Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).\n
        \n
        The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.\n
        \n
        I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692955881 {#1673
        date: 2023-08-25 11:31:21.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#1691 …}
      +nested: Doctrine\ORM\PersistentCollection {#1680 …}
      +votes: Doctrine\ORM\PersistentCollection {#1683 …}
      +reports: Doctrine\ORM\PersistentCollection {#1702 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1596 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1613 …}
      -id: 26782
      -bodyTs: "'3':137 'abl':122 'actual':42 'best':103 'comment':107 'control':48,66,124 'diod':14,109 'divid':143 'drive':92 'due':73 'either':133 'end':57,118 'exist':135 'fet':41,70,83,126,149 'gate':76 'go':154 'head':26 'high':61,87 'isn':100 'like':45 'll':34,44 'micro':97 'microcontrol':114 'n':148 'n-fet':147 'need':46 'nfet':53 'nonesens':21 'option':136 'otherwis':54 'p':40 'p-fet':39 'pfet':50,139 'pin':67,115 'point':6 'practic':104 'protect':112 'pullup':77 'push/pull':94 'realli':102 'replac':11 'resistor':8 'sorri':15 'still':56 'sure':2,32 'switch':144 'talk':20 'think':17,132 'threshold':89 'understand':4 'unless':78 'upstream':140 'use':81 'vgs':88 'via':145 'voltag':63 'way':130,152 'woke':29 'work':35 'would':9"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://feddit.uk/comment/2186641"
      +editedAt: DateTimeImmutable @1692956099 {#1560
        date: 2023-08-25 11:34:59.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692955881 {#1568
        date: 2023-08-25 11:31:21.0 +02:00
      }
      +"title": 26782
    }
    0 => App\Entity\EntryComment {#1709}
  ]
  -id: 1944
  -titleTs: "'batteri':5 'circuit':7 'improv':3 'measur':6"
  -bodyTs: "'/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':152 '/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':188 '/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':53 '1.1':69,77 '10':107 '100µa':127 '10kω':88 '5v':5 '9v':12 'abl':73 'ad':178 'adc':85,95,165 'add':137 'address':173 'analog':99 'anyon':213 'approxim':106 'arduino':7 'atmega':83,91 'atmega328p':9 'bad':156 'batteri':28,130,170 'block':13 'bother':118 'buck':16 'chosen':56 'circuit':123 'clone':8 'constant':125 'convert':17 'curious':211 'current':197 'datasheet':92 'discuss.tchncs.de':52,151,187 'discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':150 'discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':186 'discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':51 'divid':50,142 'draw':126,195 'except':198 'figur':239 'first':42 'full':38 'get':33 'great':113 'haven':237 'howev':201 'idea':35,43,216 'imped':104 'input':166 'intern':79 'issu':175 'kω':108 'less':110 'let':22 'like':230 'm':210,246 'measur':26,66,149,184,200 'microcontrol':6,24 'mosfet':139,161,181,225 'next':133 'obvious':155 'occasion':25 'oh':242 'optim':97 'output':67,103 'part':207 'path':185 'pleas':251 'possibl':234 'power':3 'quit':204 'r1':86 'r2':87 'refer':80 'resistor':58 'say':93 'second':180 'see':167 'seem':227 'signal':100 'simpl':48 'sinc':89 'singl':224 'someth':248 'stupid':249 'switch':144 'tell':252 'thought':134 'use':10,46,75 'v':70,78 'valu':59 've':55,177 'voltag':29,49,63,171 'want':20 'whole':169 'work':190"
  +cross: false
  +upVotes: 0
  +downVotes: 0
  +ranking: 1693029637
  +visibility: "visible             "
  +apId: "https://discuss.tchncs.de/post/2309537"
  +editedAt: DateTimeImmutable @1692947232 {#1693
    date: 2023-08-25 09:07:12.0 +02:00
  }
  +createdAt: DateTimeImmutable @1692947137 {#1740
    date: 2023-08-25 09:05:37.0 +02:00
  }
  +__isInitialized__: true
   …2
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS DENIED
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
4 DENIED moderate
Proxies\__CG__\App\Entity\Entry {#1591
  +user: Proxies\__CG__\App\Entity\User {#2459 …}
  +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
  +image: null
  +domain: Proxies\__CG__\App\Entity\Domain {#1630 …}
  +slug: "How-to-improve-my-battery-measurement-circuit"
  +title: "How to improve my battery measurement circuit?"
  +url: null
  +body: """
    I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is.\n
    \n
    My first idea was to use a simple voltage divider:\n
    \n
    ![](https://discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)\n
    \n
    I’ve chosen the resistor values so that:\n
    \n
    - the voltage at the measure output is `< 1.1V`, to be able to use the 1.1V internal reference of the atmega’s ADC\n
    - `R1 || R2 < 10kΩ`, since the atmega datasheet says “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”\n
    \n
    This is great and all, but what bothers me is that this circuit will constantly draw ~100µA from the battery.\n
    \n
    So, my next thought was to add a mosfet to the divider, to switch it on only while measuring:\n
    \n
    ![](https://discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)\n
    \n
    This is obviously bad, because now when the mosfet is off, the ADC input sees the whole battery voltage.\n
    \n
    To address that issue, I’ve added a second mosfet into the measure path:\n
    \n
    ![](https://discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)\n
    \n
    This works, and it does not draw any current, except while measuring.\n
    \n
    However, it’s quite a few parts. So I’m curious if anyone has an idea how to do this with just a single mosfet. It seems to me like it should be possible, but I haven’t figured out how.\n
    \n
    Oh, and if I’m doing something stupid here, please tell me :)
    """
  +type: "article"
  +lang: "en"
  +isOc: false
  +hasEmbed: false
  +commentCount: 11
  +favouriteCount: 17
  +score: 0
  +isAdult: false
  +sticky: false
  +lastActive: DateTime @1694781042 {#1715
    date: 2023-09-15 14:30:42.0 +02:00
  }
  +ip: null
  +adaAmount: 0
  +tags: null
  +mentions: null
  +comments: Doctrine\ORM\PersistentCollection {#1629 …}
  +votes: Doctrine\ORM\PersistentCollection {#1626 …}
  +reports: Doctrine\ORM\PersistentCollection {#1625 …}
  +favourites: Doctrine\ORM\PersistentCollection {#2370 …}
  +notifications: Doctrine\ORM\PersistentCollection {#2371 …}
  +badges: Doctrine\ORM\PersistentCollection {#1708 …}
  +children: [
    1 => App\Entity\EntryComment {#1549
      +user: App\Entity\User {#265 …}
      +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
      +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
      +image: null
      +parent: Proxies\__CG__\App\Entity\EntryComment {#1692 …}
      +root: App\Entity\EntryComment {#1709
        +user: App\Entity\User {#265 …}
        +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
        +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
        +image: null
        +parent: null
        +root: null
        +body: """
          Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?\n
          \n
          Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
          \n
          Switch it with an NFET\n
          \n
          The micro will see 0V or divided/clamped battery voltage on the measurement pin.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 3
        +score: 0
        +lastActive: DateTime @1692955883 {#1439
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#1579 …}
        +nested: Doctrine\ORM\PersistentCollection {#1577 …}
        +votes: Doctrine\ORM\PersistentCollection {#1578 …}
        +reports: Doctrine\ORM\PersistentCollection {#1571 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1574 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1667 …}
        -id: 26779
        -bodyTs: "'0v':70,117 '2':7 'add':30,62 'also':76 'anoth':63 'batteri':22,120 'clamp':100 'control':67 'could':1 'current':89 'default':45 'diagram':6 'diod':94 'divid':29,105 'divided/clamped':119 'ensur':39 'fet':14,19,41 'first':24 'gate':32,51 'higher':84 'instead':9,95,103 'limit':72,88 'll':58 'measur':56,124 'micro':48,114 'much':82,83 'n':13 'n-fet':12 'need':60 'nfet':112 'p':18 'p-fet':17 'pin':68,125 'potenti':28 'probabl':59 'pull':33,49 'realli':87 'resistor':25,35,64,98 'robust':107 'second':97 'see':116 'similar':4 'sourc':37 'switch':108 'take':54 'two':79 'use':15,91 'valu':85 'voltag':74,102,121 'zener/tvs':93"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://feddit.uk/comment/2185380"
        +editedAt: DateTimeImmutable @1692969047 {#1435
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#1436
          date: 2023-08-25 10:03:15.0 +02:00
        }
        +"title": 26779
      }
      +body: """
        > Not sure I understand this point. Which resistor would you replace with a diode?\n
        \n
        Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).\n
        \n
        Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).\n
        \n
        The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.\n
        \n
        I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692955881 {#1673
        date: 2023-08-25 11:31:21.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#1691 …}
      +nested: Doctrine\ORM\PersistentCollection {#1680 …}
      +votes: Doctrine\ORM\PersistentCollection {#1683 …}
      +reports: Doctrine\ORM\PersistentCollection {#1702 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1596 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1613 …}
      -id: 26782
      -bodyTs: "'3':137 'abl':122 'actual':42 'best':103 'comment':107 'control':48,66,124 'diod':14,109 'divid':143 'drive':92 'due':73 'either':133 'end':57,118 'exist':135 'fet':41,70,83,126,149 'gate':76 'go':154 'head':26 'high':61,87 'isn':100 'like':45 'll':34,44 'micro':97 'microcontrol':114 'n':148 'n-fet':147 'need':46 'nfet':53 'nonesens':21 'option':136 'otherwis':54 'p':40 'p-fet':39 'pfet':50,139 'pin':67,115 'point':6 'practic':104 'protect':112 'pullup':77 'push/pull':94 'realli':102 'replac':11 'resistor':8 'sorri':15 'still':56 'sure':2,32 'switch':144 'talk':20 'think':17,132 'threshold':89 'understand':4 'unless':78 'upstream':140 'use':81 'vgs':88 'via':145 'voltag':63 'way':130,152 'woke':29 'work':35 'would':9"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://feddit.uk/comment/2186641"
      +editedAt: DateTimeImmutable @1692956099 {#1560
        date: 2023-08-25 11:34:59.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692955881 {#1568
        date: 2023-08-25 11:31:21.0 +02:00
      }
      +"title": 26782
    }
    0 => App\Entity\EntryComment {#1709}
  ]
  -id: 1944
  -titleTs: "'batteri':5 'circuit':7 'improv':3 'measur':6"
  -bodyTs: "'/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':152 '/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':188 '/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':53 '1.1':69,77 '10':107 '100µa':127 '10kω':88 '5v':5 '9v':12 'abl':73 'ad':178 'adc':85,95,165 'add':137 'address':173 'analog':99 'anyon':213 'approxim':106 'arduino':7 'atmega':83,91 'atmega328p':9 'bad':156 'batteri':28,130,170 'block':13 'bother':118 'buck':16 'chosen':56 'circuit':123 'clone':8 'constant':125 'convert':17 'curious':211 'current':197 'datasheet':92 'discuss.tchncs.de':52,151,187 'discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':150 'discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':186 'discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':51 'divid':50,142 'draw':126,195 'except':198 'figur':239 'first':42 'full':38 'get':33 'great':113 'haven':237 'howev':201 'idea':35,43,216 'imped':104 'input':166 'intern':79 'issu':175 'kω':108 'less':110 'let':22 'like':230 'm':210,246 'measur':26,66,149,184,200 'microcontrol':6,24 'mosfet':139,161,181,225 'next':133 'obvious':155 'occasion':25 'oh':242 'optim':97 'output':67,103 'part':207 'path':185 'pleas':251 'possibl':234 'power':3 'quit':204 'r1':86 'r2':87 'refer':80 'resistor':58 'say':93 'second':180 'see':167 'seem':227 'signal':100 'simpl':48 'sinc':89 'singl':224 'someth':248 'stupid':249 'switch':144 'tell':252 'thought':134 'use':10,46,75 'v':70,78 'valu':59 've':55,177 'voltag':29,49,63,171 'want':20 'whole':169 'work':190"
  +cross: false
  +upVotes: 0
  +downVotes: 0
  +ranking: 1693029637
  +visibility: "visible             "
  +apId: "https://discuss.tchncs.de/post/2309537"
  +editedAt: DateTimeImmutable @1692947232 {#1693
    date: 2023-08-25 09:07:12.0 +02:00
  }
  +createdAt: DateTimeImmutable @1692947137 {#1740
    date: 2023-08-25 09:05:37.0 +02:00
  }
  +__isInitialized__: true
   …2
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS DENIED
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
5 DENIED ROLE_USER
null
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
ACCESS DENIED
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
6 DENIED moderate
App\Entity\EntryComment {#1549
  +user: App\Entity\User {#265 …}
  +entry: Proxies\__CG__\App\Entity\Entry {#1591
    +user: Proxies\__CG__\App\Entity\User {#2459 …}
    +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1630 …}
    +slug: "How-to-improve-my-battery-measurement-circuit"
    +title: "How to improve my battery measurement circuit?"
    +url: null
    +body: """
      I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is.\n
      \n
      My first idea was to use a simple voltage divider:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)\n
      \n
      I’ve chosen the resistor values so that:\n
      \n
      - the voltage at the measure output is `< 1.1V`, to be able to use the 1.1V internal reference of the atmega’s ADC\n
      - `R1 || R2 < 10kΩ`, since the atmega datasheet says “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”\n
      \n
      This is great and all, but what bothers me is that this circuit will constantly draw ~100µA from the battery.\n
      \n
      So, my next thought was to add a mosfet to the divider, to switch it on only while measuring:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)\n
      \n
      This is obviously bad, because now when the mosfet is off, the ADC input sees the whole battery voltage.\n
      \n
      To address that issue, I’ve added a second mosfet into the measure path:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)\n
      \n
      This works, and it does not draw any current, except while measuring.\n
      \n
      However, it’s quite a few parts. So I’m curious if anyone has an idea how to do this with just a single mosfet. It seems to me like it should be possible, but I haven’t figured out how.\n
      \n
      Oh, and if I’m doing something stupid here, please tell me :)
      """
    +type: "article"
    +lang: "en"
    +isOc: false
    +hasEmbed: false
    +commentCount: 11
    +favouriteCount: 17
    +score: 0
    +isAdult: false
    +sticky: false
    +lastActive: DateTime @1694781042 {#1715
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1629 …}
    +votes: Doctrine\ORM\PersistentCollection {#1626 …}
    +reports: Doctrine\ORM\PersistentCollection {#1625 …}
    +favourites: Doctrine\ORM\PersistentCollection {#2370 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2371 …}
    +badges: Doctrine\ORM\PersistentCollection {#1708 …}
    +children: [
      1 => App\Entity\EntryComment {#1549}
      0 => App\Entity\EntryComment {#1709
        +user: App\Entity\User {#265 …}
        +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
        +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
        +image: null
        +parent: null
        +root: null
        +body: """
          Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?\n
          \n
          Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
          \n
          Switch it with an NFET\n
          \n
          The micro will see 0V or divided/clamped battery voltage on the measurement pin.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 3
        +score: 0
        +lastActive: DateTime @1692955883 {#1439
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#1579 …}
        +nested: Doctrine\ORM\PersistentCollection {#1577 …}
        +votes: Doctrine\ORM\PersistentCollection {#1578 …}
        +reports: Doctrine\ORM\PersistentCollection {#1571 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1574 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1667 …}
        -id: 26779
        -bodyTs: "'0v':70,117 '2':7 'add':30,62 'also':76 'anoth':63 'batteri':22,120 'clamp':100 'control':67 'could':1 'current':89 'default':45 'diagram':6 'diod':94 'divid':29,105 'divided/clamped':119 'ensur':39 'fet':14,19,41 'first':24 'gate':32,51 'higher':84 'instead':9,95,103 'limit':72,88 'll':58 'measur':56,124 'micro':48,114 'much':82,83 'n':13 'n-fet':12 'need':60 'nfet':112 'p':18 'p-fet':17 'pin':68,125 'potenti':28 'probabl':59 'pull':33,49 'realli':87 'resistor':25,35,64,98 'robust':107 'second':97 'see':116 'similar':4 'sourc':37 'switch':108 'take':54 'two':79 'use':15,91 'valu':85 'voltag':74,102,121 'zener/tvs':93"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://feddit.uk/comment/2185380"
        +editedAt: DateTimeImmutable @1692969047 {#1435
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#1436
          date: 2023-08-25 10:03:15.0 +02:00
        }
        +"title": 26779
      }
    ]
    -id: 1944
    -titleTs: "'batteri':5 'circuit':7 'improv':3 'measur':6"
    -bodyTs: "'/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':152 '/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':188 '/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':53 '1.1':69,77 '10':107 '100µa':127 '10kω':88 '5v':5 '9v':12 'abl':73 'ad':178 'adc':85,95,165 'add':137 'address':173 'analog':99 'anyon':213 'approxim':106 'arduino':7 'atmega':83,91 'atmega328p':9 'bad':156 'batteri':28,130,170 'block':13 'bother':118 'buck':16 'chosen':56 'circuit':123 'clone':8 'constant':125 'convert':17 'curious':211 'current':197 'datasheet':92 'discuss.tchncs.de':52,151,187 'discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':150 'discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':186 'discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':51 'divid':50,142 'draw':126,195 'except':198 'figur':239 'first':42 'full':38 'get':33 'great':113 'haven':237 'howev':201 'idea':35,43,216 'imped':104 'input':166 'intern':79 'issu':175 'kω':108 'less':110 'let':22 'like':230 'm':210,246 'measur':26,66,149,184,200 'microcontrol':6,24 'mosfet':139,161,181,225 'next':133 'obvious':155 'occasion':25 'oh':242 'optim':97 'output':67,103 'part':207 'path':185 'pleas':251 'possibl':234 'power':3 'quit':204 'r1':86 'r2':87 'refer':80 'resistor':58 'say':93 'second':180 'see':167 'seem':227 'signal':100 'simpl':48 'sinc':89 'singl':224 'someth':248 'stupid':249 'switch':144 'tell':252 'thought':134 'use':10,46,75 'v':70,78 'valu':59 've':55,177 'voltag':29,49,63,171 'want':20 'whole':169 'work':190"
    +cross: false
    +upVotes: 0
    +downVotes: 0
    +ranking: 1693029637
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/post/2309537"
    +editedAt: DateTimeImmutable @1692947232 {#1693
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#1740
      date: 2023-08-25 09:05:37.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
  +image: null
  +parent: Proxies\__CG__\App\Entity\EntryComment {#1692 …}
  +root: App\Entity\EntryComment {#1709}
  +body: """
    > Not sure I understand this point. Which resistor would you replace with a diode?\n
    \n
    Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).\n
    \n
    Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).\n
    \n
    The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.\n
    \n
    I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 2
  +score: 0
  +lastActive: DateTime @1692955881 {#1673
    date: 2023-08-25 11:31:21.0 +02:00
  }
  +ip: null
  +tags: null
  +mentions: [
    "@nilclass@discuss.tchncs.de"
    "@Yonrak@feddit.uk"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1691 …}
  +nested: Doctrine\ORM\PersistentCollection {#1680 …}
  +votes: Doctrine\ORM\PersistentCollection {#1683 …}
  +reports: Doctrine\ORM\PersistentCollection {#1702 …}
  +favourites: Doctrine\ORM\PersistentCollection {#1596 …}
  +notifications: Doctrine\ORM\PersistentCollection {#1613 …}
  -id: 26782
  -bodyTs: "'3':137 'abl':122 'actual':42 'best':103 'comment':107 'control':48,66,124 'diod':14,109 'divid':143 'drive':92 'due':73 'either':133 'end':57,118 'exist':135 'fet':41,70,83,126,149 'gate':76 'go':154 'head':26 'high':61,87 'isn':100 'like':45 'll':34,44 'micro':97 'microcontrol':114 'n':148 'n-fet':147 'need':46 'nfet':53 'nonesens':21 'option':136 'otherwis':54 'p':40 'p-fet':39 'pfet':50,139 'pin':67,115 'point':6 'practic':104 'protect':112 'pullup':77 'push/pull':94 'realli':102 'replac':11 'resistor':8 'sorri':15 'still':56 'sure':2,32 'switch':144 'talk':20 'think':17,132 'threshold':89 'understand':4 'unless':78 'upstream':140 'use':81 'vgs':88 'via':145 'voltag':63 'way':130,152 'woke':29 'work':35 'would':9"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://feddit.uk/comment/2186641"
  +editedAt: DateTimeImmutable @1692956099 {#1560
    date: 2023-08-25 11:34:59.0 +02:00
  }
  +createdAt: DateTimeImmutable @1692955881 {#1568
    date: 2023-08-25 11:31:21.0 +02:00
  }
  +"title": 26782
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
7 DENIED edit
App\Entity\EntryComment {#1549
  +user: App\Entity\User {#265 …}
  +entry: Proxies\__CG__\App\Entity\Entry {#1591
    +user: Proxies\__CG__\App\Entity\User {#2459 …}
    +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1630 …}
    +slug: "How-to-improve-my-battery-measurement-circuit"
    +title: "How to improve my battery measurement circuit?"
    +url: null
    +body: """
      I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is.\n
      \n
      My first idea was to use a simple voltage divider:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)\n
      \n
      I’ve chosen the resistor values so that:\n
      \n
      - the voltage at the measure output is `< 1.1V`, to be able to use the 1.1V internal reference of the atmega’s ADC\n
      - `R1 || R2 < 10kΩ`, since the atmega datasheet says “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”\n
      \n
      This is great and all, but what bothers me is that this circuit will constantly draw ~100µA from the battery.\n
      \n
      So, my next thought was to add a mosfet to the divider, to switch it on only while measuring:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)\n
      \n
      This is obviously bad, because now when the mosfet is off, the ADC input sees the whole battery voltage.\n
      \n
      To address that issue, I’ve added a second mosfet into the measure path:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)\n
      \n
      This works, and it does not draw any current, except while measuring.\n
      \n
      However, it’s quite a few parts. So I’m curious if anyone has an idea how to do this with just a single mosfet. It seems to me like it should be possible, but I haven’t figured out how.\n
      \n
      Oh, and if I’m doing something stupid here, please tell me :)
      """
    +type: "article"
    +lang: "en"
    +isOc: false
    +hasEmbed: false
    +commentCount: 11
    +favouriteCount: 17
    +score: 0
    +isAdult: false
    +sticky: false
    +lastActive: DateTime @1694781042 {#1715
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1629 …}
    +votes: Doctrine\ORM\PersistentCollection {#1626 …}
    +reports: Doctrine\ORM\PersistentCollection {#1625 …}
    +favourites: Doctrine\ORM\PersistentCollection {#2370 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2371 …}
    +badges: Doctrine\ORM\PersistentCollection {#1708 …}
    +children: [
      1 => App\Entity\EntryComment {#1549}
      0 => App\Entity\EntryComment {#1709
        +user: App\Entity\User {#265 …}
        +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
        +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
        +image: null
        +parent: null
        +root: null
        +body: """
          Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?\n
          \n
          Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
          \n
          Switch it with an NFET\n
          \n
          The micro will see 0V or divided/clamped battery voltage on the measurement pin.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 3
        +score: 0
        +lastActive: DateTime @1692955883 {#1439
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#1579 …}
        +nested: Doctrine\ORM\PersistentCollection {#1577 …}
        +votes: Doctrine\ORM\PersistentCollection {#1578 …}
        +reports: Doctrine\ORM\PersistentCollection {#1571 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1574 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1667 …}
        -id: 26779
        -bodyTs: "'0v':70,117 '2':7 'add':30,62 'also':76 'anoth':63 'batteri':22,120 'clamp':100 'control':67 'could':1 'current':89 'default':45 'diagram':6 'diod':94 'divid':29,105 'divided/clamped':119 'ensur':39 'fet':14,19,41 'first':24 'gate':32,51 'higher':84 'instead':9,95,103 'limit':72,88 'll':58 'measur':56,124 'micro':48,114 'much':82,83 'n':13 'n-fet':12 'need':60 'nfet':112 'p':18 'p-fet':17 'pin':68,125 'potenti':28 'probabl':59 'pull':33,49 'realli':87 'resistor':25,35,64,98 'robust':107 'second':97 'see':116 'similar':4 'sourc':37 'switch':108 'take':54 'two':79 'use':15,91 'valu':85 'voltag':74,102,121 'zener/tvs':93"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://feddit.uk/comment/2185380"
        +editedAt: DateTimeImmutable @1692969047 {#1435
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#1436
          date: 2023-08-25 10:03:15.0 +02:00
        }
        +"title": 26779
      }
    ]
    -id: 1944
    -titleTs: "'batteri':5 'circuit':7 'improv':3 'measur':6"
    -bodyTs: "'/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':152 '/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':188 '/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':53 '1.1':69,77 '10':107 '100µa':127 '10kω':88 '5v':5 '9v':12 'abl':73 'ad':178 'adc':85,95,165 'add':137 'address':173 'analog':99 'anyon':213 'approxim':106 'arduino':7 'atmega':83,91 'atmega328p':9 'bad':156 'batteri':28,130,170 'block':13 'bother':118 'buck':16 'chosen':56 'circuit':123 'clone':8 'constant':125 'convert':17 'curious':211 'current':197 'datasheet':92 'discuss.tchncs.de':52,151,187 'discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':150 'discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':186 'discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':51 'divid':50,142 'draw':126,195 'except':198 'figur':239 'first':42 'full':38 'get':33 'great':113 'haven':237 'howev':201 'idea':35,43,216 'imped':104 'input':166 'intern':79 'issu':175 'kω':108 'less':110 'let':22 'like':230 'm':210,246 'measur':26,66,149,184,200 'microcontrol':6,24 'mosfet':139,161,181,225 'next':133 'obvious':155 'occasion':25 'oh':242 'optim':97 'output':67,103 'part':207 'path':185 'pleas':251 'possibl':234 'power':3 'quit':204 'r1':86 'r2':87 'refer':80 'resistor':58 'say':93 'second':180 'see':167 'seem':227 'signal':100 'simpl':48 'sinc':89 'singl':224 'someth':248 'stupid':249 'switch':144 'tell':252 'thought':134 'use':10,46,75 'v':70,78 'valu':59 've':55,177 'voltag':29,49,63,171 'want':20 'whole':169 'work':190"
    +cross: false
    +upVotes: 0
    +downVotes: 0
    +ranking: 1693029637
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/post/2309537"
    +editedAt: DateTimeImmutable @1692947232 {#1693
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#1740
      date: 2023-08-25 09:05:37.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
  +image: null
  +parent: Proxies\__CG__\App\Entity\EntryComment {#1692 …}
  +root: App\Entity\EntryComment {#1709}
  +body: """
    > Not sure I understand this point. Which resistor would you replace with a diode?\n
    \n
    Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).\n
    \n
    Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).\n
    \n
    The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.\n
    \n
    I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 2
  +score: 0
  +lastActive: DateTime @1692955881 {#1673
    date: 2023-08-25 11:31:21.0 +02:00
  }
  +ip: null
  +tags: null
  +mentions: [
    "@nilclass@discuss.tchncs.de"
    "@Yonrak@feddit.uk"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1691 …}
  +nested: Doctrine\ORM\PersistentCollection {#1680 …}
  +votes: Doctrine\ORM\PersistentCollection {#1683 …}
  +reports: Doctrine\ORM\PersistentCollection {#1702 …}
  +favourites: Doctrine\ORM\PersistentCollection {#1596 …}
  +notifications: Doctrine\ORM\PersistentCollection {#1613 …}
  -id: 26782
  -bodyTs: "'3':137 'abl':122 'actual':42 'best':103 'comment':107 'control':48,66,124 'diod':14,109 'divid':143 'drive':92 'due':73 'either':133 'end':57,118 'exist':135 'fet':41,70,83,126,149 'gate':76 'go':154 'head':26 'high':61,87 'isn':100 'like':45 'll':34,44 'micro':97 'microcontrol':114 'n':148 'n-fet':147 'need':46 'nfet':53 'nonesens':21 'option':136 'otherwis':54 'p':40 'p-fet':39 'pfet':50,139 'pin':67,115 'point':6 'practic':104 'protect':112 'pullup':77 'push/pull':94 'realli':102 'replac':11 'resistor':8 'sorri':15 'still':56 'sure':2,32 'switch':144 'talk':20 'think':17,132 'threshold':89 'understand':4 'unless':78 'upstream':140 'use':81 'vgs':88 'via':145 'voltag':63 'way':130,152 'woke':29 'work':35 'would':9"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://feddit.uk/comment/2186641"
  +editedAt: DateTimeImmutable @1692956099 {#1560
    date: 2023-08-25 11:34:59.0 +02:00
  }
  +createdAt: DateTimeImmutable @1692955881 {#1568
    date: 2023-08-25 11:31:21.0 +02:00
  }
  +"title": 26782
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
8 DENIED moderate
App\Entity\EntryComment {#1549
  +user: App\Entity\User {#265 …}
  +entry: Proxies\__CG__\App\Entity\Entry {#1591
    +user: Proxies\__CG__\App\Entity\User {#2459 …}
    +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1630 …}
    +slug: "How-to-improve-my-battery-measurement-circuit"
    +title: "How to improve my battery measurement circuit?"
    +url: null
    +body: """
      I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is.\n
      \n
      My first idea was to use a simple voltage divider:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)\n
      \n
      I’ve chosen the resistor values so that:\n
      \n
      - the voltage at the measure output is `< 1.1V`, to be able to use the 1.1V internal reference of the atmega’s ADC\n
      - `R1 || R2 < 10kΩ`, since the atmega datasheet says “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”\n
      \n
      This is great and all, but what bothers me is that this circuit will constantly draw ~100µA from the battery.\n
      \n
      So, my next thought was to add a mosfet to the divider, to switch it on only while measuring:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)\n
      \n
      This is obviously bad, because now when the mosfet is off, the ADC input sees the whole battery voltage.\n
      \n
      To address that issue, I’ve added a second mosfet into the measure path:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)\n
      \n
      This works, and it does not draw any current, except while measuring.\n
      \n
      However, it’s quite a few parts. So I’m curious if anyone has an idea how to do this with just a single mosfet. It seems to me like it should be possible, but I haven’t figured out how.\n
      \n
      Oh, and if I’m doing something stupid here, please tell me :)
      """
    +type: "article"
    +lang: "en"
    +isOc: false
    +hasEmbed: false
    +commentCount: 11
    +favouriteCount: 17
    +score: 0
    +isAdult: false
    +sticky: false
    +lastActive: DateTime @1694781042 {#1715
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1629 …}
    +votes: Doctrine\ORM\PersistentCollection {#1626 …}
    +reports: Doctrine\ORM\PersistentCollection {#1625 …}
    +favourites: Doctrine\ORM\PersistentCollection {#2370 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2371 …}
    +badges: Doctrine\ORM\PersistentCollection {#1708 …}
    +children: [
      1 => App\Entity\EntryComment {#1549}
      0 => App\Entity\EntryComment {#1709
        +user: App\Entity\User {#265 …}
        +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
        +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
        +image: null
        +parent: null
        +root: null
        +body: """
          Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?\n
          \n
          Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
          \n
          Switch it with an NFET\n
          \n
          The micro will see 0V or divided/clamped battery voltage on the measurement pin.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 3
        +score: 0
        +lastActive: DateTime @1692955883 {#1439
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#1579 …}
        +nested: Doctrine\ORM\PersistentCollection {#1577 …}
        +votes: Doctrine\ORM\PersistentCollection {#1578 …}
        +reports: Doctrine\ORM\PersistentCollection {#1571 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1574 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1667 …}
        -id: 26779
        -bodyTs: "'0v':70,117 '2':7 'add':30,62 'also':76 'anoth':63 'batteri':22,120 'clamp':100 'control':67 'could':1 'current':89 'default':45 'diagram':6 'diod':94 'divid':29,105 'divided/clamped':119 'ensur':39 'fet':14,19,41 'first':24 'gate':32,51 'higher':84 'instead':9,95,103 'limit':72,88 'll':58 'measur':56,124 'micro':48,114 'much':82,83 'n':13 'n-fet':12 'need':60 'nfet':112 'p':18 'p-fet':17 'pin':68,125 'potenti':28 'probabl':59 'pull':33,49 'realli':87 'resistor':25,35,64,98 'robust':107 'second':97 'see':116 'similar':4 'sourc':37 'switch':108 'take':54 'two':79 'use':15,91 'valu':85 'voltag':74,102,121 'zener/tvs':93"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://feddit.uk/comment/2185380"
        +editedAt: DateTimeImmutable @1692969047 {#1435
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#1436
          date: 2023-08-25 10:03:15.0 +02:00
        }
        +"title": 26779
      }
    ]
    -id: 1944
    -titleTs: "'batteri':5 'circuit':7 'improv':3 'measur':6"
    -bodyTs: "'/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':152 '/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':188 '/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':53 '1.1':69,77 '10':107 '100µa':127 '10kω':88 '5v':5 '9v':12 'abl':73 'ad':178 'adc':85,95,165 'add':137 'address':173 'analog':99 'anyon':213 'approxim':106 'arduino':7 'atmega':83,91 'atmega328p':9 'bad':156 'batteri':28,130,170 'block':13 'bother':118 'buck':16 'chosen':56 'circuit':123 'clone':8 'constant':125 'convert':17 'curious':211 'current':197 'datasheet':92 'discuss.tchncs.de':52,151,187 'discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':150 'discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':186 'discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':51 'divid':50,142 'draw':126,195 'except':198 'figur':239 'first':42 'full':38 'get':33 'great':113 'haven':237 'howev':201 'idea':35,43,216 'imped':104 'input':166 'intern':79 'issu':175 'kω':108 'less':110 'let':22 'like':230 'm':210,246 'measur':26,66,149,184,200 'microcontrol':6,24 'mosfet':139,161,181,225 'next':133 'obvious':155 'occasion':25 'oh':242 'optim':97 'output':67,103 'part':207 'path':185 'pleas':251 'possibl':234 'power':3 'quit':204 'r1':86 'r2':87 'refer':80 'resistor':58 'say':93 'second':180 'see':167 'seem':227 'signal':100 'simpl':48 'sinc':89 'singl':224 'someth':248 'stupid':249 'switch':144 'tell':252 'thought':134 'use':10,46,75 'v':70,78 'valu':59 've':55,177 'voltag':29,49,63,171 'want':20 'whole':169 'work':190"
    +cross: false
    +upVotes: 0
    +downVotes: 0
    +ranking: 1693029637
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/post/2309537"
    +editedAt: DateTimeImmutable @1692947232 {#1693
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#1740
      date: 2023-08-25 09:05:37.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
  +image: null
  +parent: Proxies\__CG__\App\Entity\EntryComment {#1692 …}
  +root: App\Entity\EntryComment {#1709}
  +body: """
    > Not sure I understand this point. Which resistor would you replace with a diode?\n
    \n
    Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).\n
    \n
    Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).\n
    \n
    The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.\n
    \n
    I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 2
  +score: 0
  +lastActive: DateTime @1692955881 {#1673
    date: 2023-08-25 11:31:21.0 +02:00
  }
  +ip: null
  +tags: null
  +mentions: [
    "@nilclass@discuss.tchncs.de"
    "@Yonrak@feddit.uk"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1691 …}
  +nested: Doctrine\ORM\PersistentCollection {#1680 …}
  +votes: Doctrine\ORM\PersistentCollection {#1683 …}
  +reports: Doctrine\ORM\PersistentCollection {#1702 …}
  +favourites: Doctrine\ORM\PersistentCollection {#1596 …}
  +notifications: Doctrine\ORM\PersistentCollection {#1613 …}
  -id: 26782
  -bodyTs: "'3':137 'abl':122 'actual':42 'best':103 'comment':107 'control':48,66,124 'diod':14,109 'divid':143 'drive':92 'due':73 'either':133 'end':57,118 'exist':135 'fet':41,70,83,126,149 'gate':76 'go':154 'head':26 'high':61,87 'isn':100 'like':45 'll':34,44 'micro':97 'microcontrol':114 'n':148 'n-fet':147 'need':46 'nfet':53 'nonesens':21 'option':136 'otherwis':54 'p':40 'p-fet':39 'pfet':50,139 'pin':67,115 'point':6 'practic':104 'protect':112 'pullup':77 'push/pull':94 'realli':102 'replac':11 'resistor':8 'sorri':15 'still':56 'sure':2,32 'switch':144 'talk':20 'think':17,132 'threshold':89 'understand':4 'unless':78 'upstream':140 'use':81 'vgs':88 'via':145 'voltag':63 'way':130,152 'woke':29 'work':35 'would':9"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://feddit.uk/comment/2186641"
  +editedAt: DateTimeImmutable @1692956099 {#1560
    date: 2023-08-25 11:34:59.0 +02:00
  }
  +createdAt: DateTimeImmutable @1692955881 {#1568
    date: 2023-08-25 11:31:21.0 +02:00
  }
  +"title": 26782
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
9 DENIED ROLE_USER
null
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
ACCESS DENIED
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
10 DENIED moderate
App\Entity\EntryComment {#1709
  +user: App\Entity\User {#265 …}
  +entry: Proxies\__CG__\App\Entity\Entry {#1591
    +user: Proxies\__CG__\App\Entity\User {#2459 …}
    +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1630 …}
    +slug: "How-to-improve-my-battery-measurement-circuit"
    +title: "How to improve my battery measurement circuit?"
    +url: null
    +body: """
      I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is.\n
      \n
      My first idea was to use a simple voltage divider:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)\n
      \n
      I’ve chosen the resistor values so that:\n
      \n
      - the voltage at the measure output is `< 1.1V`, to be able to use the 1.1V internal reference of the atmega’s ADC\n
      - `R1 || R2 < 10kΩ`, since the atmega datasheet says “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”\n
      \n
      This is great and all, but what bothers me is that this circuit will constantly draw ~100µA from the battery.\n
      \n
      So, my next thought was to add a mosfet to the divider, to switch it on only while measuring:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)\n
      \n
      This is obviously bad, because now when the mosfet is off, the ADC input sees the whole battery voltage.\n
      \n
      To address that issue, I’ve added a second mosfet into the measure path:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)\n
      \n
      This works, and it does not draw any current, except while measuring.\n
      \n
      However, it’s quite a few parts. So I’m curious if anyone has an idea how to do this with just a single mosfet. It seems to me like it should be possible, but I haven’t figured out how.\n
      \n
      Oh, and if I’m doing something stupid here, please tell me :)
      """
    +type: "article"
    +lang: "en"
    +isOc: false
    +hasEmbed: false
    +commentCount: 11
    +favouriteCount: 17
    +score: 0
    +isAdult: false
    +sticky: false
    +lastActive: DateTime @1694781042 {#1715
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1629 …}
    +votes: Doctrine\ORM\PersistentCollection {#1626 …}
    +reports: Doctrine\ORM\PersistentCollection {#1625 …}
    +favourites: Doctrine\ORM\PersistentCollection {#2370 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2371 …}
    +badges: Doctrine\ORM\PersistentCollection {#1708 …}
    +children: [
      1 => App\Entity\EntryComment {#1549
        +user: App\Entity\User {#265 …}
        +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
        +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
        +image: null
        +parent: Proxies\__CG__\App\Entity\EntryComment {#1692 …}
        +root: App\Entity\EntryComment {#1709}
        +body: """
          > Not sure I understand this point. Which resistor would you replace with a diode?\n
          \n
          Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).\n
          \n
          Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).\n
          \n
          The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.\n
          \n
          I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1692955881 {#1673
          date: 2023-08-25 11:31:21.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@Yonrak@feddit.uk"
        ]
        +children: Doctrine\ORM\PersistentCollection {#1691 …}
        +nested: Doctrine\ORM\PersistentCollection {#1680 …}
        +votes: Doctrine\ORM\PersistentCollection {#1683 …}
        +reports: Doctrine\ORM\PersistentCollection {#1702 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1596 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1613 …}
        -id: 26782
        -bodyTs: "'3':137 'abl':122 'actual':42 'best':103 'comment':107 'control':48,66,124 'diod':14,109 'divid':143 'drive':92 'due':73 'either':133 'end':57,118 'exist':135 'fet':41,70,83,126,149 'gate':76 'go':154 'head':26 'high':61,87 'isn':100 'like':45 'll':34,44 'micro':97 'microcontrol':114 'n':148 'n-fet':147 'need':46 'nfet':53 'nonesens':21 'option':136 'otherwis':54 'p':40 'p-fet':39 'pfet':50,139 'pin':67,115 'point':6 'practic':104 'protect':112 'pullup':77 'push/pull':94 'realli':102 'replac':11 'resistor':8 'sorri':15 'still':56 'sure':2,32 'switch':144 'talk':20 'think':17,132 'threshold':89 'understand':4 'unless':78 'upstream':140 'use':81 'vgs':88 'via':145 'voltag':63 'way':130,152 'woke':29 'work':35 'would':9"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://feddit.uk/comment/2186641"
        +editedAt: DateTimeImmutable @1692956099 {#1560
          date: 2023-08-25 11:34:59.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692955881 {#1568
          date: 2023-08-25 11:31:21.0 +02:00
        }
        +"title": 26782
      }
      0 => App\Entity\EntryComment {#1709}
    ]
    -id: 1944
    -titleTs: "'batteri':5 'circuit':7 'improv':3 'measur':6"
    -bodyTs: "'/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':152 '/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':188 '/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':53 '1.1':69,77 '10':107 '100µa':127 '10kω':88 '5v':5 '9v':12 'abl':73 'ad':178 'adc':85,95,165 'add':137 'address':173 'analog':99 'anyon':213 'approxim':106 'arduino':7 'atmega':83,91 'atmega328p':9 'bad':156 'batteri':28,130,170 'block':13 'bother':118 'buck':16 'chosen':56 'circuit':123 'clone':8 'constant':125 'convert':17 'curious':211 'current':197 'datasheet':92 'discuss.tchncs.de':52,151,187 'discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':150 'discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':186 'discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':51 'divid':50,142 'draw':126,195 'except':198 'figur':239 'first':42 'full':38 'get':33 'great':113 'haven':237 'howev':201 'idea':35,43,216 'imped':104 'input':166 'intern':79 'issu':175 'kω':108 'less':110 'let':22 'like':230 'm':210,246 'measur':26,66,149,184,200 'microcontrol':6,24 'mosfet':139,161,181,225 'next':133 'obvious':155 'occasion':25 'oh':242 'optim':97 'output':67,103 'part':207 'path':185 'pleas':251 'possibl':234 'power':3 'quit':204 'r1':86 'r2':87 'refer':80 'resistor':58 'say':93 'second':180 'see':167 'seem':227 'signal':100 'simpl':48 'sinc':89 'singl':224 'someth':248 'stupid':249 'switch':144 'tell':252 'thought':134 'use':10,46,75 'v':70,78 'valu':59 've':55,177 'voltag':29,49,63,171 'want':20 'whole':169 'work':190"
    +cross: false
    +upVotes: 0
    +downVotes: 0
    +ranking: 1693029637
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/post/2309537"
    +editedAt: DateTimeImmutable @1692947232 {#1693
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#1740
      date: 2023-08-25 09:05:37.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
  +image: null
  +parent: null
  +root: null
  +body: """
    Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?\n
    \n
    Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
    \n
    Switch it with an NFET\n
    \n
    The micro will see 0V or divided/clamped battery voltage on the measurement pin.
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 3
  +score: 0
  +lastActive: DateTime @1692955883 {#1439
    date: 2023-08-25 11:31:23.0 +02:00
  }
  +ip: null
  +tags: null
  +mentions: [
    "@nilclass@discuss.tchncs.de"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1579 …}
  +nested: Doctrine\ORM\PersistentCollection {#1577 …}
  +votes: Doctrine\ORM\PersistentCollection {#1578 …}
  +reports: Doctrine\ORM\PersistentCollection {#1571 …}
  +favourites: Doctrine\ORM\PersistentCollection {#1574 …}
  +notifications: Doctrine\ORM\PersistentCollection {#1667 …}
  -id: 26779
  -bodyTs: "'0v':70,117 '2':7 'add':30,62 'also':76 'anoth':63 'batteri':22,120 'clamp':100 'control':67 'could':1 'current':89 'default':45 'diagram':6 'diod':94 'divid':29,105 'divided/clamped':119 'ensur':39 'fet':14,19,41 'first':24 'gate':32,51 'higher':84 'instead':9,95,103 'limit':72,88 'll':58 'measur':56,124 'micro':48,114 'much':82,83 'n':13 'n-fet':12 'need':60 'nfet':112 'p':18 'p-fet':17 'pin':68,125 'potenti':28 'probabl':59 'pull':33,49 'realli':87 'resistor':25,35,64,98 'robust':107 'second':97 'see':116 'similar':4 'sourc':37 'switch':108 'take':54 'two':79 'use':15,91 'valu':85 'voltag':74,102,121 'zener/tvs':93"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://feddit.uk/comment/2185380"
  +editedAt: DateTimeImmutable @1692969047 {#1435
    date: 2023-08-25 15:10:47.0 +02:00
  }
  +createdAt: DateTimeImmutable @1692950595 {#1436
    date: 2023-08-25 10:03:15.0 +02:00
  }
  +"title": 26779
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
11 DENIED edit
App\Entity\EntryComment {#1709
  +user: App\Entity\User {#265 …}
  +entry: Proxies\__CG__\App\Entity\Entry {#1591
    +user: Proxies\__CG__\App\Entity\User {#2459 …}
    +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1630 …}
    +slug: "How-to-improve-my-battery-measurement-circuit"
    +title: "How to improve my battery measurement circuit?"
    +url: null
    +body: """
      I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is.\n
      \n
      My first idea was to use a simple voltage divider:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)\n
      \n
      I’ve chosen the resistor values so that:\n
      \n
      - the voltage at the measure output is `< 1.1V`, to be able to use the 1.1V internal reference of the atmega’s ADC\n
      - `R1 || R2 < 10kΩ`, since the atmega datasheet says “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”\n
      \n
      This is great and all, but what bothers me is that this circuit will constantly draw ~100µA from the battery.\n
      \n
      So, my next thought was to add a mosfet to the divider, to switch it on only while measuring:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)\n
      \n
      This is obviously bad, because now when the mosfet is off, the ADC input sees the whole battery voltage.\n
      \n
      To address that issue, I’ve added a second mosfet into the measure path:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)\n
      \n
      This works, and it does not draw any current, except while measuring.\n
      \n
      However, it’s quite a few parts. So I’m curious if anyone has an idea how to do this with just a single mosfet. It seems to me like it should be possible, but I haven’t figured out how.\n
      \n
      Oh, and if I’m doing something stupid here, please tell me :)
      """
    +type: "article"
    +lang: "en"
    +isOc: false
    +hasEmbed: false
    +commentCount: 11
    +favouriteCount: 17
    +score: 0
    +isAdult: false
    +sticky: false
    +lastActive: DateTime @1694781042 {#1715
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1629 …}
    +votes: Doctrine\ORM\PersistentCollection {#1626 …}
    +reports: Doctrine\ORM\PersistentCollection {#1625 …}
    +favourites: Doctrine\ORM\PersistentCollection {#2370 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2371 …}
    +badges: Doctrine\ORM\PersistentCollection {#1708 …}
    +children: [
      1 => App\Entity\EntryComment {#1549
        +user: App\Entity\User {#265 …}
        +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
        +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
        +image: null
        +parent: Proxies\__CG__\App\Entity\EntryComment {#1692 …}
        +root: App\Entity\EntryComment {#1709}
        +body: """
          > Not sure I understand this point. Which resistor would you replace with a diode?\n
          \n
          Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).\n
          \n
          Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).\n
          \n
          The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.\n
          \n
          I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1692955881 {#1673
          date: 2023-08-25 11:31:21.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@Yonrak@feddit.uk"
        ]
        +children: Doctrine\ORM\PersistentCollection {#1691 …}
        +nested: Doctrine\ORM\PersistentCollection {#1680 …}
        +votes: Doctrine\ORM\PersistentCollection {#1683 …}
        +reports: Doctrine\ORM\PersistentCollection {#1702 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1596 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1613 …}
        -id: 26782
        -bodyTs: "'3':137 'abl':122 'actual':42 'best':103 'comment':107 'control':48,66,124 'diod':14,109 'divid':143 'drive':92 'due':73 'either':133 'end':57,118 'exist':135 'fet':41,70,83,126,149 'gate':76 'go':154 'head':26 'high':61,87 'isn':100 'like':45 'll':34,44 'micro':97 'microcontrol':114 'n':148 'n-fet':147 'need':46 'nfet':53 'nonesens':21 'option':136 'otherwis':54 'p':40 'p-fet':39 'pfet':50,139 'pin':67,115 'point':6 'practic':104 'protect':112 'pullup':77 'push/pull':94 'realli':102 'replac':11 'resistor':8 'sorri':15 'still':56 'sure':2,32 'switch':144 'talk':20 'think':17,132 'threshold':89 'understand':4 'unless':78 'upstream':140 'use':81 'vgs':88 'via':145 'voltag':63 'way':130,152 'woke':29 'work':35 'would':9"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://feddit.uk/comment/2186641"
        +editedAt: DateTimeImmutable @1692956099 {#1560
          date: 2023-08-25 11:34:59.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692955881 {#1568
          date: 2023-08-25 11:31:21.0 +02:00
        }
        +"title": 26782
      }
      0 => App\Entity\EntryComment {#1709}
    ]
    -id: 1944
    -titleTs: "'batteri':5 'circuit':7 'improv':3 'measur':6"
    -bodyTs: "'/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':152 '/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':188 '/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':53 '1.1':69,77 '10':107 '100µa':127 '10kω':88 '5v':5 '9v':12 'abl':73 'ad':178 'adc':85,95,165 'add':137 'address':173 'analog':99 'anyon':213 'approxim':106 'arduino':7 'atmega':83,91 'atmega328p':9 'bad':156 'batteri':28,130,170 'block':13 'bother':118 'buck':16 'chosen':56 'circuit':123 'clone':8 'constant':125 'convert':17 'curious':211 'current':197 'datasheet':92 'discuss.tchncs.de':52,151,187 'discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':150 'discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':186 'discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':51 'divid':50,142 'draw':126,195 'except':198 'figur':239 'first':42 'full':38 'get':33 'great':113 'haven':237 'howev':201 'idea':35,43,216 'imped':104 'input':166 'intern':79 'issu':175 'kω':108 'less':110 'let':22 'like':230 'm':210,246 'measur':26,66,149,184,200 'microcontrol':6,24 'mosfet':139,161,181,225 'next':133 'obvious':155 'occasion':25 'oh':242 'optim':97 'output':67,103 'part':207 'path':185 'pleas':251 'possibl':234 'power':3 'quit':204 'r1':86 'r2':87 'refer':80 'resistor':58 'say':93 'second':180 'see':167 'seem':227 'signal':100 'simpl':48 'sinc':89 'singl':224 'someth':248 'stupid':249 'switch':144 'tell':252 'thought':134 'use':10,46,75 'v':70,78 'valu':59 've':55,177 'voltag':29,49,63,171 'want':20 'whole':169 'work':190"
    +cross: false
    +upVotes: 0
    +downVotes: 0
    +ranking: 1693029637
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/post/2309537"
    +editedAt: DateTimeImmutable @1692947232 {#1693
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#1740
      date: 2023-08-25 09:05:37.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
  +image: null
  +parent: null
  +root: null
  +body: """
    Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?\n
    \n
    Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
    \n
    Switch it with an NFET\n
    \n
    The micro will see 0V or divided/clamped battery voltage on the measurement pin.
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 3
  +score: 0
  +lastActive: DateTime @1692955883 {#1439
    date: 2023-08-25 11:31:23.0 +02:00
  }
  +ip: null
  +tags: null
  +mentions: [
    "@nilclass@discuss.tchncs.de"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1579 …}
  +nested: Doctrine\ORM\PersistentCollection {#1577 …}
  +votes: Doctrine\ORM\PersistentCollection {#1578 …}
  +reports: Doctrine\ORM\PersistentCollection {#1571 …}
  +favourites: Doctrine\ORM\PersistentCollection {#1574 …}
  +notifications: Doctrine\ORM\PersistentCollection {#1667 …}
  -id: 26779
  -bodyTs: "'0v':70,117 '2':7 'add':30,62 'also':76 'anoth':63 'batteri':22,120 'clamp':100 'control':67 'could':1 'current':89 'default':45 'diagram':6 'diod':94 'divid':29,105 'divided/clamped':119 'ensur':39 'fet':14,19,41 'first':24 'gate':32,51 'higher':84 'instead':9,95,103 'limit':72,88 'll':58 'measur':56,124 'micro':48,114 'much':82,83 'n':13 'n-fet':12 'need':60 'nfet':112 'p':18 'p-fet':17 'pin':68,125 'potenti':28 'probabl':59 'pull':33,49 'realli':87 'resistor':25,35,64,98 'robust':107 'second':97 'see':116 'similar':4 'sourc':37 'switch':108 'take':54 'two':79 'use':15,91 'valu':85 'voltag':74,102,121 'zener/tvs':93"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://feddit.uk/comment/2185380"
  +editedAt: DateTimeImmutable @1692969047 {#1435
    date: 2023-08-25 15:10:47.0 +02:00
  }
  +createdAt: DateTimeImmutable @1692950595 {#1436
    date: 2023-08-25 10:03:15.0 +02:00
  }
  +"title": 26779
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
12 DENIED moderate
App\Entity\EntryComment {#1709
  +user: App\Entity\User {#265 …}
  +entry: Proxies\__CG__\App\Entity\Entry {#1591
    +user: Proxies\__CG__\App\Entity\User {#2459 …}
    +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1630 …}
    +slug: "How-to-improve-my-battery-measurement-circuit"
    +title: "How to improve my battery measurement circuit?"
    +url: null
    +body: """
      I am powering a 5V microcontroller (arduino clone, atmega328p) using a 9V block and a buck converter. Now I want to let the microcontroller occasionally measure the battery voltage, so I can get an idea of how full it is.\n
      \n
      My first idea was to use a simple voltage divider:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)\n
      \n
      I’ve chosen the resistor values so that:\n
      \n
      - the voltage at the measure output is `< 1.1V`, to be able to use the 1.1V internal reference of the atmega’s ADC\n
      - `R1 || R2 < 10kΩ`, since the atmega datasheet says “The ADC is optimized for analog signals with an output impedance of approximately 10 kΩ or less”\n
      \n
      This is great and all, but what bothers me is that this circuit will constantly draw ~100µA from the battery.\n
      \n
      So, my next thought was to add a mosfet to the divider, to switch it on only while measuring:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)\n
      \n
      This is obviously bad, because now when the mosfet is off, the ADC input sees the whole battery voltage.\n
      \n
      To address that issue, I’ve added a second mosfet into the measure path:\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)\n
      \n
      This works, and it does not draw any current, except while measuring.\n
      \n
      However, it’s quite a few parts. So I’m curious if anyone has an idea how to do this with just a single mosfet. It seems to me like it should be possible, but I haven’t figured out how.\n
      \n
      Oh, and if I’m doing something stupid here, please tell me :)
      """
    +type: "article"
    +lang: "en"
    +isOc: false
    +hasEmbed: false
    +commentCount: 11
    +favouriteCount: 17
    +score: 0
    +isAdult: false
    +sticky: false
    +lastActive: DateTime @1694781042 {#1715
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1629 …}
    +votes: Doctrine\ORM\PersistentCollection {#1626 …}
    +reports: Doctrine\ORM\PersistentCollection {#1625 …}
    +favourites: Doctrine\ORM\PersistentCollection {#2370 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2371 …}
    +badges: Doctrine\ORM\PersistentCollection {#1708 …}
    +children: [
      1 => App\Entity\EntryComment {#1549
        +user: App\Entity\User {#265 …}
        +entry: Proxies\__CG__\App\Entity\Entry {#1591 …2}
        +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
        +image: null
        +parent: Proxies\__CG__\App\Entity\EntryComment {#1692 …}
        +root: App\Entity\EntryComment {#1709}
        +body: """
          > Not sure I understand this point. Which resistor would you replace with a diode?\n
          \n
          Sorry, I think I was talking nonesense (doing this in my head and just woke up 😅).\n
          \n
          Not sure it’ll work with just a P-FET actually. You’ll likely need to control the PFET with a NFET, otherwise you still end up with too high a voltage on your control pin when the FET is off due to the gate pullup (unless you can use a fet with a very high Vgs Threshold and then drive it push/pull from the micro, but this isn’t really best practice).\n
          \n
          The above comment about diodes was to protect the microcontroller pin, but you end up not being able to control the FET doing it that way.\n
          \n
          I think either your existing Option 3 or PFET upstream of the divider, switched via an N-FET is the way to go.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1692955881 {#1673
          date: 2023-08-25 11:31:21.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@Yonrak@feddit.uk"
        ]
        +children: Doctrine\ORM\PersistentCollection {#1691 …}
        +nested: Doctrine\ORM\PersistentCollection {#1680 …}
        +votes: Doctrine\ORM\PersistentCollection {#1683 …}
        +reports: Doctrine\ORM\PersistentCollection {#1702 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1596 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1613 …}
        -id: 26782
        -bodyTs: "'3':137 'abl':122 'actual':42 'best':103 'comment':107 'control':48,66,124 'diod':14,109 'divid':143 'drive':92 'due':73 'either':133 'end':57,118 'exist':135 'fet':41,70,83,126,149 'gate':76 'go':154 'head':26 'high':61,87 'isn':100 'like':45 'll':34,44 'micro':97 'microcontrol':114 'n':148 'n-fet':147 'need':46 'nfet':53 'nonesens':21 'option':136 'otherwis':54 'p':40 'p-fet':39 'pfet':50,139 'pin':67,115 'point':6 'practic':104 'protect':112 'pullup':77 'push/pull':94 'realli':102 'replac':11 'resistor':8 'sorri':15 'still':56 'sure':2,32 'switch':144 'talk':20 'think':17,132 'threshold':89 'understand':4 'unless':78 'upstream':140 'use':81 'vgs':88 'via':145 'voltag':63 'way':130,152 'woke':29 'work':35 'would':9"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://feddit.uk/comment/2186641"
        +editedAt: DateTimeImmutable @1692956099 {#1560
          date: 2023-08-25 11:34:59.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692955881 {#1568
          date: 2023-08-25 11:31:21.0 +02:00
        }
        +"title": 26782
      }
      0 => App\Entity\EntryComment {#1709}
    ]
    -id: 1944
    -titleTs: "'batteri':5 'circuit':7 'improv':3 'measur':6"
    -bodyTs: "'/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':152 '/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':188 '/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':53 '1.1':69,77 '10':107 '100µa':127 '10kω':88 '5v':5 '9v':12 'abl':73 'ad':178 'adc':85,95,165 'add':137 'address':173 'analog':99 'anyon':213 'approxim':106 'arduino':7 'atmega':83,91 'atmega328p':9 'bad':156 'batteri':28,130,170 'block':13 'bother':118 'buck':16 'chosen':56 'circuit':123 'clone':8 'constant':125 'convert':17 'curious':211 'current':197 'datasheet':92 'discuss.tchncs.de':52,151,187 'discuss.tchncs.de/pictrs/image/450dc371-58d0-4eb0-8f3b-4e76bf676bf4.png)':150 'discuss.tchncs.de/pictrs/image/970e3840-fcbb-46dd-92fb-8903b89149a0.png)':186 'discuss.tchncs.de/pictrs/image/9d173f1d-8412-4129-8ae1-c549a7895107.png)':51 'divid':50,142 'draw':126,195 'except':198 'figur':239 'first':42 'full':38 'get':33 'great':113 'haven':237 'howev':201 'idea':35,43,216 'imped':104 'input':166 'intern':79 'issu':175 'kω':108 'less':110 'let':22 'like':230 'm':210,246 'measur':26,66,149,184,200 'microcontrol':6,24 'mosfet':139,161,181,225 'next':133 'obvious':155 'occasion':25 'oh':242 'optim':97 'output':67,103 'part':207 'path':185 'pleas':251 'possibl':234 'power':3 'quit':204 'r1':86 'r2':87 'refer':80 'resistor':58 'say':93 'second':180 'see':167 'seem':227 'signal':100 'simpl':48 'sinc':89 'singl':224 'someth':248 'stupid':249 'switch':144 'tell':252 'thought':134 'use':10,46,75 'v':70,78 'valu':59 've':55,177 'voltag':29,49,63,171 'want':20 'whole':169 'work':190"
    +cross: false
    +upVotes: 0
    +downVotes: 0
    +ranking: 1693029637
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/post/2309537"
    +editedAt: DateTimeImmutable @1692947232 {#1693
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#1740
      date: 2023-08-25 09:05:37.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +magazine: Proxies\__CG__\App\Entity\Magazine {#1584 …}
  +image: null
  +parent: null
  +root: null
  +body: """
    Could you do similar to diagram 2, but instead of an N-FET use a P-FET between the battery and first resistor in the potential divider?\n
    \n
    Add a gate pull up resistor to source to ensure the FET is off by default, have the micro pull the gate down to take a measurement. You’ll probably need to add another resistor on the control pin to 0V to limit the voltage there also, but those two can be much much higher values to really limit current. Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
    \n
    Switch it with an NFET\n
    \n
    The micro will see 0V or divided/clamped battery voltage on the measurement pin.
    """
  +lang: "en"
  +isAdult: false
  +favouriteCount: 3
  +score: 0
  +lastActive: DateTime @1692955883 {#1439
    date: 2023-08-25 11:31:23.0 +02:00
  }
  +ip: null
  +tags: null
  +mentions: [
    "@nilclass@discuss.tchncs.de"
  ]
  +children: Doctrine\ORM\PersistentCollection {#1579 …}
  +nested: Doctrine\ORM\PersistentCollection {#1577 …}
  +votes: Doctrine\ORM\PersistentCollection {#1578 …}
  +reports: Doctrine\ORM\PersistentCollection {#1571 …}
  +favourites: Doctrine\ORM\PersistentCollection {#1574 …}
  +notifications: Doctrine\ORM\PersistentCollection {#1667 …}
  -id: 26779
  -bodyTs: "'0v':70,117 '2':7 'add':30,62 'also':76 'anoth':63 'batteri':22,120 'clamp':100 'control':67 'could':1 'current':89 'default':45 'diagram':6 'diod':94 'divid':29,105 'divided/clamped':119 'ensur':39 'fet':14,19,41 'first':24 'gate':32,51 'higher':84 'instead':9,95,103 'limit':72,88 'll':58 'measur':56,124 'micro':48,114 'much':82,83 'n':13 'n-fet':12 'need':60 'nfet':112 'p':18 'p-fet':17 'pin':68,125 'potenti':28 'probabl':59 'pull':33,49 'realli':87 'resistor':25,35,64,98 'robust':107 'second':97 'see':116 'similar':4 'sourc':37 'switch':108 'take':54 'two':79 'use':15,91 'valu':85 'voltag':74,102,121 'zener/tvs':93"
  +ranking: 0
  +commentCount: 0
  +upVotes: 0
  +downVotes: 0
  +visibility: "visible             "
  +apId: "https://feddit.uk/comment/2185380"
  +editedAt: DateTimeImmutable @1692969047 {#1435
    date: 2023-08-25 15:10:47.0 +02:00
  }
  +createdAt: DateTimeImmutable @1692950595 {#1436
    date: 2023-08-25 10:03:15.0 +02:00
  }
  +"title": 26779
}
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryCommentVoter"
ACCESS DENIED
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
13 DENIED ROLE_ADMIN
null
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
ACCESS DENIED
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details
14 DENIED ROLE_MODERATOR
null
"Scheb\TwoFactorBundle\Security\Authorization\Voter\TwoFactorInProgressVoter"
ACCESS ABSTAIN
"Symfony\Component\Security\Core\Authorization\Voter\RoleHierarchyVoter"
ACCESS DENIED
"App\Security\Voter\EntryCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\EntryVoter"
ACCESS ABSTAIN
"App\Security\Voter\MagazineVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageThreadVoter"
ACCESS ABSTAIN
"App\Security\Voter\MessageVoter"
ACCESS ABSTAIN
"App\Security\Voter\NotificationVoter"
ACCESS ABSTAIN
"App\Security\Voter\OAuth2UserConsentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostCommentVoter"
ACCESS ABSTAIN
"App\Security\Voter\PostVoter"
ACCESS ABSTAIN
"App\Security\Voter\UserVoter"
ACCESS ABSTAIN
Show voter details