Components

24 Twig Components
135 Render Count
409 ms Render Time
14.0 MiB Memory Usage

Components

Name Metadata Render Count Render Time
user_avatar
"App\Twig\Components\UserAvatarComponent"
components/user_avatar.html.twig
16 57.17ms
settings_row_switch
"App\Twig\Components\SettingsRowSwitchComponent"
components/_settings_row_switch.html.twig
15 1.92ms
date
"App\Twig\Components\DateComponent"
components/date.html.twig
14 2.14ms
user_inline
"App\Twig\Components\UserInlineComponent"
components/user_inline.html.twig
13 7.30ms
date_edited
"App\Twig\Components\DateEditedComponent"
components/date_edited.html.twig
12 1.21ms
vote
"App\Twig\Components\VoteComponent"
components/vote.html.twig
12 12.97ms
boost
"App\Twig\Components\BoostComponent"
components/boost.html.twig
12 22.79ms
entry_comment
"App\Twig\Components\EntryCommentComponent"
components/entry_comment.html.twig
11 523.70ms
entry_comments_nested
"App\Twig\Components\EntryCommentsNestedComponent"
components/_cached.html.twig
11 278.57ms
user_settings_row_switch
"App\Twig\Components\UserSettingsRowSwitchComponent"
components/_user_settings_row_switch.html.twig
4 0.74ms
settings_row_enum
"App\Twig\Components\SettingsRowEnumComponent"
components/_settings_row_enum.html.twig
2 0.43ms
entry
"App\Twig\Components\EntryComponent"
components/_cached.html.twig
1 7.65ms
entries_cross
"App\Twig\Components\EntriesCrossComponent"
components/_cached.html.twig
1 41.87ms
editor_toolbar
"App\Twig\Components\EditorToolbarComponent"
components/editor_toolbar.html.twig
1 0.40ms
user_actions
"App\Twig\Components\UserActionsComponent"
components/user_actions.html.twig
1 0.46ms
magazine_box
"App\Twig\Components\MagazineBoxComponent"
components/magazine_box.html.twig
1 17.59ms
magazine_sub
"App\Twig\Components\MagazineSubComponent"
components/magazine_sub.html.twig
1 0.54ms
related_magazines
"App\Twig\Components\RelatedMagazinesComponent"
components/_cached.html.twig
1 6.80ms
active_users
"App\Twig\Components\ActiveUsersComponent"
components/_cached.html.twig
1 20.43ms
related_categories
"App\Twig\Components\RelatedCategoriesComponent"
components/_cached.html.twig
1 12.08ms
related_posts
"App\Twig\Components\RelatedPostsComponent"
components/_cached.html.twig
1 5.07ms
related_entries
"App\Twig\Components\RelatedEntriesComponent"
components/_cached.html.twig
1 20.84ms
support_us_block
"App\Twig\Components\SupportUsBlock"
components/_cached.html.twig
1 0.24ms
featured_magazines
"App\Twig\Components\FeaturedMagazinesComponent"
components/_cached.html.twig
1 0.76ms

Render calls

entry App\Twig\Components\EntryComponent 12.0 MiB 7.65 ms
Input props
[
  "entry" => App\Entity\Entry {#2412
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +magazine: App\Entity\Magazine {#266
      +icon: Proxies\__CG__\App\Entity\Image {#247 …}
      +name: "askelectronics@discuss.tchncs.de"
      +title: "askelectronics"
      +description: """
        **For questions about component-level electronic circuits, tools and equipment.**\n
        \n
        Rules\n
        -----\n
        \n
        1: Be nice.\n
        \n
        2: Be on-topic (eg: *Electronic*, not *electrical*).\n
        \n
        3: No commercial stuff, buying, selling or valuations.\n
        \n
        4: Be safe.\n
        \n
        ---
        """
      +rules: null
      +subscriptionsCount: 1
      +entryCount: 154
      +entryCommentCount: 1230
      +postCount: 1
      +postCommentCount: 4
      +isAdult: false
      +customCss: null
      +lastActive: DateTime @1729413608 {#276
        date: 2024-10-20 10:40:08.0 +02:00
      }
      +markedForDeletionAt: null
      +tags: null
      +moderators: Doctrine\ORM\PersistentCollection {#238 …}
      +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
      +entries: Doctrine\ORM\PersistentCollection {#181 …}
      +posts: Doctrine\ORM\PersistentCollection {#139 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
      +bans: Doctrine\ORM\PersistentCollection {#118 …}
      +reports: Doctrine\ORM\PersistentCollection {#104 …}
      +badges: Doctrine\ORM\PersistentCollection {#82 …}
      +logs: Doctrine\ORM\PersistentCollection {#72 …}
      +awards: Doctrine\ORM\PersistentCollection {#61 …}
      +categories: Doctrine\ORM\PersistentCollection {#1820 …}
      -id: 11
      +apId: "askelectronics@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
      +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
      +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "askelectronics"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: null
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1727247714 {#270
        date: 2024-09-25 09:01:54.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687144409 {#272
        date: 2023-06-19 05:13:29.0 +02:00
      }
    }
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
    +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 {#2410
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1884 …}
    +votes: Doctrine\ORM\PersistentCollection {#1973 …}
    +reports: Doctrine\ORM\PersistentCollection {#1959 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
    +badges: Doctrine\ORM\PersistentCollection {#2440 …}
    +children: []
    -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 {#1850
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#2420
      date: 2023-08-25 09:05:37.0 +02:00
    }
  }
  "isSingle" => true
  "showShortSentence" => false
  "showBody" => true
]
Attributes
[
  "class" => "entry--single section--top"
]
Component
App\Twig\Components\EntryComponent {#2955
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
  -newCommentMarkerCount: App\Kbin\NewCommentMarker\NewCommentMarkerCount {#2956 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -twig: Twig\Environment {#1252 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  +entry: App\Entity\Entry {#2412
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +magazine: App\Entity\Magazine {#266
      +icon: Proxies\__CG__\App\Entity\Image {#247 …}
      +name: "askelectronics@discuss.tchncs.de"
      +title: "askelectronics"
      +description: """
        **For questions about component-level electronic circuits, tools and equipment.**\n
        \n
        Rules\n
        -----\n
        \n
        1: Be nice.\n
        \n
        2: Be on-topic (eg: *Electronic*, not *electrical*).\n
        \n
        3: No commercial stuff, buying, selling or valuations.\n
        \n
        4: Be safe.\n
        \n
        ---
        """
      +rules: null
      +subscriptionsCount: 1
      +entryCount: 154
      +entryCommentCount: 1230
      +postCount: 1
      +postCommentCount: 4
      +isAdult: false
      +customCss: null
      +lastActive: DateTime @1729413608 {#276
        date: 2024-10-20 10:40:08.0 +02:00
      }
      +markedForDeletionAt: null
      +tags: null
      +moderators: Doctrine\ORM\PersistentCollection {#238 …}
      +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
      +entries: Doctrine\ORM\PersistentCollection {#181 …}
      +posts: Doctrine\ORM\PersistentCollection {#139 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
      +bans: Doctrine\ORM\PersistentCollection {#118 …}
      +reports: Doctrine\ORM\PersistentCollection {#104 …}
      +badges: Doctrine\ORM\PersistentCollection {#82 …}
      +logs: Doctrine\ORM\PersistentCollection {#72 …}
      +awards: Doctrine\ORM\PersistentCollection {#61 …}
      +categories: Doctrine\ORM\PersistentCollection {#1820 …}
      -id: 11
      +apId: "askelectronics@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
      +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
      +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "askelectronics"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: null
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1727247714 {#270
        date: 2024-09-25 09:01:54.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687144409 {#272
        date: 2023-06-19 05:13:29.0 +02:00
      }
    }
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
    +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 {#2410
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1884 …}
    +votes: Doctrine\ORM\PersistentCollection {#1973 …}
    +reports: Doctrine\ORM\PersistentCollection {#1959 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
    +badges: Doctrine\ORM\PersistentCollection {#2440 …}
    +children: []
    -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 {#1850
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#2420
      date: 2023-08-25 09:05:37.0 +02:00
    }
  }
  +isSingle: true
  +showShortSentence: false
  +showBody: true
  +showMagazineName: false
  +canSeeTrash: false
  +newComments: 0
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.28 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#3178
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.34 ms
Input props
[
  "date" => DateTimeImmutable @1692947137 {#2420
    date: 2023-08-25 09:05:37.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#3248
  +date: DateTimeImmutable @1692947137 {#2420
    date: 2023-08-25 09:05:37.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.15 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692947137 {#2420
    date: 2023-08-25 09:05:37.0 +02:00
  }
  "editedAt" => DateTimeImmutable @1692947232 {#1850
    date: 2023-08-25 09:07:12.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#3312
  +createdAt: DateTimeImmutable @1692947137 {#2420
    date: 2023-08-25 09:05:37.0 +02:00
  }
  +editedAt: DateTimeImmutable @1692947232 {#1850
    date: 2023-08-25 09:07:12.0 +02:00
  }
}
vote App\Twig\Components\VoteComponent 12.0 MiB 0.44 ms
Input props
[
  "subject" => App\Entity\Entry {#2412
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +magazine: App\Entity\Magazine {#266
      +icon: Proxies\__CG__\App\Entity\Image {#247 …}
      +name: "askelectronics@discuss.tchncs.de"
      +title: "askelectronics"
      +description: """
        **For questions about component-level electronic circuits, tools and equipment.**\n
        \n
        Rules\n
        -----\n
        \n
        1: Be nice.\n
        \n
        2: Be on-topic (eg: *Electronic*, not *electrical*).\n
        \n
        3: No commercial stuff, buying, selling or valuations.\n
        \n
        4: Be safe.\n
        \n
        ---
        """
      +rules: null
      +subscriptionsCount: 1
      +entryCount: 154
      +entryCommentCount: 1230
      +postCount: 1
      +postCommentCount: 4
      +isAdult: false
      +customCss: null
      +lastActive: DateTime @1729413608 {#276
        date: 2024-10-20 10:40:08.0 +02:00
      }
      +markedForDeletionAt: null
      +tags: null
      +moderators: Doctrine\ORM\PersistentCollection {#238 …}
      +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
      +entries: Doctrine\ORM\PersistentCollection {#181 …}
      +posts: Doctrine\ORM\PersistentCollection {#139 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
      +bans: Doctrine\ORM\PersistentCollection {#118 …}
      +reports: Doctrine\ORM\PersistentCollection {#104 …}
      +badges: Doctrine\ORM\PersistentCollection {#82 …}
      +logs: Doctrine\ORM\PersistentCollection {#72 …}
      +awards: Doctrine\ORM\PersistentCollection {#61 …}
      +categories: Doctrine\ORM\PersistentCollection {#1820 …}
      -id: 11
      +apId: "askelectronics@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
      +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
      +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "askelectronics"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: null
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1727247714 {#270
        date: 2024-09-25 09:01:54.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687144409 {#272
        date: 2023-06-19 05:13:29.0 +02:00
      }
    }
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
    +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 {#2410
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1884 …}
    +votes: Doctrine\ORM\PersistentCollection {#1973 …}
    +reports: Doctrine\ORM\PersistentCollection {#1959 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
    +badges: Doctrine\ORM\PersistentCollection {#2440 …}
    +children: []
    -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 {#1850
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#2420
      date: 2023-08-25 09:05:37.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#3377
  +subject: App\Entity\Entry {#2412
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +magazine: App\Entity\Magazine {#266
      +icon: Proxies\__CG__\App\Entity\Image {#247 …}
      +name: "askelectronics@discuss.tchncs.de"
      +title: "askelectronics"
      +description: """
        **For questions about component-level electronic circuits, tools and equipment.**\n
        \n
        Rules\n
        -----\n
        \n
        1: Be nice.\n
        \n
        2: Be on-topic (eg: *Electronic*, not *electrical*).\n
        \n
        3: No commercial stuff, buying, selling or valuations.\n
        \n
        4: Be safe.\n
        \n
        ---
        """
      +rules: null
      +subscriptionsCount: 1
      +entryCount: 154
      +entryCommentCount: 1230
      +postCount: 1
      +postCommentCount: 4
      +isAdult: false
      +customCss: null
      +lastActive: DateTime @1729413608 {#276
        date: 2024-10-20 10:40:08.0 +02:00
      }
      +markedForDeletionAt: null
      +tags: null
      +moderators: Doctrine\ORM\PersistentCollection {#238 …}
      +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
      +entries: Doctrine\ORM\PersistentCollection {#181 …}
      +posts: Doctrine\ORM\PersistentCollection {#139 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
      +bans: Doctrine\ORM\PersistentCollection {#118 …}
      +reports: Doctrine\ORM\PersistentCollection {#104 …}
      +badges: Doctrine\ORM\PersistentCollection {#82 …}
      +logs: Doctrine\ORM\PersistentCollection {#72 …}
      +awards: Doctrine\ORM\PersistentCollection {#61 …}
      +categories: Doctrine\ORM\PersistentCollection {#1820 …}
      -id: 11
      +apId: "askelectronics@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
      +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
      +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "askelectronics"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: null
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1727247714 {#270
        date: 2024-09-25 09:01:54.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687144409 {#272
        date: 2023-06-19 05:13:29.0 +02:00
      }
    }
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
    +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 {#2410
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1884 …}
    +votes: Doctrine\ORM\PersistentCollection {#1973 …}
    +reports: Doctrine\ORM\PersistentCollection {#1959 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
    +badges: Doctrine\ORM\PersistentCollection {#2440 …}
    +children: []
    -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 {#1850
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#2420
      date: 2023-08-25 09:05:37.0 +02:00
    }
  }
  +formDest: "entry"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 1.27 ms
Input props
[
  "subject" => App\Entity\Entry {#2412
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +magazine: App\Entity\Magazine {#266
      +icon: Proxies\__CG__\App\Entity\Image {#247 …}
      +name: "askelectronics@discuss.tchncs.de"
      +title: "askelectronics"
      +description: """
        **For questions about component-level electronic circuits, tools and equipment.**\n
        \n
        Rules\n
        -----\n
        \n
        1: Be nice.\n
        \n
        2: Be on-topic (eg: *Electronic*, not *electrical*).\n
        \n
        3: No commercial stuff, buying, selling or valuations.\n
        \n
        4: Be safe.\n
        \n
        ---
        """
      +rules: null
      +subscriptionsCount: 1
      +entryCount: 154
      +entryCommentCount: 1230
      +postCount: 1
      +postCommentCount: 4
      +isAdult: false
      +customCss: null
      +lastActive: DateTime @1729413608 {#276
        date: 2024-10-20 10:40:08.0 +02:00
      }
      +markedForDeletionAt: null
      +tags: null
      +moderators: Doctrine\ORM\PersistentCollection {#238 …}
      +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
      +entries: Doctrine\ORM\PersistentCollection {#181 …}
      +posts: Doctrine\ORM\PersistentCollection {#139 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
      +bans: Doctrine\ORM\PersistentCollection {#118 …}
      +reports: Doctrine\ORM\PersistentCollection {#104 …}
      +badges: Doctrine\ORM\PersistentCollection {#82 …}
      +logs: Doctrine\ORM\PersistentCollection {#72 …}
      +awards: Doctrine\ORM\PersistentCollection {#61 …}
      +categories: Doctrine\ORM\PersistentCollection {#1820 …}
      -id: 11
      +apId: "askelectronics@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
      +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
      +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "askelectronics"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: null
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1727247714 {#270
        date: 2024-09-25 09:01:54.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687144409 {#272
        date: 2023-06-19 05:13:29.0 +02:00
      }
    }
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
    +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 {#2410
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1884 …}
    +votes: Doctrine\ORM\PersistentCollection {#1973 …}
    +reports: Doctrine\ORM\PersistentCollection {#1959 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
    +badges: Doctrine\ORM\PersistentCollection {#2440 …}
    +children: []
    -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 {#1850
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#2420
      date: 2023-08-25 09:05:37.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#3443
  +formDest: "entry"
  +subject: App\Entity\Entry {#2412
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +magazine: App\Entity\Magazine {#266
      +icon: Proxies\__CG__\App\Entity\Image {#247 …}
      +name: "askelectronics@discuss.tchncs.de"
      +title: "askelectronics"
      +description: """
        **For questions about component-level electronic circuits, tools and equipment.**\n
        \n
        Rules\n
        -----\n
        \n
        1: Be nice.\n
        \n
        2: Be on-topic (eg: *Electronic*, not *electrical*).\n
        \n
        3: No commercial stuff, buying, selling or valuations.\n
        \n
        4: Be safe.\n
        \n
        ---
        """
      +rules: null
      +subscriptionsCount: 1
      +entryCount: 154
      +entryCommentCount: 1230
      +postCount: 1
      +postCommentCount: 4
      +isAdult: false
      +customCss: null
      +lastActive: DateTime @1729413608 {#276
        date: 2024-10-20 10:40:08.0 +02:00
      }
      +markedForDeletionAt: null
      +tags: null
      +moderators: Doctrine\ORM\PersistentCollection {#238 …}
      +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
      +entries: Doctrine\ORM\PersistentCollection {#181 …}
      +posts: Doctrine\ORM\PersistentCollection {#139 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
      +bans: Doctrine\ORM\PersistentCollection {#118 …}
      +reports: Doctrine\ORM\PersistentCollection {#104 …}
      +badges: Doctrine\ORM\PersistentCollection {#82 …}
      +logs: Doctrine\ORM\PersistentCollection {#72 …}
      +awards: Doctrine\ORM\PersistentCollection {#61 …}
      +categories: Doctrine\ORM\PersistentCollection {#1820 …}
      -id: 11
      +apId: "askelectronics@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
      +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
      +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "askelectronics"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: null
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1727247714 {#270
        date: 2024-09-25 09:01:54.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687144409 {#272
        date: 2023-06-19 05:13:29.0 +02:00
      }
    }
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
    +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 {#2410
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1884 …}
    +votes: Doctrine\ORM\PersistentCollection {#1973 …}
    +reports: Doctrine\ORM\PersistentCollection {#1959 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
    +badges: Doctrine\ORM\PersistentCollection {#2440 …}
    +children: []
    -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 {#1850
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#2420
      date: 2023-08-25 09:05:37.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entries_cross App\Twig\Components\EntriesCrossComponent 12.0 MiB 41.87 ms
Input props
[
  "entry" => App\Entity\Entry {#2412
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +magazine: App\Entity\Magazine {#266
      +icon: Proxies\__CG__\App\Entity\Image {#247 …}
      +name: "askelectronics@discuss.tchncs.de"
      +title: "askelectronics"
      +description: """
        **For questions about component-level electronic circuits, tools and equipment.**\n
        \n
        Rules\n
        -----\n
        \n
        1: Be nice.\n
        \n
        2: Be on-topic (eg: *Electronic*, not *electrical*).\n
        \n
        3: No commercial stuff, buying, selling or valuations.\n
        \n
        4: Be safe.\n
        \n
        ---
        """
      +rules: null
      +subscriptionsCount: 1
      +entryCount: 154
      +entryCommentCount: 1230
      +postCount: 1
      +postCommentCount: 4
      +isAdult: false
      +customCss: null
      +lastActive: DateTime @1729413608 {#276
        date: 2024-10-20 10:40:08.0 +02:00
      }
      +markedForDeletionAt: null
      +tags: null
      +moderators: Doctrine\ORM\PersistentCollection {#238 …}
      +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
      +entries: Doctrine\ORM\PersistentCollection {#181 …}
      +posts: Doctrine\ORM\PersistentCollection {#139 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
      +bans: Doctrine\ORM\PersistentCollection {#118 …}
      +reports: Doctrine\ORM\PersistentCollection {#104 …}
      +badges: Doctrine\ORM\PersistentCollection {#82 …}
      +logs: Doctrine\ORM\PersistentCollection {#72 …}
      +awards: Doctrine\ORM\PersistentCollection {#61 …}
      +categories: Doctrine\ORM\PersistentCollection {#1820 …}
      -id: 11
      +apId: "askelectronics@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
      +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
      +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "askelectronics"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: null
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1727247714 {#270
        date: 2024-09-25 09:01:54.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687144409 {#272
        date: 2023-06-19 05:13:29.0 +02:00
      }
    }
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
    +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 {#2410
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1884 …}
    +votes: Doctrine\ORM\PersistentCollection {#1973 …}
    +reports: Doctrine\ORM\PersistentCollection {#1959 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
    +badges: Doctrine\ORM\PersistentCollection {#2440 …}
    +children: []
    -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 {#1850
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#2420
      date: 2023-08-25 09:05:37.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\EntriesCrossComponent {#3757
  +entry: App\Entity\Entry {#2412
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +magazine: App\Entity\Magazine {#266
      +icon: Proxies\__CG__\App\Entity\Image {#247 …}
      +name: "askelectronics@discuss.tchncs.de"
      +title: "askelectronics"
      +description: """
        **For questions about component-level electronic circuits, tools and equipment.**\n
        \n
        Rules\n
        -----\n
        \n
        1: Be nice.\n
        \n
        2: Be on-topic (eg: *Electronic*, not *electrical*).\n
        \n
        3: No commercial stuff, buying, selling or valuations.\n
        \n
        4: Be safe.\n
        \n
        ---
        """
      +rules: null
      +subscriptionsCount: 1
      +entryCount: 154
      +entryCommentCount: 1230
      +postCount: 1
      +postCommentCount: 4
      +isAdult: false
      +customCss: null
      +lastActive: DateTime @1729413608 {#276
        date: 2024-10-20 10:40:08.0 +02:00
      }
      +markedForDeletionAt: null
      +tags: null
      +moderators: Doctrine\ORM\PersistentCollection {#238 …}
      +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
      +entries: Doctrine\ORM\PersistentCollection {#181 …}
      +posts: Doctrine\ORM\PersistentCollection {#139 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
      +bans: Doctrine\ORM\PersistentCollection {#118 …}
      +reports: Doctrine\ORM\PersistentCollection {#104 …}
      +badges: Doctrine\ORM\PersistentCollection {#82 …}
      +logs: Doctrine\ORM\PersistentCollection {#72 …}
      +awards: Doctrine\ORM\PersistentCollection {#61 …}
      +categories: Doctrine\ORM\PersistentCollection {#1820 …}
      -id: 11
      +apId: "askelectronics@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
      +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
      +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "askelectronics"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: null
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1727247714 {#270
        date: 2024-09-25 09:01:54.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687144409 {#272
        date: 2023-06-19 05:13:29.0 +02:00
      }
    }
    +image: null
    +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
    +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 {#2410
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +adaAmount: 0
    +tags: null
    +mentions: null
    +comments: Doctrine\ORM\PersistentCollection {#1884 …}
    +votes: Doctrine\ORM\PersistentCollection {#1973 …}
    +reports: Doctrine\ORM\PersistentCollection {#1959 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
    +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
    +badges: Doctrine\ORM\PersistentCollection {#2440 …}
    +children: []
    -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 {#1850
      date: 2023-08-25 09:07:12.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692947137 {#2420
      date: 2023-08-25 09:05:37.0 +02:00
    }
  }
  -repository: App\Repository\EntryRepository {#271 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -twig: Twig\Environment {#1252 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
}
editor_toolbar App\Twig\Components\EditorToolbarComponent 12.0 MiB 0.40 ms
Input props
[
  "id" => "entry_comment_67a06026a9bb87.39939661_body"
]
Attributes
[]
Component
App\Twig\Components\EditorToolbarComponent {#3882
  +id: "entry_comment_67a06026a9bb87.39939661_body"
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 107.92 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4085
    +user: App\Entity\User {#4034
      +avatar: null
      +cover: null
      +email: "WaterWaiver@aussie.zone"
      +username: "@WaterWaiver@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: """
        I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
        \n
        Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
        """
      +lastActive: DateTime @1728391969 {#4090
        date: 2024-10-08 14:52:49.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
      +entries: Doctrine\ORM\PersistentCollection {#4028 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
      +posts: Doctrine\ORM\PersistentCollection {#4018 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
      +follows: Doctrine\ORM\PersistentCollection {#4004 …}
      +followers: Doctrine\ORM\PersistentCollection {#4002 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
      +reports: Doctrine\ORM\PersistentCollection {#4115 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
      +violations: Doctrine\ORM\PersistentCollection {#4151 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
      +awards: Doctrine\ORM\PersistentCollection {#4145 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
      +categories: Doctrine\ORM\PersistentCollection {#4143 …}
      -id: 42479
      -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
      +apId: "WaterWaiver@aussie.zone"
      +apProfileId: "https://aussie.zone/u/WaterWaiver"
      +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "WaterWaiver"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1724531625 {#4088
        date: 2024-08-24 22:33:45.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692949316 {#4087
        date: 2023-08-25 09:41:56.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
      \n
      A couple more things to keep in mind:\n
      \n
      - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 6
    +score: 0
    +lastActive: DateTime @1692964519 {#4095
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4083 …}
    +nested: Doctrine\ORM\PersistentCollection {#4081 …}
    +votes: Doctrine\ORM\PersistentCollection {#4079 …}
    +reports: Doctrine\ORM\PersistentCollection {#4077 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
    -id: 26778
    -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2116578"
    +editedAt: DateTimeImmutable @1692949446 {#4027
      date: 2023-08-25 09:44:06.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692949313 {#4094
      date: 2023-08-25 09:41:53.0 +02:00
    }
  }
  "showNested" => true
  "dateAsUrl" => false
  "showMagazineName" => false
  "showEntryTitle" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#4407
  +comment: App\Entity\EntryComment {#4085
    +user: App\Entity\User {#4034
      +avatar: null
      +cover: null
      +email: "WaterWaiver@aussie.zone"
      +username: "@WaterWaiver@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: """
        I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
        \n
        Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
        """
      +lastActive: DateTime @1728391969 {#4090
        date: 2024-10-08 14:52:49.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
      +entries: Doctrine\ORM\PersistentCollection {#4028 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
      +posts: Doctrine\ORM\PersistentCollection {#4018 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
      +follows: Doctrine\ORM\PersistentCollection {#4004 …}
      +followers: Doctrine\ORM\PersistentCollection {#4002 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
      +reports: Doctrine\ORM\PersistentCollection {#4115 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
      +violations: Doctrine\ORM\PersistentCollection {#4151 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
      +awards: Doctrine\ORM\PersistentCollection {#4145 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
      +categories: Doctrine\ORM\PersistentCollection {#4143 …}
      -id: 42479
      -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
      +apId: "WaterWaiver@aussie.zone"
      +apProfileId: "https://aussie.zone/u/WaterWaiver"
      +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "WaterWaiver"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1724531625 {#4088
        date: 2024-08-24 22:33:45.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692949316 {#4087
        date: 2023-08-25 09:41:56.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
      \n
      A couple more things to keep in mind:\n
      \n
      - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 6
    +score: 0
    +lastActive: DateTime @1692964519 {#4095
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4083 …}
    +nested: Doctrine\ORM\PersistentCollection {#4081 …}
    +votes: Doctrine\ORM\PersistentCollection {#4079 …}
    +reports: Doctrine\ORM\PersistentCollection {#4077 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
    -id: 26778
    -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2116578"
    +editedAt: DateTimeImmutable @1692949446 {#4027
      date: 2023-08-25 09:44:06.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692949313 {#4094
      date: 2023-08-25 09:41:53.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 1
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.14 ms
Input props
[
  "user" => App\Entity\User {#4034
    +avatar: null
    +cover: null
    +email: "WaterWaiver@aussie.zone"
    +username: "@WaterWaiver@aussie.zone"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
      \n
      Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
      """
    +lastActive: DateTime @1728391969 {#4090
      date: 2024-10-08 14:52:49.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
    +entries: Doctrine\ORM\PersistentCollection {#4028 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
    +posts: Doctrine\ORM\PersistentCollection {#4018 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
    +follows: Doctrine\ORM\PersistentCollection {#4004 …}
    +followers: Doctrine\ORM\PersistentCollection {#4002 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
    +reports: Doctrine\ORM\PersistentCollection {#4115 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
    +violations: Doctrine\ORM\PersistentCollection {#4151 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
    +awards: Doctrine\ORM\PersistentCollection {#4145 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
    +categories: Doctrine\ORM\PersistentCollection {#4143 …}
    -id: 42479
    -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
    +apId: "WaterWaiver@aussie.zone"
    +apProfileId: "https://aussie.zone/u/WaterWaiver"
    +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
    +apFollowersUrl: null
    +apInboxUrl: "https://aussie.zone/inbox"
    +apDomain: "aussie.zone"
    +apPreferredUsername: "WaterWaiver"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1724531625 {#4088
      date: 2024-08-24 22:33:45.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692949316 {#4087
      date: 2023-08-25 09:41:56.0 +02:00
    }
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#4537
  +user: App\Entity\User {#4034
    +avatar: null
    +cover: null
    +email: "WaterWaiver@aussie.zone"
    +username: "@WaterWaiver@aussie.zone"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
      \n
      Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
      """
    +lastActive: DateTime @1728391969 {#4090
      date: 2024-10-08 14:52:49.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
    +entries: Doctrine\ORM\PersistentCollection {#4028 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
    +posts: Doctrine\ORM\PersistentCollection {#4018 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
    +follows: Doctrine\ORM\PersistentCollection {#4004 …}
    +followers: Doctrine\ORM\PersistentCollection {#4002 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
    +reports: Doctrine\ORM\PersistentCollection {#4115 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
    +violations: Doctrine\ORM\PersistentCollection {#4151 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
    +awards: Doctrine\ORM\PersistentCollection {#4145 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
    +categories: Doctrine\ORM\PersistentCollection {#4143 …}
    -id: 42479
    -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
    +apId: "WaterWaiver@aussie.zone"
    +apProfileId: "https://aussie.zone/u/WaterWaiver"
    +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
    +apFollowersUrl: null
    +apInboxUrl: "https://aussie.zone/inbox"
    +apDomain: "aussie.zone"
    +apPreferredUsername: "WaterWaiver"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1724531625 {#4088
      date: 2024-08-24 22:33:45.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692949316 {#4087
      date: 2023-08-25 09:41:56.0 +02:00
    }
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.16 ms
Input props
[
  "date" => DateTimeImmutable @1692949313 {#4094
    date: 2023-08-25 09:41:53.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#4592
  +date: DateTimeImmutable @1692949313 {#4094
    date: 2023-08-25 09:41:53.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.10 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692949313 {#4094
    date: 2023-08-25 09:41:53.0 +02:00
  }
  "editedAt" => DateTimeImmutable @1692949446 {#4027
    date: 2023-08-25 09:44:06.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#4646
  +createdAt: DateTimeImmutable @1692949313 {#4094
    date: 2023-08-25 09:41:53.0 +02:00
  }
  +editedAt: DateTimeImmutable @1692949446 {#4027
    date: 2023-08-25 09:44:06.0 +02:00
  }
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 0.24 ms
Input props
[
  "user" => App\Entity\User {#4034
    +avatar: null
    +cover: null
    +email: "WaterWaiver@aussie.zone"
    +username: "@WaterWaiver@aussie.zone"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
      \n
      Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
      """
    +lastActive: DateTime @1728391969 {#4090
      date: 2024-10-08 14:52:49.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
    +entries: Doctrine\ORM\PersistentCollection {#4028 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
    +posts: Doctrine\ORM\PersistentCollection {#4018 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
    +follows: Doctrine\ORM\PersistentCollection {#4004 …}
    +followers: Doctrine\ORM\PersistentCollection {#4002 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
    +reports: Doctrine\ORM\PersistentCollection {#4115 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
    +violations: Doctrine\ORM\PersistentCollection {#4151 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
    +awards: Doctrine\ORM\PersistentCollection {#4145 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
    +categories: Doctrine\ORM\PersistentCollection {#4143 …}
    -id: 42479
    -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
    +apId: "WaterWaiver@aussie.zone"
    +apProfileId: "https://aussie.zone/u/WaterWaiver"
    +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
    +apFollowersUrl: null
    +apInboxUrl: "https://aussie.zone/inbox"
    +apDomain: "aussie.zone"
    +apPreferredUsername: "WaterWaiver"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1724531625 {#4088
      date: 2024-08-24 22:33:45.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692949316 {#4087
      date: 2023-08-25 09:41:56.0 +02:00
    }
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#4702
  +width: 40
  +height: 40
  +user: App\Entity\User {#4034
    +avatar: null
    +cover: null
    +email: "WaterWaiver@aussie.zone"
    +username: "@WaterWaiver@aussie.zone"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
      \n
      Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
      """
    +lastActive: DateTime @1728391969 {#4090
      date: 2024-10-08 14:52:49.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
    +entries: Doctrine\ORM\PersistentCollection {#4028 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
    +posts: Doctrine\ORM\PersistentCollection {#4018 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
    +follows: Doctrine\ORM\PersistentCollection {#4004 …}
    +followers: Doctrine\ORM\PersistentCollection {#4002 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
    +reports: Doctrine\ORM\PersistentCollection {#4115 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
    +violations: Doctrine\ORM\PersistentCollection {#4151 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
    +awards: Doctrine\ORM\PersistentCollection {#4145 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
    +categories: Doctrine\ORM\PersistentCollection {#4143 …}
    -id: 42479
    -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
    +apId: "WaterWaiver@aussie.zone"
    +apProfileId: "https://aussie.zone/u/WaterWaiver"
    +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
    +apFollowersUrl: null
    +apInboxUrl: "https://aussie.zone/inbox"
    +apDomain: "aussie.zone"
    +apPreferredUsername: "WaterWaiver"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1724531625 {#4088
      date: 2024-08-24 22:33:45.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692949316 {#4087
      date: 2023-08-25 09:41:56.0 +02:00
    }
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 1.46 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4085
    +user: App\Entity\User {#4034
      +avatar: null
      +cover: null
      +email: "WaterWaiver@aussie.zone"
      +username: "@WaterWaiver@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: """
        I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
        \n
        Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
        """
      +lastActive: DateTime @1728391969 {#4090
        date: 2024-10-08 14:52:49.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
      +entries: Doctrine\ORM\PersistentCollection {#4028 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
      +posts: Doctrine\ORM\PersistentCollection {#4018 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
      +follows: Doctrine\ORM\PersistentCollection {#4004 …}
      +followers: Doctrine\ORM\PersistentCollection {#4002 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
      +reports: Doctrine\ORM\PersistentCollection {#4115 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
      +violations: Doctrine\ORM\PersistentCollection {#4151 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
      +awards: Doctrine\ORM\PersistentCollection {#4145 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
      +categories: Doctrine\ORM\PersistentCollection {#4143 …}
      -id: 42479
      -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
      +apId: "WaterWaiver@aussie.zone"
      +apProfileId: "https://aussie.zone/u/WaterWaiver"
      +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "WaterWaiver"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1724531625 {#4088
        date: 2024-08-24 22:33:45.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692949316 {#4087
        date: 2023-08-25 09:41:56.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
      \n
      A couple more things to keep in mind:\n
      \n
      - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 6
    +score: 0
    +lastActive: DateTime @1692964519 {#4095
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4083 …}
    +nested: Doctrine\ORM\PersistentCollection {#4081 …}
    +votes: Doctrine\ORM\PersistentCollection {#4079 …}
    +reports: Doctrine\ORM\PersistentCollection {#4077 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
    -id: 26778
    -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2116578"
    +editedAt: DateTimeImmutable @1692949446 {#4027
      date: 2023-08-25 09:44:06.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692949313 {#4094
      date: 2023-08-25 09:41:53.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#4805
  +subject: App\Entity\EntryComment {#4085
    +user: App\Entity\User {#4034
      +avatar: null
      +cover: null
      +email: "WaterWaiver@aussie.zone"
      +username: "@WaterWaiver@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: """
        I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
        \n
        Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
        """
      +lastActive: DateTime @1728391969 {#4090
        date: 2024-10-08 14:52:49.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
      +entries: Doctrine\ORM\PersistentCollection {#4028 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
      +posts: Doctrine\ORM\PersistentCollection {#4018 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
      +follows: Doctrine\ORM\PersistentCollection {#4004 …}
      +followers: Doctrine\ORM\PersistentCollection {#4002 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
      +reports: Doctrine\ORM\PersistentCollection {#4115 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
      +violations: Doctrine\ORM\PersistentCollection {#4151 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
      +awards: Doctrine\ORM\PersistentCollection {#4145 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
      +categories: Doctrine\ORM\PersistentCollection {#4143 …}
      -id: 42479
      -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
      +apId: "WaterWaiver@aussie.zone"
      +apProfileId: "https://aussie.zone/u/WaterWaiver"
      +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "WaterWaiver"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1724531625 {#4088
        date: 2024-08-24 22:33:45.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692949316 {#4087
        date: 2023-08-25 09:41:56.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
      \n
      A couple more things to keep in mind:\n
      \n
      - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 6
    +score: 0
    +lastActive: DateTime @1692964519 {#4095
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4083 …}
    +nested: Doctrine\ORM\PersistentCollection {#4081 …}
    +votes: Doctrine\ORM\PersistentCollection {#4079 …}
    +reports: Doctrine\ORM\PersistentCollection {#4077 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
    -id: 26778
    -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2116578"
    +editedAt: DateTimeImmutable @1692949446 {#4027
      date: 2023-08-25 09:44:06.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692949313 {#4094
      date: 2023-08-25 09:41:53.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.63 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4085
    +user: App\Entity\User {#4034
      +avatar: null
      +cover: null
      +email: "WaterWaiver@aussie.zone"
      +username: "@WaterWaiver@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: """
        I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
        \n
        Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
        """
      +lastActive: DateTime @1728391969 {#4090
        date: 2024-10-08 14:52:49.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
      +entries: Doctrine\ORM\PersistentCollection {#4028 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
      +posts: Doctrine\ORM\PersistentCollection {#4018 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
      +follows: Doctrine\ORM\PersistentCollection {#4004 …}
      +followers: Doctrine\ORM\PersistentCollection {#4002 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
      +reports: Doctrine\ORM\PersistentCollection {#4115 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
      +violations: Doctrine\ORM\PersistentCollection {#4151 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
      +awards: Doctrine\ORM\PersistentCollection {#4145 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
      +categories: Doctrine\ORM\PersistentCollection {#4143 …}
      -id: 42479
      -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
      +apId: "WaterWaiver@aussie.zone"
      +apProfileId: "https://aussie.zone/u/WaterWaiver"
      +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "WaterWaiver"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1724531625 {#4088
        date: 2024-08-24 22:33:45.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692949316 {#4087
        date: 2023-08-25 09:41:56.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
      \n
      A couple more things to keep in mind:\n
      \n
      - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 6
    +score: 0
    +lastActive: DateTime @1692964519 {#4095
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4083 …}
    +nested: Doctrine\ORM\PersistentCollection {#4081 …}
    +votes: Doctrine\ORM\PersistentCollection {#4079 …}
    +reports: Doctrine\ORM\PersistentCollection {#4077 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
    -id: 26778
    -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2116578"
    +editedAt: DateTimeImmutable @1692949446 {#4027
      date: 2023-08-25 09:44:06.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692949313 {#4094
      date: 2023-08-25 09:41:53.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#4862
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4085
    +user: App\Entity\User {#4034
      +avatar: null
      +cover: null
      +email: "WaterWaiver@aussie.zone"
      +username: "@WaterWaiver@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: """
        I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
        \n
        Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
        """
      +lastActive: DateTime @1728391969 {#4090
        date: 2024-10-08 14:52:49.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
      +entries: Doctrine\ORM\PersistentCollection {#4028 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
      +posts: Doctrine\ORM\PersistentCollection {#4018 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
      +follows: Doctrine\ORM\PersistentCollection {#4004 …}
      +followers: Doctrine\ORM\PersistentCollection {#4002 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
      +reports: Doctrine\ORM\PersistentCollection {#4115 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
      +violations: Doctrine\ORM\PersistentCollection {#4151 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
      +awards: Doctrine\ORM\PersistentCollection {#4145 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
      +categories: Doctrine\ORM\PersistentCollection {#4143 …}
      -id: 42479
      -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
      +apId: "WaterWaiver@aussie.zone"
      +apProfileId: "https://aussie.zone/u/WaterWaiver"
      +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "WaterWaiver"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1724531625 {#4088
        date: 2024-08-24 22:33:45.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692949316 {#4087
        date: 2023-08-25 09:41:56.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
      \n
      A couple more things to keep in mind:\n
      \n
      - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 6
    +score: 0
    +lastActive: DateTime @1692964519 {#4095
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4083 …}
    +nested: Doctrine\ORM\PersistentCollection {#4081 …}
    +votes: Doctrine\ORM\PersistentCollection {#4079 …}
    +reports: Doctrine\ORM\PersistentCollection {#4077 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
    -id: 26778
    -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2116578"
    +editedAt: DateTimeImmutable @1692949446 {#4027
      date: 2023-08-25 09:44:06.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692949313 {#4094
      date: 2023-08-25 09:41:53.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 67.32 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4085
    +user: App\Entity\User {#4034
      +avatar: null
      +cover: null
      +email: "WaterWaiver@aussie.zone"
      +username: "@WaterWaiver@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: """
        I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
        \n
        Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
        """
      +lastActive: DateTime @1728391969 {#4090
        date: 2024-10-08 14:52:49.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
      +entries: Doctrine\ORM\PersistentCollection {#4028 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
      +posts: Doctrine\ORM\PersistentCollection {#4018 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
      +follows: Doctrine\ORM\PersistentCollection {#4004 …}
      +followers: Doctrine\ORM\PersistentCollection {#4002 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
      +reports: Doctrine\ORM\PersistentCollection {#4115 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
      +violations: Doctrine\ORM\PersistentCollection {#4151 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
      +awards: Doctrine\ORM\PersistentCollection {#4145 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
      +categories: Doctrine\ORM\PersistentCollection {#4143 …}
      -id: 42479
      -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
      +apId: "WaterWaiver@aussie.zone"
      +apProfileId: "https://aussie.zone/u/WaterWaiver"
      +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "WaterWaiver"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1724531625 {#4088
        date: 2024-08-24 22:33:45.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692949316 {#4087
        date: 2023-08-25 09:41:56.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
      \n
      A couple more things to keep in mind:\n
      \n
      - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 6
    +score: 0
    +lastActive: DateTime @1692964519 {#4095
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4083 …}
    +nested: Doctrine\ORM\PersistentCollection {#4081 …}
    +votes: Doctrine\ORM\PersistentCollection {#4079 …}
    +reports: Doctrine\ORM\PersistentCollection {#4077 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
    -id: 26778
    -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2116578"
    +editedAt: DateTimeImmutable @1692949446 {#4027
      date: 2023-08-25 09:44:06.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692949313 {#4094
      date: 2023-08-25 09:41:53.0 +02:00
    }
  }
  "level" => 1
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#5109
  +comment: App\Entity\EntryComment {#4085
    +user: App\Entity\User {#4034
      +avatar: null
      +cover: null
      +email: "WaterWaiver@aussie.zone"
      +username: "@WaterWaiver@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: """
        I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
        \n
        Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
        """
      +lastActive: DateTime @1728391969 {#4090
        date: 2024-10-08 14:52:49.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
      +entries: Doctrine\ORM\PersistentCollection {#4028 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
      +posts: Doctrine\ORM\PersistentCollection {#4018 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
      +follows: Doctrine\ORM\PersistentCollection {#4004 …}
      +followers: Doctrine\ORM\PersistentCollection {#4002 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
      +reports: Doctrine\ORM\PersistentCollection {#4115 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
      +violations: Doctrine\ORM\PersistentCollection {#4151 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
      +awards: Doctrine\ORM\PersistentCollection {#4145 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
      +categories: Doctrine\ORM\PersistentCollection {#4143 …}
      -id: 42479
      -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
      +apId: "WaterWaiver@aussie.zone"
      +apProfileId: "https://aussie.zone/u/WaterWaiver"
      +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "WaterWaiver"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1724531625 {#4088
        date: 2024-08-24 22:33:45.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692949316 {#4087
        date: 2023-08-25 09:41:56.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
      \n
      A couple more things to keep in mind:\n
      \n
      - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 6
    +score: 0
    +lastActive: DateTime @1692964519 {#4095
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4083 …}
    +nested: Doctrine\ORM\PersistentCollection {#4081 …}
    +votes: Doctrine\ORM\PersistentCollection {#4079 …}
    +reports: Doctrine\ORM\PersistentCollection {#4077 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
    -id: 26778
    -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2116578"
    +editedAt: DateTimeImmutable @1692949446 {#4027
      date: 2023-08-25 09:44:06.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692949313 {#4094
      date: 2023-08-25 09:41:53.0 +02:00
    }
  }
  +nestedComments: [
    26790 => App\Entity\EntryComment {#4412
      +user: Proxies\__CG__\App\Entity\User {#4409
        +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
        +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
        +email: "brendan@mastodon.brendans-bits.com"
        +username: "@brendan@mastodon.brendans-bits.com"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
        +lastActive: DateTime @1692964519 {#5980
          date: 2023-08-25 13:55:19.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
        +entries: Doctrine\ORM\PersistentCollection {#5994 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
        +posts: Doctrine\ORM\PersistentCollection {#6002 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
        +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
        +follows: Doctrine\ORM\PersistentCollection {#6014 …}
        +followers: Doctrine\ORM\PersistentCollection {#6016 …}
        +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
        +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
        +reports: Doctrine\ORM\PersistentCollection {#6026 …}
        +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
        +violations: Doctrine\ORM\PersistentCollection {#6030 …}
        +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
        +awards: Doctrine\ORM\PersistentCollection {#6034 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
        +categories: Doctrine\ORM\PersistentCollection {#6038 …}
        -id: 42498
        -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
        +apId: "brendan@mastodon.brendans-bits.com"
        +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
        +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
        +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
        +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
        +apDomain: "mastodon.brendans-bits.com"
        +apPreferredUsername: "brendan"
        +apDiscoverable: false
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1692964518 {#5977
          date: 2023-08-25 13:55:18.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692964515 {#5979
          date: 2023-08-25 13:55:15.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4355
        +user: Proxies\__CG__\App\Entity\User {#1970 …2}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4085}
        +root: App\Entity\EntryComment {#4085}
        +body: """
          > You could probably increase the 82K and 10K resistors to be much bigger\n
          \n
          That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
          \n
          > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
          \n
          Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
          \n
          > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
          \n
          This is a good point!\n
          \n
          My firmware will be pretty monotonic though, basically:\n
          \n
          1. wake up\n
          2. measure battery\n
          3. measure some other sensors (the actual task of the device)\n
          4. turn on a transceiver, send all the measurements (including battery voltage)\n
          5. turn off transceiver & go to sleep\n
          \n
          So, the load should be always the same at step (2).
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 3
        +score: 0
        +lastActive: DateTime @1692954197 {#4354
          date: 2023-08-25 11:03:17.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@WaterWaiver@aussie.zone"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4358 …}
        +nested: Doctrine\ORM\PersistentCollection {#4363 …}
        +votes: Doctrine\ORM\PersistentCollection {#4359 …}
        +reports: Doctrine\ORM\PersistentCollection {#4365 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
        -id: 26780
        -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://discuss.tchncs.de/comment/2363671"
        +editedAt: null
        +createdAt: DateTimeImmutable @1692954197 {#4351
          date: 2023-08-25 11:03:17.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4085}
      +body: """
        @nilclass@discuss.tchncs.de\n
        \n
        @WaterWaiver@aussie.zone\n
        \n
        From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."\n
        \n
        In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692964486 {#4413
        date: 2023-08-25 13:54:46.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@WaterWaiver@aussie.zone"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4406 …}
      +nested: Doctrine\ORM\PersistentCollection {#4404 …}
      +votes: Doctrine\ORM\PersistentCollection {#4408 …}
      +reports: Doctrine\ORM\PersistentCollection {#4419 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4421 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4423 …}
      -id: 26790
      -bodyTs: "'10':8 'ac':77 'affect':64 'becom':29 'capacitor':24 'caus':55 'convers':39 'drastic':63 'e.g':75 'effect':21 'exchang':6 'fast':72 'filter':20 'frequenc':47 'go':61 'higher':52 'imped':54 'issu':32 'kω':9 'larg':57 'less':11 'limit':44 'longer':35 'low':18 'major':31 'maximum':46 'measur':74 'need':69 'nilclass@discuss.tchncs.de':1 'otherwis':16 'pass':19 'post':7 'recommend':15 'repeat':73 'requir':33 'resist':13,28 'resistor':58 'result':43,66 'sampl':36 'sourc':12,27,53,78 'stack':5 'take':71 'time':37 'waterwaiver@aussie.zone':2 'word':50"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://mastodon.brendans-bits.com/users/brendan/statuses/110950120565907377"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692964486 {#4416
        date: 2023-08-25 13:54:46.0 +02:00
      }
    }
    26780 => App\Entity\EntryComment {#4355}
  ]
  +level: 1
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 66.10 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4355
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4085
      +user: App\Entity\User {#4034
        +avatar: null
        +cover: null
        +email: "WaterWaiver@aussie.zone"
        +username: "@WaterWaiver@aussie.zone"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: """
          I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
          \n
          Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
          """
        +lastActive: DateTime @1728391969 {#4090
          date: 2024-10-08 14:52:49.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
        +entries: Doctrine\ORM\PersistentCollection {#4028 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
        +posts: Doctrine\ORM\PersistentCollection {#4018 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
        +follows: Doctrine\ORM\PersistentCollection {#4004 …}
        +followers: Doctrine\ORM\PersistentCollection {#4002 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
        +reports: Doctrine\ORM\PersistentCollection {#4115 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
        +violations: Doctrine\ORM\PersistentCollection {#4151 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
        +awards: Doctrine\ORM\PersistentCollection {#4145 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
        +categories: Doctrine\ORM\PersistentCollection {#4143 …}
        -id: 42479
        -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
        +apId: "WaterWaiver@aussie.zone"
        +apProfileId: "https://aussie.zone/u/WaterWaiver"
        +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
        +apFollowersUrl: null
        +apInboxUrl: "https://aussie.zone/inbox"
        +apDomain: "aussie.zone"
        +apPreferredUsername: "WaterWaiver"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1724531625 {#4088
          date: 2024-08-24 22:33:45.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692949316 {#4087
          date: 2023-08-25 09:41:56.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
        \n
        A couple more things to keep in mind:\n
        \n
        - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 6
      +score: 0
      +lastActive: DateTime @1692964519 {#4095
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4083 …}
      +nested: Doctrine\ORM\PersistentCollection {#4081 …}
      +votes: Doctrine\ORM\PersistentCollection {#4079 …}
      +reports: Doctrine\ORM\PersistentCollection {#4077 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
      -id: 26778
      -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://aussie.zone/comment/2116578"
      +editedAt: DateTimeImmutable @1692949446 {#4027
        date: 2023-08-25 09:44:06.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692949313 {#4094
        date: 2023-08-25 09:41:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      > You could probably increase the 82K and 10K resistors to be much bigger\n
      \n
      That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
      \n
      > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      \n
      Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
      \n
      > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
      \n
      This is a good point!\n
      \n
      My firmware will be pretty monotonic though, basically:\n
      \n
      1. wake up\n
      2. measure battery\n
      3. measure some other sensors (the actual task of the device)\n
      4. turn on a transceiver, send all the measurements (including battery voltage)\n
      5. turn off transceiver & go to sleep\n
      \n
      So, the load should be always the same at step (2).
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 3
    +score: 0
    +lastActive: DateTime @1692954197 {#4354
      date: 2023-08-25 11:03:17.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4358 …}
    +nested: Doctrine\ORM\PersistentCollection {#4363 …}
    +votes: Doctrine\ORM\PersistentCollection {#4359 …}
    +reports: Doctrine\ORM\PersistentCollection {#4365 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
    -id: 26780
    -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363671"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954197 {#4351
      date: 2023-08-25 11:03:17.0 +02:00
    }
  }
  "showNested" => true
  "level" => 2
  "showEntryTitle" => false
  "showMagazineName" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#5183
  +comment: App\Entity\EntryComment {#4355
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4085
      +user: App\Entity\User {#4034
        +avatar: null
        +cover: null
        +email: "WaterWaiver@aussie.zone"
        +username: "@WaterWaiver@aussie.zone"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: """
          I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
          \n
          Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
          """
        +lastActive: DateTime @1728391969 {#4090
          date: 2024-10-08 14:52:49.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
        +entries: Doctrine\ORM\PersistentCollection {#4028 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
        +posts: Doctrine\ORM\PersistentCollection {#4018 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
        +follows: Doctrine\ORM\PersistentCollection {#4004 …}
        +followers: Doctrine\ORM\PersistentCollection {#4002 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
        +reports: Doctrine\ORM\PersistentCollection {#4115 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
        +violations: Doctrine\ORM\PersistentCollection {#4151 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
        +awards: Doctrine\ORM\PersistentCollection {#4145 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
        +categories: Doctrine\ORM\PersistentCollection {#4143 …}
        -id: 42479
        -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
        +apId: "WaterWaiver@aussie.zone"
        +apProfileId: "https://aussie.zone/u/WaterWaiver"
        +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
        +apFollowersUrl: null
        +apInboxUrl: "https://aussie.zone/inbox"
        +apDomain: "aussie.zone"
        +apPreferredUsername: "WaterWaiver"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1724531625 {#4088
          date: 2024-08-24 22:33:45.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692949316 {#4087
          date: 2023-08-25 09:41:56.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
        \n
        A couple more things to keep in mind:\n
        \n
        - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 6
      +score: 0
      +lastActive: DateTime @1692964519 {#4095
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4083 …}
      +nested: Doctrine\ORM\PersistentCollection {#4081 …}
      +votes: Doctrine\ORM\PersistentCollection {#4079 …}
      +reports: Doctrine\ORM\PersistentCollection {#4077 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
      -id: 26778
      -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://aussie.zone/comment/2116578"
      +editedAt: DateTimeImmutable @1692949446 {#4027
        date: 2023-08-25 09:44:06.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692949313 {#4094
        date: 2023-08-25 09:41:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      > You could probably increase the 82K and 10K resistors to be much bigger\n
      \n
      That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
      \n
      > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      \n
      Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
      \n
      > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
      \n
      This is a good point!\n
      \n
      My firmware will be pretty monotonic though, basically:\n
      \n
      1. wake up\n
      2. measure battery\n
      3. measure some other sensors (the actual task of the device)\n
      4. turn on a transceiver, send all the measurements (including battery voltage)\n
      5. turn off transceiver & go to sleep\n
      \n
      So, the load should be always the same at step (2).
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 3
    +score: 0
    +lastActive: DateTime @1692954197 {#4354
      date: 2023-08-25 11:03:17.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4358 …}
    +nested: Doctrine\ORM\PersistentCollection {#4363 …}
    +votes: Doctrine\ORM\PersistentCollection {#4359 …}
    +reports: Doctrine\ORM\PersistentCollection {#4365 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
    -id: 26780
    -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363671"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954197 {#4351
      date: 2023-08-25 11:03:17.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 2
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.13 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#5230
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.13 ms
Input props
[
  "date" => DateTimeImmutable @1692954197 {#4351
    date: 2023-08-25 11:03:17.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#5285
  +date: DateTimeImmutable @1692954197 {#4351
    date: 2023-08-25 11:03:17.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.09 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692954197 {#4351
    date: 2023-08-25 11:03:17.0 +02:00
  }
  "editedAt" => null
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#5339
  +createdAt: DateTimeImmutable @1692954197 {#4351
    date: 2023-08-25 11:03:17.0 +02:00
  }
  +editedAt: null
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 0.20 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#5393
  +width: 40
  +height: 40
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 0.41 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4355
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4085
      +user: App\Entity\User {#4034
        +avatar: null
        +cover: null
        +email: "WaterWaiver@aussie.zone"
        +username: "@WaterWaiver@aussie.zone"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: """
          I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
          \n
          Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
          """
        +lastActive: DateTime @1728391969 {#4090
          date: 2024-10-08 14:52:49.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
        +entries: Doctrine\ORM\PersistentCollection {#4028 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
        +posts: Doctrine\ORM\PersistentCollection {#4018 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
        +follows: Doctrine\ORM\PersistentCollection {#4004 …}
        +followers: Doctrine\ORM\PersistentCollection {#4002 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
        +reports: Doctrine\ORM\PersistentCollection {#4115 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
        +violations: Doctrine\ORM\PersistentCollection {#4151 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
        +awards: Doctrine\ORM\PersistentCollection {#4145 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
        +categories: Doctrine\ORM\PersistentCollection {#4143 …}
        -id: 42479
        -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
        +apId: "WaterWaiver@aussie.zone"
        +apProfileId: "https://aussie.zone/u/WaterWaiver"
        +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
        +apFollowersUrl: null
        +apInboxUrl: "https://aussie.zone/inbox"
        +apDomain: "aussie.zone"
        +apPreferredUsername: "WaterWaiver"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1724531625 {#4088
          date: 2024-08-24 22:33:45.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692949316 {#4087
          date: 2023-08-25 09:41:56.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
        \n
        A couple more things to keep in mind:\n
        \n
        - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 6
      +score: 0
      +lastActive: DateTime @1692964519 {#4095
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4083 …}
      +nested: Doctrine\ORM\PersistentCollection {#4081 …}
      +votes: Doctrine\ORM\PersistentCollection {#4079 …}
      +reports: Doctrine\ORM\PersistentCollection {#4077 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
      -id: 26778
      -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://aussie.zone/comment/2116578"
      +editedAt: DateTimeImmutable @1692949446 {#4027
        date: 2023-08-25 09:44:06.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692949313 {#4094
        date: 2023-08-25 09:41:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      > You could probably increase the 82K and 10K resistors to be much bigger\n
      \n
      That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
      \n
      > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      \n
      Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
      \n
      > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
      \n
      This is a good point!\n
      \n
      My firmware will be pretty monotonic though, basically:\n
      \n
      1. wake up\n
      2. measure battery\n
      3. measure some other sensors (the actual task of the device)\n
      4. turn on a transceiver, send all the measurements (including battery voltage)\n
      5. turn off transceiver & go to sleep\n
      \n
      So, the load should be always the same at step (2).
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 3
    +score: 0
    +lastActive: DateTime @1692954197 {#4354
      date: 2023-08-25 11:03:17.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4358 …}
    +nested: Doctrine\ORM\PersistentCollection {#4363 …}
    +votes: Doctrine\ORM\PersistentCollection {#4359 …}
    +reports: Doctrine\ORM\PersistentCollection {#4365 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
    -id: 26780
    -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363671"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954197 {#4351
      date: 2023-08-25 11:03:17.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#5543
  +subject: App\Entity\EntryComment {#4355
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4085
      +user: App\Entity\User {#4034
        +avatar: null
        +cover: null
        +email: "WaterWaiver@aussie.zone"
        +username: "@WaterWaiver@aussie.zone"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: """
          I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
          \n
          Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
          """
        +lastActive: DateTime @1728391969 {#4090
          date: 2024-10-08 14:52:49.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
        +entries: Doctrine\ORM\PersistentCollection {#4028 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
        +posts: Doctrine\ORM\PersistentCollection {#4018 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
        +follows: Doctrine\ORM\PersistentCollection {#4004 …}
        +followers: Doctrine\ORM\PersistentCollection {#4002 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
        +reports: Doctrine\ORM\PersistentCollection {#4115 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
        +violations: Doctrine\ORM\PersistentCollection {#4151 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
        +awards: Doctrine\ORM\PersistentCollection {#4145 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
        +categories: Doctrine\ORM\PersistentCollection {#4143 …}
        -id: 42479
        -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
        +apId: "WaterWaiver@aussie.zone"
        +apProfileId: "https://aussie.zone/u/WaterWaiver"
        +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
        +apFollowersUrl: null
        +apInboxUrl: "https://aussie.zone/inbox"
        +apDomain: "aussie.zone"
        +apPreferredUsername: "WaterWaiver"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1724531625 {#4088
          date: 2024-08-24 22:33:45.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692949316 {#4087
          date: 2023-08-25 09:41:56.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
        \n
        A couple more things to keep in mind:\n
        \n
        - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 6
      +score: 0
      +lastActive: DateTime @1692964519 {#4095
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4083 …}
      +nested: Doctrine\ORM\PersistentCollection {#4081 …}
      +votes: Doctrine\ORM\PersistentCollection {#4079 …}
      +reports: Doctrine\ORM\PersistentCollection {#4077 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
      -id: 26778
      -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://aussie.zone/comment/2116578"
      +editedAt: DateTimeImmutable @1692949446 {#4027
        date: 2023-08-25 09:44:06.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692949313 {#4094
        date: 2023-08-25 09:41:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      > You could probably increase the 82K and 10K resistors to be much bigger\n
      \n
      That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
      \n
      > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      \n
      Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
      \n
      > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
      \n
      This is a good point!\n
      \n
      My firmware will be pretty monotonic though, basically:\n
      \n
      1. wake up\n
      2. measure battery\n
      3. measure some other sensors (the actual task of the device)\n
      4. turn on a transceiver, send all the measurements (including battery voltage)\n
      5. turn off transceiver & go to sleep\n
      \n
      So, the load should be always the same at step (2).
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 3
    +score: 0
    +lastActive: DateTime @1692954197 {#4354
      date: 2023-08-25 11:03:17.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4358 …}
    +nested: Doctrine\ORM\PersistentCollection {#4363 …}
    +votes: Doctrine\ORM\PersistentCollection {#4359 …}
    +reports: Doctrine\ORM\PersistentCollection {#4365 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
    -id: 26780
    -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363671"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954197 {#4351
      date: 2023-08-25 11:03:17.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.65 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4355
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4085
      +user: App\Entity\User {#4034
        +avatar: null
        +cover: null
        +email: "WaterWaiver@aussie.zone"
        +username: "@WaterWaiver@aussie.zone"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: """
          I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
          \n
          Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
          """
        +lastActive: DateTime @1728391969 {#4090
          date: 2024-10-08 14:52:49.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
        +entries: Doctrine\ORM\PersistentCollection {#4028 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
        +posts: Doctrine\ORM\PersistentCollection {#4018 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
        +follows: Doctrine\ORM\PersistentCollection {#4004 …}
        +followers: Doctrine\ORM\PersistentCollection {#4002 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
        +reports: Doctrine\ORM\PersistentCollection {#4115 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
        +violations: Doctrine\ORM\PersistentCollection {#4151 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
        +awards: Doctrine\ORM\PersistentCollection {#4145 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
        +categories: Doctrine\ORM\PersistentCollection {#4143 …}
        -id: 42479
        -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
        +apId: "WaterWaiver@aussie.zone"
        +apProfileId: "https://aussie.zone/u/WaterWaiver"
        +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
        +apFollowersUrl: null
        +apInboxUrl: "https://aussie.zone/inbox"
        +apDomain: "aussie.zone"
        +apPreferredUsername: "WaterWaiver"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1724531625 {#4088
          date: 2024-08-24 22:33:45.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692949316 {#4087
          date: 2023-08-25 09:41:56.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
        \n
        A couple more things to keep in mind:\n
        \n
        - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 6
      +score: 0
      +lastActive: DateTime @1692964519 {#4095
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4083 …}
      +nested: Doctrine\ORM\PersistentCollection {#4081 …}
      +votes: Doctrine\ORM\PersistentCollection {#4079 …}
      +reports: Doctrine\ORM\PersistentCollection {#4077 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
      -id: 26778
      -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://aussie.zone/comment/2116578"
      +editedAt: DateTimeImmutable @1692949446 {#4027
        date: 2023-08-25 09:44:06.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692949313 {#4094
        date: 2023-08-25 09:41:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      > You could probably increase the 82K and 10K resistors to be much bigger\n
      \n
      That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
      \n
      > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      \n
      Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
      \n
      > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
      \n
      This is a good point!\n
      \n
      My firmware will be pretty monotonic though, basically:\n
      \n
      1. wake up\n
      2. measure battery\n
      3. measure some other sensors (the actual task of the device)\n
      4. turn on a transceiver, send all the measurements (including battery voltage)\n
      5. turn off transceiver & go to sleep\n
      \n
      So, the load should be always the same at step (2).
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 3
    +score: 0
    +lastActive: DateTime @1692954197 {#4354
      date: 2023-08-25 11:03:17.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4358 …}
    +nested: Doctrine\ORM\PersistentCollection {#4363 …}
    +votes: Doctrine\ORM\PersistentCollection {#4359 …}
    +reports: Doctrine\ORM\PersistentCollection {#4365 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
    -id: 26780
    -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363671"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954197 {#4351
      date: 2023-08-25 11:03:17.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#5600
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4355
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4085
      +user: App\Entity\User {#4034
        +avatar: null
        +cover: null
        +email: "WaterWaiver@aussie.zone"
        +username: "@WaterWaiver@aussie.zone"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: """
          I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
          \n
          Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
          """
        +lastActive: DateTime @1728391969 {#4090
          date: 2024-10-08 14:52:49.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
        +entries: Doctrine\ORM\PersistentCollection {#4028 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
        +posts: Doctrine\ORM\PersistentCollection {#4018 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
        +follows: Doctrine\ORM\PersistentCollection {#4004 …}
        +followers: Doctrine\ORM\PersistentCollection {#4002 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
        +reports: Doctrine\ORM\PersistentCollection {#4115 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
        +violations: Doctrine\ORM\PersistentCollection {#4151 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
        +awards: Doctrine\ORM\PersistentCollection {#4145 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
        +categories: Doctrine\ORM\PersistentCollection {#4143 …}
        -id: 42479
        -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
        +apId: "WaterWaiver@aussie.zone"
        +apProfileId: "https://aussie.zone/u/WaterWaiver"
        +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
        +apFollowersUrl: null
        +apInboxUrl: "https://aussie.zone/inbox"
        +apDomain: "aussie.zone"
        +apPreferredUsername: "WaterWaiver"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1724531625 {#4088
          date: 2024-08-24 22:33:45.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692949316 {#4087
          date: 2023-08-25 09:41:56.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
        \n
        A couple more things to keep in mind:\n
        \n
        - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 6
      +score: 0
      +lastActive: DateTime @1692964519 {#4095
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4083 …}
      +nested: Doctrine\ORM\PersistentCollection {#4081 …}
      +votes: Doctrine\ORM\PersistentCollection {#4079 …}
      +reports: Doctrine\ORM\PersistentCollection {#4077 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
      -id: 26778
      -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://aussie.zone/comment/2116578"
      +editedAt: DateTimeImmutable @1692949446 {#4027
        date: 2023-08-25 09:44:06.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692949313 {#4094
        date: 2023-08-25 09:41:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      > You could probably increase the 82K and 10K resistors to be much bigger\n
      \n
      That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
      \n
      > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      \n
      Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
      \n
      > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
      \n
      This is a good point!\n
      \n
      My firmware will be pretty monotonic though, basically:\n
      \n
      1. wake up\n
      2. measure battery\n
      3. measure some other sensors (the actual task of the device)\n
      4. turn on a transceiver, send all the measurements (including battery voltage)\n
      5. turn off transceiver & go to sleep\n
      \n
      So, the load should be always the same at step (2).
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 3
    +score: 0
    +lastActive: DateTime @1692954197 {#4354
      date: 2023-08-25 11:03:17.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4358 …}
    +nested: Doctrine\ORM\PersistentCollection {#4363 …}
    +votes: Doctrine\ORM\PersistentCollection {#4359 …}
    +reports: Doctrine\ORM\PersistentCollection {#4365 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
    -id: 26780
    -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363671"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954197 {#4351
      date: 2023-08-25 11:03:17.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 59.66 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4355
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4085
      +user: App\Entity\User {#4034
        +avatar: null
        +cover: null
        +email: "WaterWaiver@aussie.zone"
        +username: "@WaterWaiver@aussie.zone"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: """
          I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
          \n
          Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
          """
        +lastActive: DateTime @1728391969 {#4090
          date: 2024-10-08 14:52:49.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
        +entries: Doctrine\ORM\PersistentCollection {#4028 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
        +posts: Doctrine\ORM\PersistentCollection {#4018 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
        +follows: Doctrine\ORM\PersistentCollection {#4004 …}
        +followers: Doctrine\ORM\PersistentCollection {#4002 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
        +reports: Doctrine\ORM\PersistentCollection {#4115 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
        +violations: Doctrine\ORM\PersistentCollection {#4151 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
        +awards: Doctrine\ORM\PersistentCollection {#4145 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
        +categories: Doctrine\ORM\PersistentCollection {#4143 …}
        -id: 42479
        -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
        +apId: "WaterWaiver@aussie.zone"
        +apProfileId: "https://aussie.zone/u/WaterWaiver"
        +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
        +apFollowersUrl: null
        +apInboxUrl: "https://aussie.zone/inbox"
        +apDomain: "aussie.zone"
        +apPreferredUsername: "WaterWaiver"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1724531625 {#4088
          date: 2024-08-24 22:33:45.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692949316 {#4087
          date: 2023-08-25 09:41:56.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
        \n
        A couple more things to keep in mind:\n
        \n
        - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 6
      +score: 0
      +lastActive: DateTime @1692964519 {#4095
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4083 …}
      +nested: Doctrine\ORM\PersistentCollection {#4081 …}
      +votes: Doctrine\ORM\PersistentCollection {#4079 …}
      +reports: Doctrine\ORM\PersistentCollection {#4077 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
      -id: 26778
      -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://aussie.zone/comment/2116578"
      +editedAt: DateTimeImmutable @1692949446 {#4027
        date: 2023-08-25 09:44:06.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692949313 {#4094
        date: 2023-08-25 09:41:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      > You could probably increase the 82K and 10K resistors to be much bigger\n
      \n
      That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
      \n
      > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      \n
      Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
      \n
      > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
      \n
      This is a good point!\n
      \n
      My firmware will be pretty monotonic though, basically:\n
      \n
      1. wake up\n
      2. measure battery\n
      3. measure some other sensors (the actual task of the device)\n
      4. turn on a transceiver, send all the measurements (including battery voltage)\n
      5. turn off transceiver & go to sleep\n
      \n
      So, the load should be always the same at step (2).
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 3
    +score: 0
    +lastActive: DateTime @1692954197 {#4354
      date: 2023-08-25 11:03:17.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4358 …}
    +nested: Doctrine\ORM\PersistentCollection {#4363 …}
    +votes: Doctrine\ORM\PersistentCollection {#4359 …}
    +reports: Doctrine\ORM\PersistentCollection {#4365 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
    -id: 26780
    -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363671"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954197 {#4351
      date: 2023-08-25 11:03:17.0 +02:00
    }
  }
  "level" => 2
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#5840
  +comment: App\Entity\EntryComment {#4355
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4085
      +user: App\Entity\User {#4034
        +avatar: null
        +cover: null
        +email: "WaterWaiver@aussie.zone"
        +username: "@WaterWaiver@aussie.zone"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: """
          I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
          \n
          Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
          """
        +lastActive: DateTime @1728391969 {#4090
          date: 2024-10-08 14:52:49.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
        +entries: Doctrine\ORM\PersistentCollection {#4028 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
        +posts: Doctrine\ORM\PersistentCollection {#4018 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
        +follows: Doctrine\ORM\PersistentCollection {#4004 …}
        +followers: Doctrine\ORM\PersistentCollection {#4002 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
        +reports: Doctrine\ORM\PersistentCollection {#4115 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
        +violations: Doctrine\ORM\PersistentCollection {#4151 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
        +awards: Doctrine\ORM\PersistentCollection {#4145 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
        +categories: Doctrine\ORM\PersistentCollection {#4143 …}
        -id: 42479
        -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
        +apId: "WaterWaiver@aussie.zone"
        +apProfileId: "https://aussie.zone/u/WaterWaiver"
        +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
        +apFollowersUrl: null
        +apInboxUrl: "https://aussie.zone/inbox"
        +apDomain: "aussie.zone"
        +apPreferredUsername: "WaterWaiver"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1724531625 {#4088
          date: 2024-08-24 22:33:45.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692949316 {#4087
          date: 2023-08-25 09:41:56.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
        \n
        A couple more things to keep in mind:\n
        \n
        - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 6
      +score: 0
      +lastActive: DateTime @1692964519 {#4095
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4083 …}
      +nested: Doctrine\ORM\PersistentCollection {#4081 …}
      +votes: Doctrine\ORM\PersistentCollection {#4079 …}
      +reports: Doctrine\ORM\PersistentCollection {#4077 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
      -id: 26778
      -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://aussie.zone/comment/2116578"
      +editedAt: DateTimeImmutable @1692949446 {#4027
        date: 2023-08-25 09:44:06.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692949313 {#4094
        date: 2023-08-25 09:41:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      > You could probably increase the 82K and 10K resistors to be much bigger\n
      \n
      That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
      \n
      > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
      \n
      Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
      \n
      > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
      \n
      This is a good point!\n
      \n
      My firmware will be pretty monotonic though, basically:\n
      \n
      1. wake up\n
      2. measure battery\n
      3. measure some other sensors (the actual task of the device)\n
      4. turn on a transceiver, send all the measurements (including battery voltage)\n
      5. turn off transceiver & go to sleep\n
      \n
      So, the load should be always the same at step (2).
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 3
    +score: 0
    +lastActive: DateTime @1692954197 {#4354
      date: 2023-08-25 11:03:17.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4358 …}
    +nested: Doctrine\ORM\PersistentCollection {#4363 …}
    +votes: Doctrine\ORM\PersistentCollection {#4359 …}
    +reports: Doctrine\ORM\PersistentCollection {#4365 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
    -id: 26780
    -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363671"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954197 {#4351
      date: 2023-08-25 11:03:17.0 +02:00
    }
  }
  +nestedComments: []
  +level: 2
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 58.96 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4412
    +user: Proxies\__CG__\App\Entity\User {#4409
      +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
      +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
      +email: "brendan@mastodon.brendans-bits.com"
      +username: "@brendan@mastodon.brendans-bits.com"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
      +lastActive: DateTime @1692964519 {#5980
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
      +entries: Doctrine\ORM\PersistentCollection {#5994 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
      +posts: Doctrine\ORM\PersistentCollection {#6002 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
      +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
      +follows: Doctrine\ORM\PersistentCollection {#6014 …}
      +followers: Doctrine\ORM\PersistentCollection {#6016 …}
      +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
      +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
      +reports: Doctrine\ORM\PersistentCollection {#6026 …}
      +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
      +violations: Doctrine\ORM\PersistentCollection {#6030 …}
      +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
      +awards: Doctrine\ORM\PersistentCollection {#6034 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
      +categories: Doctrine\ORM\PersistentCollection {#6038 …}
      -id: 42498
      -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
      +apId: "brendan@mastodon.brendans-bits.com"
      +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
      +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
      +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
      +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
      +apDomain: "mastodon.brendans-bits.com"
      +apPreferredUsername: "brendan"
      +apDiscoverable: false
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692964518 {#5977
        date: 2023-08-25 13:55:18.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692964515 {#5979
        date: 2023-08-25 13:55:15.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4355
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4085
        +user: App\Entity\User {#4034
          +avatar: null
          +cover: null
          +email: "WaterWaiver@aussie.zone"
          +username: "@WaterWaiver@aussie.zone"
          +roles: []
          +followersCount: 0
          +homepage: "front"
          +about: """
            I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
            \n
            Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
            """
          +lastActive: DateTime @1728391969 {#4090
            date: 2024-10-08 14:52:49.0 +02:00
          }
          +markedForDeletionAt: null
          +fields: null
          +oauthGithubId: null
          +oauthGoogleId: null
          +oauthFacebookId: null
          +oauthKeycloakId: null
          +hideAdult: true
          +showSubscribedUsers: true
          +showSubscribedMagazines: true
          +showSubscribedDomains: true
          +preferredLanguages: []
          +featuredMagazines: null
          +showProfileSubscriptions: false
          +showProfileFollowings: true
          +markNewComments: false
          +notifyOnNewEntry: false
          +notifyOnNewEntryReply: true
          +notifyOnNewEntryCommentReply: true
          +notifyOnNewPost: false
          +notifyOnNewPostReply: true
          +notifyOnNewPostCommentReply: true
          +addMentionsEntries: false
          +addMentionsPosts: true
          +isBanned: false
          +isVerified: false
          +isDeleted: false
          +isBot: false
          +spamProtection: true
          +customCss: null
          +ignoreMagazinesCustomCss: false
          +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
          +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
          +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
          +entries: Doctrine\ORM\PersistentCollection {#4028 …}
          +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
          +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
          +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
          +posts: Doctrine\ORM\PersistentCollection {#4018 …}
          +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
          +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
          +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
          +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
          +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
          +follows: Doctrine\ORM\PersistentCollection {#4004 …}
          +followers: Doctrine\ORM\PersistentCollection {#4002 …}
          +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
          +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
          +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
          +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
          +reports: Doctrine\ORM\PersistentCollection {#4115 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
          +violations: Doctrine\ORM\PersistentCollection {#4151 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
          +awards: Doctrine\ORM\PersistentCollection {#4145 …}
          +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
          +categories: Doctrine\ORM\PersistentCollection {#4143 …}
          -id: 42479
          -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
          -totpSecret: null
          -totpBackupCodes: []
          -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
          +apId: "WaterWaiver@aussie.zone"
          +apProfileId: "https://aussie.zone/u/WaterWaiver"
          +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
          +apFollowersUrl: null
          +apInboxUrl: "https://aussie.zone/inbox"
          +apDomain: "aussie.zone"
          +apPreferredUsername: "WaterWaiver"
          +apDiscoverable: true
          +apManuallyApprovesFollowers: false
          +privateKey: null
          +publicKey: null
          +apFetchedAt: DateTime @1724531625 {#4088
            date: 2024-08-24 22:33:45.0 +02:00
          }
          +apDeletedAt: null
          +apTimeoutAt: null
          +visibility: "visible             "
          +createdAt: DateTimeImmutable @1692949316 {#4087
            date: 2023-08-25 09:41:56.0 +02:00
          }
        }
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
          \n
          A couple more things to keep in mind:\n
          \n
          - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
          - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 6
        +score: 0
        +lastActive: DateTime @1692964519 {#4095
          date: 2023-08-25 13:55:19.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4083 …}
        +nested: Doctrine\ORM\PersistentCollection {#4081 …}
        +votes: Doctrine\ORM\PersistentCollection {#4079 …}
        +reports: Doctrine\ORM\PersistentCollection {#4077 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
        -id: 26778
        -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://aussie.zone/comment/2116578"
        +editedAt: DateTimeImmutable @1692949446 {#4027
          date: 2023-08-25 09:44:06.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692949313 {#4094
          date: 2023-08-25 09:41:53.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4085}
      +body: """
        > You could probably increase the 82K and 10K resistors to be much bigger\n
        \n
        That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
        \n
        > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        \n
        Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
        \n
        > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
        \n
        This is a good point!\n
        \n
        My firmware will be pretty monotonic though, basically:\n
        \n
        1. wake up\n
        2. measure battery\n
        3. measure some other sensors (the actual task of the device)\n
        4. turn on a transceiver, send all the measurements (including battery voltage)\n
        5. turn off transceiver & go to sleep\n
        \n
        So, the load should be always the same at step (2).
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 3
      +score: 0
      +lastActive: DateTime @1692954197 {#4354
        date: 2023-08-25 11:03:17.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@WaterWaiver@aussie.zone"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4358 …}
      +nested: Doctrine\ORM\PersistentCollection {#4363 …}
      +votes: Doctrine\ORM\PersistentCollection {#4359 …}
      +reports: Doctrine\ORM\PersistentCollection {#4365 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
      -id: 26780
      -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363671"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954197 {#4351
        date: 2023-08-25 11:03:17.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      @nilclass@discuss.tchncs.de\n
      \n
      @WaterWaiver@aussie.zone\n
      \n
      From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."\n
      \n
      In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692964486 {#4413
      date: 2023-08-25 13:54:46.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4406 …}
    +nested: Doctrine\ORM\PersistentCollection {#4404 …}
    +votes: Doctrine\ORM\PersistentCollection {#4408 …}
    +reports: Doctrine\ORM\PersistentCollection {#4419 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4421 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4423 …}
    -id: 26790
    -bodyTs: "'10':8 'ac':77 'affect':64 'becom':29 'capacitor':24 'caus':55 'convers':39 'drastic':63 'e.g':75 'effect':21 'exchang':6 'fast':72 'filter':20 'frequenc':47 'go':61 'higher':52 'imped':54 'issu':32 'kω':9 'larg':57 'less':11 'limit':44 'longer':35 'low':18 'major':31 'maximum':46 'measur':74 'need':69 'nilclass@discuss.tchncs.de':1 'otherwis':16 'pass':19 'post':7 'recommend':15 'repeat':73 'requir':33 'resist':13,28 'resistor':58 'result':43,66 'sampl':36 'sourc':12,27,53,78 'stack':5 'take':71 'time':37 'waterwaiver@aussie.zone':2 'word':50"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://mastodon.brendans-bits.com/users/brendan/statuses/110950120565907377"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692964486 {#4416
      date: 2023-08-25 13:54:46.0 +02:00
    }
  }
  "showNested" => true
  "level" => 3
  "showEntryTitle" => false
  "showMagazineName" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#5895
  +comment: App\Entity\EntryComment {#4412
    +user: Proxies\__CG__\App\Entity\User {#4409
      +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
      +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
      +email: "brendan@mastodon.brendans-bits.com"
      +username: "@brendan@mastodon.brendans-bits.com"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
      +lastActive: DateTime @1692964519 {#5980
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
      +entries: Doctrine\ORM\PersistentCollection {#5994 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
      +posts: Doctrine\ORM\PersistentCollection {#6002 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
      +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
      +follows: Doctrine\ORM\PersistentCollection {#6014 …}
      +followers: Doctrine\ORM\PersistentCollection {#6016 …}
      +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
      +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
      +reports: Doctrine\ORM\PersistentCollection {#6026 …}
      +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
      +violations: Doctrine\ORM\PersistentCollection {#6030 …}
      +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
      +awards: Doctrine\ORM\PersistentCollection {#6034 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
      +categories: Doctrine\ORM\PersistentCollection {#6038 …}
      -id: 42498
      -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
      +apId: "brendan@mastodon.brendans-bits.com"
      +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
      +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
      +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
      +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
      +apDomain: "mastodon.brendans-bits.com"
      +apPreferredUsername: "brendan"
      +apDiscoverable: false
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692964518 {#5977
        date: 2023-08-25 13:55:18.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692964515 {#5979
        date: 2023-08-25 13:55:15.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4355
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4085
        +user: App\Entity\User {#4034
          +avatar: null
          +cover: null
          +email: "WaterWaiver@aussie.zone"
          +username: "@WaterWaiver@aussie.zone"
          +roles: []
          +followersCount: 0
          +homepage: "front"
          +about: """
            I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
            \n
            Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
            """
          +lastActive: DateTime @1728391969 {#4090
            date: 2024-10-08 14:52:49.0 +02:00
          }
          +markedForDeletionAt: null
          +fields: null
          +oauthGithubId: null
          +oauthGoogleId: null
          +oauthFacebookId: null
          +oauthKeycloakId: null
          +hideAdult: true
          +showSubscribedUsers: true
          +showSubscribedMagazines: true
          +showSubscribedDomains: true
          +preferredLanguages: []
          +featuredMagazines: null
          +showProfileSubscriptions: false
          +showProfileFollowings: true
          +markNewComments: false
          +notifyOnNewEntry: false
          +notifyOnNewEntryReply: true
          +notifyOnNewEntryCommentReply: true
          +notifyOnNewPost: false
          +notifyOnNewPostReply: true
          +notifyOnNewPostCommentReply: true
          +addMentionsEntries: false
          +addMentionsPosts: true
          +isBanned: false
          +isVerified: false
          +isDeleted: false
          +isBot: false
          +spamProtection: true
          +customCss: null
          +ignoreMagazinesCustomCss: false
          +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
          +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
          +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
          +entries: Doctrine\ORM\PersistentCollection {#4028 …}
          +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
          +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
          +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
          +posts: Doctrine\ORM\PersistentCollection {#4018 …}
          +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
          +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
          +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
          +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
          +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
          +follows: Doctrine\ORM\PersistentCollection {#4004 …}
          +followers: Doctrine\ORM\PersistentCollection {#4002 …}
          +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
          +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
          +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
          +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
          +reports: Doctrine\ORM\PersistentCollection {#4115 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
          +violations: Doctrine\ORM\PersistentCollection {#4151 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
          +awards: Doctrine\ORM\PersistentCollection {#4145 …}
          +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
          +categories: Doctrine\ORM\PersistentCollection {#4143 …}
          -id: 42479
          -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
          -totpSecret: null
          -totpBackupCodes: []
          -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
          +apId: "WaterWaiver@aussie.zone"
          +apProfileId: "https://aussie.zone/u/WaterWaiver"
          +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
          +apFollowersUrl: null
          +apInboxUrl: "https://aussie.zone/inbox"
          +apDomain: "aussie.zone"
          +apPreferredUsername: "WaterWaiver"
          +apDiscoverable: true
          +apManuallyApprovesFollowers: false
          +privateKey: null
          +publicKey: null
          +apFetchedAt: DateTime @1724531625 {#4088
            date: 2024-08-24 22:33:45.0 +02:00
          }
          +apDeletedAt: null
          +apTimeoutAt: null
          +visibility: "visible             "
          +createdAt: DateTimeImmutable @1692949316 {#4087
            date: 2023-08-25 09:41:56.0 +02:00
          }
        }
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
          \n
          A couple more things to keep in mind:\n
          \n
          - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
          - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 6
        +score: 0
        +lastActive: DateTime @1692964519 {#4095
          date: 2023-08-25 13:55:19.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4083 …}
        +nested: Doctrine\ORM\PersistentCollection {#4081 …}
        +votes: Doctrine\ORM\PersistentCollection {#4079 …}
        +reports: Doctrine\ORM\PersistentCollection {#4077 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
        -id: 26778
        -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://aussie.zone/comment/2116578"
        +editedAt: DateTimeImmutable @1692949446 {#4027
          date: 2023-08-25 09:44:06.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692949313 {#4094
          date: 2023-08-25 09:41:53.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4085}
      +body: """
        > You could probably increase the 82K and 10K resistors to be much bigger\n
        \n
        That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
        \n
        > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        \n
        Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
        \n
        > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
        \n
        This is a good point!\n
        \n
        My firmware will be pretty monotonic though, basically:\n
        \n
        1. wake up\n
        2. measure battery\n
        3. measure some other sensors (the actual task of the device)\n
        4. turn on a transceiver, send all the measurements (including battery voltage)\n
        5. turn off transceiver & go to sleep\n
        \n
        So, the load should be always the same at step (2).
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 3
      +score: 0
      +lastActive: DateTime @1692954197 {#4354
        date: 2023-08-25 11:03:17.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@WaterWaiver@aussie.zone"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4358 …}
      +nested: Doctrine\ORM\PersistentCollection {#4363 …}
      +votes: Doctrine\ORM\PersistentCollection {#4359 …}
      +reports: Doctrine\ORM\PersistentCollection {#4365 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
      -id: 26780
      -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363671"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954197 {#4351
        date: 2023-08-25 11:03:17.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      @nilclass@discuss.tchncs.de\n
      \n
      @WaterWaiver@aussie.zone\n
      \n
      From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."\n
      \n
      In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692964486 {#4413
      date: 2023-08-25 13:54:46.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4406 …}
    +nested: Doctrine\ORM\PersistentCollection {#4404 …}
    +votes: Doctrine\ORM\PersistentCollection {#4408 …}
    +reports: Doctrine\ORM\PersistentCollection {#4419 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4421 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4423 …}
    -id: 26790
    -bodyTs: "'10':8 'ac':77 'affect':64 'becom':29 'capacitor':24 'caus':55 'convers':39 'drastic':63 'e.g':75 'effect':21 'exchang':6 'fast':72 'filter':20 'frequenc':47 'go':61 'higher':52 'imped':54 'issu':32 'kω':9 'larg':57 'less':11 'limit':44 'longer':35 'low':18 'major':31 'maximum':46 'measur':74 'need':69 'nilclass@discuss.tchncs.de':1 'otherwis':16 'pass':19 'post':7 'recommend':15 'repeat':73 'requir':33 'resist':13,28 'resistor':58 'result':43,66 'sampl':36 'sourc':12,27,53,78 'stack':5 'take':71 'time':37 'waterwaiver@aussie.zone':2 'word':50"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://mastodon.brendans-bits.com/users/brendan/statuses/110950120565907377"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692964486 {#4416
      date: 2023-08-25 13:54:46.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 3
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 2.15 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#4409
    +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
    +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
    +email: "brendan@mastodon.brendans-bits.com"
    +username: "@brendan@mastodon.brendans-bits.com"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
    +lastActive: DateTime @1692964519 {#5980
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
    +entries: Doctrine\ORM\PersistentCollection {#5994 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
    +posts: Doctrine\ORM\PersistentCollection {#6002 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
    +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
    +follows: Doctrine\ORM\PersistentCollection {#6014 …}
    +followers: Doctrine\ORM\PersistentCollection {#6016 …}
    +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
    +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
    +reports: Doctrine\ORM\PersistentCollection {#6026 …}
    +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
    +violations: Doctrine\ORM\PersistentCollection {#6030 …}
    +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
    +awards: Doctrine\ORM\PersistentCollection {#6034 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
    +categories: Doctrine\ORM\PersistentCollection {#6038 …}
    -id: 42498
    -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
    +apId: "brendan@mastodon.brendans-bits.com"
    +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
    +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
    +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
    +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
    +apDomain: "mastodon.brendans-bits.com"
    +apPreferredUsername: "brendan"
    +apDiscoverable: false
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692964518 {#5977
      date: 2023-08-25 13:55:18.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692964515 {#5979
      date: 2023-08-25 13:55:15.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#5940
  +user: Proxies\__CG__\App\Entity\User {#4409
    +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
    +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
    +email: "brendan@mastodon.brendans-bits.com"
    +username: "@brendan@mastodon.brendans-bits.com"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
    +lastActive: DateTime @1692964519 {#5980
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
    +entries: Doctrine\ORM\PersistentCollection {#5994 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
    +posts: Doctrine\ORM\PersistentCollection {#6002 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
    +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
    +follows: Doctrine\ORM\PersistentCollection {#6014 …}
    +followers: Doctrine\ORM\PersistentCollection {#6016 …}
    +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
    +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
    +reports: Doctrine\ORM\PersistentCollection {#6026 …}
    +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
    +violations: Doctrine\ORM\PersistentCollection {#6030 …}
    +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
    +awards: Doctrine\ORM\PersistentCollection {#6034 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
    +categories: Doctrine\ORM\PersistentCollection {#6038 …}
    -id: 42498
    -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
    +apId: "brendan@mastodon.brendans-bits.com"
    +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
    +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
    +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
    +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
    +apDomain: "mastodon.brendans-bits.com"
    +apPreferredUsername: "brendan"
    +apDiscoverable: false
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692964518 {#5977
      date: 2023-08-25 13:55:18.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692964515 {#5979
      date: 2023-08-25 13:55:15.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.14 ms
Input props
[
  "date" => DateTimeImmutable @1692964486 {#4416
    date: 2023-08-25 13:54:46.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#6060
  +date: DateTimeImmutable @1692964486 {#4416
    date: 2023-08-25 13:54:46.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.09 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692964486 {#4416
    date: 2023-08-25 13:54:46.0 +02:00
  }
  "editedAt" => null
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#6114
  +createdAt: DateTimeImmutable @1692964486 {#4416
    date: 2023-08-25 13:54:46.0 +02:00
  }
  +editedAt: null
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 50.67 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#4409
    +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
    +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
    +email: "brendan@mastodon.brendans-bits.com"
    +username: "@brendan@mastodon.brendans-bits.com"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
    +lastActive: DateTime @1692964519 {#5980
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
    +entries: Doctrine\ORM\PersistentCollection {#5994 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
    +posts: Doctrine\ORM\PersistentCollection {#6002 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
    +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
    +follows: Doctrine\ORM\PersistentCollection {#6014 …}
    +followers: Doctrine\ORM\PersistentCollection {#6016 …}
    +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
    +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
    +reports: Doctrine\ORM\PersistentCollection {#6026 …}
    +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
    +violations: Doctrine\ORM\PersistentCollection {#6030 …}
    +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
    +awards: Doctrine\ORM\PersistentCollection {#6034 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
    +categories: Doctrine\ORM\PersistentCollection {#6038 …}
    -id: 42498
    -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
    +apId: "brendan@mastodon.brendans-bits.com"
    +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
    +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
    +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
    +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
    +apDomain: "mastodon.brendans-bits.com"
    +apPreferredUsername: "brendan"
    +apDiscoverable: false
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692964518 {#5977
      date: 2023-08-25 13:55:18.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692964515 {#5979
      date: 2023-08-25 13:55:15.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#6168
  +width: 40
  +height: 40
  +user: Proxies\__CG__\App\Entity\User {#4409
    +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
    +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
    +email: "brendan@mastodon.brendans-bits.com"
    +username: "@brendan@mastodon.brendans-bits.com"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
    +lastActive: DateTime @1692964519 {#5980
      date: 2023-08-25 13:55:19.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
    +entries: Doctrine\ORM\PersistentCollection {#5994 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
    +posts: Doctrine\ORM\PersistentCollection {#6002 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
    +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
    +follows: Doctrine\ORM\PersistentCollection {#6014 …}
    +followers: Doctrine\ORM\PersistentCollection {#6016 …}
    +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
    +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
    +reports: Doctrine\ORM\PersistentCollection {#6026 …}
    +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
    +violations: Doctrine\ORM\PersistentCollection {#6030 …}
    +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
    +awards: Doctrine\ORM\PersistentCollection {#6034 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
    +categories: Doctrine\ORM\PersistentCollection {#6038 …}
    -id: 42498
    -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
    +apId: "brendan@mastodon.brendans-bits.com"
    +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
    +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
    +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
    +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
    +apDomain: "mastodon.brendans-bits.com"
    +apPreferredUsername: "brendan"
    +apDiscoverable: false
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692964518 {#5977
      date: 2023-08-25 13:55:18.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692964515 {#5979
      date: 2023-08-25 13:55:15.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 0.53 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4412
    +user: Proxies\__CG__\App\Entity\User {#4409
      +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
      +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
      +email: "brendan@mastodon.brendans-bits.com"
      +username: "@brendan@mastodon.brendans-bits.com"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
      +lastActive: DateTime @1692964519 {#5980
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
      +entries: Doctrine\ORM\PersistentCollection {#5994 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
      +posts: Doctrine\ORM\PersistentCollection {#6002 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
      +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
      +follows: Doctrine\ORM\PersistentCollection {#6014 …}
      +followers: Doctrine\ORM\PersistentCollection {#6016 …}
      +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
      +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
      +reports: Doctrine\ORM\PersistentCollection {#6026 …}
      +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
      +violations: Doctrine\ORM\PersistentCollection {#6030 …}
      +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
      +awards: Doctrine\ORM\PersistentCollection {#6034 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
      +categories: Doctrine\ORM\PersistentCollection {#6038 …}
      -id: 42498
      -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
      +apId: "brendan@mastodon.brendans-bits.com"
      +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
      +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
      +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
      +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
      +apDomain: "mastodon.brendans-bits.com"
      +apPreferredUsername: "brendan"
      +apDiscoverable: false
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692964518 {#5977
        date: 2023-08-25 13:55:18.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692964515 {#5979
        date: 2023-08-25 13:55:15.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4355
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4085
        +user: App\Entity\User {#4034
          +avatar: null
          +cover: null
          +email: "WaterWaiver@aussie.zone"
          +username: "@WaterWaiver@aussie.zone"
          +roles: []
          +followersCount: 0
          +homepage: "front"
          +about: """
            I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
            \n
            Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
            """
          +lastActive: DateTime @1728391969 {#4090
            date: 2024-10-08 14:52:49.0 +02:00
          }
          +markedForDeletionAt: null
          +fields: null
          +oauthGithubId: null
          +oauthGoogleId: null
          +oauthFacebookId: null
          +oauthKeycloakId: null
          +hideAdult: true
          +showSubscribedUsers: true
          +showSubscribedMagazines: true
          +showSubscribedDomains: true
          +preferredLanguages: []
          +featuredMagazines: null
          +showProfileSubscriptions: false
          +showProfileFollowings: true
          +markNewComments: false
          +notifyOnNewEntry: false
          +notifyOnNewEntryReply: true
          +notifyOnNewEntryCommentReply: true
          +notifyOnNewPost: false
          +notifyOnNewPostReply: true
          +notifyOnNewPostCommentReply: true
          +addMentionsEntries: false
          +addMentionsPosts: true
          +isBanned: false
          +isVerified: false
          +isDeleted: false
          +isBot: false
          +spamProtection: true
          +customCss: null
          +ignoreMagazinesCustomCss: false
          +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
          +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
          +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
          +entries: Doctrine\ORM\PersistentCollection {#4028 …}
          +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
          +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
          +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
          +posts: Doctrine\ORM\PersistentCollection {#4018 …}
          +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
          +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
          +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
          +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
          +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
          +follows: Doctrine\ORM\PersistentCollection {#4004 …}
          +followers: Doctrine\ORM\PersistentCollection {#4002 …}
          +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
          +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
          +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
          +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
          +reports: Doctrine\ORM\PersistentCollection {#4115 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
          +violations: Doctrine\ORM\PersistentCollection {#4151 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
          +awards: Doctrine\ORM\PersistentCollection {#4145 …}
          +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
          +categories: Doctrine\ORM\PersistentCollection {#4143 …}
          -id: 42479
          -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
          -totpSecret: null
          -totpBackupCodes: []
          -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
          +apId: "WaterWaiver@aussie.zone"
          +apProfileId: "https://aussie.zone/u/WaterWaiver"
          +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
          +apFollowersUrl: null
          +apInboxUrl: "https://aussie.zone/inbox"
          +apDomain: "aussie.zone"
          +apPreferredUsername: "WaterWaiver"
          +apDiscoverable: true
          +apManuallyApprovesFollowers: false
          +privateKey: null
          +publicKey: null
          +apFetchedAt: DateTime @1724531625 {#4088
            date: 2024-08-24 22:33:45.0 +02:00
          }
          +apDeletedAt: null
          +apTimeoutAt: null
          +visibility: "visible             "
          +createdAt: DateTimeImmutable @1692949316 {#4087
            date: 2023-08-25 09:41:56.0 +02:00
          }
        }
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
          \n
          A couple more things to keep in mind:\n
          \n
          - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
          - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 6
        +score: 0
        +lastActive: DateTime @1692964519 {#4095
          date: 2023-08-25 13:55:19.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4083 …}
        +nested: Doctrine\ORM\PersistentCollection {#4081 …}
        +votes: Doctrine\ORM\PersistentCollection {#4079 …}
        +reports: Doctrine\ORM\PersistentCollection {#4077 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
        -id: 26778
        -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://aussie.zone/comment/2116578"
        +editedAt: DateTimeImmutable @1692949446 {#4027
          date: 2023-08-25 09:44:06.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692949313 {#4094
          date: 2023-08-25 09:41:53.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4085}
      +body: """
        > You could probably increase the 82K and 10K resistors to be much bigger\n
        \n
        That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
        \n
        > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        \n
        Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
        \n
        > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
        \n
        This is a good point!\n
        \n
        My firmware will be pretty monotonic though, basically:\n
        \n
        1. wake up\n
        2. measure battery\n
        3. measure some other sensors (the actual task of the device)\n
        4. turn on a transceiver, send all the measurements (including battery voltage)\n
        5. turn off transceiver & go to sleep\n
        \n
        So, the load should be always the same at step (2).
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 3
      +score: 0
      +lastActive: DateTime @1692954197 {#4354
        date: 2023-08-25 11:03:17.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@WaterWaiver@aussie.zone"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4358 …}
      +nested: Doctrine\ORM\PersistentCollection {#4363 …}
      +votes: Doctrine\ORM\PersistentCollection {#4359 …}
      +reports: Doctrine\ORM\PersistentCollection {#4365 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
      -id: 26780
      -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363671"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954197 {#4351
        date: 2023-08-25 11:03:17.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      @nilclass@discuss.tchncs.de\n
      \n
      @WaterWaiver@aussie.zone\n
      \n
      From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."\n
      \n
      In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692964486 {#4413
      date: 2023-08-25 13:54:46.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4406 …}
    +nested: Doctrine\ORM\PersistentCollection {#4404 …}
    +votes: Doctrine\ORM\PersistentCollection {#4408 …}
    +reports: Doctrine\ORM\PersistentCollection {#4419 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4421 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4423 …}
    -id: 26790
    -bodyTs: "'10':8 'ac':77 'affect':64 'becom':29 'capacitor':24 'caus':55 'convers':39 'drastic':63 'e.g':75 'effect':21 'exchang':6 'fast':72 'filter':20 'frequenc':47 'go':61 'higher':52 'imped':54 'issu':32 'kω':9 'larg':57 'less':11 'limit':44 'longer':35 'low':18 'major':31 'maximum':46 'measur':74 'need':69 'nilclass@discuss.tchncs.de':1 'otherwis':16 'pass':19 'post':7 'recommend':15 'repeat':73 'requir':33 'resist':13,28 'resistor':58 'result':43,66 'sampl':36 'sourc':12,27,53,78 'stack':5 'take':71 'time':37 'waterwaiver@aussie.zone':2 'word':50"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://mastodon.brendans-bits.com/users/brendan/statuses/110950120565907377"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692964486 {#4416
      date: 2023-08-25 13:54:46.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#6262
  +subject: App\Entity\EntryComment {#4412
    +user: Proxies\__CG__\App\Entity\User {#4409
      +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
      +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
      +email: "brendan@mastodon.brendans-bits.com"
      +username: "@brendan@mastodon.brendans-bits.com"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
      +lastActive: DateTime @1692964519 {#5980
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
      +entries: Doctrine\ORM\PersistentCollection {#5994 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
      +posts: Doctrine\ORM\PersistentCollection {#6002 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
      +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
      +follows: Doctrine\ORM\PersistentCollection {#6014 …}
      +followers: Doctrine\ORM\PersistentCollection {#6016 …}
      +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
      +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
      +reports: Doctrine\ORM\PersistentCollection {#6026 …}
      +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
      +violations: Doctrine\ORM\PersistentCollection {#6030 …}
      +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
      +awards: Doctrine\ORM\PersistentCollection {#6034 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
      +categories: Doctrine\ORM\PersistentCollection {#6038 …}
      -id: 42498
      -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
      +apId: "brendan@mastodon.brendans-bits.com"
      +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
      +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
      +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
      +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
      +apDomain: "mastodon.brendans-bits.com"
      +apPreferredUsername: "brendan"
      +apDiscoverable: false
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692964518 {#5977
        date: 2023-08-25 13:55:18.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692964515 {#5979
        date: 2023-08-25 13:55:15.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4355
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4085
        +user: App\Entity\User {#4034
          +avatar: null
          +cover: null
          +email: "WaterWaiver@aussie.zone"
          +username: "@WaterWaiver@aussie.zone"
          +roles: []
          +followersCount: 0
          +homepage: "front"
          +about: """
            I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
            \n
            Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
            """
          +lastActive: DateTime @1728391969 {#4090
            date: 2024-10-08 14:52:49.0 +02:00
          }
          +markedForDeletionAt: null
          +fields: null
          +oauthGithubId: null
          +oauthGoogleId: null
          +oauthFacebookId: null
          +oauthKeycloakId: null
          +hideAdult: true
          +showSubscribedUsers: true
          +showSubscribedMagazines: true
          +showSubscribedDomains: true
          +preferredLanguages: []
          +featuredMagazines: null
          +showProfileSubscriptions: false
          +showProfileFollowings: true
          +markNewComments: false
          +notifyOnNewEntry: false
          +notifyOnNewEntryReply: true
          +notifyOnNewEntryCommentReply: true
          +notifyOnNewPost: false
          +notifyOnNewPostReply: true
          +notifyOnNewPostCommentReply: true
          +addMentionsEntries: false
          +addMentionsPosts: true
          +isBanned: false
          +isVerified: false
          +isDeleted: false
          +isBot: false
          +spamProtection: true
          +customCss: null
          +ignoreMagazinesCustomCss: false
          +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
          +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
          +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
          +entries: Doctrine\ORM\PersistentCollection {#4028 …}
          +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
          +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
          +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
          +posts: Doctrine\ORM\PersistentCollection {#4018 …}
          +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
          +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
          +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
          +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
          +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
          +follows: Doctrine\ORM\PersistentCollection {#4004 …}
          +followers: Doctrine\ORM\PersistentCollection {#4002 …}
          +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
          +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
          +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
          +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
          +reports: Doctrine\ORM\PersistentCollection {#4115 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
          +violations: Doctrine\ORM\PersistentCollection {#4151 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
          +awards: Doctrine\ORM\PersistentCollection {#4145 …}
          +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
          +categories: Doctrine\ORM\PersistentCollection {#4143 …}
          -id: 42479
          -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
          -totpSecret: null
          -totpBackupCodes: []
          -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
          +apId: "WaterWaiver@aussie.zone"
          +apProfileId: "https://aussie.zone/u/WaterWaiver"
          +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
          +apFollowersUrl: null
          +apInboxUrl: "https://aussie.zone/inbox"
          +apDomain: "aussie.zone"
          +apPreferredUsername: "WaterWaiver"
          +apDiscoverable: true
          +apManuallyApprovesFollowers: false
          +privateKey: null
          +publicKey: null
          +apFetchedAt: DateTime @1724531625 {#4088
            date: 2024-08-24 22:33:45.0 +02:00
          }
          +apDeletedAt: null
          +apTimeoutAt: null
          +visibility: "visible             "
          +createdAt: DateTimeImmutable @1692949316 {#4087
            date: 2023-08-25 09:41:56.0 +02:00
          }
        }
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
          \n
          A couple more things to keep in mind:\n
          \n
          - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
          - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 6
        +score: 0
        +lastActive: DateTime @1692964519 {#4095
          date: 2023-08-25 13:55:19.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4083 …}
        +nested: Doctrine\ORM\PersistentCollection {#4081 …}
        +votes: Doctrine\ORM\PersistentCollection {#4079 …}
        +reports: Doctrine\ORM\PersistentCollection {#4077 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
        -id: 26778
        -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://aussie.zone/comment/2116578"
        +editedAt: DateTimeImmutable @1692949446 {#4027
          date: 2023-08-25 09:44:06.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692949313 {#4094
          date: 2023-08-25 09:41:53.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4085}
      +body: """
        > You could probably increase the 82K and 10K resistors to be much bigger\n
        \n
        That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
        \n
        > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        \n
        Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
        \n
        > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
        \n
        This is a good point!\n
        \n
        My firmware will be pretty monotonic though, basically:\n
        \n
        1. wake up\n
        2. measure battery\n
        3. measure some other sensors (the actual task of the device)\n
        4. turn on a transceiver, send all the measurements (including battery voltage)\n
        5. turn off transceiver & go to sleep\n
        \n
        So, the load should be always the same at step (2).
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 3
      +score: 0
      +lastActive: DateTime @1692954197 {#4354
        date: 2023-08-25 11:03:17.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@WaterWaiver@aussie.zone"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4358 …}
      +nested: Doctrine\ORM\PersistentCollection {#4363 …}
      +votes: Doctrine\ORM\PersistentCollection {#4359 …}
      +reports: Doctrine\ORM\PersistentCollection {#4365 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
      -id: 26780
      -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363671"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954197 {#4351
        date: 2023-08-25 11:03:17.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      @nilclass@discuss.tchncs.de\n
      \n
      @WaterWaiver@aussie.zone\n
      \n
      From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."\n
      \n
      In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692964486 {#4413
      date: 2023-08-25 13:54:46.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4406 …}
    +nested: Doctrine\ORM\PersistentCollection {#4404 …}
    +votes: Doctrine\ORM\PersistentCollection {#4408 …}
    +reports: Doctrine\ORM\PersistentCollection {#4419 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4421 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4423 …}
    -id: 26790
    -bodyTs: "'10':8 'ac':77 'affect':64 'becom':29 'capacitor':24 'caus':55 'convers':39 'drastic':63 'e.g':75 'effect':21 'exchang':6 'fast':72 'filter':20 'frequenc':47 'go':61 'higher':52 'imped':54 'issu':32 'kω':9 'larg':57 'less':11 'limit':44 'longer':35 'low':18 'major':31 'maximum':46 'measur':74 'need':69 'nilclass@discuss.tchncs.de':1 'otherwis':16 'pass':19 'post':7 'recommend':15 'repeat':73 'requir':33 'resist':13,28 'resistor':58 'result':43,66 'sampl':36 'sourc':12,27,53,78 'stack':5 'take':71 'time':37 'waterwaiver@aussie.zone':2 'word':50"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://mastodon.brendans-bits.com/users/brendan/statuses/110950120565907377"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692964486 {#4416
      date: 2023-08-25 13:54:46.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.67 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4412
    +user: Proxies\__CG__\App\Entity\User {#4409
      +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
      +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
      +email: "brendan@mastodon.brendans-bits.com"
      +username: "@brendan@mastodon.brendans-bits.com"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
      +lastActive: DateTime @1692964519 {#5980
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
      +entries: Doctrine\ORM\PersistentCollection {#5994 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
      +posts: Doctrine\ORM\PersistentCollection {#6002 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
      +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
      +follows: Doctrine\ORM\PersistentCollection {#6014 …}
      +followers: Doctrine\ORM\PersistentCollection {#6016 …}
      +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
      +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
      +reports: Doctrine\ORM\PersistentCollection {#6026 …}
      +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
      +violations: Doctrine\ORM\PersistentCollection {#6030 …}
      +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
      +awards: Doctrine\ORM\PersistentCollection {#6034 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
      +categories: Doctrine\ORM\PersistentCollection {#6038 …}
      -id: 42498
      -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
      +apId: "brendan@mastodon.brendans-bits.com"
      +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
      +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
      +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
      +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
      +apDomain: "mastodon.brendans-bits.com"
      +apPreferredUsername: "brendan"
      +apDiscoverable: false
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692964518 {#5977
        date: 2023-08-25 13:55:18.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692964515 {#5979
        date: 2023-08-25 13:55:15.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4355
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4085
        +user: App\Entity\User {#4034
          +avatar: null
          +cover: null
          +email: "WaterWaiver@aussie.zone"
          +username: "@WaterWaiver@aussie.zone"
          +roles: []
          +followersCount: 0
          +homepage: "front"
          +about: """
            I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
            \n
            Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
            """
          +lastActive: DateTime @1728391969 {#4090
            date: 2024-10-08 14:52:49.0 +02:00
          }
          +markedForDeletionAt: null
          +fields: null
          +oauthGithubId: null
          +oauthGoogleId: null
          +oauthFacebookId: null
          +oauthKeycloakId: null
          +hideAdult: true
          +showSubscribedUsers: true
          +showSubscribedMagazines: true
          +showSubscribedDomains: true
          +preferredLanguages: []
          +featuredMagazines: null
          +showProfileSubscriptions: false
          +showProfileFollowings: true
          +markNewComments: false
          +notifyOnNewEntry: false
          +notifyOnNewEntryReply: true
          +notifyOnNewEntryCommentReply: true
          +notifyOnNewPost: false
          +notifyOnNewPostReply: true
          +notifyOnNewPostCommentReply: true
          +addMentionsEntries: false
          +addMentionsPosts: true
          +isBanned: false
          +isVerified: false
          +isDeleted: false
          +isBot: false
          +spamProtection: true
          +customCss: null
          +ignoreMagazinesCustomCss: false
          +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
          +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
          +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
          +entries: Doctrine\ORM\PersistentCollection {#4028 …}
          +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
          +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
          +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
          +posts: Doctrine\ORM\PersistentCollection {#4018 …}
          +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
          +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
          +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
          +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
          +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
          +follows: Doctrine\ORM\PersistentCollection {#4004 …}
          +followers: Doctrine\ORM\PersistentCollection {#4002 …}
          +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
          +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
          +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
          +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
          +reports: Doctrine\ORM\PersistentCollection {#4115 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
          +violations: Doctrine\ORM\PersistentCollection {#4151 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
          +awards: Doctrine\ORM\PersistentCollection {#4145 …}
          +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
          +categories: Doctrine\ORM\PersistentCollection {#4143 …}
          -id: 42479
          -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
          -totpSecret: null
          -totpBackupCodes: []
          -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
          +apId: "WaterWaiver@aussie.zone"
          +apProfileId: "https://aussie.zone/u/WaterWaiver"
          +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
          +apFollowersUrl: null
          +apInboxUrl: "https://aussie.zone/inbox"
          +apDomain: "aussie.zone"
          +apPreferredUsername: "WaterWaiver"
          +apDiscoverable: true
          +apManuallyApprovesFollowers: false
          +privateKey: null
          +publicKey: null
          +apFetchedAt: DateTime @1724531625 {#4088
            date: 2024-08-24 22:33:45.0 +02:00
          }
          +apDeletedAt: null
          +apTimeoutAt: null
          +visibility: "visible             "
          +createdAt: DateTimeImmutable @1692949316 {#4087
            date: 2023-08-25 09:41:56.0 +02:00
          }
        }
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
          \n
          A couple more things to keep in mind:\n
          \n
          - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
          - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 6
        +score: 0
        +lastActive: DateTime @1692964519 {#4095
          date: 2023-08-25 13:55:19.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4083 …}
        +nested: Doctrine\ORM\PersistentCollection {#4081 …}
        +votes: Doctrine\ORM\PersistentCollection {#4079 …}
        +reports: Doctrine\ORM\PersistentCollection {#4077 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
        -id: 26778
        -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://aussie.zone/comment/2116578"
        +editedAt: DateTimeImmutable @1692949446 {#4027
          date: 2023-08-25 09:44:06.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692949313 {#4094
          date: 2023-08-25 09:41:53.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4085}
      +body: """
        > You could probably increase the 82K and 10K resistors to be much bigger\n
        \n
        That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
        \n
        > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        \n
        Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
        \n
        > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
        \n
        This is a good point!\n
        \n
        My firmware will be pretty monotonic though, basically:\n
        \n
        1. wake up\n
        2. measure battery\n
        3. measure some other sensors (the actual task of the device)\n
        4. turn on a transceiver, send all the measurements (including battery voltage)\n
        5. turn off transceiver & go to sleep\n
        \n
        So, the load should be always the same at step (2).
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 3
      +score: 0
      +lastActive: DateTime @1692954197 {#4354
        date: 2023-08-25 11:03:17.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@WaterWaiver@aussie.zone"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4358 …}
      +nested: Doctrine\ORM\PersistentCollection {#4363 …}
      +votes: Doctrine\ORM\PersistentCollection {#4359 …}
      +reports: Doctrine\ORM\PersistentCollection {#4365 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
      -id: 26780
      -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363671"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954197 {#4351
        date: 2023-08-25 11:03:17.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      @nilclass@discuss.tchncs.de\n
      \n
      @WaterWaiver@aussie.zone\n
      \n
      From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."\n
      \n
      In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692964486 {#4413
      date: 2023-08-25 13:54:46.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4406 …}
    +nested: Doctrine\ORM\PersistentCollection {#4404 …}
    +votes: Doctrine\ORM\PersistentCollection {#4408 …}
    +reports: Doctrine\ORM\PersistentCollection {#4419 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4421 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4423 …}
    -id: 26790
    -bodyTs: "'10':8 'ac':77 'affect':64 'becom':29 'capacitor':24 'caus':55 'convers':39 'drastic':63 'e.g':75 'effect':21 'exchang':6 'fast':72 'filter':20 'frequenc':47 'go':61 'higher':52 'imped':54 'issu':32 'kω':9 'larg':57 'less':11 'limit':44 'longer':35 'low':18 'major':31 'maximum':46 'measur':74 'need':69 'nilclass@discuss.tchncs.de':1 'otherwis':16 'pass':19 'post':7 'recommend':15 'repeat':73 'requir':33 'resist':13,28 'resistor':58 'result':43,66 'sampl':36 'sourc':12,27,53,78 'stack':5 'take':71 'time':37 'waterwaiver@aussie.zone':2 'word':50"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://mastodon.brendans-bits.com/users/brendan/statuses/110950120565907377"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692964486 {#4416
      date: 2023-08-25 13:54:46.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#6319
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4412
    +user: Proxies\__CG__\App\Entity\User {#4409
      +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
      +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
      +email: "brendan@mastodon.brendans-bits.com"
      +username: "@brendan@mastodon.brendans-bits.com"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
      +lastActive: DateTime @1692964519 {#5980
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
      +entries: Doctrine\ORM\PersistentCollection {#5994 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
      +posts: Doctrine\ORM\PersistentCollection {#6002 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
      +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
      +follows: Doctrine\ORM\PersistentCollection {#6014 …}
      +followers: Doctrine\ORM\PersistentCollection {#6016 …}
      +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
      +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
      +reports: Doctrine\ORM\PersistentCollection {#6026 …}
      +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
      +violations: Doctrine\ORM\PersistentCollection {#6030 …}
      +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
      +awards: Doctrine\ORM\PersistentCollection {#6034 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
      +categories: Doctrine\ORM\PersistentCollection {#6038 …}
      -id: 42498
      -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
      +apId: "brendan@mastodon.brendans-bits.com"
      +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
      +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
      +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
      +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
      +apDomain: "mastodon.brendans-bits.com"
      +apPreferredUsername: "brendan"
      +apDiscoverable: false
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692964518 {#5977
        date: 2023-08-25 13:55:18.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692964515 {#5979
        date: 2023-08-25 13:55:15.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4355
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4085
        +user: App\Entity\User {#4034
          +avatar: null
          +cover: null
          +email: "WaterWaiver@aussie.zone"
          +username: "@WaterWaiver@aussie.zone"
          +roles: []
          +followersCount: 0
          +homepage: "front"
          +about: """
            I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
            \n
            Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
            """
          +lastActive: DateTime @1728391969 {#4090
            date: 2024-10-08 14:52:49.0 +02:00
          }
          +markedForDeletionAt: null
          +fields: null
          +oauthGithubId: null
          +oauthGoogleId: null
          +oauthFacebookId: null
          +oauthKeycloakId: null
          +hideAdult: true
          +showSubscribedUsers: true
          +showSubscribedMagazines: true
          +showSubscribedDomains: true
          +preferredLanguages: []
          +featuredMagazines: null
          +showProfileSubscriptions: false
          +showProfileFollowings: true
          +markNewComments: false
          +notifyOnNewEntry: false
          +notifyOnNewEntryReply: true
          +notifyOnNewEntryCommentReply: true
          +notifyOnNewPost: false
          +notifyOnNewPostReply: true
          +notifyOnNewPostCommentReply: true
          +addMentionsEntries: false
          +addMentionsPosts: true
          +isBanned: false
          +isVerified: false
          +isDeleted: false
          +isBot: false
          +spamProtection: true
          +customCss: null
          +ignoreMagazinesCustomCss: false
          +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
          +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
          +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
          +entries: Doctrine\ORM\PersistentCollection {#4028 …}
          +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
          +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
          +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
          +posts: Doctrine\ORM\PersistentCollection {#4018 …}
          +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
          +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
          +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
          +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
          +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
          +follows: Doctrine\ORM\PersistentCollection {#4004 …}
          +followers: Doctrine\ORM\PersistentCollection {#4002 …}
          +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
          +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
          +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
          +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
          +reports: Doctrine\ORM\PersistentCollection {#4115 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
          +violations: Doctrine\ORM\PersistentCollection {#4151 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
          +awards: Doctrine\ORM\PersistentCollection {#4145 …}
          +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
          +categories: Doctrine\ORM\PersistentCollection {#4143 …}
          -id: 42479
          -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
          -totpSecret: null
          -totpBackupCodes: []
          -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
          +apId: "WaterWaiver@aussie.zone"
          +apProfileId: "https://aussie.zone/u/WaterWaiver"
          +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
          +apFollowersUrl: null
          +apInboxUrl: "https://aussie.zone/inbox"
          +apDomain: "aussie.zone"
          +apPreferredUsername: "WaterWaiver"
          +apDiscoverable: true
          +apManuallyApprovesFollowers: false
          +privateKey: null
          +publicKey: null
          +apFetchedAt: DateTime @1724531625 {#4088
            date: 2024-08-24 22:33:45.0 +02:00
          }
          +apDeletedAt: null
          +apTimeoutAt: null
          +visibility: "visible             "
          +createdAt: DateTimeImmutable @1692949316 {#4087
            date: 2023-08-25 09:41:56.0 +02:00
          }
        }
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
          \n
          A couple more things to keep in mind:\n
          \n
          - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
          - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 6
        +score: 0
        +lastActive: DateTime @1692964519 {#4095
          date: 2023-08-25 13:55:19.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4083 …}
        +nested: Doctrine\ORM\PersistentCollection {#4081 …}
        +votes: Doctrine\ORM\PersistentCollection {#4079 …}
        +reports: Doctrine\ORM\PersistentCollection {#4077 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
        -id: 26778
        -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://aussie.zone/comment/2116578"
        +editedAt: DateTimeImmutable @1692949446 {#4027
          date: 2023-08-25 09:44:06.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692949313 {#4094
          date: 2023-08-25 09:41:53.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4085}
      +body: """
        > You could probably increase the 82K and 10K resistors to be much bigger\n
        \n
        That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
        \n
        > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        \n
        Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
        \n
        > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
        \n
        This is a good point!\n
        \n
        My firmware will be pretty monotonic though, basically:\n
        \n
        1. wake up\n
        2. measure battery\n
        3. measure some other sensors (the actual task of the device)\n
        4. turn on a transceiver, send all the measurements (including battery voltage)\n
        5. turn off transceiver & go to sleep\n
        \n
        So, the load should be always the same at step (2).
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 3
      +score: 0
      +lastActive: DateTime @1692954197 {#4354
        date: 2023-08-25 11:03:17.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@WaterWaiver@aussie.zone"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4358 …}
      +nested: Doctrine\ORM\PersistentCollection {#4363 …}
      +votes: Doctrine\ORM\PersistentCollection {#4359 …}
      +reports: Doctrine\ORM\PersistentCollection {#4365 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
      -id: 26780
      -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363671"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954197 {#4351
        date: 2023-08-25 11:03:17.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      @nilclass@discuss.tchncs.de\n
      \n
      @WaterWaiver@aussie.zone\n
      \n
      From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."\n
      \n
      In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692964486 {#4413
      date: 2023-08-25 13:54:46.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4406 …}
    +nested: Doctrine\ORM\PersistentCollection {#4404 …}
    +votes: Doctrine\ORM\PersistentCollection {#4408 …}
    +reports: Doctrine\ORM\PersistentCollection {#4419 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4421 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4423 …}
    -id: 26790
    -bodyTs: "'10':8 'ac':77 'affect':64 'becom':29 'capacitor':24 'caus':55 'convers':39 'drastic':63 'e.g':75 'effect':21 'exchang':6 'fast':72 'filter':20 'frequenc':47 'go':61 'higher':52 'imped':54 'issu':32 'kω':9 'larg':57 'less':11 'limit':44 'longer':35 'low':18 'major':31 'maximum':46 'measur':74 'need':69 'nilclass@discuss.tchncs.de':1 'otherwis':16 'pass':19 'post':7 'recommend':15 'repeat':73 'requir':33 'resist':13,28 'resistor':58 'result':43,66 'sampl':36 'sourc':12,27,53,78 'stack':5 'take':71 'time':37 'waterwaiver@aussie.zone':2 'word':50"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://mastodon.brendans-bits.com/users/brendan/statuses/110950120565907377"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692964486 {#4416
      date: 2023-08-25 13:54:46.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 0.38 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4412
    +user: Proxies\__CG__\App\Entity\User {#4409
      +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
      +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
      +email: "brendan@mastodon.brendans-bits.com"
      +username: "@brendan@mastodon.brendans-bits.com"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
      +lastActive: DateTime @1692964519 {#5980
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
      +entries: Doctrine\ORM\PersistentCollection {#5994 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
      +posts: Doctrine\ORM\PersistentCollection {#6002 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
      +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
      +follows: Doctrine\ORM\PersistentCollection {#6014 …}
      +followers: Doctrine\ORM\PersistentCollection {#6016 …}
      +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
      +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
      +reports: Doctrine\ORM\PersistentCollection {#6026 …}
      +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
      +violations: Doctrine\ORM\PersistentCollection {#6030 …}
      +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
      +awards: Doctrine\ORM\PersistentCollection {#6034 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
      +categories: Doctrine\ORM\PersistentCollection {#6038 …}
      -id: 42498
      -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
      +apId: "brendan@mastodon.brendans-bits.com"
      +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
      +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
      +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
      +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
      +apDomain: "mastodon.brendans-bits.com"
      +apPreferredUsername: "brendan"
      +apDiscoverable: false
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692964518 {#5977
        date: 2023-08-25 13:55:18.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692964515 {#5979
        date: 2023-08-25 13:55:15.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4355
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4085
        +user: App\Entity\User {#4034
          +avatar: null
          +cover: null
          +email: "WaterWaiver@aussie.zone"
          +username: "@WaterWaiver@aussie.zone"
          +roles: []
          +followersCount: 0
          +homepage: "front"
          +about: """
            I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
            \n
            Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
            """
          +lastActive: DateTime @1728391969 {#4090
            date: 2024-10-08 14:52:49.0 +02:00
          }
          +markedForDeletionAt: null
          +fields: null
          +oauthGithubId: null
          +oauthGoogleId: null
          +oauthFacebookId: null
          +oauthKeycloakId: null
          +hideAdult: true
          +showSubscribedUsers: true
          +showSubscribedMagazines: true
          +showSubscribedDomains: true
          +preferredLanguages: []
          +featuredMagazines: null
          +showProfileSubscriptions: false
          +showProfileFollowings: true
          +markNewComments: false
          +notifyOnNewEntry: false
          +notifyOnNewEntryReply: true
          +notifyOnNewEntryCommentReply: true
          +notifyOnNewPost: false
          +notifyOnNewPostReply: true
          +notifyOnNewPostCommentReply: true
          +addMentionsEntries: false
          +addMentionsPosts: true
          +isBanned: false
          +isVerified: false
          +isDeleted: false
          +isBot: false
          +spamProtection: true
          +customCss: null
          +ignoreMagazinesCustomCss: false
          +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
          +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
          +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
          +entries: Doctrine\ORM\PersistentCollection {#4028 …}
          +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
          +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
          +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
          +posts: Doctrine\ORM\PersistentCollection {#4018 …}
          +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
          +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
          +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
          +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
          +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
          +follows: Doctrine\ORM\PersistentCollection {#4004 …}
          +followers: Doctrine\ORM\PersistentCollection {#4002 …}
          +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
          +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
          +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
          +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
          +reports: Doctrine\ORM\PersistentCollection {#4115 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
          +violations: Doctrine\ORM\PersistentCollection {#4151 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
          +awards: Doctrine\ORM\PersistentCollection {#4145 …}
          +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
          +categories: Doctrine\ORM\PersistentCollection {#4143 …}
          -id: 42479
          -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
          -totpSecret: null
          -totpBackupCodes: []
          -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
          +apId: "WaterWaiver@aussie.zone"
          +apProfileId: "https://aussie.zone/u/WaterWaiver"
          +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
          +apFollowersUrl: null
          +apInboxUrl: "https://aussie.zone/inbox"
          +apDomain: "aussie.zone"
          +apPreferredUsername: "WaterWaiver"
          +apDiscoverable: true
          +apManuallyApprovesFollowers: false
          +privateKey: null
          +publicKey: null
          +apFetchedAt: DateTime @1724531625 {#4088
            date: 2024-08-24 22:33:45.0 +02:00
          }
          +apDeletedAt: null
          +apTimeoutAt: null
          +visibility: "visible             "
          +createdAt: DateTimeImmutable @1692949316 {#4087
            date: 2023-08-25 09:41:56.0 +02:00
          }
        }
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
          \n
          A couple more things to keep in mind:\n
          \n
          - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
          - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 6
        +score: 0
        +lastActive: DateTime @1692964519 {#4095
          date: 2023-08-25 13:55:19.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4083 …}
        +nested: Doctrine\ORM\PersistentCollection {#4081 …}
        +votes: Doctrine\ORM\PersistentCollection {#4079 …}
        +reports: Doctrine\ORM\PersistentCollection {#4077 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
        -id: 26778
        -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://aussie.zone/comment/2116578"
        +editedAt: DateTimeImmutable @1692949446 {#4027
          date: 2023-08-25 09:44:06.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692949313 {#4094
          date: 2023-08-25 09:41:53.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4085}
      +body: """
        > You could probably increase the 82K and 10K resistors to be much bigger\n
        \n
        That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
        \n
        > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        \n
        Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
        \n
        > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
        \n
        This is a good point!\n
        \n
        My firmware will be pretty monotonic though, basically:\n
        \n
        1. wake up\n
        2. measure battery\n
        3. measure some other sensors (the actual task of the device)\n
        4. turn on a transceiver, send all the measurements (including battery voltage)\n
        5. turn off transceiver & go to sleep\n
        \n
        So, the load should be always the same at step (2).
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 3
      +score: 0
      +lastActive: DateTime @1692954197 {#4354
        date: 2023-08-25 11:03:17.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@WaterWaiver@aussie.zone"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4358 …}
      +nested: Doctrine\ORM\PersistentCollection {#4363 …}
      +votes: Doctrine\ORM\PersistentCollection {#4359 …}
      +reports: Doctrine\ORM\PersistentCollection {#4365 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
      -id: 26780
      -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363671"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954197 {#4351
        date: 2023-08-25 11:03:17.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      @nilclass@discuss.tchncs.de\n
      \n
      @WaterWaiver@aussie.zone\n
      \n
      From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."\n
      \n
      In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692964486 {#4413
      date: 2023-08-25 13:54:46.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4406 …}
    +nested: Doctrine\ORM\PersistentCollection {#4404 …}
    +votes: Doctrine\ORM\PersistentCollection {#4408 …}
    +reports: Doctrine\ORM\PersistentCollection {#4419 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4421 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4423 …}
    -id: 26790
    -bodyTs: "'10':8 'ac':77 'affect':64 'becom':29 'capacitor':24 'caus':55 'convers':39 'drastic':63 'e.g':75 'effect':21 'exchang':6 'fast':72 'filter':20 'frequenc':47 'go':61 'higher':52 'imped':54 'issu':32 'kω':9 'larg':57 'less':11 'limit':44 'longer':35 'low':18 'major':31 'maximum':46 'measur':74 'need':69 'nilclass@discuss.tchncs.de':1 'otherwis':16 'pass':19 'post':7 'recommend':15 'repeat':73 'requir':33 'resist':13,28 'resistor':58 'result':43,66 'sampl':36 'sourc':12,27,53,78 'stack':5 'take':71 'time':37 'waterwaiver@aussie.zone':2 'word':50"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://mastodon.brendans-bits.com/users/brendan/statuses/110950120565907377"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692964486 {#4416
      date: 2023-08-25 13:54:46.0 +02:00
    }
  }
  "level" => 3
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#6559
  +comment: App\Entity\EntryComment {#4412
    +user: Proxies\__CG__\App\Entity\User {#4409
      +avatar: Proxies\__CG__\App\Entity\Image {#5985 …}
      +cover: Proxies\__CG__\App\Entity\Image {#5987 …}
      +email: "brendan@mastodon.brendans-bits.com"
      +username: "@brendan@mastodon.brendans-bits.com"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: "A PhD candidate and tinkerer, interested in [#FreeBSD](https://mastodon.brendans-bits.com/tags/FreeBSD) [#rust](https://mastodon.brendans-bits.com/tags/rust) [#rustlang](https://mastodon.brendans-bits.com/tags/rustlang) [#CriticalRealism](https://mastodon.brendans-bits.com/tags/CriticalRealism)"
      +lastActive: DateTime @1692964519 {#5980
        date: 2023-08-25 13:55:19.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#5988 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#5990 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#5992 …}
      +entries: Doctrine\ORM\PersistentCollection {#5994 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#5996 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#5998 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#6000 …}
      +posts: Doctrine\ORM\PersistentCollection {#6002 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#6004 …}
      +postComments: Doctrine\ORM\PersistentCollection {#6006 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#6008 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#6010 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#6012 …}
      +follows: Doctrine\ORM\PersistentCollection {#6014 …}
      +followers: Doctrine\ORM\PersistentCollection {#6016 …}
      +blocks: Doctrine\ORM\PersistentCollection {#6018 …}
      +blockers: Doctrine\ORM\PersistentCollection {#6020 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#6022 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#6024 …}
      +reports: Doctrine\ORM\PersistentCollection {#6026 …}
      +favourites: Doctrine\ORM\PersistentCollection {#6028 …}
      +violations: Doctrine\ORM\PersistentCollection {#6030 …}
      +notifications: Doctrine\ORM\PersistentCollection {#6032 …}
      +awards: Doctrine\ORM\PersistentCollection {#6034 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#6036 …}
      +categories: Doctrine\ORM\PersistentCollection {#6038 …}
      -id: 42498
      -password: "$2y$13$u8YrKsIdbA570AU/1vf4DeI6Hwejm5.vfDHBPPQbzPW.H6L1H2NYO"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#6040 …}
      +apId: "brendan@mastodon.brendans-bits.com"
      +apProfileId: "https://mastodon.brendans-bits.com/users/brendan"
      +apPublicUrl: "https://mastodon.brendans-bits.com/@brendan"
      +apFollowersUrl: "https://mastodon.brendans-bits.com/users/brendan/followers"
      +apInboxUrl: "https://mastodon.brendans-bits.com/inbox"
      +apDomain: "mastodon.brendans-bits.com"
      +apPreferredUsername: "brendan"
      +apDiscoverable: false
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692964518 {#5977
        date: 2023-08-25 13:55:18.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692964515 {#5979
        date: 2023-08-25 13:55:15.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4355
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4085
        +user: App\Entity\User {#4034
          +avatar: null
          +cover: null
          +email: "WaterWaiver@aussie.zone"
          +username: "@WaterWaiver@aussie.zone"
          +roles: []
          +followersCount: 0
          +homepage: "front"
          +about: """
            I once met a person that never drank water, only soft drinks. It’s not the unhealthiness of this that disturbed me, but the fact they did it without the requisite paperwork.\n
            \n
            Unlike those disorganised people *I* have a formal waiver. I primarily drink steam and crushed glaciers.
            """
          +lastActive: DateTime @1728391969 {#4090
            date: 2024-10-08 14:52:49.0 +02:00
          }
          +markedForDeletionAt: null
          +fields: null
          +oauthGithubId: null
          +oauthGoogleId: null
          +oauthFacebookId: null
          +oauthKeycloakId: null
          +hideAdult: true
          +showSubscribedUsers: true
          +showSubscribedMagazines: true
          +showSubscribedDomains: true
          +preferredLanguages: []
          +featuredMagazines: null
          +showProfileSubscriptions: false
          +showProfileFollowings: true
          +markNewComments: false
          +notifyOnNewEntry: false
          +notifyOnNewEntryReply: true
          +notifyOnNewEntryCommentReply: true
          +notifyOnNewPost: false
          +notifyOnNewPostReply: true
          +notifyOnNewPostCommentReply: true
          +addMentionsEntries: false
          +addMentionsPosts: true
          +isBanned: false
          +isVerified: false
          +isDeleted: false
          +isBot: false
          +spamProtection: true
          +customCss: null
          +ignoreMagazinesCustomCss: false
          +moderatorTokens: Doctrine\ORM\PersistentCollection {#4035 …}
          +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4037 …}
          +moderatorRequests: Doctrine\ORM\PersistentCollection {#4030 …}
          +entries: Doctrine\ORM\PersistentCollection {#4028 …}
          +entryVotes: Doctrine\ORM\PersistentCollection {#4025 …}
          +entryComments: Doctrine\ORM\PersistentCollection {#4023 …}
          +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4020 …}
          +posts: Doctrine\ORM\PersistentCollection {#4018 …}
          +postVotes: Doctrine\ORM\PersistentCollection {#4016 …}
          +postComments: Doctrine\ORM\PersistentCollection {#4013 …}
          +postCommentVotes: Doctrine\ORM\PersistentCollection {#4011 …}
          +subscriptions: Doctrine\ORM\PersistentCollection {#4009 …}
          +subscribedDomains: Doctrine\ORM\PersistentCollection {#4006 …}
          +follows: Doctrine\ORM\PersistentCollection {#4004 …}
          +followers: Doctrine\ORM\PersistentCollection {#4002 …}
          +blocks: Doctrine\ORM\PersistentCollection {#4150 …}
          +blockers: Doctrine\ORM\PersistentCollection {#4146 …}
          +blockedMagazines: Doctrine\ORM\PersistentCollection {#4135 …}
          +blockedDomains: Doctrine\ORM\PersistentCollection {#4126 …}
          +reports: Doctrine\ORM\PersistentCollection {#4115 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4154 …}
          +violations: Doctrine\ORM\PersistentCollection {#4151 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4148 …}
          +awards: Doctrine\ORM\PersistentCollection {#4145 …}
          +subscribedCategories: Doctrine\ORM\PersistentCollection {#4144 …}
          +categories: Doctrine\ORM\PersistentCollection {#4143 …}
          -id: 42479
          -password: "$2y$13$AS/AvLXylvIap782WOC8BeL7mL3b8tkpMVZanWtJSGz3kVE9K.klO"
          -totpSecret: null
          -totpBackupCodes: []
          -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4133 …}
          +apId: "WaterWaiver@aussie.zone"
          +apProfileId: "https://aussie.zone/u/WaterWaiver"
          +apPublicUrl: "https://aussie.zone/u/WaterWaiver"
          +apFollowersUrl: null
          +apInboxUrl: "https://aussie.zone/inbox"
          +apDomain: "aussie.zone"
          +apPreferredUsername: "WaterWaiver"
          +apDiscoverable: true
          +apManuallyApprovesFollowers: false
          +privateKey: null
          +publicKey: null
          +apFetchedAt: DateTime @1724531625 {#4088
            date: 2024-08-24 22:33:45.0 +02:00
          }
          +apDeletedAt: null
          +apTimeoutAt: null
          +visibility: "visible             "
          +createdAt: DateTimeImmutable @1692949316 {#4087
            date: 2023-08-25 09:41:56.0 +02:00
          }
        }
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could probably increase the 82K and 10K resistors to be much bigger (by a factor of 10x or maybe even 100x). Lookup the input impedance for the ADC of your model of ATmega, as long as it’s >10x the size of your resistors then your circuit will probably be accurate enough.\n
          \n
          A couple more things to keep in mind:\n
          \n
          - a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
          - 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 6
        +score: 0
        +lastActive: DateTime @1692964519 {#4095
          date: 2023-08-25 13:55:19.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4083 …}
        +nested: Doctrine\ORM\PersistentCollection {#4081 …}
        +votes: Doctrine\ORM\PersistentCollection {#4079 …}
        +reports: Doctrine\ORM\PersistentCollection {#4077 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4045 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4049 …}
        -id: 26778
        -bodyTs: "'100x':22 '10k':8 '10x':18,40 '82k':6 '9.6':69 '9v':65,74,75 'accur':52 'actual':68 'adc':29 'alkalin':64 'atmega':34 'batteri':66,76 'bigger':13 'circuit':48 'condit':96 'could':2 'coupl':55 'droop':78 'enough':53 'even':21 'factor':16 'fresh':63 'high':86 'imped':26 'increas':4 'input':25 'intern':87 'keep':59 'load':82 'long':36 'lookup':23 'make':89 'mayb':20 'measur':92 'mind':61 'model':32 'much':12 'notic':79 'probabl':3,50 'resist':88 'resistor':9,45 'size':42 'sure':90 'thing':57 'v':70 'voltag':77"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://aussie.zone/comment/2116578"
        +editedAt: DateTimeImmutable @1692949446 {#4027
          date: 2023-08-25 09:44:06.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692949313 {#4094
          date: 2023-08-25 09:41:53.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4085}
      +body: """
        > You could probably increase the 82K and 10K resistors to be much bigger\n
        \n
        That’s what I thought initially, but [this stackoverflow post](https://electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767) dissuaded me. The argument there is that the measurement will be wrong, if the input current is not enough to charge the internal cap within the measurement period. But I’ve done some testing now, and measurements done with 820k and 100k agree well with what my voltmeter measures, so I’ll go with this solution!\n
        \n
        > a fresh alkaline 9V battery is actually 9.6V or more, not 9V.\n
        \n
        Indeed! `9.6V * 10k/92k = 1.04V` is still below 1.1V, so I should be fine in this case :)\n
        \n
        > 9V battery voltages droop noticeably when under load because of their high internal resistance. Make sure to measure under the same conditions.\n
        \n
        This is a good point!\n
        \n
        My firmware will be pretty monotonic though, basically:\n
        \n
        1. wake up\n
        2. measure battery\n
        3. measure some other sensors (the actual task of the device)\n
        4. turn on a transceiver, send all the measurements (including battery voltage)\n
        5. turn off transceiver & go to sleep\n
        \n
        So, the load should be always the same at step (2).
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 3
      +score: 0
      +lastActive: DateTime @1692954197 {#4354
        date: 2023-08-25 11:03:17.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@WaterWaiver@aussie.zone"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4358 …}
      +nested: Doctrine\ORM\PersistentCollection {#4363 …}
      +votes: Doctrine\ORM\PersistentCollection {#4359 …}
      +reports: Doctrine\ORM\PersistentCollection {#4365 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4367 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4369 …}
      -id: 26780
      -bodyTs: "'/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':26 '1':150 '1.04':100 '1.1':105 '100k':68 '10k':8 '10k/92k':99 '2':153,196 '3':156 '4':167 '5':179 '820k':66 '82k':6 '9.6':90,97 '9v':86,95,115 'actual':89,162 'agre':69 'alkalin':85 'alway':191 'argument':30 'basic':149 'batteri':87,116,155,177 'bigger':13 'cap':50 'case':114 'charg':47 'condit':136 'could':2 'current':42 'devic':166 'dissuad':27 'done':58,64 'droop':118 'electronics.stackexchange.com':25 'electronics.stackexchange.com/questions/250759/how-many-ohm-is-the-adc-port-internal-resistance-of-the-atmega8#250767)':24 'enough':45 'fine':111 'firmwar':143 'fresh':84 'go':79,183 'good':140 'high':126 'includ':176 'increas':4 'inde':96 'initi':19 'input':41 'intern':49,127 'll':78 'load':122,188 'make':129 'measur':35,53,63,75,132,154,157,175 'monoton':147 'much':12 'notic':119 'period':54 'point':141 'post':23 'pretti':146 'probabl':3 'resist':128 'resistor':9 'send':172 'sensor':160 'sleep':185 'solut':82 'stackoverflow':22 'step':195 'still':103 'sure':130 'task':163 'test':60 'though':148 'thought':18 'transceiv':171,182 'turn':168,180 'v':91,98,101,106 've':57 'voltag':117,178 'voltmet':74 'wake':151 'well':70 'within':51 'wrong':38"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363671"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954197 {#4351
        date: 2023-08-25 11:03:17.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4085}
    +body: """
      @nilclass@discuss.tchncs.de\n
      \n
      @WaterWaiver@aussie.zone\n
      \n
      From the stack exchange post: " 10 kΩ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency."\n
      \n
      In other words: a higher source impedance (caused by large resistors) is only going to drastically affect the results when you need to take fast repeated measurements (e.g. an AC source)
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692964486 {#4413
      date: 2023-08-25 13:54:46.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@WaterWaiver@aussie.zone"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4406 …}
    +nested: Doctrine\ORM\PersistentCollection {#4404 …}
    +votes: Doctrine\ORM\PersistentCollection {#4408 …}
    +reports: Doctrine\ORM\PersistentCollection {#4419 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4421 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4423 …}
    -id: 26790
    -bodyTs: "'10':8 'ac':77 'affect':64 'becom':29 'capacitor':24 'caus':55 'convers':39 'drastic':63 'e.g':75 'effect':21 'exchang':6 'fast':72 'filter':20 'frequenc':47 'go':61 'higher':52 'imped':54 'issu':32 'kω':9 'larg':57 'less':11 'limit':44 'longer':35 'low':18 'major':31 'maximum':46 'measur':74 'need':69 'nilclass@discuss.tchncs.de':1 'otherwis':16 'pass':19 'post':7 'recommend':15 'repeat':73 'requir':33 'resist':13,28 'resistor':58 'result':43,66 'sampl':36 'sourc':12,27,53,78 'stack':5 'take':71 'time':37 'waterwaiver@aussie.zone':2 'word':50"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://mastodon.brendans-bits.com/users/brendan/statuses/110950120565907377"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692964486 {#4416
      date: 2023-08-25 13:54:46.0 +02:00
    }
  }
  +nestedComments: []
  +level: 3
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 90.32 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4129
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +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 {#4136
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4127 …}
    +nested: Doctrine\ORM\PersistentCollection {#4125 …}
    +votes: Doctrine\ORM\PersistentCollection {#4123 …}
    +reports: Doctrine\ORM\PersistentCollection {#4122 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
    -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 {#4137
      date: 2023-08-25 15:10:47.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692950595 {#4134
      date: 2023-08-25 10:03:15.0 +02:00
    }
  }
  "showNested" => true
  "dateAsUrl" => false
  "showMagazineName" => false
  "showEntryTitle" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#6646
  +comment: App\Entity\EntryComment {#4129
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +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 {#4136
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4127 …}
    +nested: Doctrine\ORM\PersistentCollection {#4125 …}
    +votes: Doctrine\ORM\PersistentCollection {#4123 …}
    +reports: Doctrine\ORM\PersistentCollection {#4122 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
    -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 {#4137
      date: 2023-08-25 15:10:47.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692950595 {#4134
      date: 2023-08-25 10:03:15.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 1
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.16 ms
Input props
[
  "user" => App\Entity\User {#4111
    +avatar: null
    +cover: null
    +email: "Yonrak@feddit.uk"
    +username: "@Yonrak@feddit.uk"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1692955883 {#4130
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
    +entries: Doctrine\ORM\PersistentCollection {#4104 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
    +posts: Doctrine\ORM\PersistentCollection {#4096 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
    +follows: Doctrine\ORM\PersistentCollection {#4168 …}
    +followers: Doctrine\ORM\PersistentCollection {#4170 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
    +reports: Doctrine\ORM\PersistentCollection {#4180 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
    +violations: Doctrine\ORM\PersistentCollection {#4184 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
    +awards: Doctrine\ORM\PersistentCollection {#4188 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
    +categories: Doctrine\ORM\PersistentCollection {#4192 …}
    -id: 42482
    -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
    +apId: "Yonrak@feddit.uk"
    +apProfileId: "https://feddit.uk/u/Yonrak"
    +apPublicUrl: "https://feddit.uk/u/Yonrak"
    +apFollowersUrl: null
    +apInboxUrl: "https://feddit.uk/inbox"
    +apDomain: "feddit.uk"
    +apPreferredUsername: "Yonrak"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692955883 {#4132
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692950596 {#4124
      date: 2023-08-25 10:03:16.0 +02:00
    }
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#6691
  +user: App\Entity\User {#4111
    +avatar: null
    +cover: null
    +email: "Yonrak@feddit.uk"
    +username: "@Yonrak@feddit.uk"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1692955883 {#4130
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
    +entries: Doctrine\ORM\PersistentCollection {#4104 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
    +posts: Doctrine\ORM\PersistentCollection {#4096 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
    +follows: Doctrine\ORM\PersistentCollection {#4168 …}
    +followers: Doctrine\ORM\PersistentCollection {#4170 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
    +reports: Doctrine\ORM\PersistentCollection {#4180 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
    +violations: Doctrine\ORM\PersistentCollection {#4184 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
    +awards: Doctrine\ORM\PersistentCollection {#4188 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
    +categories: Doctrine\ORM\PersistentCollection {#4192 …}
    -id: 42482
    -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
    +apId: "Yonrak@feddit.uk"
    +apProfileId: "https://feddit.uk/u/Yonrak"
    +apPublicUrl: "https://feddit.uk/u/Yonrak"
    +apFollowersUrl: null
    +apInboxUrl: "https://feddit.uk/inbox"
    +apDomain: "feddit.uk"
    +apPreferredUsername: "Yonrak"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692955883 {#4132
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692950596 {#4124
      date: 2023-08-25 10:03:16.0 +02:00
    }
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.14 ms
Input props
[
  "date" => DateTimeImmutable @1692950595 {#4134
    date: 2023-08-25 10:03:15.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#6746
  +date: DateTimeImmutable @1692950595 {#4134
    date: 2023-08-25 10:03:15.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.13 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692950595 {#4134
    date: 2023-08-25 10:03:15.0 +02:00
  }
  "editedAt" => DateTimeImmutable @1692969047 {#4137
    date: 2023-08-25 15:10:47.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#6800
  +createdAt: DateTimeImmutable @1692950595 {#4134
    date: 2023-08-25 10:03:15.0 +02:00
  }
  +editedAt: DateTimeImmutable @1692969047 {#4137
    date: 2023-08-25 15:10:47.0 +02:00
  }
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 0.13 ms
Input props
[
  "user" => App\Entity\User {#4111
    +avatar: null
    +cover: null
    +email: "Yonrak@feddit.uk"
    +username: "@Yonrak@feddit.uk"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1692955883 {#4130
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
    +entries: Doctrine\ORM\PersistentCollection {#4104 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
    +posts: Doctrine\ORM\PersistentCollection {#4096 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
    +follows: Doctrine\ORM\PersistentCollection {#4168 …}
    +followers: Doctrine\ORM\PersistentCollection {#4170 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
    +reports: Doctrine\ORM\PersistentCollection {#4180 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
    +violations: Doctrine\ORM\PersistentCollection {#4184 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
    +awards: Doctrine\ORM\PersistentCollection {#4188 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
    +categories: Doctrine\ORM\PersistentCollection {#4192 …}
    -id: 42482
    -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
    +apId: "Yonrak@feddit.uk"
    +apProfileId: "https://feddit.uk/u/Yonrak"
    +apPublicUrl: "https://feddit.uk/u/Yonrak"
    +apFollowersUrl: null
    +apInboxUrl: "https://feddit.uk/inbox"
    +apDomain: "feddit.uk"
    +apPreferredUsername: "Yonrak"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692955883 {#4132
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692950596 {#4124
      date: 2023-08-25 10:03:16.0 +02:00
    }
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#6854
  +width: 40
  +height: 40
  +user: App\Entity\User {#4111
    +avatar: null
    +cover: null
    +email: "Yonrak@feddit.uk"
    +username: "@Yonrak@feddit.uk"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1692955883 {#4130
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
    +entries: Doctrine\ORM\PersistentCollection {#4104 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
    +posts: Doctrine\ORM\PersistentCollection {#4096 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
    +follows: Doctrine\ORM\PersistentCollection {#4168 …}
    +followers: Doctrine\ORM\PersistentCollection {#4170 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
    +reports: Doctrine\ORM\PersistentCollection {#4180 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
    +violations: Doctrine\ORM\PersistentCollection {#4184 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
    +awards: Doctrine\ORM\PersistentCollection {#4188 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
    +categories: Doctrine\ORM\PersistentCollection {#4192 …}
    -id: 42482
    -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
    +apId: "Yonrak@feddit.uk"
    +apProfileId: "https://feddit.uk/u/Yonrak"
    +apPublicUrl: "https://feddit.uk/u/Yonrak"
    +apFollowersUrl: null
    +apInboxUrl: "https://feddit.uk/inbox"
    +apDomain: "feddit.uk"
    +apPreferredUsername: "Yonrak"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692955883 {#4132
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692950596 {#4124
      date: 2023-08-25 10:03:16.0 +02:00
    }
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 0.34 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4129
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +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 {#4136
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4127 …}
    +nested: Doctrine\ORM\PersistentCollection {#4125 …}
    +votes: Doctrine\ORM\PersistentCollection {#4123 …}
    +reports: Doctrine\ORM\PersistentCollection {#4122 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
    -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 {#4137
      date: 2023-08-25 15:10:47.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692950595 {#4134
      date: 2023-08-25 10:03:15.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#6935
  +subject: App\Entity\EntryComment {#4129
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +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 {#4136
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4127 …}
    +nested: Doctrine\ORM\PersistentCollection {#4125 …}
    +votes: Doctrine\ORM\PersistentCollection {#4123 …}
    +reports: Doctrine\ORM\PersistentCollection {#4122 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
    -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 {#4137
      date: 2023-08-25 15:10:47.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692950595 {#4134
      date: 2023-08-25 10:03:15.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.77 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4129
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +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 {#4136
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4127 …}
    +nested: Doctrine\ORM\PersistentCollection {#4125 …}
    +votes: Doctrine\ORM\PersistentCollection {#4123 …}
    +reports: Doctrine\ORM\PersistentCollection {#4122 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
    -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 {#4137
      date: 2023-08-25 15:10:47.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692950595 {#4134
      date: 2023-08-25 10:03:15.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#6992
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4129
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +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 {#4136
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4127 …}
    +nested: Doctrine\ORM\PersistentCollection {#4125 …}
    +votes: Doctrine\ORM\PersistentCollection {#4123 …}
    +reports: Doctrine\ORM\PersistentCollection {#4122 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
    -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 {#4137
      date: 2023-08-25 15:10:47.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692950595 {#4134
      date: 2023-08-25 10:03:15.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 55.63 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4129
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +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 {#4136
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4127 …}
    +nested: Doctrine\ORM\PersistentCollection {#4125 …}
    +votes: Doctrine\ORM\PersistentCollection {#4123 …}
    +reports: Doctrine\ORM\PersistentCollection {#4122 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
    -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 {#4137
      date: 2023-08-25 15:10:47.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692950595 {#4134
      date: 2023-08-25 10:03:15.0 +02:00
    }
  }
  "level" => 1
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#7232
  +comment: App\Entity\EntryComment {#4129
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +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 {#4136
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4127 …}
    +nested: Doctrine\ORM\PersistentCollection {#4125 …}
    +votes: Doctrine\ORM\PersistentCollection {#4123 …}
    +reports: Doctrine\ORM\PersistentCollection {#4122 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
    -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 {#4137
      date: 2023-08-25 15:10:47.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692950595 {#4134
      date: 2023-08-25 10:03:15.0 +02:00
    }
  }
  +nestedComments: [
    26781 => App\Entity\EntryComment {#4373
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4129}
      +root: App\Entity\EntryComment {#4129}
      +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
        That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
        \n
        > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
        \n
        Not sure I understand this point. Which resistor would you replace with a diode?
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692954353 {#4371
        date: 2023-08-25 11:05:53.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4374 …}
      +nested: Doctrine\ORM\PersistentCollection {#4376 …}
      +votes: Doctrine\ORM\PersistentCollection {#4378 …}
      +reports: Doctrine\ORM\PersistentCollection {#4380 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
      -id: 26781
      -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363713"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954353 {#4372
        date: 2023-08-25 11:05:53.0 +02:00
      }
    }
    26782 => App\Entity\EntryComment {#4428
      +user: App\Entity\User {#4111}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4373}
      +root: App\Entity\EntryComment {#4129}
      +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 {#4425
        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 {#4429 …}
      +nested: Doctrine\ORM\PersistentCollection {#4431 …}
      +votes: Doctrine\ORM\PersistentCollection {#4433 …}
      +reports: Doctrine\ORM\PersistentCollection {#4435 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4437 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4439 …}
      -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 {#4426
        date: 2023-08-25 11:34:59.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692955881 {#4427
        date: 2023-08-25 11:31:21.0 +02:00
      }
    }
  ]
  +level: 1
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 36.81 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4373
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4129
      +user: App\Entity\User {#4111
        +avatar: null
        +cover: null
        +email: "Yonrak@feddit.uk"
        +username: "@Yonrak@feddit.uk"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1692955883 {#4130
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
        +entries: Doctrine\ORM\PersistentCollection {#4104 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
        +posts: Doctrine\ORM\PersistentCollection {#4096 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
        +follows: Doctrine\ORM\PersistentCollection {#4168 …}
        +followers: Doctrine\ORM\PersistentCollection {#4170 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
        +reports: Doctrine\ORM\PersistentCollection {#4180 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
        +violations: Doctrine\ORM\PersistentCollection {#4184 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
        +awards: Doctrine\ORM\PersistentCollection {#4188 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
        +categories: Doctrine\ORM\PersistentCollection {#4192 …}
        -id: 42482
        -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
        +apId: "Yonrak@feddit.uk"
        +apProfileId: "https://feddit.uk/u/Yonrak"
        +apPublicUrl: "https://feddit.uk/u/Yonrak"
        +apFollowersUrl: null
        +apInboxUrl: "https://feddit.uk/inbox"
        +apDomain: "feddit.uk"
        +apPreferredUsername: "Yonrak"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1692955883 {#4132
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692950596 {#4124
          date: 2023-08-25 10:03:16.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +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 {#4136
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4127 …}
      +nested: Doctrine\ORM\PersistentCollection {#4125 …}
      +votes: Doctrine\ORM\PersistentCollection {#4123 …}
      +reports: Doctrine\ORM\PersistentCollection {#4122 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
      -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 {#4137
        date: 2023-08-25 15:10:47.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692950595 {#4134
        date: 2023-08-25 10:03:15.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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
      That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
      \n
      > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
      \n
      Not sure I understand this point. Which resistor would you replace with a diode?
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692954353 {#4371
      date: 2023-08-25 11:05:53.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@Yonrak@feddit.uk"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4374 …}
    +nested: Doctrine\ORM\PersistentCollection {#4376 …}
    +votes: Doctrine\ORM\PersistentCollection {#4378 …}
    +reports: Doctrine\ORM\PersistentCollection {#4380 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
    -id: 26781
    -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363713"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954353 {#4372
      date: 2023-08-25 11:05:53.0 +02:00
    }
  }
  "showNested" => true
  "level" => 2
  "showEntryTitle" => false
  "showMagazineName" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#7292
  +comment: App\Entity\EntryComment {#4373
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4129
      +user: App\Entity\User {#4111
        +avatar: null
        +cover: null
        +email: "Yonrak@feddit.uk"
        +username: "@Yonrak@feddit.uk"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1692955883 {#4130
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
        +entries: Doctrine\ORM\PersistentCollection {#4104 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
        +posts: Doctrine\ORM\PersistentCollection {#4096 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
        +follows: Doctrine\ORM\PersistentCollection {#4168 …}
        +followers: Doctrine\ORM\PersistentCollection {#4170 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
        +reports: Doctrine\ORM\PersistentCollection {#4180 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
        +violations: Doctrine\ORM\PersistentCollection {#4184 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
        +awards: Doctrine\ORM\PersistentCollection {#4188 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
        +categories: Doctrine\ORM\PersistentCollection {#4192 …}
        -id: 42482
        -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
        +apId: "Yonrak@feddit.uk"
        +apProfileId: "https://feddit.uk/u/Yonrak"
        +apPublicUrl: "https://feddit.uk/u/Yonrak"
        +apFollowersUrl: null
        +apInboxUrl: "https://feddit.uk/inbox"
        +apDomain: "feddit.uk"
        +apPreferredUsername: "Yonrak"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1692955883 {#4132
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692950596 {#4124
          date: 2023-08-25 10:03:16.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +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 {#4136
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4127 …}
      +nested: Doctrine\ORM\PersistentCollection {#4125 …}
      +votes: Doctrine\ORM\PersistentCollection {#4123 …}
      +reports: Doctrine\ORM\PersistentCollection {#4122 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
      -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 {#4137
        date: 2023-08-25 15:10:47.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692950595 {#4134
        date: 2023-08-25 10:03:15.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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
      That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
      \n
      > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
      \n
      Not sure I understand this point. Which resistor would you replace with a diode?
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692954353 {#4371
      date: 2023-08-25 11:05:53.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@Yonrak@feddit.uk"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4374 …}
    +nested: Doctrine\ORM\PersistentCollection {#4376 …}
    +votes: Doctrine\ORM\PersistentCollection {#4378 …}
    +reports: Doctrine\ORM\PersistentCollection {#4380 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
    -id: 26781
    -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363713"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954353 {#4372
      date: 2023-08-25 11:05:53.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 2
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.15 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#7337
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.14 ms
Input props
[
  "date" => DateTimeImmutable @1692954353 {#4372
    date: 2023-08-25 11:05:53.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#7392
  +date: DateTimeImmutable @1692954353 {#4372
    date: 2023-08-25 11:05:53.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.09 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692954353 {#4372
    date: 2023-08-25 11:05:53.0 +02:00
  }
  "editedAt" => null
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#7446
  +createdAt: DateTimeImmutable @1692954353 {#4372
    date: 2023-08-25 11:05:53.0 +02:00
  }
  +editedAt: null
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 2.74 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#7500
  +width: 40
  +height: 40
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 4.67 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4373
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4129
      +user: App\Entity\User {#4111
        +avatar: null
        +cover: null
        +email: "Yonrak@feddit.uk"
        +username: "@Yonrak@feddit.uk"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1692955883 {#4130
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
        +entries: Doctrine\ORM\PersistentCollection {#4104 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
        +posts: Doctrine\ORM\PersistentCollection {#4096 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
        +follows: Doctrine\ORM\PersistentCollection {#4168 …}
        +followers: Doctrine\ORM\PersistentCollection {#4170 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
        +reports: Doctrine\ORM\PersistentCollection {#4180 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
        +violations: Doctrine\ORM\PersistentCollection {#4184 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
        +awards: Doctrine\ORM\PersistentCollection {#4188 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
        +categories: Doctrine\ORM\PersistentCollection {#4192 …}
        -id: 42482
        -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
        +apId: "Yonrak@feddit.uk"
        +apProfileId: "https://feddit.uk/u/Yonrak"
        +apPublicUrl: "https://feddit.uk/u/Yonrak"
        +apFollowersUrl: null
        +apInboxUrl: "https://feddit.uk/inbox"
        +apDomain: "feddit.uk"
        +apPreferredUsername: "Yonrak"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1692955883 {#4132
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692950596 {#4124
          date: 2023-08-25 10:03:16.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +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 {#4136
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4127 …}
      +nested: Doctrine\ORM\PersistentCollection {#4125 …}
      +votes: Doctrine\ORM\PersistentCollection {#4123 …}
      +reports: Doctrine\ORM\PersistentCollection {#4122 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
      -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 {#4137
        date: 2023-08-25 15:10:47.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692950595 {#4134
        date: 2023-08-25 10:03:15.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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
      That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
      \n
      > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
      \n
      Not sure I understand this point. Which resistor would you replace with a diode?
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692954353 {#4371
      date: 2023-08-25 11:05:53.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@Yonrak@feddit.uk"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4374 …}
    +nested: Doctrine\ORM\PersistentCollection {#4376 …}
    +votes: Doctrine\ORM\PersistentCollection {#4378 …}
    +reports: Doctrine\ORM\PersistentCollection {#4380 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
    -id: 26781
    -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363713"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954353 {#4372
      date: 2023-08-25 11:05:53.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#3132
  +subject: App\Entity\EntryComment {#4373
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4129
      +user: App\Entity\User {#4111
        +avatar: null
        +cover: null
        +email: "Yonrak@feddit.uk"
        +username: "@Yonrak@feddit.uk"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1692955883 {#4130
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
        +entries: Doctrine\ORM\PersistentCollection {#4104 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
        +posts: Doctrine\ORM\PersistentCollection {#4096 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
        +follows: Doctrine\ORM\PersistentCollection {#4168 …}
        +followers: Doctrine\ORM\PersistentCollection {#4170 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
        +reports: Doctrine\ORM\PersistentCollection {#4180 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
        +violations: Doctrine\ORM\PersistentCollection {#4184 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
        +awards: Doctrine\ORM\PersistentCollection {#4188 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
        +categories: Doctrine\ORM\PersistentCollection {#4192 …}
        -id: 42482
        -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
        +apId: "Yonrak@feddit.uk"
        +apProfileId: "https://feddit.uk/u/Yonrak"
        +apPublicUrl: "https://feddit.uk/u/Yonrak"
        +apFollowersUrl: null
        +apInboxUrl: "https://feddit.uk/inbox"
        +apDomain: "feddit.uk"
        +apPreferredUsername: "Yonrak"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1692955883 {#4132
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692950596 {#4124
          date: 2023-08-25 10:03:16.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +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 {#4136
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4127 …}
      +nested: Doctrine\ORM\PersistentCollection {#4125 …}
      +votes: Doctrine\ORM\PersistentCollection {#4123 …}
      +reports: Doctrine\ORM\PersistentCollection {#4122 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
      -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 {#4137
        date: 2023-08-25 15:10:47.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692950595 {#4134
        date: 2023-08-25 10:03:15.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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
      That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
      \n
      > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
      \n
      Not sure I understand this point. Which resistor would you replace with a diode?
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692954353 {#4371
      date: 2023-08-25 11:05:53.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@Yonrak@feddit.uk"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4374 …}
    +nested: Doctrine\ORM\PersistentCollection {#4376 …}
    +votes: Doctrine\ORM\PersistentCollection {#4378 …}
    +reports: Doctrine\ORM\PersistentCollection {#4380 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
    -id: 26781
    -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363713"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954353 {#4372
      date: 2023-08-25 11:05:53.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.69 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4373
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4129
      +user: App\Entity\User {#4111
        +avatar: null
        +cover: null
        +email: "Yonrak@feddit.uk"
        +username: "@Yonrak@feddit.uk"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1692955883 {#4130
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
        +entries: Doctrine\ORM\PersistentCollection {#4104 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
        +posts: Doctrine\ORM\PersistentCollection {#4096 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
        +follows: Doctrine\ORM\PersistentCollection {#4168 …}
        +followers: Doctrine\ORM\PersistentCollection {#4170 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
        +reports: Doctrine\ORM\PersistentCollection {#4180 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
        +violations: Doctrine\ORM\PersistentCollection {#4184 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
        +awards: Doctrine\ORM\PersistentCollection {#4188 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
        +categories: Doctrine\ORM\PersistentCollection {#4192 …}
        -id: 42482
        -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
        +apId: "Yonrak@feddit.uk"
        +apProfileId: "https://feddit.uk/u/Yonrak"
        +apPublicUrl: "https://feddit.uk/u/Yonrak"
        +apFollowersUrl: null
        +apInboxUrl: "https://feddit.uk/inbox"
        +apDomain: "feddit.uk"
        +apPreferredUsername: "Yonrak"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1692955883 {#4132
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692950596 {#4124
          date: 2023-08-25 10:03:16.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +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 {#4136
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4127 …}
      +nested: Doctrine\ORM\PersistentCollection {#4125 …}
      +votes: Doctrine\ORM\PersistentCollection {#4123 …}
      +reports: Doctrine\ORM\PersistentCollection {#4122 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
      -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 {#4137
        date: 2023-08-25 15:10:47.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692950595 {#4134
        date: 2023-08-25 10:03:15.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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
      That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
      \n
      > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
      \n
      Not sure I understand this point. Which resistor would you replace with a diode?
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692954353 {#4371
      date: 2023-08-25 11:05:53.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@Yonrak@feddit.uk"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4374 …}
    +nested: Doctrine\ORM\PersistentCollection {#4376 …}
    +votes: Doctrine\ORM\PersistentCollection {#4378 …}
    +reports: Doctrine\ORM\PersistentCollection {#4380 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
    -id: 26781
    -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363713"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954353 {#4372
      date: 2023-08-25 11:05:53.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#5524
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4373
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4129
      +user: App\Entity\User {#4111
        +avatar: null
        +cover: null
        +email: "Yonrak@feddit.uk"
        +username: "@Yonrak@feddit.uk"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1692955883 {#4130
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
        +entries: Doctrine\ORM\PersistentCollection {#4104 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
        +posts: Doctrine\ORM\PersistentCollection {#4096 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
        +follows: Doctrine\ORM\PersistentCollection {#4168 …}
        +followers: Doctrine\ORM\PersistentCollection {#4170 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
        +reports: Doctrine\ORM\PersistentCollection {#4180 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
        +violations: Doctrine\ORM\PersistentCollection {#4184 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
        +awards: Doctrine\ORM\PersistentCollection {#4188 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
        +categories: Doctrine\ORM\PersistentCollection {#4192 …}
        -id: 42482
        -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
        +apId: "Yonrak@feddit.uk"
        +apProfileId: "https://feddit.uk/u/Yonrak"
        +apPublicUrl: "https://feddit.uk/u/Yonrak"
        +apFollowersUrl: null
        +apInboxUrl: "https://feddit.uk/inbox"
        +apDomain: "feddit.uk"
        +apPreferredUsername: "Yonrak"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1692955883 {#4132
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692950596 {#4124
          date: 2023-08-25 10:03:16.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +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 {#4136
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4127 …}
      +nested: Doctrine\ORM\PersistentCollection {#4125 …}
      +votes: Doctrine\ORM\PersistentCollection {#4123 …}
      +reports: Doctrine\ORM\PersistentCollection {#4122 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
      -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 {#4137
        date: 2023-08-25 15:10:47.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692950595 {#4134
        date: 2023-08-25 10:03:15.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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
      That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
      \n
      > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
      \n
      Not sure I understand this point. Which resistor would you replace with a diode?
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692954353 {#4371
      date: 2023-08-25 11:05:53.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@Yonrak@feddit.uk"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4374 …}
    +nested: Doctrine\ORM\PersistentCollection {#4376 …}
    +votes: Doctrine\ORM\PersistentCollection {#4378 …}
    +reports: Doctrine\ORM\PersistentCollection {#4380 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
    -id: 26781
    -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363713"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954353 {#4372
      date: 2023-08-25 11:05:53.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 9.16 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4373
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4129
      +user: App\Entity\User {#4111
        +avatar: null
        +cover: null
        +email: "Yonrak@feddit.uk"
        +username: "@Yonrak@feddit.uk"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1692955883 {#4130
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
        +entries: Doctrine\ORM\PersistentCollection {#4104 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
        +posts: Doctrine\ORM\PersistentCollection {#4096 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
        +follows: Doctrine\ORM\PersistentCollection {#4168 …}
        +followers: Doctrine\ORM\PersistentCollection {#4170 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
        +reports: Doctrine\ORM\PersistentCollection {#4180 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
        +violations: Doctrine\ORM\PersistentCollection {#4184 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
        +awards: Doctrine\ORM\PersistentCollection {#4188 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
        +categories: Doctrine\ORM\PersistentCollection {#4192 …}
        -id: 42482
        -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
        +apId: "Yonrak@feddit.uk"
        +apProfileId: "https://feddit.uk/u/Yonrak"
        +apPublicUrl: "https://feddit.uk/u/Yonrak"
        +apFollowersUrl: null
        +apInboxUrl: "https://feddit.uk/inbox"
        +apDomain: "feddit.uk"
        +apPreferredUsername: "Yonrak"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1692955883 {#4132
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692950596 {#4124
          date: 2023-08-25 10:03:16.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +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 {#4136
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4127 …}
      +nested: Doctrine\ORM\PersistentCollection {#4125 …}
      +votes: Doctrine\ORM\PersistentCollection {#4123 …}
      +reports: Doctrine\ORM\PersistentCollection {#4122 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
      -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 {#4137
        date: 2023-08-25 15:10:47.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692950595 {#4134
        date: 2023-08-25 10:03:15.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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
      That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
      \n
      > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
      \n
      Not sure I understand this point. Which resistor would you replace with a diode?
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692954353 {#4371
      date: 2023-08-25 11:05:53.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@Yonrak@feddit.uk"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4374 …}
    +nested: Doctrine\ORM\PersistentCollection {#4376 …}
    +votes: Doctrine\ORM\PersistentCollection {#4378 …}
    +reports: Doctrine\ORM\PersistentCollection {#4380 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
    -id: 26781
    -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363713"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954353 {#4372
      date: 2023-08-25 11:05:53.0 +02:00
    }
  }
  "level" => 2
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#7565
  +comment: App\Entity\EntryComment {#4373
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4129
      +user: App\Entity\User {#4111
        +avatar: null
        +cover: null
        +email: "Yonrak@feddit.uk"
        +username: "@Yonrak@feddit.uk"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1692955883 {#4130
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: false
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: true
        +notifyOnNewEntryCommentReply: true
        +notifyOnNewPost: false
        +notifyOnNewPostReply: true
        +notifyOnNewPostCommentReply: true
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
        +entries: Doctrine\ORM\PersistentCollection {#4104 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
        +posts: Doctrine\ORM\PersistentCollection {#4096 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
        +follows: Doctrine\ORM\PersistentCollection {#4168 …}
        +followers: Doctrine\ORM\PersistentCollection {#4170 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
        +reports: Doctrine\ORM\PersistentCollection {#4180 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
        +violations: Doctrine\ORM\PersistentCollection {#4184 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
        +awards: Doctrine\ORM\PersistentCollection {#4188 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
        +categories: Doctrine\ORM\PersistentCollection {#4192 …}
        -id: 42482
        -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
        +apId: "Yonrak@feddit.uk"
        +apProfileId: "https://feddit.uk/u/Yonrak"
        +apPublicUrl: "https://feddit.uk/u/Yonrak"
        +apFollowersUrl: null
        +apInboxUrl: "https://feddit.uk/inbox"
        +apDomain: "feddit.uk"
        +apPreferredUsername: "Yonrak"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1692955883 {#4132
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1692950596 {#4124
          date: 2023-08-25 10:03:16.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +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 {#4136
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4127 …}
      +nested: Doctrine\ORM\PersistentCollection {#4125 …}
      +votes: Doctrine\ORM\PersistentCollection {#4123 …}
      +reports: Doctrine\ORM\PersistentCollection {#4122 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
      -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 {#4137
        date: 2023-08-25 15:10:47.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692950595 {#4134
        date: 2023-08-25 10:03:15.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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
      That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
      \n
      > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
      \n
      Not sure I understand this point. Which resistor would you replace with a diode?
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692954353 {#4371
      date: 2023-08-25 11:05:53.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@Yonrak@feddit.uk"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4374 …}
    +nested: Doctrine\ORM\PersistentCollection {#4376 …}
    +votes: Doctrine\ORM\PersistentCollection {#4378 …}
    +reports: Doctrine\ORM\PersistentCollection {#4380 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
    -id: 26781
    -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2363713"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692954353 {#4372
      date: 2023-08-25 11:05:53.0 +02:00
    }
  }
  +nestedComments: []
  +level: 2
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 8.19 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4428
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4373
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4129
        +user: App\Entity\User {#4111}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +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 {#4136
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4127 …}
        +nested: Doctrine\ORM\PersistentCollection {#4125 …}
        +votes: Doctrine\ORM\PersistentCollection {#4123 …}
        +reports: Doctrine\ORM\PersistentCollection {#4122 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
        -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 {#4137
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#4134
          date: 2023-08-25 10:03:15.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4129}
      +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
        That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
        \n
        > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
        \n
        Not sure I understand this point. Which resistor would you replace with a diode?
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692954353 {#4371
        date: 2023-08-25 11:05:53.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4374 …}
      +nested: Doctrine\ORM\PersistentCollection {#4376 …}
      +votes: Doctrine\ORM\PersistentCollection {#4378 …}
      +reports: Doctrine\ORM\PersistentCollection {#4380 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
      -id: 26781
      -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363713"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954353 {#4372
        date: 2023-08-25 11:05:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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 {#4425
      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 {#4429 …}
    +nested: Doctrine\ORM\PersistentCollection {#4431 …}
    +votes: Doctrine\ORM\PersistentCollection {#4433 …}
    +reports: Doctrine\ORM\PersistentCollection {#4435 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4437 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4439 …}
    -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 {#4426
      date: 2023-08-25 11:34:59.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692955881 {#4427
      date: 2023-08-25 11:31:21.0 +02:00
    }
  }
  "showNested" => true
  "level" => 3
  "showEntryTitle" => false
  "showMagazineName" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#7620
  +comment: App\Entity\EntryComment {#4428
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4373
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4129
        +user: App\Entity\User {#4111}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +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 {#4136
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4127 …}
        +nested: Doctrine\ORM\PersistentCollection {#4125 …}
        +votes: Doctrine\ORM\PersistentCollection {#4123 …}
        +reports: Doctrine\ORM\PersistentCollection {#4122 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
        -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 {#4137
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#4134
          date: 2023-08-25 10:03:15.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4129}
      +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
        That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
        \n
        > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
        \n
        Not sure I understand this point. Which resistor would you replace with a diode?
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692954353 {#4371
        date: 2023-08-25 11:05:53.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4374 …}
      +nested: Doctrine\ORM\PersistentCollection {#4376 …}
      +votes: Doctrine\ORM\PersistentCollection {#4378 …}
      +reports: Doctrine\ORM\PersistentCollection {#4380 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
      -id: 26781
      -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363713"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954353 {#4372
        date: 2023-08-25 11:05:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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 {#4425
      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 {#4429 …}
    +nested: Doctrine\ORM\PersistentCollection {#4431 …}
    +votes: Doctrine\ORM\PersistentCollection {#4433 …}
    +reports: Doctrine\ORM\PersistentCollection {#4435 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4437 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4439 …}
    -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 {#4426
      date: 2023-08-25 11:34:59.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692955881 {#4427
      date: 2023-08-25 11:31:21.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 3
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.13 ms
Input props
[
  "user" => App\Entity\User {#4111
    +avatar: null
    +cover: null
    +email: "Yonrak@feddit.uk"
    +username: "@Yonrak@feddit.uk"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1692955883 {#4130
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
    +entries: Doctrine\ORM\PersistentCollection {#4104 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
    +posts: Doctrine\ORM\PersistentCollection {#4096 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
    +follows: Doctrine\ORM\PersistentCollection {#4168 …}
    +followers: Doctrine\ORM\PersistentCollection {#4170 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
    +reports: Doctrine\ORM\PersistentCollection {#4180 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
    +violations: Doctrine\ORM\PersistentCollection {#4184 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
    +awards: Doctrine\ORM\PersistentCollection {#4188 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
    +categories: Doctrine\ORM\PersistentCollection {#4192 …}
    -id: 42482
    -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
    +apId: "Yonrak@feddit.uk"
    +apProfileId: "https://feddit.uk/u/Yonrak"
    +apPublicUrl: "https://feddit.uk/u/Yonrak"
    +apFollowersUrl: null
    +apInboxUrl: "https://feddit.uk/inbox"
    +apDomain: "feddit.uk"
    +apPreferredUsername: "Yonrak"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692955883 {#4132
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692950596 {#4124
      date: 2023-08-25 10:03:16.0 +02:00
    }
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#7665
  +user: App\Entity\User {#4111
    +avatar: null
    +cover: null
    +email: "Yonrak@feddit.uk"
    +username: "@Yonrak@feddit.uk"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1692955883 {#4130
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
    +entries: Doctrine\ORM\PersistentCollection {#4104 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
    +posts: Doctrine\ORM\PersistentCollection {#4096 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
    +follows: Doctrine\ORM\PersistentCollection {#4168 …}
    +followers: Doctrine\ORM\PersistentCollection {#4170 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
    +reports: Doctrine\ORM\PersistentCollection {#4180 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
    +violations: Doctrine\ORM\PersistentCollection {#4184 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
    +awards: Doctrine\ORM\PersistentCollection {#4188 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
    +categories: Doctrine\ORM\PersistentCollection {#4192 …}
    -id: 42482
    -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
    +apId: "Yonrak@feddit.uk"
    +apProfileId: "https://feddit.uk/u/Yonrak"
    +apPublicUrl: "https://feddit.uk/u/Yonrak"
    +apFollowersUrl: null
    +apInboxUrl: "https://feddit.uk/inbox"
    +apDomain: "feddit.uk"
    +apPreferredUsername: "Yonrak"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692955883 {#4132
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692950596 {#4124
      date: 2023-08-25 10:03:16.0 +02:00
    }
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.13 ms
Input props
[
  "date" => DateTimeImmutable @1692955881 {#4427
    date: 2023-08-25 11:31:21.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#7720
  +date: DateTimeImmutable @1692955881 {#4427
    date: 2023-08-25 11:31:21.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.11 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692955881 {#4427
    date: 2023-08-25 11:31:21.0 +02:00
  }
  "editedAt" => DateTimeImmutable @1692956099 {#4426
    date: 2023-08-25 11:34:59.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#7774
  +createdAt: DateTimeImmutable @1692955881 {#4427
    date: 2023-08-25 11:31:21.0 +02:00
  }
  +editedAt: DateTimeImmutable @1692956099 {#4426
    date: 2023-08-25 11:34:59.0 +02:00
  }
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 0.13 ms
Input props
[
  "user" => App\Entity\User {#4111
    +avatar: null
    +cover: null
    +email: "Yonrak@feddit.uk"
    +username: "@Yonrak@feddit.uk"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1692955883 {#4130
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
    +entries: Doctrine\ORM\PersistentCollection {#4104 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
    +posts: Doctrine\ORM\PersistentCollection {#4096 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
    +follows: Doctrine\ORM\PersistentCollection {#4168 …}
    +followers: Doctrine\ORM\PersistentCollection {#4170 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
    +reports: Doctrine\ORM\PersistentCollection {#4180 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
    +violations: Doctrine\ORM\PersistentCollection {#4184 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
    +awards: Doctrine\ORM\PersistentCollection {#4188 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
    +categories: Doctrine\ORM\PersistentCollection {#4192 …}
    -id: 42482
    -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
    +apId: "Yonrak@feddit.uk"
    +apProfileId: "https://feddit.uk/u/Yonrak"
    +apPublicUrl: "https://feddit.uk/u/Yonrak"
    +apFollowersUrl: null
    +apInboxUrl: "https://feddit.uk/inbox"
    +apDomain: "feddit.uk"
    +apPreferredUsername: "Yonrak"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692955883 {#4132
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692950596 {#4124
      date: 2023-08-25 10:03:16.0 +02:00
    }
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#7828
  +width: 40
  +height: 40
  +user: App\Entity\User {#4111
    +avatar: null
    +cover: null
    +email: "Yonrak@feddit.uk"
    +username: "@Yonrak@feddit.uk"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1692955883 {#4130
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
    +entries: Doctrine\ORM\PersistentCollection {#4104 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
    +posts: Doctrine\ORM\PersistentCollection {#4096 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
    +follows: Doctrine\ORM\PersistentCollection {#4168 …}
    +followers: Doctrine\ORM\PersistentCollection {#4170 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
    +reports: Doctrine\ORM\PersistentCollection {#4180 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
    +violations: Doctrine\ORM\PersistentCollection {#4184 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
    +awards: Doctrine\ORM\PersistentCollection {#4188 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
    +categories: Doctrine\ORM\PersistentCollection {#4192 …}
    -id: 42482
    -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
    +apId: "Yonrak@feddit.uk"
    +apProfileId: "https://feddit.uk/u/Yonrak"
    +apPublicUrl: "https://feddit.uk/u/Yonrak"
    +apFollowersUrl: null
    +apInboxUrl: "https://feddit.uk/inbox"
    +apDomain: "feddit.uk"
    +apPreferredUsername: "Yonrak"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692955883 {#4132
      date: 2023-08-25 11:31:23.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692950596 {#4124
      date: 2023-08-25 10:03:16.0 +02:00
    }
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 0.53 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4428
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4373
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4129
        +user: App\Entity\User {#4111}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +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 {#4136
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4127 …}
        +nested: Doctrine\ORM\PersistentCollection {#4125 …}
        +votes: Doctrine\ORM\PersistentCollection {#4123 …}
        +reports: Doctrine\ORM\PersistentCollection {#4122 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
        -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 {#4137
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#4134
          date: 2023-08-25 10:03:15.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4129}
      +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
        That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
        \n
        > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
        \n
        Not sure I understand this point. Which resistor would you replace with a diode?
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692954353 {#4371
        date: 2023-08-25 11:05:53.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4374 …}
      +nested: Doctrine\ORM\PersistentCollection {#4376 …}
      +votes: Doctrine\ORM\PersistentCollection {#4378 …}
      +reports: Doctrine\ORM\PersistentCollection {#4380 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
      -id: 26781
      -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363713"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954353 {#4372
        date: 2023-08-25 11:05:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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 {#4425
      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 {#4429 …}
    +nested: Doctrine\ORM\PersistentCollection {#4431 …}
    +votes: Doctrine\ORM\PersistentCollection {#4433 …}
    +reports: Doctrine\ORM\PersistentCollection {#4435 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4437 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4439 …}
    -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 {#4426
      date: 2023-08-25 11:34:59.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692955881 {#4427
      date: 2023-08-25 11:31:21.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#7915
  +subject: App\Entity\EntryComment {#4428
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4373
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4129
        +user: App\Entity\User {#4111}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +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 {#4136
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4127 …}
        +nested: Doctrine\ORM\PersistentCollection {#4125 …}
        +votes: Doctrine\ORM\PersistentCollection {#4123 …}
        +reports: Doctrine\ORM\PersistentCollection {#4122 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
        -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 {#4137
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#4134
          date: 2023-08-25 10:03:15.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4129}
      +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
        That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
        \n
        > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
        \n
        Not sure I understand this point. Which resistor would you replace with a diode?
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692954353 {#4371
        date: 2023-08-25 11:05:53.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4374 …}
      +nested: Doctrine\ORM\PersistentCollection {#4376 …}
      +votes: Doctrine\ORM\PersistentCollection {#4378 …}
      +reports: Doctrine\ORM\PersistentCollection {#4380 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
      -id: 26781
      -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363713"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954353 {#4372
        date: 2023-08-25 11:05:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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 {#4425
      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 {#4429 …}
    +nested: Doctrine\ORM\PersistentCollection {#4431 …}
    +votes: Doctrine\ORM\PersistentCollection {#4433 …}
    +reports: Doctrine\ORM\PersistentCollection {#4435 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4437 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4439 …}
    -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 {#4426
      date: 2023-08-25 11:34:59.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692955881 {#4427
      date: 2023-08-25 11:31:21.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.74 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4428
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4373
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4129
        +user: App\Entity\User {#4111}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +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 {#4136
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4127 …}
        +nested: Doctrine\ORM\PersistentCollection {#4125 …}
        +votes: Doctrine\ORM\PersistentCollection {#4123 …}
        +reports: Doctrine\ORM\PersistentCollection {#4122 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
        -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 {#4137
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#4134
          date: 2023-08-25 10:03:15.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4129}
      +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
        That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
        \n
        > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
        \n
        Not sure I understand this point. Which resistor would you replace with a diode?
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692954353 {#4371
        date: 2023-08-25 11:05:53.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4374 …}
      +nested: Doctrine\ORM\PersistentCollection {#4376 …}
      +votes: Doctrine\ORM\PersistentCollection {#4378 …}
      +reports: Doctrine\ORM\PersistentCollection {#4380 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
      -id: 26781
      -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363713"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954353 {#4372
        date: 2023-08-25 11:05:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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 {#4425
      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 {#4429 …}
    +nested: Doctrine\ORM\PersistentCollection {#4431 …}
    +votes: Doctrine\ORM\PersistentCollection {#4433 …}
    +reports: Doctrine\ORM\PersistentCollection {#4435 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4437 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4439 …}
    -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 {#4426
      date: 2023-08-25 11:34:59.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692955881 {#4427
      date: 2023-08-25 11:31:21.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#7972
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4428
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4373
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4129
        +user: App\Entity\User {#4111}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +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 {#4136
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4127 …}
        +nested: Doctrine\ORM\PersistentCollection {#4125 …}
        +votes: Doctrine\ORM\PersistentCollection {#4123 …}
        +reports: Doctrine\ORM\PersistentCollection {#4122 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
        -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 {#4137
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#4134
          date: 2023-08-25 10:03:15.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4129}
      +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
        That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
        \n
        > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
        \n
        Not sure I understand this point. Which resistor would you replace with a diode?
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692954353 {#4371
        date: 2023-08-25 11:05:53.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4374 …}
      +nested: Doctrine\ORM\PersistentCollection {#4376 …}
      +votes: Doctrine\ORM\PersistentCollection {#4378 …}
      +reports: Doctrine\ORM\PersistentCollection {#4380 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
      -id: 26781
      -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363713"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954353 {#4372
        date: 2023-08-25 11:05:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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 {#4425
      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 {#4429 …}
    +nested: Doctrine\ORM\PersistentCollection {#4431 …}
    +votes: Doctrine\ORM\PersistentCollection {#4433 …}
    +reports: Doctrine\ORM\PersistentCollection {#4435 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4437 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4439 …}
    -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 {#4426
      date: 2023-08-25 11:34:59.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692955881 {#4427
      date: 2023-08-25 11:31:21.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 0.51 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4428
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4373
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4129
        +user: App\Entity\User {#4111}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +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 {#4136
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4127 …}
        +nested: Doctrine\ORM\PersistentCollection {#4125 …}
        +votes: Doctrine\ORM\PersistentCollection {#4123 …}
        +reports: Doctrine\ORM\PersistentCollection {#4122 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
        -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 {#4137
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#4134
          date: 2023-08-25 10:03:15.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4129}
      +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
        That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
        \n
        > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
        \n
        Not sure I understand this point. Which resistor would you replace with a diode?
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692954353 {#4371
        date: 2023-08-25 11:05:53.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4374 …}
      +nested: Doctrine\ORM\PersistentCollection {#4376 …}
      +votes: Doctrine\ORM\PersistentCollection {#4378 …}
      +reports: Doctrine\ORM\PersistentCollection {#4380 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
      -id: 26781
      -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363713"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954353 {#4372
        date: 2023-08-25 11:05:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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 {#4425
      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 {#4429 …}
    +nested: Doctrine\ORM\PersistentCollection {#4431 …}
    +votes: Doctrine\ORM\PersistentCollection {#4433 …}
    +reports: Doctrine\ORM\PersistentCollection {#4435 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4437 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4439 …}
    -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 {#4426
      date: 2023-08-25 11:34:59.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692955881 {#4427
      date: 2023-08-25 11:31:21.0 +02:00
    }
  }
  "level" => 3
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#8212
  +comment: App\Entity\EntryComment {#4428
    +user: App\Entity\User {#4111
      +avatar: null
      +cover: null
      +email: "Yonrak@feddit.uk"
      +username: "@Yonrak@feddit.uk"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1692955883 {#4130
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4110 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4108 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4106 …}
      +entries: Doctrine\ORM\PersistentCollection {#4104 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4102 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4100 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4098 …}
      +posts: Doctrine\ORM\PersistentCollection {#4096 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4157 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4160 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4162 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4164 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4166 …}
      +follows: Doctrine\ORM\PersistentCollection {#4168 …}
      +followers: Doctrine\ORM\PersistentCollection {#4170 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4172 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4174 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4176 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4178 …}
      +reports: Doctrine\ORM\PersistentCollection {#4180 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4182 …}
      +violations: Doctrine\ORM\PersistentCollection {#4184 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4186 …}
      +awards: Doctrine\ORM\PersistentCollection {#4188 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4190 …}
      +categories: Doctrine\ORM\PersistentCollection {#4192 …}
      -id: 42482
      -password: "$2y$13$NhIMiF1JXctMkB.To0A1l.9Yf5tUWEmnsXRxLOIoPHjfEy4B2UkMe"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4194 …}
      +apId: "Yonrak@feddit.uk"
      +apProfileId: "https://feddit.uk/u/Yonrak"
      +apPublicUrl: "https://feddit.uk/u/Yonrak"
      +apFollowersUrl: null
      +apInboxUrl: "https://feddit.uk/inbox"
      +apDomain: "feddit.uk"
      +apPreferredUsername: "Yonrak"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1692955883 {#4132
        date: 2023-08-25 11:31:23.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1692950596 {#4124
        date: 2023-08-25 10:03:16.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4373
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4129
        +user: App\Entity\User {#4111}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +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 {#4136
          date: 2023-08-25 11:31:23.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4127 …}
        +nested: Doctrine\ORM\PersistentCollection {#4125 …}
        +votes: Doctrine\ORM\PersistentCollection {#4123 …}
        +reports: Doctrine\ORM\PersistentCollection {#4122 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4113 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4116 …}
        -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 {#4137
          date: 2023-08-25 15:10:47.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692950595 {#4134
          date: 2023-08-25 10:03:15.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4129}
      +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
        That’s a great idea! Unfortunately I don’t have a P-FET lying around, so cannot try it right now.\n
        \n
        > Or use a zener/TVS diode instead of second resistor to clamp the voltage instead of dividing (more robust).\n
        \n
        Not sure I understand this point. Which resistor would you replace with a diode?
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692954353 {#4371
        date: 2023-08-25 11:05:53.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@Yonrak@feddit.uk"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4374 …}
      +nested: Doctrine\ORM\PersistentCollection {#4376 …}
      +votes: Doctrine\ORM\PersistentCollection {#4378 …}
      +reports: Doctrine\ORM\PersistentCollection {#4380 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4382 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4384 …}
      -id: 26781
      -bodyTs: "'2':7 'around':45 'batteri':22 'cannot':47 'clamp':62 'could':1 'diagram':6 'diod':56,83 'divid':29,67 'fet':14,19,43 'first':24 'great':33 'idea':34 'instead':9,57,65 'lie':44 'n':13 'n-fet':12 'p':18,42 'p-fet':17,41 'point':75 'potenti':28 'replac':80 'resistor':25,60,77 'right':50 'robust':69 'second':59 'similar':4 'sure':71 'tri':48 'understand':73 'unfortun':35 'use':15,53 'voltag':64 'would':78 'zener/tvs':55"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2363713"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692954353 {#4372
        date: 2023-08-25 11:05:53.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4129}
    +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 {#4425
      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 {#4429 …}
    +nested: Doctrine\ORM\PersistentCollection {#4431 …}
    +votes: Doctrine\ORM\PersistentCollection {#4433 …}
    +reports: Doctrine\ORM\PersistentCollection {#4435 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4437 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4439 …}
    -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 {#4426
      date: 2023-08-25 11:34:59.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692955881 {#4427
      date: 2023-08-25 11:31:21.0 +02:00
    }
  }
  +nestedComments: []
  +level: 3
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 43.20 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4202
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
      \n
      ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
      \n
      My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1693038333 {#4196
      date: 2023-08-26 10:25:33.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4203 …}
    +nested: Doctrine\ORM\PersistentCollection {#4205 …}
    +votes: Doctrine\ORM\PersistentCollection {#4207 …}
    +reports: Doctrine\ORM\PersistentCollection {#4209 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
    -id: 26785
    -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2548436"
    +editedAt: DateTimeImmutable @1692962277 {#4197
      date: 2023-08-25 13:17:57.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692962079 {#4198
      date: 2023-08-25 13:14:39.0 +02:00
    }
  }
  "showNested" => true
  "dateAsUrl" => false
  "showMagazineName" => false
  "showEntryTitle" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#8299
  +comment: App\Entity\EntryComment {#4202
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
      \n
      ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
      \n
      My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1693038333 {#4196
      date: 2023-08-26 10:25:33.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4203 …}
    +nested: Doctrine\ORM\PersistentCollection {#4205 …}
    +votes: Doctrine\ORM\PersistentCollection {#4207 …}
    +reports: Doctrine\ORM\PersistentCollection {#4209 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
    -id: 26785
    -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2548436"
    +editedAt: DateTimeImmutable @1692962277 {#4197
      date: 2023-08-25 13:17:57.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692962079 {#4198
      date: 2023-08-25 13:14:39.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 1
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.15 ms
Input props
[
  "user" => App\Entity\User {#4215
    +avatar: null
    +cover: null
    +email: "jjagaimo@lemmy.ca"
    +username: "@jjagaimo@lemmy.ca"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1726525707 {#4199
      date: 2024-09-17 00:28:27.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
    +entries: Doctrine\ORM\PersistentCollection {#4222 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
    +posts: Doctrine\ORM\PersistentCollection {#4230 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
    +follows: Doctrine\ORM\PersistentCollection {#4242 …}
    +followers: Doctrine\ORM\PersistentCollection {#4244 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
    +reports: Doctrine\ORM\PersistentCollection {#4254 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
    +violations: Doctrine\ORM\PersistentCollection {#4258 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
    +awards: Doctrine\ORM\PersistentCollection {#4262 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
    +categories: Doctrine\ORM\PersistentCollection {#4266 …}
    -id: 5699
    -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
    +apId: "jjagaimo@lemmy.ca"
    +apProfileId: "https://lemmy.ca/u/jjagaimo"
    +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ca/inbox"
    +apDomain: "lemmy.ca"
    +apPreferredUsername: "jjagaimo"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729032387 {#4200
      date: 2024-10-16 00:46:27.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687224837 {#4201
      date: 2023-06-20 03:33:57.0 +02:00
    }
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#8344
  +user: App\Entity\User {#4215
    +avatar: null
    +cover: null
    +email: "jjagaimo@lemmy.ca"
    +username: "@jjagaimo@lemmy.ca"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1726525707 {#4199
      date: 2024-09-17 00:28:27.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
    +entries: Doctrine\ORM\PersistentCollection {#4222 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
    +posts: Doctrine\ORM\PersistentCollection {#4230 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
    +follows: Doctrine\ORM\PersistentCollection {#4242 …}
    +followers: Doctrine\ORM\PersistentCollection {#4244 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
    +reports: Doctrine\ORM\PersistentCollection {#4254 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
    +violations: Doctrine\ORM\PersistentCollection {#4258 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
    +awards: Doctrine\ORM\PersistentCollection {#4262 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
    +categories: Doctrine\ORM\PersistentCollection {#4266 …}
    -id: 5699
    -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
    +apId: "jjagaimo@lemmy.ca"
    +apProfileId: "https://lemmy.ca/u/jjagaimo"
    +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ca/inbox"
    +apDomain: "lemmy.ca"
    +apPreferredUsername: "jjagaimo"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729032387 {#4200
      date: 2024-10-16 00:46:27.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687224837 {#4201
      date: 2023-06-20 03:33:57.0 +02:00
    }
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.14 ms
Input props
[
  "date" => DateTimeImmutable @1692962079 {#4198
    date: 2023-08-25 13:14:39.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#8399
  +date: DateTimeImmutable @1692962079 {#4198
    date: 2023-08-25 13:14:39.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.10 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692962079 {#4198
    date: 2023-08-25 13:14:39.0 +02:00
  }
  "editedAt" => DateTimeImmutable @1692962277 {#4197
    date: 2023-08-25 13:17:57.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#8453
  +createdAt: DateTimeImmutable @1692962079 {#4198
    date: 2023-08-25 13:14:39.0 +02:00
  }
  +editedAt: DateTimeImmutable @1692962277 {#4197
    date: 2023-08-25 13:17:57.0 +02:00
  }
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 0.13 ms
Input props
[
  "user" => App\Entity\User {#4215
    +avatar: null
    +cover: null
    +email: "jjagaimo@lemmy.ca"
    +username: "@jjagaimo@lemmy.ca"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1726525707 {#4199
      date: 2024-09-17 00:28:27.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
    +entries: Doctrine\ORM\PersistentCollection {#4222 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
    +posts: Doctrine\ORM\PersistentCollection {#4230 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
    +follows: Doctrine\ORM\PersistentCollection {#4242 …}
    +followers: Doctrine\ORM\PersistentCollection {#4244 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
    +reports: Doctrine\ORM\PersistentCollection {#4254 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
    +violations: Doctrine\ORM\PersistentCollection {#4258 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
    +awards: Doctrine\ORM\PersistentCollection {#4262 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
    +categories: Doctrine\ORM\PersistentCollection {#4266 …}
    -id: 5699
    -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
    +apId: "jjagaimo@lemmy.ca"
    +apProfileId: "https://lemmy.ca/u/jjagaimo"
    +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ca/inbox"
    +apDomain: "lemmy.ca"
    +apPreferredUsername: "jjagaimo"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729032387 {#4200
      date: 2024-10-16 00:46:27.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687224837 {#4201
      date: 2023-06-20 03:33:57.0 +02:00
    }
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#8507
  +width: 40
  +height: 40
  +user: App\Entity\User {#4215
    +avatar: null
    +cover: null
    +email: "jjagaimo@lemmy.ca"
    +username: "@jjagaimo@lemmy.ca"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1726525707 {#4199
      date: 2024-09-17 00:28:27.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
    +entries: Doctrine\ORM\PersistentCollection {#4222 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
    +posts: Doctrine\ORM\PersistentCollection {#4230 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
    +follows: Doctrine\ORM\PersistentCollection {#4242 …}
    +followers: Doctrine\ORM\PersistentCollection {#4244 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
    +reports: Doctrine\ORM\PersistentCollection {#4254 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
    +violations: Doctrine\ORM\PersistentCollection {#4258 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
    +awards: Doctrine\ORM\PersistentCollection {#4262 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
    +categories: Doctrine\ORM\PersistentCollection {#4266 …}
    -id: 5699
    -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
    +apId: "jjagaimo@lemmy.ca"
    +apProfileId: "https://lemmy.ca/u/jjagaimo"
    +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ca/inbox"
    +apDomain: "lemmy.ca"
    +apPreferredUsername: "jjagaimo"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729032387 {#4200
      date: 2024-10-16 00:46:27.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687224837 {#4201
      date: 2023-06-20 03:33:57.0 +02:00
    }
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 0.35 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4202
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
      \n
      ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
      \n
      My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1693038333 {#4196
      date: 2023-08-26 10:25:33.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4203 …}
    +nested: Doctrine\ORM\PersistentCollection {#4205 …}
    +votes: Doctrine\ORM\PersistentCollection {#4207 …}
    +reports: Doctrine\ORM\PersistentCollection {#4209 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
    -id: 26785
    -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2548436"
    +editedAt: DateTimeImmutable @1692962277 {#4197
      date: 2023-08-25 13:17:57.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692962079 {#4198
      date: 2023-08-25 13:14:39.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#8584
  +subject: App\Entity\EntryComment {#4202
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
      \n
      ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
      \n
      My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1693038333 {#4196
      date: 2023-08-26 10:25:33.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4203 …}
    +nested: Doctrine\ORM\PersistentCollection {#4205 …}
    +votes: Doctrine\ORM\PersistentCollection {#4207 …}
    +reports: Doctrine\ORM\PersistentCollection {#4209 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
    -id: 26785
    -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2548436"
    +editedAt: DateTimeImmutable @1692962277 {#4197
      date: 2023-08-25 13:17:57.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692962079 {#4198
      date: 2023-08-25 13:14:39.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.62 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4202
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
      \n
      ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
      \n
      My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1693038333 {#4196
      date: 2023-08-26 10:25:33.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4203 …}
    +nested: Doctrine\ORM\PersistentCollection {#4205 …}
    +votes: Doctrine\ORM\PersistentCollection {#4207 …}
    +reports: Doctrine\ORM\PersistentCollection {#4209 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
    -id: 26785
    -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2548436"
    +editedAt: DateTimeImmutable @1692962277 {#4197
      date: 2023-08-25 13:17:57.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692962079 {#4198
      date: 2023-08-25 13:14:39.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#8641
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4202
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
      \n
      ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
      \n
      My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1693038333 {#4196
      date: 2023-08-26 10:25:33.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4203 …}
    +nested: Doctrine\ORM\PersistentCollection {#4205 …}
    +votes: Doctrine\ORM\PersistentCollection {#4207 …}
    +reports: Doctrine\ORM\PersistentCollection {#4209 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
    -id: 26785
    -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2548436"
    +editedAt: DateTimeImmutable @1692962277 {#4197
      date: 2023-08-25 13:17:57.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692962079 {#4198
      date: 2023-08-25 13:14:39.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 36.50 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4202
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
      \n
      ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
      \n
      My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1693038333 {#4196
      date: 2023-08-26 10:25:33.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4203 …}
    +nested: Doctrine\ORM\PersistentCollection {#4205 …}
    +votes: Doctrine\ORM\PersistentCollection {#4207 …}
    +reports: Doctrine\ORM\PersistentCollection {#4209 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
    -id: 26785
    -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2548436"
    +editedAt: DateTimeImmutable @1692962277 {#4197
      date: 2023-08-25 13:17:57.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692962079 {#4198
      date: 2023-08-25 13:14:39.0 +02:00
    }
  }
  "level" => 1
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#8881
  +comment: App\Entity\EntryComment {#4202
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: """
      You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
      \n
      ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
      \n
      My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1693038333 {#4196
      date: 2023-08-26 10:25:33.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4203 …}
    +nested: Doctrine\ORM\PersistentCollection {#4205 …}
    +votes: Doctrine\ORM\PersistentCollection {#4207 …}
    +reports: Doctrine\ORM\PersistentCollection {#4209 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
    -id: 26785
    -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2548436"
    +editedAt: DateTimeImmutable @1692962277 {#4197
      date: 2023-08-25 13:17:57.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692962079 {#4198
      date: 2023-08-25 13:14:39.0 +02:00
    }
  }
  +nestedComments: [
    26788 => App\Entity\EntryComment {#4389
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4202}
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
        \n
        When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
        \n
        and fully on, when a pulse is applied\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
        \n
        Source:\n
        \n
        spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692964218 {#4386
        date: 2023-08-25 13:50:18.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4390 …}
      +nested: Doctrine\ORM\PersistentCollection {#4392 …}
      +votes: Doctrine\ORM\PersistentCollection {#4394 …}
      +reports: Doctrine\ORM\PersistentCollection {#4396 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
      -id: 26788
      -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2366650"
      +editedAt: DateTimeImmutable @1692964281 {#4387
        date: 2023-08-25 13:51:21.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692964218 {#4388
        date: 2023-08-25 13:50:18.0 +02:00
      }
    }
    26868 => App\Entity\EntryComment {#4466
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4443
        +user: App\Entity\User {#4215}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4389}
        +root: App\Entity\EntryComment {#4202}
        +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1692976324 {#4441
          date: 2023-08-25 17:12:04.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@jjagaimo@lemmy.ca"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4444 …}
        +nested: Doctrine\ORM\PersistentCollection {#4446 …}
        +votes: Doctrine\ORM\PersistentCollection {#4448 …}
        +reports: Doctrine\ORM\PersistentCollection {#4450 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
        -id: 26797
        -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://lemmy.ca/comment/2554107"
        +editedAt: null
        +createdAt: DateTimeImmutable @1692976324 {#4442
          date: 2023-08-25 17:12:04.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Nice, than you for sharing!\n
        \n
        I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 0
      +score: 0
      +lastActive: DateTime @1693038331 {#4467
        date: 2023-08-26 10:25:31.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4463 …}
      +nested: Doctrine\ORM\PersistentCollection {#4459 …}
      +votes: Doctrine\ORM\PersistentCollection {#4457 …}
      +reports: Doctrine\ORM\PersistentCollection {#4472 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4474 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4476 …}
      -id: 26868
      -bodyTs: "'aim':25 'bootstrap':41 'experi':36 'familiar':38 'issu':15 'less':27 'll':33 'measur':14 'much':20 'nice':1 'option':18 'part':28 'share':5 'simpler':21 'use':10 'won':7"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2393904"
      +editedAt: null
      +createdAt: DateTimeImmutable @1693038331 {#4470
        date: 2023-08-26 10:25:31.0 +02:00
      }
    }
    26797 => App\Entity\EntryComment {#4443}
  ]
  +level: 1
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 35.11 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4389
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4202
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
        \n
        ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
        \n
        My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1693038333 {#4196
        date: 2023-08-26 10:25:33.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4203 …}
      +nested: Doctrine\ORM\PersistentCollection {#4205 …}
      +votes: Doctrine\ORM\PersistentCollection {#4207 …}
      +reports: Doctrine\ORM\PersistentCollection {#4209 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
      -id: 26785
      -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2548436"
      +editedAt: DateTimeImmutable @1692962277 {#4197
        date: 2023-08-25 13:17:57.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692962079 {#4198
        date: 2023-08-25 13:14:39.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
      \n
      When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
      \n
      and fully on, when a pulse is applied\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
      \n
      Source:\n
      \n
      spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692964218 {#4386
      date: 2023-08-25 13:50:18.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4390 …}
    +nested: Doctrine\ORM\PersistentCollection {#4392 …}
    +votes: Doctrine\ORM\PersistentCollection {#4394 …}
    +reports: Doctrine\ORM\PersistentCollection {#4396 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
    -id: 26788
    -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2366650"
    +editedAt: DateTimeImmutable @1692964281 {#4387
      date: 2023-08-25 13:51:21.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692964218 {#4388
      date: 2023-08-25 13:50:18.0 +02:00
    }
  }
  "showNested" => true
  "level" => 2
  "showEntryTitle" => false
  "showMagazineName" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#8941
  +comment: App\Entity\EntryComment {#4389
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4202
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
        \n
        ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
        \n
        My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1693038333 {#4196
        date: 2023-08-26 10:25:33.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4203 …}
      +nested: Doctrine\ORM\PersistentCollection {#4205 …}
      +votes: Doctrine\ORM\PersistentCollection {#4207 …}
      +reports: Doctrine\ORM\PersistentCollection {#4209 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
      -id: 26785
      -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2548436"
      +editedAt: DateTimeImmutable @1692962277 {#4197
        date: 2023-08-25 13:17:57.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692962079 {#4198
        date: 2023-08-25 13:14:39.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
      \n
      When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
      \n
      and fully on, when a pulse is applied\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
      \n
      Source:\n
      \n
      spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692964218 {#4386
      date: 2023-08-25 13:50:18.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4390 …}
    +nested: Doctrine\ORM\PersistentCollection {#4392 …}
    +votes: Doctrine\ORM\PersistentCollection {#4394 …}
    +reports: Doctrine\ORM\PersistentCollection {#4396 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
    -id: 26788
    -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2366650"
    +editedAt: DateTimeImmutable @1692964281 {#4387
      date: 2023-08-25 13:51:21.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692964218 {#4388
      date: 2023-08-25 13:50:18.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 2
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.14 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#8986
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.13 ms
Input props
[
  "date" => DateTimeImmutable @1692964218 {#4388
    date: 2023-08-25 13:50:18.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#9041
  +date: DateTimeImmutable @1692964218 {#4388
    date: 2023-08-25 13:50:18.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.09 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692964218 {#4388
    date: 2023-08-25 13:50:18.0 +02:00
  }
  "editedAt" => DateTimeImmutable @1692964281 {#4387
    date: 2023-08-25 13:51:21.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#9095
  +createdAt: DateTimeImmutable @1692964218 {#4388
    date: 2023-08-25 13:50:18.0 +02:00
  }
  +editedAt: DateTimeImmutable @1692964281 {#4387
    date: 2023-08-25 13:51:21.0 +02:00
  }
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 0.13 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#9149
  +width: 40
  +height: 40
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 2.88 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4389
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4202
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
        \n
        ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
        \n
        My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1693038333 {#4196
        date: 2023-08-26 10:25:33.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4203 …}
      +nested: Doctrine\ORM\PersistentCollection {#4205 …}
      +votes: Doctrine\ORM\PersistentCollection {#4207 …}
      +reports: Doctrine\ORM\PersistentCollection {#4209 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
      -id: 26785
      -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2548436"
      +editedAt: DateTimeImmutable @1692962277 {#4197
        date: 2023-08-25 13:17:57.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692962079 {#4198
        date: 2023-08-25 13:14:39.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
      \n
      When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
      \n
      and fully on, when a pulse is applied\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
      \n
      Source:\n
      \n
      spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692964218 {#4386
      date: 2023-08-25 13:50:18.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4390 …}
    +nested: Doctrine\ORM\PersistentCollection {#4392 …}
    +votes: Doctrine\ORM\PersistentCollection {#4394 …}
    +reports: Doctrine\ORM\PersistentCollection {#4396 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
    -id: 26788
    -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2366650"
    +editedAt: DateTimeImmutable @1692964281 {#4387
      date: 2023-08-25 13:51:21.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692964218 {#4388
      date: 2023-08-25 13:50:18.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#9246
  +subject: App\Entity\EntryComment {#4389
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4202
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
        \n
        ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
        \n
        My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1693038333 {#4196
        date: 2023-08-26 10:25:33.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4203 …}
      +nested: Doctrine\ORM\PersistentCollection {#4205 …}
      +votes: Doctrine\ORM\PersistentCollection {#4207 …}
      +reports: Doctrine\ORM\PersistentCollection {#4209 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
      -id: 26785
      -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2548436"
      +editedAt: DateTimeImmutable @1692962277 {#4197
        date: 2023-08-25 13:17:57.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692962079 {#4198
        date: 2023-08-25 13:14:39.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
      \n
      When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
      \n
      and fully on, when a pulse is applied\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
      \n
      Source:\n
      \n
      spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692964218 {#4386
      date: 2023-08-25 13:50:18.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4390 …}
    +nested: Doctrine\ORM\PersistentCollection {#4392 …}
    +votes: Doctrine\ORM\PersistentCollection {#4394 …}
    +reports: Doctrine\ORM\PersistentCollection {#4396 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
    -id: 26788
    -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2366650"
    +editedAt: DateTimeImmutable @1692964281 {#4387
      date: 2023-08-25 13:51:21.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692964218 {#4388
      date: 2023-08-25 13:50:18.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.68 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4389
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4202
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
        \n
        ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
        \n
        My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1693038333 {#4196
        date: 2023-08-26 10:25:33.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4203 …}
      +nested: Doctrine\ORM\PersistentCollection {#4205 …}
      +votes: Doctrine\ORM\PersistentCollection {#4207 …}
      +reports: Doctrine\ORM\PersistentCollection {#4209 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
      -id: 26785
      -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2548436"
      +editedAt: DateTimeImmutable @1692962277 {#4197
        date: 2023-08-25 13:17:57.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692962079 {#4198
        date: 2023-08-25 13:14:39.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
      \n
      When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
      \n
      and fully on, when a pulse is applied\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
      \n
      Source:\n
      \n
      spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692964218 {#4386
      date: 2023-08-25 13:50:18.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4390 …}
    +nested: Doctrine\ORM\PersistentCollection {#4392 …}
    +votes: Doctrine\ORM\PersistentCollection {#4394 …}
    +reports: Doctrine\ORM\PersistentCollection {#4396 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
    -id: 26788
    -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2366650"
    +editedAt: DateTimeImmutable @1692964281 {#4387
      date: 2023-08-25 13:51:21.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692964218 {#4388
      date: 2023-08-25 13:50:18.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#9303
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4389
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4202
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
        \n
        ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
        \n
        My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1693038333 {#4196
        date: 2023-08-26 10:25:33.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4203 …}
      +nested: Doctrine\ORM\PersistentCollection {#4205 …}
      +votes: Doctrine\ORM\PersistentCollection {#4207 …}
      +reports: Doctrine\ORM\PersistentCollection {#4209 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
      -id: 26785
      -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2548436"
      +editedAt: DateTimeImmutable @1692962277 {#4197
        date: 2023-08-25 13:17:57.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692962079 {#4198
        date: 2023-08-25 13:14:39.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
      \n
      When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
      \n
      and fully on, when a pulse is applied\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
      \n
      Source:\n
      \n
      spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692964218 {#4386
      date: 2023-08-25 13:50:18.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4390 …}
    +nested: Doctrine\ORM\PersistentCollection {#4392 …}
    +votes: Doctrine\ORM\PersistentCollection {#4394 …}
    +reports: Doctrine\ORM\PersistentCollection {#4396 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
    -id: 26788
    -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2366650"
    +editedAt: DateTimeImmutable @1692964281 {#4387
      date: 2023-08-25 13:51:21.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692964218 {#4388
      date: 2023-08-25 13:50:18.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 27.08 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4389
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4202
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
        \n
        ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
        \n
        My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1693038333 {#4196
        date: 2023-08-26 10:25:33.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4203 …}
      +nested: Doctrine\ORM\PersistentCollection {#4205 …}
      +votes: Doctrine\ORM\PersistentCollection {#4207 …}
      +reports: Doctrine\ORM\PersistentCollection {#4209 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
      -id: 26785
      -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2548436"
      +editedAt: DateTimeImmutable @1692962277 {#4197
        date: 2023-08-25 13:17:57.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692962079 {#4198
        date: 2023-08-25 13:14:39.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
      \n
      When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
      \n
      and fully on, when a pulse is applied\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
      \n
      Source:\n
      \n
      spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692964218 {#4386
      date: 2023-08-25 13:50:18.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4390 …}
    +nested: Doctrine\ORM\PersistentCollection {#4392 …}
    +votes: Doctrine\ORM\PersistentCollection {#4394 …}
    +reports: Doctrine\ORM\PersistentCollection {#4396 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
    -id: 26788
    -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2366650"
    +editedAt: DateTimeImmutable @1692964281 {#4387
      date: 2023-08-25 13:51:21.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692964218 {#4388
      date: 2023-08-25 13:50:18.0 +02:00
    }
  }
  "level" => 2
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#9543
  +comment: App\Entity\EntryComment {#4389
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4202
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: null
      +root: null
      +body: """
        You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
        \n
        ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
        \n
        My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1693038333 {#4196
        date: 2023-08-26 10:25:33.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4203 …}
      +nested: Doctrine\ORM\PersistentCollection {#4205 …}
      +votes: Doctrine\ORM\PersistentCollection {#4207 …}
      +reports: Doctrine\ORM\PersistentCollection {#4209 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
      -id: 26785
      -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2548436"
      +editedAt: DateTimeImmutable @1692962277 {#4197
        date: 2023-08-25 13:17:57.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692962079 {#4198
        date: 2023-08-25 13:14:39.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
      \n
      When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
      \n
      and fully on, when a pulse is applied\n
      \n
      ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
      \n
      Source:\n
      \n
      spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1692964218 {#4386
      date: 2023-08-25 13:50:18.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4390 …}
    +nested: Doctrine\ORM\PersistentCollection {#4392 …}
    +votes: Doctrine\ORM\PersistentCollection {#4394 …}
    +reports: Doctrine\ORM\PersistentCollection {#4396 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
    -id: 26788
    -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2366650"
    +editedAt: DateTimeImmutable @1692964281 {#4387
      date: 2023-08-25 13:51:21.0 +02:00
    }
    +createdAt: DateTimeImmutable @1692964218 {#4388
      date: 2023-08-25 13:50:18.0 +02:00
    }
  }
  +nestedComments: []
  +level: 2
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 26.07 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4443
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4389
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4202
        +user: App\Entity\User {#4215}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
          \n
          ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
          \n
          My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1693038333 {#4196
          date: 2023-08-26 10:25:33.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4203 …}
        +nested: Doctrine\ORM\PersistentCollection {#4205 …}
        +votes: Doctrine\ORM\PersistentCollection {#4207 …}
        +reports: Doctrine\ORM\PersistentCollection {#4209 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
        -id: 26785
        -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://lemmy.ca/comment/2548436"
        +editedAt: DateTimeImmutable @1692962277 {#4197
          date: 2023-08-25 13:17:57.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692962079 {#4198
          date: 2023-08-25 13:14:39.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
        \n
        When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
        \n
        and fully on, when a pulse is applied\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
        \n
        Source:\n
        \n
        spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692964218 {#4386
        date: 2023-08-25 13:50:18.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4390 …}
      +nested: Doctrine\ORM\PersistentCollection {#4392 …}
      +votes: Doctrine\ORM\PersistentCollection {#4394 …}
      +reports: Doctrine\ORM\PersistentCollection {#4396 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
      -id: 26788
      -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2366650"
      +editedAt: DateTimeImmutable @1692964281 {#4387
        date: 2023-08-25 13:51:21.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692964218 {#4388
        date: 2023-08-25 13:50:18.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692976324 {#4441
      date: 2023-08-25 17:12:04.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4444 …}
    +nested: Doctrine\ORM\PersistentCollection {#4446 …}
    +votes: Doctrine\ORM\PersistentCollection {#4448 …}
    +reports: Doctrine\ORM\PersistentCollection {#4450 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
    -id: 26797
    -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2554107"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692976324 {#4442
      date: 2023-08-25 17:12:04.0 +02:00
    }
  }
  "showNested" => true
  "level" => 3
  "showEntryTitle" => false
  "showMagazineName" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#9598
  +comment: App\Entity\EntryComment {#4443
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4389
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4202
        +user: App\Entity\User {#4215}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
          \n
          ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
          \n
          My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1693038333 {#4196
          date: 2023-08-26 10:25:33.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4203 …}
        +nested: Doctrine\ORM\PersistentCollection {#4205 …}
        +votes: Doctrine\ORM\PersistentCollection {#4207 …}
        +reports: Doctrine\ORM\PersistentCollection {#4209 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
        -id: 26785
        -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://lemmy.ca/comment/2548436"
        +editedAt: DateTimeImmutable @1692962277 {#4197
          date: 2023-08-25 13:17:57.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692962079 {#4198
          date: 2023-08-25 13:14:39.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
        \n
        When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
        \n
        and fully on, when a pulse is applied\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
        \n
        Source:\n
        \n
        spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692964218 {#4386
        date: 2023-08-25 13:50:18.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4390 …}
      +nested: Doctrine\ORM\PersistentCollection {#4392 …}
      +votes: Doctrine\ORM\PersistentCollection {#4394 …}
      +reports: Doctrine\ORM\PersistentCollection {#4396 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
      -id: 26788
      -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2366650"
      +editedAt: DateTimeImmutable @1692964281 {#4387
        date: 2023-08-25 13:51:21.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692964218 {#4388
        date: 2023-08-25 13:50:18.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692976324 {#4441
      date: 2023-08-25 17:12:04.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4444 …}
    +nested: Doctrine\ORM\PersistentCollection {#4446 …}
    +votes: Doctrine\ORM\PersistentCollection {#4448 …}
    +reports: Doctrine\ORM\PersistentCollection {#4450 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
    -id: 26797
    -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2554107"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692976324 {#4442
      date: 2023-08-25 17:12:04.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 3
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.13 ms
Input props
[
  "user" => App\Entity\User {#4215
    +avatar: null
    +cover: null
    +email: "jjagaimo@lemmy.ca"
    +username: "@jjagaimo@lemmy.ca"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1726525707 {#4199
      date: 2024-09-17 00:28:27.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
    +entries: Doctrine\ORM\PersistentCollection {#4222 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
    +posts: Doctrine\ORM\PersistentCollection {#4230 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
    +follows: Doctrine\ORM\PersistentCollection {#4242 …}
    +followers: Doctrine\ORM\PersistentCollection {#4244 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
    +reports: Doctrine\ORM\PersistentCollection {#4254 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
    +violations: Doctrine\ORM\PersistentCollection {#4258 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
    +awards: Doctrine\ORM\PersistentCollection {#4262 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
    +categories: Doctrine\ORM\PersistentCollection {#4266 …}
    -id: 5699
    -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
    +apId: "jjagaimo@lemmy.ca"
    +apProfileId: "https://lemmy.ca/u/jjagaimo"
    +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ca/inbox"
    +apDomain: "lemmy.ca"
    +apPreferredUsername: "jjagaimo"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729032387 {#4200
      date: 2024-10-16 00:46:27.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687224837 {#4201
      date: 2023-06-20 03:33:57.0 +02:00
    }
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#9643
  +user: App\Entity\User {#4215
    +avatar: null
    +cover: null
    +email: "jjagaimo@lemmy.ca"
    +username: "@jjagaimo@lemmy.ca"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1726525707 {#4199
      date: 2024-09-17 00:28:27.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
    +entries: Doctrine\ORM\PersistentCollection {#4222 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
    +posts: Doctrine\ORM\PersistentCollection {#4230 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
    +follows: Doctrine\ORM\PersistentCollection {#4242 …}
    +followers: Doctrine\ORM\PersistentCollection {#4244 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
    +reports: Doctrine\ORM\PersistentCollection {#4254 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
    +violations: Doctrine\ORM\PersistentCollection {#4258 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
    +awards: Doctrine\ORM\PersistentCollection {#4262 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
    +categories: Doctrine\ORM\PersistentCollection {#4266 …}
    -id: 5699
    -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
    +apId: "jjagaimo@lemmy.ca"
    +apProfileId: "https://lemmy.ca/u/jjagaimo"
    +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ca/inbox"
    +apDomain: "lemmy.ca"
    +apPreferredUsername: "jjagaimo"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729032387 {#4200
      date: 2024-10-16 00:46:27.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687224837 {#4201
      date: 2023-06-20 03:33:57.0 +02:00
    }
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.13 ms
Input props
[
  "date" => DateTimeImmutable @1692976324 {#4442
    date: 2023-08-25 17:12:04.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#9698
  +date: DateTimeImmutable @1692976324 {#4442
    date: 2023-08-25 17:12:04.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.09 ms
Input props
[
  "createdAt" => DateTimeImmutable @1692976324 {#4442
    date: 2023-08-25 17:12:04.0 +02:00
  }
  "editedAt" => null
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#9752
  +createdAt: DateTimeImmutable @1692976324 {#4442
    date: 2023-08-25 17:12:04.0 +02:00
  }
  +editedAt: null
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 0.18 ms
Input props
[
  "user" => App\Entity\User {#4215
    +avatar: null
    +cover: null
    +email: "jjagaimo@lemmy.ca"
    +username: "@jjagaimo@lemmy.ca"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1726525707 {#4199
      date: 2024-09-17 00:28:27.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
    +entries: Doctrine\ORM\PersistentCollection {#4222 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
    +posts: Doctrine\ORM\PersistentCollection {#4230 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
    +follows: Doctrine\ORM\PersistentCollection {#4242 …}
    +followers: Doctrine\ORM\PersistentCollection {#4244 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
    +reports: Doctrine\ORM\PersistentCollection {#4254 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
    +violations: Doctrine\ORM\PersistentCollection {#4258 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
    +awards: Doctrine\ORM\PersistentCollection {#4262 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
    +categories: Doctrine\ORM\PersistentCollection {#4266 …}
    -id: 5699
    -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
    +apId: "jjagaimo@lemmy.ca"
    +apProfileId: "https://lemmy.ca/u/jjagaimo"
    +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ca/inbox"
    +apDomain: "lemmy.ca"
    +apPreferredUsername: "jjagaimo"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729032387 {#4200
      date: 2024-10-16 00:46:27.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687224837 {#4201
      date: 2023-06-20 03:33:57.0 +02:00
    }
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#9806
  +width: 40
  +height: 40
  +user: App\Entity\User {#4215
    +avatar: null
    +cover: null
    +email: "jjagaimo@lemmy.ca"
    +username: "@jjagaimo@lemmy.ca"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1726525707 {#4199
      date: 2024-09-17 00:28:27.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
    +entries: Doctrine\ORM\PersistentCollection {#4222 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
    +posts: Doctrine\ORM\PersistentCollection {#4230 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
    +follows: Doctrine\ORM\PersistentCollection {#4242 …}
    +followers: Doctrine\ORM\PersistentCollection {#4244 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
    +reports: Doctrine\ORM\PersistentCollection {#4254 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
    +violations: Doctrine\ORM\PersistentCollection {#4258 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
    +awards: Doctrine\ORM\PersistentCollection {#4262 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
    +categories: Doctrine\ORM\PersistentCollection {#4266 …}
    -id: 5699
    -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
    +apId: "jjagaimo@lemmy.ca"
    +apProfileId: "https://lemmy.ca/u/jjagaimo"
    +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ca/inbox"
    +apDomain: "lemmy.ca"
    +apPreferredUsername: "jjagaimo"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729032387 {#4200
      date: 2024-10-16 00:46:27.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687224837 {#4201
      date: 2023-06-20 03:33:57.0 +02:00
    }
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 0.43 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4443
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4389
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4202
        +user: App\Entity\User {#4215}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
          \n
          ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
          \n
          My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1693038333 {#4196
          date: 2023-08-26 10:25:33.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4203 …}
        +nested: Doctrine\ORM\PersistentCollection {#4205 …}
        +votes: Doctrine\ORM\PersistentCollection {#4207 …}
        +reports: Doctrine\ORM\PersistentCollection {#4209 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
        -id: 26785
        -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://lemmy.ca/comment/2548436"
        +editedAt: DateTimeImmutable @1692962277 {#4197
          date: 2023-08-25 13:17:57.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692962079 {#4198
          date: 2023-08-25 13:14:39.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
        \n
        When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
        \n
        and fully on, when a pulse is applied\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
        \n
        Source:\n
        \n
        spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692964218 {#4386
        date: 2023-08-25 13:50:18.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4390 …}
      +nested: Doctrine\ORM\PersistentCollection {#4392 …}
      +votes: Doctrine\ORM\PersistentCollection {#4394 …}
      +reports: Doctrine\ORM\PersistentCollection {#4396 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
      -id: 26788
      -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2366650"
      +editedAt: DateTimeImmutable @1692964281 {#4387
        date: 2023-08-25 13:51:21.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692964218 {#4388
        date: 2023-08-25 13:50:18.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692976324 {#4441
      date: 2023-08-25 17:12:04.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4444 …}
    +nested: Doctrine\ORM\PersistentCollection {#4446 …}
    +votes: Doctrine\ORM\PersistentCollection {#4448 …}
    +reports: Doctrine\ORM\PersistentCollection {#4450 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
    -id: 26797
    -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2554107"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692976324 {#4442
      date: 2023-08-25 17:12:04.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#9875
  +subject: App\Entity\EntryComment {#4443
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4389
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4202
        +user: App\Entity\User {#4215}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
          \n
          ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
          \n
          My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1693038333 {#4196
          date: 2023-08-26 10:25:33.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4203 …}
        +nested: Doctrine\ORM\PersistentCollection {#4205 …}
        +votes: Doctrine\ORM\PersistentCollection {#4207 …}
        +reports: Doctrine\ORM\PersistentCollection {#4209 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
        -id: 26785
        -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://lemmy.ca/comment/2548436"
        +editedAt: DateTimeImmutable @1692962277 {#4197
          date: 2023-08-25 13:17:57.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692962079 {#4198
          date: 2023-08-25 13:14:39.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
        \n
        When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
        \n
        and fully on, when a pulse is applied\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
        \n
        Source:\n
        \n
        spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692964218 {#4386
        date: 2023-08-25 13:50:18.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4390 …}
      +nested: Doctrine\ORM\PersistentCollection {#4392 …}
      +votes: Doctrine\ORM\PersistentCollection {#4394 …}
      +reports: Doctrine\ORM\PersistentCollection {#4396 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
      -id: 26788
      -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2366650"
      +editedAt: DateTimeImmutable @1692964281 {#4387
        date: 2023-08-25 13:51:21.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692964218 {#4388
        date: 2023-08-25 13:50:18.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692976324 {#4441
      date: 2023-08-25 17:12:04.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4444 …}
    +nested: Doctrine\ORM\PersistentCollection {#4446 …}
    +votes: Doctrine\ORM\PersistentCollection {#4448 …}
    +reports: Doctrine\ORM\PersistentCollection {#4450 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
    -id: 26797
    -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2554107"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692976324 {#4442
      date: 2023-08-25 17:12:04.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.67 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4443
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4389
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4202
        +user: App\Entity\User {#4215}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
          \n
          ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
          \n
          My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1693038333 {#4196
          date: 2023-08-26 10:25:33.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4203 …}
        +nested: Doctrine\ORM\PersistentCollection {#4205 …}
        +votes: Doctrine\ORM\PersistentCollection {#4207 …}
        +reports: Doctrine\ORM\PersistentCollection {#4209 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
        -id: 26785
        -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://lemmy.ca/comment/2548436"
        +editedAt: DateTimeImmutable @1692962277 {#4197
          date: 2023-08-25 13:17:57.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692962079 {#4198
          date: 2023-08-25 13:14:39.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
        \n
        When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
        \n
        and fully on, when a pulse is applied\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
        \n
        Source:\n
        \n
        spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692964218 {#4386
        date: 2023-08-25 13:50:18.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4390 …}
      +nested: Doctrine\ORM\PersistentCollection {#4392 …}
      +votes: Doctrine\ORM\PersistentCollection {#4394 …}
      +reports: Doctrine\ORM\PersistentCollection {#4396 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
      -id: 26788
      -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2366650"
      +editedAt: DateTimeImmutable @1692964281 {#4387
        date: 2023-08-25 13:51:21.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692964218 {#4388
        date: 2023-08-25 13:50:18.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692976324 {#4441
      date: 2023-08-25 17:12:04.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4444 …}
    +nested: Doctrine\ORM\PersistentCollection {#4446 …}
    +votes: Doctrine\ORM\PersistentCollection {#4448 …}
    +reports: Doctrine\ORM\PersistentCollection {#4450 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
    -id: 26797
    -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2554107"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692976324 {#4442
      date: 2023-08-25 17:12:04.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#9932
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4443
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4389
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4202
        +user: App\Entity\User {#4215}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
          \n
          ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
          \n
          My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1693038333 {#4196
          date: 2023-08-26 10:25:33.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4203 …}
        +nested: Doctrine\ORM\PersistentCollection {#4205 …}
        +votes: Doctrine\ORM\PersistentCollection {#4207 …}
        +reports: Doctrine\ORM\PersistentCollection {#4209 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
        -id: 26785
        -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://lemmy.ca/comment/2548436"
        +editedAt: DateTimeImmutable @1692962277 {#4197
          date: 2023-08-25 13:17:57.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692962079 {#4198
          date: 2023-08-25 13:14:39.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
        \n
        When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
        \n
        and fully on, when a pulse is applied\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
        \n
        Source:\n
        \n
        spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692964218 {#4386
        date: 2023-08-25 13:50:18.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4390 …}
      +nested: Doctrine\ORM\PersistentCollection {#4392 …}
      +votes: Doctrine\ORM\PersistentCollection {#4394 …}
      +reports: Doctrine\ORM\PersistentCollection {#4396 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
      -id: 26788
      -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2366650"
      +editedAt: DateTimeImmutable @1692964281 {#4387
        date: 2023-08-25 13:51:21.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692964218 {#4388
        date: 2023-08-25 13:50:18.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692976324 {#4441
      date: 2023-08-25 17:12:04.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4444 …}
    +nested: Doctrine\ORM\PersistentCollection {#4446 …}
    +votes: Doctrine\ORM\PersistentCollection {#4448 …}
    +reports: Doctrine\ORM\PersistentCollection {#4450 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
    -id: 26797
    -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2554107"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692976324 {#4442
      date: 2023-08-25 17:12:04.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 20.72 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4443
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4389
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4202
        +user: App\Entity\User {#4215}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
          \n
          ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
          \n
          My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1693038333 {#4196
          date: 2023-08-26 10:25:33.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4203 …}
        +nested: Doctrine\ORM\PersistentCollection {#4205 …}
        +votes: Doctrine\ORM\PersistentCollection {#4207 …}
        +reports: Doctrine\ORM\PersistentCollection {#4209 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
        -id: 26785
        -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://lemmy.ca/comment/2548436"
        +editedAt: DateTimeImmutable @1692962277 {#4197
          date: 2023-08-25 13:17:57.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692962079 {#4198
          date: 2023-08-25 13:14:39.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
        \n
        When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
        \n
        and fully on, when a pulse is applied\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
        \n
        Source:\n
        \n
        spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692964218 {#4386
        date: 2023-08-25 13:50:18.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4390 …}
      +nested: Doctrine\ORM\PersistentCollection {#4392 …}
      +votes: Doctrine\ORM\PersistentCollection {#4394 …}
      +reports: Doctrine\ORM\PersistentCollection {#4396 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
      -id: 26788
      -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2366650"
      +editedAt: DateTimeImmutable @1692964281 {#4387
        date: 2023-08-25 13:51:21.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692964218 {#4388
        date: 2023-08-25 13:50:18.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692976324 {#4441
      date: 2023-08-25 17:12:04.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4444 …}
    +nested: Doctrine\ORM\PersistentCollection {#4446 …}
    +votes: Doctrine\ORM\PersistentCollection {#4448 …}
    +reports: Doctrine\ORM\PersistentCollection {#4450 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
    -id: 26797
    -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2554107"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692976324 {#4442
      date: 2023-08-25 17:12:04.0 +02:00
    }
  }
  "level" => 3
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#10172
  +comment: App\Entity\EntryComment {#4443
    +user: App\Entity\User {#4215
      +avatar: null
      +cover: null
      +email: "jjagaimo@lemmy.ca"
      +username: "@jjagaimo@lemmy.ca"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1726525707 {#4199
        date: 2024-09-17 00:28:27.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
      +entries: Doctrine\ORM\PersistentCollection {#4222 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
      +posts: Doctrine\ORM\PersistentCollection {#4230 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
      +follows: Doctrine\ORM\PersistentCollection {#4242 …}
      +followers: Doctrine\ORM\PersistentCollection {#4244 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
      +reports: Doctrine\ORM\PersistentCollection {#4254 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
      +violations: Doctrine\ORM\PersistentCollection {#4258 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
      +awards: Doctrine\ORM\PersistentCollection {#4262 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
      +categories: Doctrine\ORM\PersistentCollection {#4266 …}
      -id: 5699
      -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
      +apId: "jjagaimo@lemmy.ca"
      +apProfileId: "https://lemmy.ca/u/jjagaimo"
      +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
      +apFollowersUrl: null
      +apInboxUrl: "https://lemmy.ca/inbox"
      +apDomain: "lemmy.ca"
      +apPreferredUsername: "jjagaimo"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1729032387 {#4200
        date: 2024-10-16 00:46:27.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687224837 {#4201
        date: 2023-06-20 03:33:57.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4389
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4202
        +user: App\Entity\User {#4215}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: null
        +root: null
        +body: """
          You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
          \n
          ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
          \n
          My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 2
        +score: 0
        +lastActive: DateTime @1693038333 {#4196
          date: 2023-08-26 10:25:33.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4203 …}
        +nested: Doctrine\ORM\PersistentCollection {#4205 …}
        +votes: Doctrine\ORM\PersistentCollection {#4207 …}
        +reports: Doctrine\ORM\PersistentCollection {#4209 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
        -id: 26785
        -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://lemmy.ca/comment/2548436"
        +editedAt: DateTimeImmutable @1692962277 {#4197
          date: 2023-08-25 13:17:57.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692962079 {#4198
          date: 2023-08-25 13:14:39.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: """
        Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
        \n
        When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
        \n
        and fully on, when a pulse is applied\n
        \n
        ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
        \n
        Source:\n
        \n
        spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
        """
      +lang: "en"
      +isAdult: false
      +favouriteCount: 1
      +score: 0
      +lastActive: DateTime @1692964218 {#4386
        date: 2023-08-25 13:50:18.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4390 …}
      +nested: Doctrine\ORM\PersistentCollection {#4392 …}
      +votes: Doctrine\ORM\PersistentCollection {#4394 …}
      +reports: Doctrine\ORM\PersistentCollection {#4396 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
      -id: 26788
      -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://discuss.tchncs.de/comment/2366650"
      +editedAt: DateTimeImmutable @1692964281 {#4387
        date: 2023-08-25 13:51:21.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692964218 {#4388
        date: 2023-08-25 13:50:18.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
    +lang: "en"
    +isAdult: false
    +favouriteCount: 2
    +score: 0
    +lastActive: DateTime @1692976324 {#4441
      date: 2023-08-25 17:12:04.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4444 …}
    +nested: Doctrine\ORM\PersistentCollection {#4446 …}
    +votes: Doctrine\ORM\PersistentCollection {#4448 …}
    +reports: Doctrine\ORM\PersistentCollection {#4450 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
    -id: 26797
    -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://lemmy.ca/comment/2554107"
    +editedAt: null
    +createdAt: DateTimeImmutable @1692976324 {#4442
      date: 2023-08-25 17:12:04.0 +02:00
    }
  }
  +nestedComments: []
  +level: 3
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 20.08 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4466
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4443
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4389
        +user: Proxies\__CG__\App\Entity\User {#1970 …2}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4202
          +user: App\Entity\User {#4215}
          +entry: App\Entity\Entry {#2412}
          +magazine: App\Entity\Magazine {#266}
          +image: null
          +parent: null
          +root: null
          +body: """
            You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
            \n
            ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
            \n
            My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
            """
          +lang: "en"
          +isAdult: false
          +favouriteCount: 2
          +score: 0
          +lastActive: DateTime @1693038333 {#4196
            date: 2023-08-26 10:25:33.0 +02:00
          }
          +ip: null
          +tags: null
          +mentions: [
            "@nilclass@discuss.tchncs.de"
          ]
          +children: Doctrine\ORM\PersistentCollection {#4203 …}
          +nested: Doctrine\ORM\PersistentCollection {#4205 …}
          +votes: Doctrine\ORM\PersistentCollection {#4207 …}
          +reports: Doctrine\ORM\PersistentCollection {#4209 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
          -id: 26785
          -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
          +ranking: 0
          +commentCount: 0
          +upVotes: 0
          +downVotes: 0
          +visibility: "visible             "
          +apId: "https://lemmy.ca/comment/2548436"
          +editedAt: DateTimeImmutable @1692962277 {#4197
            date: 2023-08-25 13:17:57.0 +02:00
          }
          +createdAt: DateTimeImmutable @1692962079 {#4198
            date: 2023-08-25 13:14:39.0 +02:00
          }
        }
        +root: App\Entity\EntryComment {#4202}
        +body: """
          Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
          \n
          When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
          \n
          and fully on, when a pulse is applied\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
          \n
          Source:\n
          \n
          spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 1
        +score: 0
        +lastActive: DateTime @1692964218 {#4386
          date: 2023-08-25 13:50:18.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@jjagaimo@lemmy.ca"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4390 …}
        +nested: Doctrine\ORM\PersistentCollection {#4392 …}
        +votes: Doctrine\ORM\PersistentCollection {#4394 …}
        +reports: Doctrine\ORM\PersistentCollection {#4396 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
        -id: 26788
        -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://discuss.tchncs.de/comment/2366650"
        +editedAt: DateTimeImmutable @1692964281 {#4387
          date: 2023-08-25 13:51:21.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692964218 {#4388
          date: 2023-08-25 13:50:18.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692976324 {#4441
        date: 2023-08-25 17:12:04.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4444 …}
      +nested: Doctrine\ORM\PersistentCollection {#4446 …}
      +votes: Doctrine\ORM\PersistentCollection {#4448 …}
      +reports: Doctrine\ORM\PersistentCollection {#4450 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
      -id: 26797
      -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2554107"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692976324 {#4442
        date: 2023-08-25 17:12:04.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Nice, than you for sharing!\n
      \n
      I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 0
    +score: 0
    +lastActive: DateTime @1693038331 {#4467
      date: 2023-08-26 10:25:31.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4463 …}
    +nested: Doctrine\ORM\PersistentCollection {#4459 …}
    +votes: Doctrine\ORM\PersistentCollection {#4457 …}
    +reports: Doctrine\ORM\PersistentCollection {#4472 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4474 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4476 …}
    -id: 26868
    -bodyTs: "'aim':25 'bootstrap':41 'experi':36 'familiar':38 'issu':15 'less':27 'll':33 'measur':14 'much':20 'nice':1 'option':18 'part':28 'share':5 'simpler':21 'use':10 'won':7"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2393904"
    +editedAt: null
    +createdAt: DateTimeImmutable @1693038331 {#4470
      date: 2023-08-26 10:25:31.0 +02:00
    }
  }
  "showNested" => true
  "level" => 4
  "showEntryTitle" => false
  "showMagazineName" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#10227
  +comment: App\Entity\EntryComment {#4466
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4443
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4389
        +user: Proxies\__CG__\App\Entity\User {#1970 …2}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4202
          +user: App\Entity\User {#4215}
          +entry: App\Entity\Entry {#2412}
          +magazine: App\Entity\Magazine {#266}
          +image: null
          +parent: null
          +root: null
          +body: """
            You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
            \n
            ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
            \n
            My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
            """
          +lang: "en"
          +isAdult: false
          +favouriteCount: 2
          +score: 0
          +lastActive: DateTime @1693038333 {#4196
            date: 2023-08-26 10:25:33.0 +02:00
          }
          +ip: null
          +tags: null
          +mentions: [
            "@nilclass@discuss.tchncs.de"
          ]
          +children: Doctrine\ORM\PersistentCollection {#4203 …}
          +nested: Doctrine\ORM\PersistentCollection {#4205 …}
          +votes: Doctrine\ORM\PersistentCollection {#4207 …}
          +reports: Doctrine\ORM\PersistentCollection {#4209 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
          -id: 26785
          -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
          +ranking: 0
          +commentCount: 0
          +upVotes: 0
          +downVotes: 0
          +visibility: "visible             "
          +apId: "https://lemmy.ca/comment/2548436"
          +editedAt: DateTimeImmutable @1692962277 {#4197
            date: 2023-08-25 13:17:57.0 +02:00
          }
          +createdAt: DateTimeImmutable @1692962079 {#4198
            date: 2023-08-25 13:14:39.0 +02:00
          }
        }
        +root: App\Entity\EntryComment {#4202}
        +body: """
          Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
          \n
          When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
          \n
          and fully on, when a pulse is applied\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
          \n
          Source:\n
          \n
          spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 1
        +score: 0
        +lastActive: DateTime @1692964218 {#4386
          date: 2023-08-25 13:50:18.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@jjagaimo@lemmy.ca"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4390 …}
        +nested: Doctrine\ORM\PersistentCollection {#4392 …}
        +votes: Doctrine\ORM\PersistentCollection {#4394 …}
        +reports: Doctrine\ORM\PersistentCollection {#4396 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
        -id: 26788
        -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://discuss.tchncs.de/comment/2366650"
        +editedAt: DateTimeImmutable @1692964281 {#4387
          date: 2023-08-25 13:51:21.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692964218 {#4388
          date: 2023-08-25 13:50:18.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692976324 {#4441
        date: 2023-08-25 17:12:04.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4444 …}
      +nested: Doctrine\ORM\PersistentCollection {#4446 …}
      +votes: Doctrine\ORM\PersistentCollection {#4448 …}
      +reports: Doctrine\ORM\PersistentCollection {#4450 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
      -id: 26797
      -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2554107"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692976324 {#4442
        date: 2023-08-25 17:12:04.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Nice, than you for sharing!\n
      \n
      I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 0
    +score: 0
    +lastActive: DateTime @1693038331 {#4467
      date: 2023-08-26 10:25:31.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4463 …}
    +nested: Doctrine\ORM\PersistentCollection {#4459 …}
    +votes: Doctrine\ORM\PersistentCollection {#4457 …}
    +reports: Doctrine\ORM\PersistentCollection {#4472 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4474 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4476 …}
    -id: 26868
    -bodyTs: "'aim':25 'bootstrap':41 'experi':36 'familiar':38 'issu':15 'less':27 'll':33 'measur':14 'much':20 'nice':1 'option':18 'part':28 'share':5 'simpler':21 'use':10 'won':7"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2393904"
    +editedAt: null
    +createdAt: DateTimeImmutable @1693038331 {#4470
      date: 2023-08-26 10:25:31.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 4
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.12 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#10272
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.12 ms
Input props
[
  "date" => DateTimeImmutable @1693038331 {#4470
    date: 2023-08-26 10:25:31.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#10327
  +date: DateTimeImmutable @1693038331 {#4470
    date: 2023-08-26 10:25:31.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.08 ms
Input props
[
  "createdAt" => DateTimeImmutable @1693038331 {#4470
    date: 2023-08-26 10:25:31.0 +02:00
  }
  "editedAt" => null
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#10381
  +createdAt: DateTimeImmutable @1693038331 {#4470
    date: 2023-08-26 10:25:31.0 +02:00
  }
  +editedAt: null
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 0.12 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#10435
  +width: 40
  +height: 40
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 0.43 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4466
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4443
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4389
        +user: Proxies\__CG__\App\Entity\User {#1970 …2}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4202
          +user: App\Entity\User {#4215}
          +entry: App\Entity\Entry {#2412}
          +magazine: App\Entity\Magazine {#266}
          +image: null
          +parent: null
          +root: null
          +body: """
            You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
            \n
            ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
            \n
            My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
            """
          +lang: "en"
          +isAdult: false
          +favouriteCount: 2
          +score: 0
          +lastActive: DateTime @1693038333 {#4196
            date: 2023-08-26 10:25:33.0 +02:00
          }
          +ip: null
          +tags: null
          +mentions: [
            "@nilclass@discuss.tchncs.de"
          ]
          +children: Doctrine\ORM\PersistentCollection {#4203 …}
          +nested: Doctrine\ORM\PersistentCollection {#4205 …}
          +votes: Doctrine\ORM\PersistentCollection {#4207 …}
          +reports: Doctrine\ORM\PersistentCollection {#4209 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
          -id: 26785
          -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
          +ranking: 0
          +commentCount: 0
          +upVotes: 0
          +downVotes: 0
          +visibility: "visible             "
          +apId: "https://lemmy.ca/comment/2548436"
          +editedAt: DateTimeImmutable @1692962277 {#4197
            date: 2023-08-25 13:17:57.0 +02:00
          }
          +createdAt: DateTimeImmutable @1692962079 {#4198
            date: 2023-08-25 13:14:39.0 +02:00
          }
        }
        +root: App\Entity\EntryComment {#4202}
        +body: """
          Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
          \n
          When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
          \n
          and fully on, when a pulse is applied\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
          \n
          Source:\n
          \n
          spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 1
        +score: 0
        +lastActive: DateTime @1692964218 {#4386
          date: 2023-08-25 13:50:18.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@jjagaimo@lemmy.ca"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4390 …}
        +nested: Doctrine\ORM\PersistentCollection {#4392 …}
        +votes: Doctrine\ORM\PersistentCollection {#4394 …}
        +reports: Doctrine\ORM\PersistentCollection {#4396 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
        -id: 26788
        -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://discuss.tchncs.de/comment/2366650"
        +editedAt: DateTimeImmutable @1692964281 {#4387
          date: 2023-08-25 13:51:21.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692964218 {#4388
          date: 2023-08-25 13:50:18.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692976324 {#4441
        date: 2023-08-25 17:12:04.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4444 …}
      +nested: Doctrine\ORM\PersistentCollection {#4446 …}
      +votes: Doctrine\ORM\PersistentCollection {#4448 …}
      +reports: Doctrine\ORM\PersistentCollection {#4450 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
      -id: 26797
      -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2554107"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692976324 {#4442
        date: 2023-08-25 17:12:04.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Nice, than you for sharing!\n
      \n
      I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 0
    +score: 0
    +lastActive: DateTime @1693038331 {#4467
      date: 2023-08-26 10:25:31.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4463 …}
    +nested: Doctrine\ORM\PersistentCollection {#4459 …}
    +votes: Doctrine\ORM\PersistentCollection {#4457 …}
    +reports: Doctrine\ORM\PersistentCollection {#4472 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4474 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4476 …}
    -id: 26868
    -bodyTs: "'aim':25 'bootstrap':41 'experi':36 'familiar':38 'issu':15 'less':27 'll':33 'measur':14 'much':20 'nice':1 'option':18 'part':28 'share':5 'simpler':21 'use':10 'won':7"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2393904"
    +editedAt: null
    +createdAt: DateTimeImmutable @1693038331 {#4470
      date: 2023-08-26 10:25:31.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#10508
  +subject: App\Entity\EntryComment {#4466
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4443
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4389
        +user: Proxies\__CG__\App\Entity\User {#1970 …2}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4202
          +user: App\Entity\User {#4215}
          +entry: App\Entity\Entry {#2412}
          +magazine: App\Entity\Magazine {#266}
          +image: null
          +parent: null
          +root: null
          +body: """
            You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
            \n
            ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
            \n
            My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
            """
          +lang: "en"
          +isAdult: false
          +favouriteCount: 2
          +score: 0
          +lastActive: DateTime @1693038333 {#4196
            date: 2023-08-26 10:25:33.0 +02:00
          }
          +ip: null
          +tags: null
          +mentions: [
            "@nilclass@discuss.tchncs.de"
          ]
          +children: Doctrine\ORM\PersistentCollection {#4203 …}
          +nested: Doctrine\ORM\PersistentCollection {#4205 …}
          +votes: Doctrine\ORM\PersistentCollection {#4207 …}
          +reports: Doctrine\ORM\PersistentCollection {#4209 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
          -id: 26785
          -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
          +ranking: 0
          +commentCount: 0
          +upVotes: 0
          +downVotes: 0
          +visibility: "visible             "
          +apId: "https://lemmy.ca/comment/2548436"
          +editedAt: DateTimeImmutable @1692962277 {#4197
            date: 2023-08-25 13:17:57.0 +02:00
          }
          +createdAt: DateTimeImmutable @1692962079 {#4198
            date: 2023-08-25 13:14:39.0 +02:00
          }
        }
        +root: App\Entity\EntryComment {#4202}
        +body: """
          Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
          \n
          When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
          \n
          and fully on, when a pulse is applied\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
          \n
          Source:\n
          \n
          spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 1
        +score: 0
        +lastActive: DateTime @1692964218 {#4386
          date: 2023-08-25 13:50:18.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@jjagaimo@lemmy.ca"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4390 …}
        +nested: Doctrine\ORM\PersistentCollection {#4392 …}
        +votes: Doctrine\ORM\PersistentCollection {#4394 …}
        +reports: Doctrine\ORM\PersistentCollection {#4396 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
        -id: 26788
        -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://discuss.tchncs.de/comment/2366650"
        +editedAt: DateTimeImmutable @1692964281 {#4387
          date: 2023-08-25 13:51:21.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692964218 {#4388
          date: 2023-08-25 13:50:18.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692976324 {#4441
        date: 2023-08-25 17:12:04.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4444 …}
      +nested: Doctrine\ORM\PersistentCollection {#4446 …}
      +votes: Doctrine\ORM\PersistentCollection {#4448 …}
      +reports: Doctrine\ORM\PersistentCollection {#4450 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
      -id: 26797
      -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2554107"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692976324 {#4442
        date: 2023-08-25 17:12:04.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Nice, than you for sharing!\n
      \n
      I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 0
    +score: 0
    +lastActive: DateTime @1693038331 {#4467
      date: 2023-08-26 10:25:31.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4463 …}
    +nested: Doctrine\ORM\PersistentCollection {#4459 …}
    +votes: Doctrine\ORM\PersistentCollection {#4457 …}
    +reports: Doctrine\ORM\PersistentCollection {#4472 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4474 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4476 …}
    -id: 26868
    -bodyTs: "'aim':25 'bootstrap':41 'experi':36 'familiar':38 'issu':15 'less':27 'll':33 'measur':14 'much':20 'nice':1 'option':18 'part':28 'share':5 'simpler':21 'use':10 'won':7"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2393904"
    +editedAt: null
    +createdAt: DateTimeImmutable @1693038331 {#4470
      date: 2023-08-26 10:25:31.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 14.80 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4466
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4443
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4389
        +user: Proxies\__CG__\App\Entity\User {#1970 …2}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4202
          +user: App\Entity\User {#4215}
          +entry: App\Entity\Entry {#2412}
          +magazine: App\Entity\Magazine {#266}
          +image: null
          +parent: null
          +root: null
          +body: """
            You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
            \n
            ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
            \n
            My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
            """
          +lang: "en"
          +isAdult: false
          +favouriteCount: 2
          +score: 0
          +lastActive: DateTime @1693038333 {#4196
            date: 2023-08-26 10:25:33.0 +02:00
          }
          +ip: null
          +tags: null
          +mentions: [
            "@nilclass@discuss.tchncs.de"
          ]
          +children: Doctrine\ORM\PersistentCollection {#4203 …}
          +nested: Doctrine\ORM\PersistentCollection {#4205 …}
          +votes: Doctrine\ORM\PersistentCollection {#4207 …}
          +reports: Doctrine\ORM\PersistentCollection {#4209 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
          -id: 26785
          -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
          +ranking: 0
          +commentCount: 0
          +upVotes: 0
          +downVotes: 0
          +visibility: "visible             "
          +apId: "https://lemmy.ca/comment/2548436"
          +editedAt: DateTimeImmutable @1692962277 {#4197
            date: 2023-08-25 13:17:57.0 +02:00
          }
          +createdAt: DateTimeImmutable @1692962079 {#4198
            date: 2023-08-25 13:14:39.0 +02:00
          }
        }
        +root: App\Entity\EntryComment {#4202}
        +body: """
          Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
          \n
          When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
          \n
          and fully on, when a pulse is applied\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
          \n
          Source:\n
          \n
          spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 1
        +score: 0
        +lastActive: DateTime @1692964218 {#4386
          date: 2023-08-25 13:50:18.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@jjagaimo@lemmy.ca"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4390 …}
        +nested: Doctrine\ORM\PersistentCollection {#4392 …}
        +votes: Doctrine\ORM\PersistentCollection {#4394 …}
        +reports: Doctrine\ORM\PersistentCollection {#4396 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
        -id: 26788
        -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://discuss.tchncs.de/comment/2366650"
        +editedAt: DateTimeImmutable @1692964281 {#4387
          date: 2023-08-25 13:51:21.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692964218 {#4388
          date: 2023-08-25 13:50:18.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692976324 {#4441
        date: 2023-08-25 17:12:04.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4444 …}
      +nested: Doctrine\ORM\PersistentCollection {#4446 …}
      +votes: Doctrine\ORM\PersistentCollection {#4448 …}
      +reports: Doctrine\ORM\PersistentCollection {#4450 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
      -id: 26797
      -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2554107"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692976324 {#4442
        date: 2023-08-25 17:12:04.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Nice, than you for sharing!\n
      \n
      I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 0
    +score: 0
    +lastActive: DateTime @1693038331 {#4467
      date: 2023-08-26 10:25:31.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4463 …}
    +nested: Doctrine\ORM\PersistentCollection {#4459 …}
    +votes: Doctrine\ORM\PersistentCollection {#4457 …}
    +reports: Doctrine\ORM\PersistentCollection {#4472 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4474 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4476 …}
    -id: 26868
    -bodyTs: "'aim':25 'bootstrap':41 'experi':36 'familiar':38 'issu':15 'less':27 'll':33 'measur':14 'much':20 'nice':1 'option':18 'part':28 'share':5 'simpler':21 'use':10 'won':7"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2393904"
    +editedAt: null
    +createdAt: DateTimeImmutable @1693038331 {#4470
      date: 2023-08-26 10:25:31.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#10565
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4466
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4443
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4389
        +user: Proxies\__CG__\App\Entity\User {#1970 …2}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4202
          +user: App\Entity\User {#4215}
          +entry: App\Entity\Entry {#2412}
          +magazine: App\Entity\Magazine {#266}
          +image: null
          +parent: null
          +root: null
          +body: """
            You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
            \n
            ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
            \n
            My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
            """
          +lang: "en"
          +isAdult: false
          +favouriteCount: 2
          +score: 0
          +lastActive: DateTime @1693038333 {#4196
            date: 2023-08-26 10:25:33.0 +02:00
          }
          +ip: null
          +tags: null
          +mentions: [
            "@nilclass@discuss.tchncs.de"
          ]
          +children: Doctrine\ORM\PersistentCollection {#4203 …}
          +nested: Doctrine\ORM\PersistentCollection {#4205 …}
          +votes: Doctrine\ORM\PersistentCollection {#4207 …}
          +reports: Doctrine\ORM\PersistentCollection {#4209 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
          -id: 26785
          -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
          +ranking: 0
          +commentCount: 0
          +upVotes: 0
          +downVotes: 0
          +visibility: "visible             "
          +apId: "https://lemmy.ca/comment/2548436"
          +editedAt: DateTimeImmutable @1692962277 {#4197
            date: 2023-08-25 13:17:57.0 +02:00
          }
          +createdAt: DateTimeImmutable @1692962079 {#4198
            date: 2023-08-25 13:14:39.0 +02:00
          }
        }
        +root: App\Entity\EntryComment {#4202}
        +body: """
          Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
          \n
          When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
          \n
          and fully on, when a pulse is applied\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
          \n
          Source:\n
          \n
          spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 1
        +score: 0
        +lastActive: DateTime @1692964218 {#4386
          date: 2023-08-25 13:50:18.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@jjagaimo@lemmy.ca"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4390 …}
        +nested: Doctrine\ORM\PersistentCollection {#4392 …}
        +votes: Doctrine\ORM\PersistentCollection {#4394 …}
        +reports: Doctrine\ORM\PersistentCollection {#4396 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
        -id: 26788
        -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://discuss.tchncs.de/comment/2366650"
        +editedAt: DateTimeImmutable @1692964281 {#4387
          date: 2023-08-25 13:51:21.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692964218 {#4388
          date: 2023-08-25 13:50:18.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692976324 {#4441
        date: 2023-08-25 17:12:04.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4444 …}
      +nested: Doctrine\ORM\PersistentCollection {#4446 …}
      +votes: Doctrine\ORM\PersistentCollection {#4448 …}
      +reports: Doctrine\ORM\PersistentCollection {#4450 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
      -id: 26797
      -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2554107"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692976324 {#4442
        date: 2023-08-25 17:12:04.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Nice, than you for sharing!\n
      \n
      I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 0
    +score: 0
    +lastActive: DateTime @1693038331 {#4467
      date: 2023-08-26 10:25:31.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4463 …}
    +nested: Doctrine\ORM\PersistentCollection {#4459 …}
    +votes: Doctrine\ORM\PersistentCollection {#4457 …}
    +reports: Doctrine\ORM\PersistentCollection {#4472 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4474 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4476 …}
    -id: 26868
    -bodyTs: "'aim':25 'bootstrap':41 'experi':36 'familiar':38 'issu':15 'less':27 'll':33 'measur':14 'much':20 'nice':1 'option':18 'part':28 'share':5 'simpler':21 'use':10 'won':7"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2393904"
    +editedAt: null
    +createdAt: DateTimeImmutable @1693038331 {#4470
      date: 2023-08-26 10:25:31.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 0.40 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4466
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4443
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4389
        +user: Proxies\__CG__\App\Entity\User {#1970 …2}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4202
          +user: App\Entity\User {#4215}
          +entry: App\Entity\Entry {#2412}
          +magazine: App\Entity\Magazine {#266}
          +image: null
          +parent: null
          +root: null
          +body: """
            You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
            \n
            ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
            \n
            My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
            """
          +lang: "en"
          +isAdult: false
          +favouriteCount: 2
          +score: 0
          +lastActive: DateTime @1693038333 {#4196
            date: 2023-08-26 10:25:33.0 +02:00
          }
          +ip: null
          +tags: null
          +mentions: [
            "@nilclass@discuss.tchncs.de"
          ]
          +children: Doctrine\ORM\PersistentCollection {#4203 …}
          +nested: Doctrine\ORM\PersistentCollection {#4205 …}
          +votes: Doctrine\ORM\PersistentCollection {#4207 …}
          +reports: Doctrine\ORM\PersistentCollection {#4209 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
          -id: 26785
          -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
          +ranking: 0
          +commentCount: 0
          +upVotes: 0
          +downVotes: 0
          +visibility: "visible             "
          +apId: "https://lemmy.ca/comment/2548436"
          +editedAt: DateTimeImmutable @1692962277 {#4197
            date: 2023-08-25 13:17:57.0 +02:00
          }
          +createdAt: DateTimeImmutable @1692962079 {#4198
            date: 2023-08-25 13:14:39.0 +02:00
          }
        }
        +root: App\Entity\EntryComment {#4202}
        +body: """
          Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
          \n
          When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
          \n
          and fully on, when a pulse is applied\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
          \n
          Source:\n
          \n
          spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 1
        +score: 0
        +lastActive: DateTime @1692964218 {#4386
          date: 2023-08-25 13:50:18.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@jjagaimo@lemmy.ca"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4390 …}
        +nested: Doctrine\ORM\PersistentCollection {#4392 …}
        +votes: Doctrine\ORM\PersistentCollection {#4394 …}
        +reports: Doctrine\ORM\PersistentCollection {#4396 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
        -id: 26788
        -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://discuss.tchncs.de/comment/2366650"
        +editedAt: DateTimeImmutable @1692964281 {#4387
          date: 2023-08-25 13:51:21.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692964218 {#4388
          date: 2023-08-25 13:50:18.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692976324 {#4441
        date: 2023-08-25 17:12:04.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4444 …}
      +nested: Doctrine\ORM\PersistentCollection {#4446 …}
      +votes: Doctrine\ORM\PersistentCollection {#4448 …}
      +reports: Doctrine\ORM\PersistentCollection {#4450 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
      -id: 26797
      -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2554107"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692976324 {#4442
        date: 2023-08-25 17:12:04.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Nice, than you for sharing!\n
      \n
      I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 0
    +score: 0
    +lastActive: DateTime @1693038331 {#4467
      date: 2023-08-26 10:25:31.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4463 …}
    +nested: Doctrine\ORM\PersistentCollection {#4459 …}
    +votes: Doctrine\ORM\PersistentCollection {#4457 …}
    +reports: Doctrine\ORM\PersistentCollection {#4472 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4474 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4476 …}
    -id: 26868
    -bodyTs: "'aim':25 'bootstrap':41 'experi':36 'familiar':38 'issu':15 'less':27 'll':33 'measur':14 'much':20 'nice':1 'option':18 'part':28 'share':5 'simpler':21 'use':10 'won':7"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2393904"
    +editedAt: null
    +createdAt: DateTimeImmutable @1693038331 {#4470
      date: 2023-08-26 10:25:31.0 +02:00
    }
  }
  "level" => 4
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#10805
  +comment: App\Entity\EntryComment {#4466
    +user: Proxies\__CG__\App\Entity\User {#1970
      +avatar: null
      +cover: null
      +email: "nilclass@discuss.tchncs.de"
      +username: "@nilclass@discuss.tchncs.de"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1721268563 {#1536
        date: 2024-07-18 04:09:23.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: true
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: false
      +notifyOnNewEntryCommentReply: false
      +notifyOnNewPost: false
      +notifyOnNewPostReply: false
      +notifyOnNewPostCommentReply: false
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
      +entries: Doctrine\ORM\PersistentCollection {#1631 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
      +posts: Doctrine\ORM\PersistentCollection {#1659 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
      +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
      +follows: Doctrine\ORM\PersistentCollection {#1660 …}
      +followers: Doctrine\ORM\PersistentCollection {#1627 …}
      +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
      +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
      +reports: Doctrine\ORM\PersistentCollection {#1425 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
      +violations: Doctrine\ORM\PersistentCollection {#1699 …}
      +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
      +awards: Doctrine\ORM\PersistentCollection {#1430 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
      +categories: Doctrine\ORM\PersistentCollection {#1645 …}
      -id: 6046
      -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
      +apId: "nilclass@discuss.tchncs.de"
      +apProfileId: "https://discuss.tchncs.de/u/nilclass"
      +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
      +apFollowersUrl: null
      +apInboxUrl: "https://discuss.tchncs.de/inbox"
      +apDomain: "discuss.tchncs.de"
      +apPreferredUsername: "nilclass"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1720630912 {#1515
        date: 2024-07-10 19:01:52.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1687291240 {#1516
        date: 2023-06-20 22:00:40.0 +02:00
      }
      +__isInitialized__: true
       …2
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970 …2}
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: App\Entity\EntryComment {#4443
      +user: App\Entity\User {#4215
        +avatar: null
        +cover: null
        +email: "jjagaimo@lemmy.ca"
        +username: "@jjagaimo@lemmy.ca"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1726525707 {#4199
          date: 2024-09-17 00:28:27.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#4216 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4218 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#4220 …}
        +entries: Doctrine\ORM\PersistentCollection {#4222 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#4224 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#4226 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4228 …}
        +posts: Doctrine\ORM\PersistentCollection {#4230 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#4232 …}
        +postComments: Doctrine\ORM\PersistentCollection {#4234 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#4236 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#4238 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#4240 …}
        +follows: Doctrine\ORM\PersistentCollection {#4242 …}
        +followers: Doctrine\ORM\PersistentCollection {#4244 …}
        +blocks: Doctrine\ORM\PersistentCollection {#4246 …}
        +blockers: Doctrine\ORM\PersistentCollection {#4248 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#4250 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#4252 …}
        +reports: Doctrine\ORM\PersistentCollection {#4254 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4256 …}
        +violations: Doctrine\ORM\PersistentCollection {#4258 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4260 …}
        +awards: Doctrine\ORM\PersistentCollection {#4262 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#4264 …}
        +categories: Doctrine\ORM\PersistentCollection {#4266 …}
        -id: 5699
        -password: "$2y$13$Mfm9YYdSeud4.IXaL2IEFuQHzvAan10JBSLFIeADVkoSkL5OFHIH."
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4268 …}
        +apId: "jjagaimo@lemmy.ca"
        +apProfileId: "https://lemmy.ca/u/jjagaimo"
        +apPublicUrl: "https://lemmy.ca/u/jjagaimo"
        +apFollowersUrl: null
        +apInboxUrl: "https://lemmy.ca/inbox"
        +apDomain: "lemmy.ca"
        +apPreferredUsername: "jjagaimo"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1729032387 {#4200
          date: 2024-10-16 00:46:27.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687224837 {#4201
          date: 2023-06-20 03:33:57.0 +02:00
        }
      }
      +entry: App\Entity\Entry {#2412}
      +magazine: App\Entity\Magazine {#266}
      +image: null
      +parent: App\Entity\EntryComment {#4389
        +user: Proxies\__CG__\App\Entity\User {#1970 …2}
        +entry: App\Entity\Entry {#2412}
        +magazine: App\Entity\Magazine {#266}
        +image: null
        +parent: App\Entity\EntryComment {#4202
          +user: App\Entity\User {#4215}
          +entry: App\Entity\Entry {#2412}
          +magazine: App\Entity\Magazine {#266}
          +image: null
          +parent: null
          +root: null
          +body: """
            You could use a single MOSFET on the high side of the divider and use a cap + diode to boost the voltage and fully turn on the FET:\n
            \n
            ![](https://lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)\n
            \n
            My gate driver is fairly crude but you could probably make something a bit better with a PNP transistor and either pull it down or leave it floating, or instead use a szaiklai pair
            """
          +lang: "en"
          +isAdult: false
          +favouriteCount: 2
          +score: 0
          +lastActive: DateTime @1693038333 {#4196
            date: 2023-08-26 10:25:33.0 +02:00
          }
          +ip: null
          +tags: null
          +mentions: [
            "@nilclass@discuss.tchncs.de"
          ]
          +children: Doctrine\ORM\PersistentCollection {#4203 …}
          +nested: Doctrine\ORM\PersistentCollection {#4205 …}
          +votes: Doctrine\ORM\PersistentCollection {#4207 …}
          +reports: Doctrine\ORM\PersistentCollection {#4209 …}
          +favourites: Doctrine\ORM\PersistentCollection {#4211 …}
          +notifications: Doctrine\ORM\PersistentCollection {#4213 …}
          -id: 26785
          -bodyTs: "'/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':31 'better':46 'bit':45 'boost':20 'cap':17 'could':2,40 'crude':37 'diod':18 'divid':13 'driver':34 'either':52 'fair':36 'fet':28 'float':59 'fulli':24 'gate':33 'high':9 'instead':61 'leav':57 'lemmy.ca':30 'lemmy.ca/pictrs/image/8b22113e-3ad3-40c1-80ee-e7b3e6be24cb.png)':29 'make':42 'mosfet':6 'pair':65 'pnp':49 'probabl':41 'pull':53 'side':10 'singl':5 'someth':43 'szaiklai':64 'transistor':50 'turn':25 'use':3,15,62 'voltag':22"
          +ranking: 0
          +commentCount: 0
          +upVotes: 0
          +downVotes: 0
          +visibility: "visible             "
          +apId: "https://lemmy.ca/comment/2548436"
          +editedAt: DateTimeImmutable @1692962277 {#4197
            date: 2023-08-25 13:17:57.0 +02:00
          }
          +createdAt: DateTimeImmutable @1692962079 {#4198
            date: 2023-08-25 13:14:39.0 +02:00
          }
        }
        +root: App\Entity\EntryComment {#4202}
        +body: """
          Hm, I don’t understand how this is supposed to work - is that a n-channel or p-channel FET?\n
          \n
          When I sketch it using falstad’s circuitjs, it looks like the FET (n-channel) is a little bit on all the time\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)\n
          \n
          and fully on, when a pulse is applied\n
          \n
          ![](https://discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)\n
          \n
          Source:\n
          \n
          spoiler`$ 1 0.000005 10.20027730826997 50 5 43 5e-11 r 144 80 144 176 0 1000 r 0 192 96 192 0 100 t 96 192 144 192 0 1 -8.999999980890745 9.099999980846458e-10 100 default c 144 176 304 176 0 0.000001 -1.7996761414451612e-8 0 f 304 176 384 176 32 2 0.02 d 304 80 304 176 2 default r 384 192 384 272 0 1000 r 384 272 384 352 0 1000 g 384 352 384 384 0 0 g 144 208 144 256 0 0 w 144 80 304 80 0 w 384 160 384 80 0 w 384 80 304 80 0 v 528 256 528 208 0 0 40 9 0 0 0.5 w 528 256 528 352 0 w 528 352 384 352 0 w 528 208 528 80 0 w 528 80 384 80 0 g -48 208 -48 256 0 0 R -48 176 -48 128 0 0 40 5 0 0 0.5 S 0 192 -48 192 0 0 false 0 2 p 384 272 272 272 3 0 0 g 272 272 272 304 0 0`___
          """
        +lang: "en"
        +isAdult: false
        +favouriteCount: 1
        +score: 0
        +lastActive: DateTime @1692964218 {#4386
          date: 2023-08-25 13:50:18.0 +02:00
        }
        +ip: null
        +tags: null
        +mentions: [
          "@nilclass@discuss.tchncs.de"
          "@jjagaimo@lemmy.ca"
        ]
        +children: Doctrine\ORM\PersistentCollection {#4390 …}
        +nested: Doctrine\ORM\PersistentCollection {#4392 …}
        +votes: Doctrine\ORM\PersistentCollection {#4394 …}
        +reports: Doctrine\ORM\PersistentCollection {#4396 …}
        +favourites: Doctrine\ORM\PersistentCollection {#4398 …}
        +notifications: Doctrine\ORM\PersistentCollection {#4400 …}
        -id: 26788
        -bodyTs: "'-1.7996761414451612e-8':102 '-48':202,204,209,211,223 '-8.999999980890745':91 '/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':49 '/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':60 '0':75,78,82,89,100,103,124,131,138,139,145,146,152,158,164,170,171,174,175,182,188,194,200,206,207,213,214,217,218,221,225,226,228,236,237,243,244 '0.000001':101 '0.000005':64 '0.02':111 '0.5':176,219 '1':63,90 '10.20027730826997':65 '100':83,93 '1000':76,125,132 '128':212 '144':71,73,87,96,141,143,148 '160':155 '176':74,97,99,106,108,116,210 '192':79,81,86,88,121,222,224 '2':110,117,229 '208':142,169,191,203 '256':144,167,179,205 '272':123,128,232,233,234,239,240,241 '3':235 '304':98,105,113,115,150,162,242 '32':109 '352':130,135,181,185,187 '384':107,120,122,127,129,134,136,137,154,156,160,186,198,231 '40':172,215 '43':68 '5':67,216 '50':66 '528':166,168,178,180,184,190,192,196 '5e-11':69 '80':72,114,149,151,157,161,163,193,197,199 '9':173 '9.099999980846458e-10':92 '96':80,85 'appli':57 'bit':42 'c':95 'channel':17,21,38 'circuitj':30 'd':112 'default':94,118 'discuss.tchncs.de':48,59 'discuss.tchncs.de/pictrs/image/dae3ca56-da12-4a48-a023-d3c08c614efb.png)':47 'discuss.tchncs.de/pictrs/image/e929b967-601c-4796-8b42-1f17de54f037.png)':58 'f':104 'fals':227 'falstad':28 'fet':22,35 'fulli':51 'g':133,140,201,238 'hm':1 'like':33 'littl':41 'look':32 'n':16,37 'n-channel':15,36 'p':20,230 'p-channel':19 'puls':55 'r':70,77,119,126,208 'sketch':25 'sourc':61 'spoiler':62 'suppos':9 'time':46 'understand':5 'use':27 'v':165 'w':147,153,159,177,183,189,195 'work':11"
        +ranking: 0
        +commentCount: 0
        +upVotes: 0
        +downVotes: 0
        +visibility: "visible             "
        +apId: "https://discuss.tchncs.de/comment/2366650"
        +editedAt: DateTimeImmutable @1692964281 {#4387
          date: 2023-08-25 13:51:21.0 +02:00
        }
        +createdAt: DateTimeImmutable @1692964218 {#4388
          date: 2023-08-25 13:50:18.0 +02:00
        }
      }
      +root: App\Entity\EntryComment {#4202}
      +body: "It is an N channel FET. The concept is called “bootstrapping” since Vgs needs to be greater than Vth for the MOSFET to be on. When the FET is on the high side and you want the full 9V on the output, you use the diode to charge the capacitor, and the other side of the cap is 0V. Then, when the other side of the cap is connected to 9V, the charge on the cap can’t go anywhere so the voltage on the other side jumps to 18V. This creates a Vgs of 9V. Ideally you would have something better to drive the gate to fully turn off the FET, but I just used a quick and dirty driver where the bootstrap capacitor directly feeds the gate instead of being the input to the driver. Because if this, the Vgs doesn’t drop completely to 0"
      +lang: "en"
      +isAdult: false
      +favouriteCount: 2
      +score: 0
      +lastActive: DateTime @1692976324 {#4441
        date: 2023-08-25 17:12:04.0 +02:00
      }
      +ip: null
      +tags: null
      +mentions: [
        "@nilclass@discuss.tchncs.de"
        "@jjagaimo@lemmy.ca"
      ]
      +children: Doctrine\ORM\PersistentCollection {#4444 …}
      +nested: Doctrine\ORM\PersistentCollection {#4446 …}
      +votes: Doctrine\ORM\PersistentCollection {#4448 …}
      +reports: Doctrine\ORM\PersistentCollection {#4450 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4452 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4454 …}
      -id: 26797
      -bodyTs: "'0':148 '0v':59 '18v':90 '9v':39,71,96 'anywher':80 'better':102 'bootstrap':11,124 'call':10 'cap':57,67,76 'capacitor':50,125 'channel':5 'charg':48,73 'complet':146 'concept':8 'connect':69 'creat':92 'diod':46 'direct':126 'dirti':120 'doesn':143 'drive':104 'driver':121,137 'drop':145 'feed':127 'fet':6,28,112 'full':38 'fulli':108 'gate':106,129 'go':79 'greater':17 'high':32 'ideal':97 'input':134 'instead':130 'jump':88 'mosfet':22 'n':4 'need':14 'output':42 'quick':118 'side':33,54,64,87 'sinc':12 'someth':101 'turn':109 'use':44,116 'vgs':13,94,142 'voltag':83 'vth':19 'want':36 'would':99"
      +ranking: 0
      +commentCount: 0
      +upVotes: 0
      +downVotes: 0
      +visibility: "visible             "
      +apId: "https://lemmy.ca/comment/2554107"
      +editedAt: null
      +createdAt: DateTimeImmutable @1692976324 {#4442
        date: 2023-08-25 17:12:04.0 +02:00
      }
    }
    +root: App\Entity\EntryComment {#4202}
    +body: """
      Nice, than you for sharing!\n
      \n
      I won’t be using this for my measurement issue (the other options are much simpler, and i was aiming for less parts, not more), but I’ll do some experiments to familiarize myself with bootstrapping
      """
    +lang: "en"
    +isAdult: false
    +favouriteCount: 0
    +score: 0
    +lastActive: DateTime @1693038331 {#4467
      date: 2023-08-26 10:25:31.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
      "@jjagaimo@lemmy.ca"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4463 …}
    +nested: Doctrine\ORM\PersistentCollection {#4459 …}
    +votes: Doctrine\ORM\PersistentCollection {#4457 …}
    +reports: Doctrine\ORM\PersistentCollection {#4472 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4474 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4476 …}
    -id: 26868
    -bodyTs: "'aim':25 'bootstrap':41 'experi':36 'familiar':38 'issu':15 'less':27 'll':33 'measur':14 'much':20 'nice':1 'option':18 'part':28 'share':5 'simpler':21 'use':10 'won':7"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://discuss.tchncs.de/comment/2393904"
    +editedAt: null
    +createdAt: DateTimeImmutable @1693038331 {#4470
      date: 2023-08-26 10:25:31.0 +02:00
    }
  }
  +nestedComments: []
  +level: 4
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
entry_comment App\Twig\Components\EntryCommentComponent 12.0 MiB 30.95 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4275
    +user: App\Entity\User {#4288
      +avatar: null
      +cover: null
      +email: "Stoney@aussie.zone"
      +username: "@Stoney@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1694781047 {#4272
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
      +entries: Doctrine\ORM\PersistentCollection {#4295 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
      +posts: Doctrine\ORM\PersistentCollection {#4303 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
      +follows: Doctrine\ORM\PersistentCollection {#4315 …}
      +followers: Doctrine\ORM\PersistentCollection {#4317 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
      +reports: Doctrine\ORM\PersistentCollection {#4327 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
      +violations: Doctrine\ORM\PersistentCollection {#4331 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
      +awards: Doctrine\ORM\PersistentCollection {#4335 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
      +categories: Doctrine\ORM\PersistentCollection {#4339 …}
      -id: 46201
      -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
      +apId: "Stoney@aussie.zone"
      +apProfileId: "https://aussie.zone/u/Stoney"
      +apPublicUrl: "https://aussie.zone/u/Stoney"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "Stoney"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1694781047 {#4273
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1694781046 {#4274
        date: 2023-09-15 14:30:46.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: "increase the resistors by a factor of 100 or so and add a very small cap across the lower one. The cap inside the ADC is absolutely tiny, pF at best. So a 100nF cap would easily do the trick and supply the voltage as required."
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1694781042 {#4270
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4276 …}
    +nested: Doctrine\ORM\PersistentCollection {#4278 …}
    +votes: Doctrine\ORM\PersistentCollection {#4280 …}
    +reports: Doctrine\ORM\PersistentCollection {#4282 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4284 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4286 …}
    -id: 29231
    -bodyTs: "'100':8 '100nf':34 'absolut':27 'across':17 'adc':25 'add':12 'best':31 'cap':16,22,35 'easili':37 'factor':6 'increas':1 'insid':23 'lower':19 'one':20 'pf':29 'requir':46 'resistor':3 'small':15 'suppli':42 'tini':28 'trick':40 'voltag':44 'would':36"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2659403"
    +editedAt: null
    +createdAt: DateTimeImmutable @1694781042 {#4271
      date: 2023-09-15 14:30:42.0 +02:00
    }
  }
  "showNested" => true
  "dateAsUrl" => false
  "showMagazineName" => false
  "showEntryTitle" => false
]
Attributes
[]
Component
App\Twig\Components\EntryCommentComponent {#10903
  +comment: App\Entity\EntryComment {#4275
    +user: App\Entity\User {#4288
      +avatar: null
      +cover: null
      +email: "Stoney@aussie.zone"
      +username: "@Stoney@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1694781047 {#4272
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
      +entries: Doctrine\ORM\PersistentCollection {#4295 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
      +posts: Doctrine\ORM\PersistentCollection {#4303 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
      +follows: Doctrine\ORM\PersistentCollection {#4315 …}
      +followers: Doctrine\ORM\PersistentCollection {#4317 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
      +reports: Doctrine\ORM\PersistentCollection {#4327 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
      +violations: Doctrine\ORM\PersistentCollection {#4331 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
      +awards: Doctrine\ORM\PersistentCollection {#4335 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
      +categories: Doctrine\ORM\PersistentCollection {#4339 …}
      -id: 46201
      -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
      +apId: "Stoney@aussie.zone"
      +apProfileId: "https://aussie.zone/u/Stoney"
      +apPublicUrl: "https://aussie.zone/u/Stoney"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "Stoney"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1694781047 {#4273
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1694781046 {#4274
        date: 2023-09-15 14:30:46.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: "increase the resistors by a factor of 100 or so and add a very small cap across the lower one. The cap inside the ADC is absolutely tiny, pF at best. So a 100nF cap would easily do the trick and supply the voltage as required."
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1694781042 {#4270
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4276 …}
    +nested: Doctrine\ORM\PersistentCollection {#4278 …}
    +votes: Doctrine\ORM\PersistentCollection {#4280 …}
    +reports: Doctrine\ORM\PersistentCollection {#4282 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4284 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4286 …}
    -id: 29231
    -bodyTs: "'100':8 '100nf':34 'absolut':27 'across':17 'adc':25 'add':12 'best':31 'cap':16,22,35 'easili':37 'factor':6 'increas':1 'insid':23 'lower':19 'one':20 'pf':29 'requir':46 'resistor':3 'small':15 'suppli':42 'tini':28 'trick':40 'voltag':44 'would':36"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2659403"
    +editedAt: null
    +createdAt: DateTimeImmutable @1694781042 {#4271
      date: 2023-09-15 14:30:42.0 +02:00
    }
  }
  +showMagazineName: false
  +showEntryTitle: false
  +showNested: true
  +level: 1
  +canSeeTrash: false
  +dateAsUrl: false
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -authorizationChecker: Symfony\Component\Security\Core\Authorization\AuthorizationChecker {#931 …}
}
user_inline App\Twig\Components\UserInlineComponent 12.0 MiB 0.16 ms
Input props
[
  "user" => App\Entity\User {#4288
    +avatar: null
    +cover: null
    +email: "Stoney@aussie.zone"
    +username: "@Stoney@aussie.zone"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1694781047 {#4272
      date: 2023-09-15 14:30:47.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
    +entries: Doctrine\ORM\PersistentCollection {#4295 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
    +posts: Doctrine\ORM\PersistentCollection {#4303 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
    +follows: Doctrine\ORM\PersistentCollection {#4315 …}
    +followers: Doctrine\ORM\PersistentCollection {#4317 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
    +reports: Doctrine\ORM\PersistentCollection {#4327 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
    +violations: Doctrine\ORM\PersistentCollection {#4331 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
    +awards: Doctrine\ORM\PersistentCollection {#4335 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
    +categories: Doctrine\ORM\PersistentCollection {#4339 …}
    -id: 46201
    -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
    +apId: "Stoney@aussie.zone"
    +apProfileId: "https://aussie.zone/u/Stoney"
    +apPublicUrl: "https://aussie.zone/u/Stoney"
    +apFollowersUrl: null
    +apInboxUrl: "https://aussie.zone/inbox"
    +apDomain: "aussie.zone"
    +apPreferredUsername: "Stoney"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1694781047 {#4273
      date: 2023-09-15 14:30:47.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1694781046 {#4274
      date: 2023-09-15 14:30:46.0 +02:00
    }
  }
  "showAvatar" => false
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#10948
  +user: App\Entity\User {#4288
    +avatar: null
    +cover: null
    +email: "Stoney@aussie.zone"
    +username: "@Stoney@aussie.zone"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1694781047 {#4272
      date: 2023-09-15 14:30:47.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
    +entries: Doctrine\ORM\PersistentCollection {#4295 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
    +posts: Doctrine\ORM\PersistentCollection {#4303 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
    +follows: Doctrine\ORM\PersistentCollection {#4315 …}
    +followers: Doctrine\ORM\PersistentCollection {#4317 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
    +reports: Doctrine\ORM\PersistentCollection {#4327 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
    +violations: Doctrine\ORM\PersistentCollection {#4331 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
    +awards: Doctrine\ORM\PersistentCollection {#4335 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
    +categories: Doctrine\ORM\PersistentCollection {#4339 …}
    -id: 46201
    -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
    +apId: "Stoney@aussie.zone"
    +apProfileId: "https://aussie.zone/u/Stoney"
    +apPublicUrl: "https://aussie.zone/u/Stoney"
    +apFollowersUrl: null
    +apInboxUrl: "https://aussie.zone/inbox"
    +apDomain: "aussie.zone"
    +apPreferredUsername: "Stoney"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1694781047 {#4273
      date: 2023-09-15 14:30:47.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1694781046 {#4274
      date: 2023-09-15 14:30:46.0 +02:00
    }
  }
  +showAvatar: false
}
date App\Twig\Components\DateComponent 12.0 MiB 0.14 ms
Input props
[
  "date" => DateTimeImmutable @1694781042 {#4271
    date: 2023-09-15 14:30:42.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#11003
  +date: DateTimeImmutable @1694781042 {#4271
    date: 2023-09-15 14:30:42.0 +02:00
  }
}
date_edited App\Twig\Components\DateEditedComponent 12.0 MiB 0.09 ms
Input props
[
  "createdAt" => DateTimeImmutable @1694781042 {#4271
    date: 2023-09-15 14:30:42.0 +02:00
  }
  "editedAt" => null
]
Attributes
[]
Component
App\Twig\Components\DateEditedComponent {#11057
  +createdAt: DateTimeImmutable @1694781042 {#4271
    date: 2023-09-15 14:30:42.0 +02:00
  }
  +editedAt: null
}
user_avatar App\Twig\Components\UserAvatarComponent 12.0 MiB 0.13 ms
Input props
[
  "user" => App\Entity\User {#4288
    +avatar: null
    +cover: null
    +email: "Stoney@aussie.zone"
    +username: "@Stoney@aussie.zone"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1694781047 {#4272
      date: 2023-09-15 14:30:47.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
    +entries: Doctrine\ORM\PersistentCollection {#4295 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
    +posts: Doctrine\ORM\PersistentCollection {#4303 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
    +follows: Doctrine\ORM\PersistentCollection {#4315 …}
    +followers: Doctrine\ORM\PersistentCollection {#4317 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
    +reports: Doctrine\ORM\PersistentCollection {#4327 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
    +violations: Doctrine\ORM\PersistentCollection {#4331 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
    +awards: Doctrine\ORM\PersistentCollection {#4335 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
    +categories: Doctrine\ORM\PersistentCollection {#4339 …}
    -id: 46201
    -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
    +apId: "Stoney@aussie.zone"
    +apProfileId: "https://aussie.zone/u/Stoney"
    +apPublicUrl: "https://aussie.zone/u/Stoney"
    +apFollowersUrl: null
    +apInboxUrl: "https://aussie.zone/inbox"
    +apDomain: "aussie.zone"
    +apPreferredUsername: "Stoney"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1694781047 {#4273
      date: 2023-09-15 14:30:47.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1694781046 {#4274
      date: 2023-09-15 14:30:46.0 +02:00
    }
  }
  "width" => 40
  "height" => 40
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#11111
  +width: 40
  +height: 40
  +user: App\Entity\User {#4288
    +avatar: null
    +cover: null
    +email: "Stoney@aussie.zone"
    +username: "@Stoney@aussie.zone"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1694781047 {#4272
      date: 2023-09-15 14:30:47.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
    +entries: Doctrine\ORM\PersistentCollection {#4295 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
    +posts: Doctrine\ORM\PersistentCollection {#4303 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
    +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
    +follows: Doctrine\ORM\PersistentCollection {#4315 …}
    +followers: Doctrine\ORM\PersistentCollection {#4317 …}
    +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
    +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
    +reports: Doctrine\ORM\PersistentCollection {#4327 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
    +violations: Doctrine\ORM\PersistentCollection {#4331 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
    +awards: Doctrine\ORM\PersistentCollection {#4335 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
    +categories: Doctrine\ORM\PersistentCollection {#4339 …}
    -id: 46201
    -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
    +apId: "Stoney@aussie.zone"
    +apProfileId: "https://aussie.zone/u/Stoney"
    +apPublicUrl: "https://aussie.zone/u/Stoney"
    +apFollowersUrl: null
    +apInboxUrl: "https://aussie.zone/inbox"
    +apDomain: "aussie.zone"
    +apPreferredUsername: "Stoney"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1694781047 {#4273
      date: 2023-09-15 14:30:47.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1694781046 {#4274
      date: 2023-09-15 14:30:46.0 +02:00
    }
  }
  +asLink: true
}
vote App\Twig\Components\VoteComponent 12.0 MiB 0.49 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4275
    +user: App\Entity\User {#4288
      +avatar: null
      +cover: null
      +email: "Stoney@aussie.zone"
      +username: "@Stoney@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1694781047 {#4272
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
      +entries: Doctrine\ORM\PersistentCollection {#4295 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
      +posts: Doctrine\ORM\PersistentCollection {#4303 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
      +follows: Doctrine\ORM\PersistentCollection {#4315 …}
      +followers: Doctrine\ORM\PersistentCollection {#4317 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
      +reports: Doctrine\ORM\PersistentCollection {#4327 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
      +violations: Doctrine\ORM\PersistentCollection {#4331 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
      +awards: Doctrine\ORM\PersistentCollection {#4335 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
      +categories: Doctrine\ORM\PersistentCollection {#4339 …}
      -id: 46201
      -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
      +apId: "Stoney@aussie.zone"
      +apProfileId: "https://aussie.zone/u/Stoney"
      +apPublicUrl: "https://aussie.zone/u/Stoney"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "Stoney"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1694781047 {#4273
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1694781046 {#4274
        date: 2023-09-15 14:30:46.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: "increase the resistors by a factor of 100 or so and add a very small cap across the lower one. The cap inside the ADC is absolutely tiny, pF at best. So a 100nF cap would easily do the trick and supply the voltage as required."
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1694781042 {#4270
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4276 …}
    +nested: Doctrine\ORM\PersistentCollection {#4278 …}
    +votes: Doctrine\ORM\PersistentCollection {#4280 …}
    +reports: Doctrine\ORM\PersistentCollection {#4282 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4284 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4286 …}
    -id: 29231
    -bodyTs: "'100':8 '100nf':34 'absolut':27 'across':17 'adc':25 'add':12 'best':31 'cap':16,22,35 'easili':37 'factor':6 'increas':1 'insid':23 'lower':19 'one':20 'pf':29 'requir':46 'resistor':3 'small':15 'suppli':42 'tini':28 'trick':40 'voltag':44 'would':36"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2659403"
    +editedAt: null
    +createdAt: DateTimeImmutable @1694781042 {#4271
      date: 2023-09-15 14:30:42.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\VoteComponent {#11180
  +subject: App\Entity\EntryComment {#4275
    +user: App\Entity\User {#4288
      +avatar: null
      +cover: null
      +email: "Stoney@aussie.zone"
      +username: "@Stoney@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1694781047 {#4272
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
      +entries: Doctrine\ORM\PersistentCollection {#4295 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
      +posts: Doctrine\ORM\PersistentCollection {#4303 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
      +follows: Doctrine\ORM\PersistentCollection {#4315 …}
      +followers: Doctrine\ORM\PersistentCollection {#4317 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
      +reports: Doctrine\ORM\PersistentCollection {#4327 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
      +violations: Doctrine\ORM\PersistentCollection {#4331 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
      +awards: Doctrine\ORM\PersistentCollection {#4335 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
      +categories: Doctrine\ORM\PersistentCollection {#4339 …}
      -id: 46201
      -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
      +apId: "Stoney@aussie.zone"
      +apProfileId: "https://aussie.zone/u/Stoney"
      +apPublicUrl: "https://aussie.zone/u/Stoney"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "Stoney"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1694781047 {#4273
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1694781046 {#4274
        date: 2023-09-15 14:30:46.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: "increase the resistors by a factor of 100 or so and add a very small cap across the lower one. The cap inside the ADC is absolutely tiny, pF at best. So a 100nF cap would easily do the trick and supply the voltage as required."
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1694781042 {#4270
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4276 …}
    +nested: Doctrine\ORM\PersistentCollection {#4278 …}
    +votes: Doctrine\ORM\PersistentCollection {#4280 …}
    +reports: Doctrine\ORM\PersistentCollection {#4282 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4284 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4286 …}
    -id: 29231
    -bodyTs: "'100':8 '100nf':34 'absolut':27 'across':17 'adc':25 'add':12 'best':31 'cap':16,22,35 'easili':37 'factor':6 'increas':1 'insid':23 'lower':19 'one':20 'pf':29 'requir':46 'resistor':3 'small':15 'suppli':42 'tini':28 'trick':40 'voltag':44 'would':36"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2659403"
    +editedAt: null
    +createdAt: DateTimeImmutable @1694781042 {#4271
      date: 2023-09-15 14:30:42.0 +02:00
    }
  }
  +formDest: "entry_comment"
  +showDownvote: true
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
boost App\Twig\Components\BoostComponent 12.0 MiB 0.62 ms
Input props
[
  "subject" => App\Entity\EntryComment {#4275
    +user: App\Entity\User {#4288
      +avatar: null
      +cover: null
      +email: "Stoney@aussie.zone"
      +username: "@Stoney@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1694781047 {#4272
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
      +entries: Doctrine\ORM\PersistentCollection {#4295 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
      +posts: Doctrine\ORM\PersistentCollection {#4303 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
      +follows: Doctrine\ORM\PersistentCollection {#4315 …}
      +followers: Doctrine\ORM\PersistentCollection {#4317 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
      +reports: Doctrine\ORM\PersistentCollection {#4327 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
      +violations: Doctrine\ORM\PersistentCollection {#4331 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
      +awards: Doctrine\ORM\PersistentCollection {#4335 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
      +categories: Doctrine\ORM\PersistentCollection {#4339 …}
      -id: 46201
      -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
      +apId: "Stoney@aussie.zone"
      +apProfileId: "https://aussie.zone/u/Stoney"
      +apPublicUrl: "https://aussie.zone/u/Stoney"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "Stoney"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1694781047 {#4273
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1694781046 {#4274
        date: 2023-09-15 14:30:46.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: "increase the resistors by a factor of 100 or so and add a very small cap across the lower one. The cap inside the ADC is absolutely tiny, pF at best. So a 100nF cap would easily do the trick and supply the voltage as required."
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1694781042 {#4270
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4276 …}
    +nested: Doctrine\ORM\PersistentCollection {#4278 …}
    +votes: Doctrine\ORM\PersistentCollection {#4280 …}
    +reports: Doctrine\ORM\PersistentCollection {#4282 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4284 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4286 …}
    -id: 29231
    -bodyTs: "'100':8 '100nf':34 'absolut':27 'across':17 'adc':25 'add':12 'best':31 'cap':16,22,35 'easili':37 'factor':6 'increas':1 'insid':23 'lower':19 'one':20 'pf':29 'requir':46 'resistor':3 'small':15 'suppli':42 'tini':28 'trick':40 'voltag':44 'would':36"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2659403"
    +editedAt: null
    +createdAt: DateTimeImmutable @1694781042 {#4271
      date: 2023-09-15 14:30:42.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\BoostComponent {#11237
  +formDest: "entry_comment"
  +subject: App\Entity\EntryComment {#4275
    +user: App\Entity\User {#4288
      +avatar: null
      +cover: null
      +email: "Stoney@aussie.zone"
      +username: "@Stoney@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1694781047 {#4272
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
      +entries: Doctrine\ORM\PersistentCollection {#4295 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
      +posts: Doctrine\ORM\PersistentCollection {#4303 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
      +follows: Doctrine\ORM\PersistentCollection {#4315 …}
      +followers: Doctrine\ORM\PersistentCollection {#4317 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
      +reports: Doctrine\ORM\PersistentCollection {#4327 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
      +violations: Doctrine\ORM\PersistentCollection {#4331 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
      +awards: Doctrine\ORM\PersistentCollection {#4335 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
      +categories: Doctrine\ORM\PersistentCollection {#4339 …}
      -id: 46201
      -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
      +apId: "Stoney@aussie.zone"
      +apProfileId: "https://aussie.zone/u/Stoney"
      +apPublicUrl: "https://aussie.zone/u/Stoney"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "Stoney"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1694781047 {#4273
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1694781046 {#4274
        date: 2023-09-15 14:30:46.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: "increase the resistors by a factor of 100 or so and add a very small cap across the lower one. The cap inside the ADC is absolutely tiny, pF at best. So a 100nF cap would easily do the trick and supply the voltage as required."
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1694781042 {#4270
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4276 …}
    +nested: Doctrine\ORM\PersistentCollection {#4278 …}
    +votes: Doctrine\ORM\PersistentCollection {#4280 …}
    +reports: Doctrine\ORM\PersistentCollection {#4282 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4284 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4286 …}
    -id: 29231
    -bodyTs: "'100':8 '100nf':34 'absolut':27 'across':17 'adc':25 'add':12 'best':31 'cap':16,22,35 'easili':37 'factor':6 'increas':1 'insid':23 'lower':19 'one':20 'pf':29 'requir':46 'resistor':3 'small':15 'suppli':42 'tini':28 'trick':40 'voltag':44 'would':36"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2659403"
    +editedAt: null
    +createdAt: DateTimeImmutable @1694781042 {#4271
      date: 2023-09-15 14:30:42.0 +02:00
    }
  }
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
}
entry_comments_nested App\Twig\Components\EntryCommentsNestedComponent 12.0 MiB 1.22 ms
Input props
[
  "comment" => App\Entity\EntryComment {#4275
    +user: App\Entity\User {#4288
      +avatar: null
      +cover: null
      +email: "Stoney@aussie.zone"
      +username: "@Stoney@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1694781047 {#4272
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
      +entries: Doctrine\ORM\PersistentCollection {#4295 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
      +posts: Doctrine\ORM\PersistentCollection {#4303 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
      +follows: Doctrine\ORM\PersistentCollection {#4315 …}
      +followers: Doctrine\ORM\PersistentCollection {#4317 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
      +reports: Doctrine\ORM\PersistentCollection {#4327 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
      +violations: Doctrine\ORM\PersistentCollection {#4331 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
      +awards: Doctrine\ORM\PersistentCollection {#4335 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
      +categories: Doctrine\ORM\PersistentCollection {#4339 …}
      -id: 46201
      -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
      +apId: "Stoney@aussie.zone"
      +apProfileId: "https://aussie.zone/u/Stoney"
      +apPublicUrl: "https://aussie.zone/u/Stoney"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "Stoney"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1694781047 {#4273
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1694781046 {#4274
        date: 2023-09-15 14:30:46.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: "increase the resistors by a factor of 100 or so and add a very small cap across the lower one. The cap inside the ADC is absolutely tiny, pF at best. So a 100nF cap would easily do the trick and supply the voltage as required."
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1694781042 {#4270
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4276 …}
    +nested: Doctrine\ORM\PersistentCollection {#4278 …}
    +votes: Doctrine\ORM\PersistentCollection {#4280 …}
    +reports: Doctrine\ORM\PersistentCollection {#4282 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4284 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4286 …}
    -id: 29231
    -bodyTs: "'100':8 '100nf':34 'absolut':27 'across':17 'adc':25 'add':12 'best':31 'cap':16,22,35 'easili':37 'factor':6 'increas':1 'insid':23 'lower':19 'one':20 'pf':29 'requir':46 'resistor':3 'small':15 'suppli':42 'tini':28 'trick':40 'voltag':44 'would':36"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2659403"
    +editedAt: null
    +createdAt: DateTimeImmutable @1694781042 {#4271
      date: 2023-09-15 14:30:42.0 +02:00
    }
  }
  "level" => 1
  "showNested" => true
  "view" => "tree"
]
Attributes
[
  "showNested" => true
]
Component
App\Twig\Components\EntryCommentsNestedComponent {#11477
  +comment: App\Entity\EntryComment {#4275
    +user: App\Entity\User {#4288
      +avatar: null
      +cover: null
      +email: "Stoney@aussie.zone"
      +username: "@Stoney@aussie.zone"
      +roles: []
      +followersCount: 0
      +homepage: "front"
      +about: null
      +lastActive: DateTime @1694781047 {#4272
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +markedForDeletionAt: null
      +fields: null
      +oauthGithubId: null
      +oauthGoogleId: null
      +oauthFacebookId: null
      +oauthKeycloakId: null
      +hideAdult: true
      +showSubscribedUsers: true
      +showSubscribedMagazines: true
      +showSubscribedDomains: true
      +preferredLanguages: []
      +featuredMagazines: null
      +showProfileSubscriptions: false
      +showProfileFollowings: true
      +markNewComments: false
      +notifyOnNewEntry: false
      +notifyOnNewEntryReply: true
      +notifyOnNewEntryCommentReply: true
      +notifyOnNewPost: false
      +notifyOnNewPostReply: true
      +notifyOnNewPostCommentReply: true
      +addMentionsEntries: false
      +addMentionsPosts: true
      +isBanned: false
      +isVerified: false
      +isDeleted: false
      +isBot: false
      +spamProtection: true
      +customCss: null
      +ignoreMagazinesCustomCss: false
      +moderatorTokens: Doctrine\ORM\PersistentCollection {#4289 …}
      +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#4291 …}
      +moderatorRequests: Doctrine\ORM\PersistentCollection {#4293 …}
      +entries: Doctrine\ORM\PersistentCollection {#4295 …}
      +entryVotes: Doctrine\ORM\PersistentCollection {#4297 …}
      +entryComments: Doctrine\ORM\PersistentCollection {#4299 …}
      +entryCommentVotes: Doctrine\ORM\PersistentCollection {#4301 …}
      +posts: Doctrine\ORM\PersistentCollection {#4303 …}
      +postVotes: Doctrine\ORM\PersistentCollection {#4305 …}
      +postComments: Doctrine\ORM\PersistentCollection {#4307 …}
      +postCommentVotes: Doctrine\ORM\PersistentCollection {#4309 …}
      +subscriptions: Doctrine\ORM\PersistentCollection {#4311 …}
      +subscribedDomains: Doctrine\ORM\PersistentCollection {#4313 …}
      +follows: Doctrine\ORM\PersistentCollection {#4315 …}
      +followers: Doctrine\ORM\PersistentCollection {#4317 …}
      +blocks: Doctrine\ORM\PersistentCollection {#4319 …}
      +blockers: Doctrine\ORM\PersistentCollection {#4321 …}
      +blockedMagazines: Doctrine\ORM\PersistentCollection {#4323 …}
      +blockedDomains: Doctrine\ORM\PersistentCollection {#4325 …}
      +reports: Doctrine\ORM\PersistentCollection {#4327 …}
      +favourites: Doctrine\ORM\PersistentCollection {#4329 …}
      +violations: Doctrine\ORM\PersistentCollection {#4331 …}
      +notifications: Doctrine\ORM\PersistentCollection {#4333 …}
      +awards: Doctrine\ORM\PersistentCollection {#4335 …}
      +subscribedCategories: Doctrine\ORM\PersistentCollection {#4337 …}
      +categories: Doctrine\ORM\PersistentCollection {#4339 …}
      -id: 46201
      -password: "$2y$13$KbsQPjyFVkemktpB/3eA3uhMuHlcZ0brjmS3m6.FeQjltPl37KK6q"
      -totpSecret: null
      -totpBackupCodes: []
      -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#4341 …}
      +apId: "Stoney@aussie.zone"
      +apProfileId: "https://aussie.zone/u/Stoney"
      +apPublicUrl: "https://aussie.zone/u/Stoney"
      +apFollowersUrl: null
      +apInboxUrl: "https://aussie.zone/inbox"
      +apDomain: "aussie.zone"
      +apPreferredUsername: "Stoney"
      +apDiscoverable: true
      +apManuallyApprovesFollowers: false
      +privateKey: null
      +publicKey: null
      +apFetchedAt: DateTime @1694781047 {#4273
        date: 2023-09-15 14:30:47.0 +02:00
      }
      +apDeletedAt: null
      +apTimeoutAt: null
      +visibility: "visible             "
      +createdAt: DateTimeImmutable @1694781046 {#4274
        date: 2023-09-15 14:30:46.0 +02:00
      }
    }
    +entry: App\Entity\Entry {#2412
      +user: Proxies\__CG__\App\Entity\User {#1970
        +avatar: null
        +cover: null
        +email: "nilclass@discuss.tchncs.de"
        +username: "@nilclass@discuss.tchncs.de"
        +roles: []
        +followersCount: 0
        +homepage: "front"
        +about: null
        +lastActive: DateTime @1721268563 {#1536
          date: 2024-07-18 04:09:23.0 +02:00
        }
        +markedForDeletionAt: null
        +fields: null
        +oauthGithubId: null
        +oauthGoogleId: null
        +oauthFacebookId: null
        +oauthKeycloakId: null
        +hideAdult: true
        +showSubscribedUsers: true
        +showSubscribedMagazines: true
        +showSubscribedDomains: true
        +preferredLanguages: []
        +featuredMagazines: null
        +showProfileSubscriptions: true
        +showProfileFollowings: true
        +markNewComments: false
        +notifyOnNewEntry: false
        +notifyOnNewEntryReply: false
        +notifyOnNewEntryCommentReply: false
        +notifyOnNewPost: false
        +notifyOnNewPostReply: false
        +notifyOnNewPostCommentReply: false
        +addMentionsEntries: false
        +addMentionsPosts: true
        +isBanned: false
        +isVerified: false
        +isDeleted: false
        +isBot: false
        +spamProtection: true
        +customCss: null
        +ignoreMagazinesCustomCss: false
        +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
        +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
        +entries: Doctrine\ORM\PersistentCollection {#1631 …}
        +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
        +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
        +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
        +posts: Doctrine\ORM\PersistentCollection {#1659 …}
        +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
        +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
        +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
        +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
        +follows: Doctrine\ORM\PersistentCollection {#1660 …}
        +followers: Doctrine\ORM\PersistentCollection {#1627 …}
        +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
        +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
        +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
        +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
        +reports: Doctrine\ORM\PersistentCollection {#1425 …}
        +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
        +violations: Doctrine\ORM\PersistentCollection {#1699 …}
        +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
        +awards: Doctrine\ORM\PersistentCollection {#1430 …}
        +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
        +categories: Doctrine\ORM\PersistentCollection {#1645 …}
        -id: 6046
        -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
        -totpSecret: null
        -totpBackupCodes: []
        -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
        +apId: "nilclass@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/u/nilclass"
        +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
        +apFollowersUrl: null
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "nilclass"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: false
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1720630912 {#1515
          date: 2024-07-10 19:01:52.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687291240 {#1516
          date: 2023-06-20 22:00:40.0 +02:00
        }
        +__isInitialized__: true
         …2
      }
      +magazine: App\Entity\Magazine {#266
        +icon: Proxies\__CG__\App\Entity\Image {#247 …}
        +name: "askelectronics@discuss.tchncs.de"
        +title: "askelectronics"
        +description: """
          **For questions about component-level electronic circuits, tools and equipment.**\n
          \n
          Rules\n
          -----\n
          \n
          1: Be nice.\n
          \n
          2: Be on-topic (eg: *Electronic*, not *electrical*).\n
          \n
          3: No commercial stuff, buying, selling or valuations.\n
          \n
          4: Be safe.\n
          \n
          ---
          """
        +rules: null
        +subscriptionsCount: 1
        +entryCount: 154
        +entryCommentCount: 1230
        +postCount: 1
        +postCommentCount: 4
        +isAdult: false
        +customCss: null
        +lastActive: DateTime @1729413608 {#276
          date: 2024-10-20 10:40:08.0 +02:00
        }
        +markedForDeletionAt: null
        +tags: null
        +moderators: Doctrine\ORM\PersistentCollection {#238 …}
        +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
        +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
        +entries: Doctrine\ORM\PersistentCollection {#181 …}
        +posts: Doctrine\ORM\PersistentCollection {#139 …}
        +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
        +bans: Doctrine\ORM\PersistentCollection {#118 …}
        +reports: Doctrine\ORM\PersistentCollection {#104 …}
        +badges: Doctrine\ORM\PersistentCollection {#82 …}
        +logs: Doctrine\ORM\PersistentCollection {#72 …}
        +awards: Doctrine\ORM\PersistentCollection {#61 …}
        +categories: Doctrine\ORM\PersistentCollection {#1820 …}
        -id: 11
        +apId: "askelectronics@discuss.tchncs.de"
        +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
        +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
        +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
        +apInboxUrl: "https://discuss.tchncs.de/inbox"
        +apDomain: "discuss.tchncs.de"
        +apPreferredUsername: "askelectronics"
        +apDiscoverable: true
        +apManuallyApprovesFollowers: null
        +privateKey: null
        +publicKey: null
        +apFetchedAt: DateTime @1727247714 {#270
          date: 2024-09-25 09:01:54.0 +02:00
        }
        +apDeletedAt: null
        +apTimeoutAt: null
        +visibility: "visible             "
        +createdAt: DateTimeImmutable @1687144409 {#272
          date: 2023-06-19 05:13:29.0 +02:00
        }
      }
      +image: null
      +domain: Proxies\__CG__\App\Entity\Domain {#1915 …}
      +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 {#2410
        date: 2023-09-15 14:30:42.0 +02:00
      }
      +ip: null
      +adaAmount: 0
      +tags: null
      +mentions: null
      +comments: Doctrine\ORM\PersistentCollection {#1884 …}
      +votes: Doctrine\ORM\PersistentCollection {#1973 …}
      +reports: Doctrine\ORM\PersistentCollection {#1959 …}
      +favourites: Doctrine\ORM\PersistentCollection {#1927 …}
      +notifications: Doctrine\ORM\PersistentCollection {#2442 …}
      +badges: Doctrine\ORM\PersistentCollection {#2440 …}
      +children: []
      -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 {#1850
        date: 2023-08-25 09:07:12.0 +02:00
      }
      +createdAt: DateTimeImmutable @1692947137 {#2420
        date: 2023-08-25 09:05:37.0 +02:00
      }
    }
    +magazine: App\Entity\Magazine {#266}
    +image: null
    +parent: null
    +root: null
    +body: "increase the resistors by a factor of 100 or so and add a very small cap across the lower one. The cap inside the ADC is absolutely tiny, pF at best. So a 100nF cap would easily do the trick and supply the voltage as required."
    +lang: "en"
    +isAdult: false
    +favouriteCount: 1
    +score: 0
    +lastActive: DateTime @1694781042 {#4270
      date: 2023-09-15 14:30:42.0 +02:00
    }
    +ip: null
    +tags: null
    +mentions: [
      "@nilclass@discuss.tchncs.de"
    ]
    +children: Doctrine\ORM\PersistentCollection {#4276 …}
    +nested: Doctrine\ORM\PersistentCollection {#4278 …}
    +votes: Doctrine\ORM\PersistentCollection {#4280 …}
    +reports: Doctrine\ORM\PersistentCollection {#4282 …}
    +favourites: Doctrine\ORM\PersistentCollection {#4284 …}
    +notifications: Doctrine\ORM\PersistentCollection {#4286 …}
    -id: 29231
    -bodyTs: "'100':8 '100nf':34 'absolut':27 'across':17 'adc':25 'add':12 'best':31 'cap':16,22,35 'easili':37 'factor':6 'increas':1 'insid':23 'lower':19 'one':20 'pf':29 'requir':46 'resistor':3 'small':15 'suppli':42 'tini':28 'trick':40 'voltag':44 'would':36"
    +ranking: 0
    +commentCount: 0
    +upVotes: 0
    +downVotes: 0
    +visibility: "visible             "
    +apId: "https://aussie.zone/comment/2659403"
    +editedAt: null
    +createdAt: DateTimeImmutable @1694781042 {#4271
      date: 2023-09-15 14:30:42.0 +02:00
    }
  }
  +nestedComments: []
  +level: 1
  +view: "tree"
  -entryCommentRepository: App\Repository\EntryCommentRepository {#558 …}
  -twig: Twig\Environment {#1252 …}
  -security: Symfony\Bundle\SecurityBundle\Security {#1101 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
settings_row_enum App\Twig\Components\SettingsRowEnumComponent 12.0 MiB 0.21 ms
Input props
[
  "label" => "Sidebar position"
  "settingsKey" => "KBIN_GENERAL_SIDEBAR_POSITION"
  "values" => [
    [
      "name" => "Left"
      "value" => "LEFT"
    ]
    [
      "name" => "Right"
      "value" => "RIGHT"
    ]
  ]
  "defaultValue" => "RIGHT"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowEnumComponent {#11602
  +label: "Sidebar position"
  +help: ""
  +settingsKey: "KBIN_GENERAL_SIDEBAR_POSITION"
  +values: [
    [
      "name" => "Left"
      "value" => "LEFT"
    ]
    [
      "name" => "Right"
      "value" => "RIGHT"
    ]
  ]
  +defaultValue: "RIGHT"
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.19 ms
Input props
[
  "label" => "Dynamic lists"
  "settingsKey" => "KBIN_GENERAL_DYNAMIC_LISTS"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#11666
  +label: "Dynamic lists"
  +help: ""
  +settingsKey: "KBIN_GENERAL_DYNAMIC_LISTS"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.13 ms
Input props
[
  "label" => "Rounded edges"
  "settingsKey" => "KBIN_GENERAL_ROUNDED_EDGES"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#11731
  +label: "Rounded edges"
  +help: ""
  +settingsKey: "KBIN_GENERAL_ROUNDED_EDGES"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.12 ms
Input props
[
  "label" => "Infinite scrolling"
  "help" => "Automatically load more content when you reach the bottom of the page."
  "settingsKey" => "KBIN_GENERAL_INFINITE_SCROLL"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#11787
  +label: "Infinite scrolling"
  +help: "Automatically load more content when you reach the bottom of the page."
  +settingsKey: "KBIN_GENERAL_INFINITE_SCROLL"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.12 ms
Input props
[
  "label" => "Sticky navbar"
  "help" => "The navbar will stick to the top of the page when you scroll down."
  "settingsKey" => "KBIN_GENERAL_FIXED_NAVBAR"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#11846
  +label: "Sticky navbar"
  +help: "The navbar will stick to the top of the page when you scroll down."
  +settingsKey: "KBIN_GENERAL_FIXED_NAVBAR"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.12 ms
Input props
[
  "label" => "Show top bar"
  "settingsKey" => "KBIN_GENERAL_TOPBAR"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#11902
  +label: "Show top bar"
  +help: ""
  +settingsKey: "KBIN_GENERAL_TOPBAR"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.13 ms
Input props
[
  "label" => "Turbo mode (experimental)"
  "settingsKey" => "KBIN_GENERAL_TURBO"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#11958
  +label: "Turbo mode (experimental)"
  +help: ""
  +settingsKey: "KBIN_GENERAL_TURBO"
  +defaultValue: false
  +reloadRequired: true
}
user_settings_row_switch App\Twig\Components\UserSettingsRowSwitchComponent 12.0 MiB 0.29 ms
Input props
[
  "label" => "Mark new comments"
  "settingsKey" => "KBIN_MARK_NEW_COMMENTS"
]
Attributes
[]
Component
App\Twig\Components\UserSettingsRowSwitchComponent {#12016
  +label: "Mark new comments"
  +help: ""
  +settingsKey: "KBIN_MARK_NEW_COMMENTS"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.12 ms
Input props
[
  "label" => "Show "Support Us" block"
  "settingsKey" => "KBIN_GENERAL_SUPPORT_US_BLOCK"
  "defaultValue" => true
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#12079
  +label: "Show "Support Us" block"
  +help: ""
  +settingsKey: "KBIN_GENERAL_SUPPORT_US_BLOCK"
  +defaultValue: true
  +reloadRequired: true
}
user_settings_row_switch App\Twig\Components\UserSettingsRowSwitchComponent 12.0 MiB 0.14 ms
Input props
[
  "label" => "Show subscribed users"
  "settingsKey" => "KBIN_SUB_CHANNEL_USERS"
]
Attributes
[]
Component
App\Twig\Components\UserSettingsRowSwitchComponent {#12137
  +label: "Show subscribed users"
  +help: ""
  +settingsKey: "KBIN_SUB_CHANNEL_USERS"
  +defaultValue: false
  +reloadRequired: true
}
user_settings_row_switch App\Twig\Components\UserSettingsRowSwitchComponent 12.0 MiB 0.13 ms
Input props
[
  "label" => "Show subscribed magazines"
  "settingsKey" => "KBIN_SUB_CHANNEL_MAGAZINES"
]
Attributes
[]
Component
App\Twig\Components\UserSettingsRowSwitchComponent {#12193
  +label: "Show subscribed magazines"
  +help: ""
  +settingsKey: "KBIN_SUB_CHANNEL_MAGAZINES"
  +defaultValue: false
  +reloadRequired: true
}
user_settings_row_switch App\Twig\Components\UserSettingsRowSwitchComponent 12.0 MiB 0.18 ms
Input props
[
  "label" => "Show subscribed domains"
  "settingsKey" => "KBIN_SUB_CHANNEL_DOMAINS"
]
Attributes
[]
Component
App\Twig\Components\UserSettingsRowSwitchComponent {#12249
  +label: "Show subscribed domains"
  +help: ""
  +settingsKey: "KBIN_SUB_CHANNEL_DOMAINS"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.12 ms
Input props
[
  "label" => "Auto media preview"
  "help" => "Automatically expand media previews."
  "settingsKey" => "KBIN_ENTRIES_SHOW_PREVIEW"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#12305
  +label: "Auto media preview"
  +help: "Automatically expand media previews."
  +settingsKey: "KBIN_ENTRIES_SHOW_PREVIEW"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.12 ms
Input props
[
  "label" => "Compact view"
  "settingsKey" => "KBIN_ENTRIES_COMPACT"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#12361
  +label: "Compact view"
  +help: ""
  +settingsKey: "KBIN_ENTRIES_COMPACT"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.11 ms
Input props
[
  "label" => "Show users’ avatars"
  "settingsKey" => "KBIN_ENTRIES_SHOW_USERS_AVATARS"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#12417
  +label: "Show users’ avatars"
  +help: ""
  +settingsKey: "KBIN_ENTRIES_SHOW_USERS_AVATARS"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.12 ms
Input props
[
  "label" => "Show magazines’ icons"
  "settingsKey" => "KBIN_ENTRIES_SHOW_MAGAZINES_ICONS"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#12473
  +label: "Show magazines’ icons"
  +help: ""
  +settingsKey: "KBIN_ENTRIES_SHOW_MAGAZINES_ICONS"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.12 ms
Input props
[
  "label" => "Show thumbnails"
  "settingsKey" => "KBIN_ENTRIES_SHOW_THUMBNAILS"
  "defaultValue" => true
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#12529
  +label: "Show thumbnails"
  +help: ""
  +settingsKey: "KBIN_ENTRIES_SHOW_THUMBNAILS"
  +defaultValue: true
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.14 ms
Input props
[
  "label" => "Auto media preview"
  "help" => "Automatically expand media previews."
  "settingsKey" => "KBIN_POSTS_SHOW_PREVIEW"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#12585
  +label: "Auto media preview"
  +help: "Automatically expand media previews."
  +settingsKey: "KBIN_POSTS_SHOW_PREVIEW"
  +defaultValue: false
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 12.0 MiB 0.14 ms
Input props
[
  "label" => "Show users’ avatars"
  "settingsKey" => "KBIN_POSTS_SHOW_USERS_AVATARS"
  "defaultValue" => true
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#12641
  +label: "Show users’ avatars"
  +help: ""
  +settingsKey: "KBIN_POSTS_SHOW_USERS_AVATARS"
  +defaultValue: true
  +reloadRequired: true
}
settings_row_enum App\Twig\Components\SettingsRowEnumComponent 12.0 MiB 0.22 ms
Input props
[
  "label" => "Comment reply position"
  "help" => "Display the comment reply form either at the top or bottom of the page. When 'infinite scroll' is enabled the position will always appear at the top."
  "settingsKey" => "KBIN_COMMENTS_REPLY_POSITION"
  "values" => [
    [
      "name" => "top"
      "value" => "TOP"
    ]
    [
      "name" => "bottom"
      "value" => "BOTTOM"
    ]
  ]
  "defaultValue" => "TOP"
]
Attributes
[]
Component
App\Twig\Components\SettingsRowEnumComponent {#12697
  +label: "Comment reply position"
  +help: "Display the comment reply form either at the top or bottom of the page. When 'infinite scroll' is enabled the position will always appear at the top."
  +settingsKey: "KBIN_COMMENTS_REPLY_POSITION"
  +values: [
    [
      "name" => "top"
      "value" => "TOP"
    ]
    [
      "name" => "bottom"
      "value" => "BOTTOM"
    ]
  ]
  +defaultValue: "TOP"
  +reloadRequired: true
}
settings_row_switch App\Twig\Components\SettingsRowSwitchComponent 14.0 MiB 0.13 ms
Input props
[
  "label" => "Show Comment Avatars"
  "help" => "Display/hide user avatars when viewing comments on a single thread or post."
  "settingsKey" => "KBIN_COMMENTS_SHOW_USER_AVATAR"
  "defaultValue" => true
]
Attributes
[]
Component
App\Twig\Components\SettingsRowSwitchComponent {#12755
  +label: "Show Comment Avatars"
  +help: "Display/hide user avatars when viewing comments on a single thread or post."
  +settingsKey: "KBIN_COMMENTS_SHOW_USER_AVATAR"
  +defaultValue: true
  +reloadRequired: true
}
user_actions App\Twig\Components\UserActionsComponent 14.0 MiB 0.46 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
]
Attributes
[]
Component
App\Twig\Components\UserActionsComponent {#12832
  +user: Proxies\__CG__\App\Entity\User {#1970
    +avatar: null
    +cover: null
    +email: "nilclass@discuss.tchncs.de"
    +username: "@nilclass@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: null
    +lastActive: DateTime @1721268563 {#1536
      date: 2024-07-18 04:09:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#1518 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#1520 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#1632 …}
    +entries: Doctrine\ORM\PersistentCollection {#1631 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#1704 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#1712 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#1468 …}
    +posts: Doctrine\ORM\PersistentCollection {#1659 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#1487 …}
    +postComments: Doctrine\ORM\PersistentCollection {#1767 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#1638 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#1492 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#1634 …}
    +follows: Doctrine\ORM\PersistentCollection {#1660 …}
    +followers: Doctrine\ORM\PersistentCollection {#1627 …}
    +blocks: Doctrine\ORM\PersistentCollection {#1419 …}
    +blockers: Doctrine\ORM\PersistentCollection {#1412 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#1453 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#1432 …}
    +reports: Doctrine\ORM\PersistentCollection {#1425 …}
    +favourites: Doctrine\ORM\PersistentCollection {#1435 …}
    +violations: Doctrine\ORM\PersistentCollection {#1699 …}
    +notifications: Doctrine\ORM\PersistentCollection {#1703 …}
    +awards: Doctrine\ORM\PersistentCollection {#1430 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#1595 …}
    +categories: Doctrine\ORM\PersistentCollection {#1645 …}
    -id: 6046
    -password: "$2y$13$FEroXtR95mjA6.omogLZRe7NJuWUL6hb.9a/FfXkqyIPnPgg4Apme"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#1678 …}
    +apId: "nilclass@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/nilclass"
    +apPublicUrl: "https://discuss.tchncs.de/u/nilclass"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "nilclass"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1720630912 {#1515
      date: 2024-07-10 19:01:52.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687291240 {#1516
      date: 2023-06-20 22:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
}
date App\Twig\Components\DateComponent 14.0 MiB 0.13 ms
Input props
[
  "date" => DateTimeImmutable @1692947137 {#2420
    date: 2023-08-25 09:05:37.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#12893
  +date: DateTimeImmutable @1692947137 {#2420
    date: 2023-08-25 09:05:37.0 +02:00
  }
}
magazine_box App\Twig\Components\MagazineBoxComponent 14.0 MiB 17.59 ms
Input props
[
  "magazine" => App\Entity\Magazine {#266
    +icon: Proxies\__CG__\App\Entity\Image {#247 …}
    +name: "askelectronics@discuss.tchncs.de"
    +title: "askelectronics"
    +description: """
      **For questions about component-level electronic circuits, tools and equipment.**\n
      \n
      Rules\n
      -----\n
      \n
      1: Be nice.\n
      \n
      2: Be on-topic (eg: *Electronic*, not *electrical*).\n
      \n
      3: No commercial stuff, buying, selling or valuations.\n
      \n
      4: Be safe.\n
      \n
      ---
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 154
    +entryCommentCount: 1230
    +postCount: 1
    +postCommentCount: 4
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729413608 {#276
      date: 2024-10-20 10:40:08.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#238 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
    +entries: Doctrine\ORM\PersistentCollection {#181 …}
    +posts: Doctrine\ORM\PersistentCollection {#139 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
    +bans: Doctrine\ORM\PersistentCollection {#118 …}
    +reports: Doctrine\ORM\PersistentCollection {#104 …}
    +badges: Doctrine\ORM\PersistentCollection {#82 …}
    +logs: Doctrine\ORM\PersistentCollection {#72 …}
    +awards: Doctrine\ORM\PersistentCollection {#61 …}
    +categories: Doctrine\ORM\PersistentCollection {#1820 …}
    -id: 11
    +apId: "askelectronics@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
    +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
    +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "askelectronics"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1727247714 {#270
      date: 2024-09-25 09:01:54.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687144409 {#272
      date: 2023-06-19 05:13:29.0 +02:00
    }
  }
  "showSectionTitle" => true
]
Attributes
[]
Component
App\Twig\Components\MagazineBoxComponent {#12949
  +magazine: App\Entity\Magazine {#266
    +icon: Proxies\__CG__\App\Entity\Image {#247 …}
    +name: "askelectronics@discuss.tchncs.de"
    +title: "askelectronics"
    +description: """
      **For questions about component-level electronic circuits, tools and equipment.**\n
      \n
      Rules\n
      -----\n
      \n
      1: Be nice.\n
      \n
      2: Be on-topic (eg: *Electronic*, not *electrical*).\n
      \n
      3: No commercial stuff, buying, selling or valuations.\n
      \n
      4: Be safe.\n
      \n
      ---
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 154
    +entryCommentCount: 1230
    +postCount: 1
    +postCommentCount: 4
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729413608 {#276
      date: 2024-10-20 10:40:08.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#238 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
    +entries: Doctrine\ORM\PersistentCollection {#181 …}
    +posts: Doctrine\ORM\PersistentCollection {#139 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
    +bans: Doctrine\ORM\PersistentCollection {#118 …}
    +reports: Doctrine\ORM\PersistentCollection {#104 …}
    +badges: Doctrine\ORM\PersistentCollection {#82 …}
    +logs: Doctrine\ORM\PersistentCollection {#72 …}
    +awards: Doctrine\ORM\PersistentCollection {#61 …}
    +categories: Doctrine\ORM\PersistentCollection {#1820 …}
    -id: 11
    +apId: "askelectronics@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
    +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
    +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "askelectronics"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1727247714 {#270
      date: 2024-09-25 09:01:54.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687144409 {#272
      date: 2023-06-19 05:13:29.0 +02:00
    }
  }
  +showCover: true
  +showDescription: true
  +showRules: true
  +showSubscribeButton: true
  +showInfo: true
  +showMeta: true
  +showSectionTitle: true
  +stretchedLink: true
}
magazine_sub App\Twig\Components\MagazineSubComponent 14.0 MiB 0.54 ms
Input props
[
  "magazine" => App\Entity\Magazine {#266
    +icon: Proxies\__CG__\App\Entity\Image {#247 …}
    +name: "askelectronics@discuss.tchncs.de"
    +title: "askelectronics"
    +description: """
      **For questions about component-level electronic circuits, tools and equipment.**\n
      \n
      Rules\n
      -----\n
      \n
      1: Be nice.\n
      \n
      2: Be on-topic (eg: *Electronic*, not *electrical*).\n
      \n
      3: No commercial stuff, buying, selling or valuations.\n
      \n
      4: Be safe.\n
      \n
      ---
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 154
    +entryCommentCount: 1230
    +postCount: 1
    +postCommentCount: 4
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729413608 {#276
      date: 2024-10-20 10:40:08.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#238 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
    +entries: Doctrine\ORM\PersistentCollection {#181 …}
    +posts: Doctrine\ORM\PersistentCollection {#139 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
    +bans: Doctrine\ORM\PersistentCollection {#118 …}
    +reports: Doctrine\ORM\PersistentCollection {#104 …}
    +badges: Doctrine\ORM\PersistentCollection {#82 …}
    +logs: Doctrine\ORM\PersistentCollection {#72 …}
    +awards: Doctrine\ORM\PersistentCollection {#61 …}
    +categories: Doctrine\ORM\PersistentCollection {#1820 …}
    -id: 11
    +apId: "askelectronics@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
    +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
    +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "askelectronics"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1727247714 {#270
      date: 2024-09-25 09:01:54.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687144409 {#272
      date: 2023-06-19 05:13:29.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\MagazineSubComponent {#13007
  +magazine: App\Entity\Magazine {#266
    +icon: Proxies\__CG__\App\Entity\Image {#247 …}
    +name: "askelectronics@discuss.tchncs.de"
    +title: "askelectronics"
    +description: """
      **For questions about component-level electronic circuits, tools and equipment.**\n
      \n
      Rules\n
      -----\n
      \n
      1: Be nice.\n
      \n
      2: Be on-topic (eg: *Electronic*, not *electrical*).\n
      \n
      3: No commercial stuff, buying, selling or valuations.\n
      \n
      4: Be safe.\n
      \n
      ---
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 154
    +entryCommentCount: 1230
    +postCount: 1
    +postCommentCount: 4
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729413608 {#276
      date: 2024-10-20 10:40:08.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#238 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
    +entries: Doctrine\ORM\PersistentCollection {#181 …}
    +posts: Doctrine\ORM\PersistentCollection {#139 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
    +bans: Doctrine\ORM\PersistentCollection {#118 …}
    +reports: Doctrine\ORM\PersistentCollection {#104 …}
    +badges: Doctrine\ORM\PersistentCollection {#82 …}
    +logs: Doctrine\ORM\PersistentCollection {#72 …}
    +awards: Doctrine\ORM\PersistentCollection {#61 …}
    +categories: Doctrine\ORM\PersistentCollection {#1820 …}
    -id: 11
    +apId: "askelectronics@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
    +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
    +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "askelectronics"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1727247714 {#270
      date: 2024-09-25 09:01:54.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687144409 {#272
      date: 2023-06-19 05:13:29.0 +02:00
    }
  }
}
date App\Twig\Components\DateComponent 14.0 MiB 0.16 ms
Input props
[
  "date" => DateTimeImmutable @1687144409 {#272
    date: 2023-06-19 05:13:29.0 +02:00
  }
]
Attributes
[]
Component
App\Twig\Components\DateComponent {#13119
  +date: DateTimeImmutable @1687144409 {#272
    date: 2023-06-19 05:13:29.0 +02:00
  }
}
user_inline App\Twig\Components\UserInlineComponent 14.0 MiB 3.46 ms
Input props
[
  "user" => Proxies\__CG__\App\Entity\User {#13178
    +avatar: null
    +cover: null
    +email: "kbin@j0h.nl"
    +username: "Sprite_tm"
    +roles: [
      "ROLE_ADMIN"
    ]
    +followersCount: 0
    +homepage: "front"
    +about: "Hi! I'm Sprite_tm. You may know me from sites like https://spritesmods.com."
    +lastActive: DateTime @1707547382 {#13225
      date: 2024-02-10 07:43:02.0 +01:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: true
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13227 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13229 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13231 …}
    +entries: Doctrine\ORM\PersistentCollection {#13233 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13235 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13237 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13239 …}
    +posts: Doctrine\ORM\PersistentCollection {#13241 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13243 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13245 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13247 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13249 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13251 …}
    +follows: Doctrine\ORM\PersistentCollection {#13253 …}
    +followers: Doctrine\ORM\PersistentCollection {#13255 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13257 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13259 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13261 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13263 …}
    +reports: Doctrine\ORM\PersistentCollection {#13265 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13267 …}
    +violations: Doctrine\ORM\PersistentCollection {#13269 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13271 …}
    +awards: Doctrine\ORM\PersistentCollection {#13273 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13275 …}
    +categories: Doctrine\ORM\PersistentCollection {#13277 …}
    -id: 1
    -password: "$2y$13$ZX7Aou2QOPRGkHPp4y5x8OWfxZMoT1BGH7bRLlPP7mwZFTkfiaPGG"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13279 …}
    +apId: null
    +apProfileId: null
    +apPublicUrl: null
    +apFollowersUrl: null
    +apInboxUrl: null
    +apDomain: null
    +apPreferredUsername: null
    +apDiscoverable: null
    +apManuallyApprovesFollowers: null
    +privateKey: """
      -----BEGIN PRIVATE KEY-----\r\n
      MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDleeotz5TBiMlC\r\n
      YsJYJHVNxjvnvt0qsQA282B7vdqBTbARfD49iKPiMIwgU2yhCI0oTSQwc2Zy9AQ+\r\n
      31rwmvBx8VvcLgQvKpNzPVhMQjelK7k5iPiPc/W1soaauepq3YwQKgGod4c5Vh9f\r\n
      MInSANfOLOUSo3pUzfaQaGEvQc5DbKjDgIjsv/OKI1acbzu067KQzIThu+1BvcqQ\r\n
      Ypo2Ux5W23nNqkrRZ++z/r1MI2jS3vwi5OSwz4fWhLPJXE6lwokc6b/uAZe7sLT6\r\n
      QQtjevLnmMyRIVnmxbtHPMSfhLdz8ssQhoNCfAkMnBjDUX31SSs67pU8v5O3Fn2H\r\n
      d+qFWCjrREwSpBAd24INJqKsjSa6j3oLL8Xw8HZf+x6QRPJch/c3FNWRtM2b9n8V\r\n
      sAQiD985pafyeQ1TqIe4iSjI0iUgy2WgwO0C1Z0PNbQzQmRk0EOAlxIXjPmB229P\r\n
      V4+OcZxLT9phP/rid1Qt9Ro+2LdkS9Zqe8c2JHeJKc5Nv/8OOX5uQ/B82JXnuXYi\r\n
      /oVEJb5t42G8u3IIkYM5G/Gt033WU6dbyKOBmdnbXaPw9LC3M7oop3yyCb3UDLfg\r\n
      g/XnZVvZxSPCPlh5G1Lb0r47siKq/0k9YRua0AFsVg0dhqfuwsb6G9Hx5EicuPsu\r\n
      OIjXINBTjlnE4SdMz0ZJt7bLjwlKdQIDAQABAoICAAlWo8QHfYs+sMoF0Njbavam\r\n
      SYvNxZxWJacW0mdWu4ylh7O+dZ31cI3k4d7y5inLeksYkI90MsgczAtu9XlzJLPO\r\n
      WamlKcBtoCCBb5Vy4GbVV61SuKLF2krxn+6uAC8nIusJepXLf3JC4fXyuLkWFbIr\r\n
      O4s9od3Pn+gSh1nv+J/fzSJfmbLgwN1vQLgPAsQDD3o7CHFTP318ZsDnclUhnst0\r\n
      FQnckzzgWO3fQP7XNg3WyzX0UKYtW97L+bEJE55FQ2Us0gWyhOU7dLH2casztqzc\r\n
      F/8T91+fzlZAz9OaCAks6Tyb7L2I5KlhtNRF/bU8rAiy6tnVBgLeZG9d3upcQxX0\r\n
      L+SMPWg55qERGI5mO+BxFdUnVtcmswziKmySYtzgm+c4jmPS5cWhGB9HFCTW2S0x\r\n
      GoVA2cZGWjMTrbZQhgJjBqzp76fhLtXTufd328sYmX7fBYKEWFYNwrEJaWYUNl/V\r\n
      yEyl0aMQWKhVokx6eCqnuDZUc77LeuGuCleIdhQ53NYHrXMCmgVyLfmGdrOS3Uh6\r\n
      RrAYmnvvMkAUTOQajW2csC345PmgBOjE7vB7349ylKUkXvN4L+9xZCYaVjBt3O24\r\n
      aRoQSQDGhk+NIaYleiFx+u7dJSryxdx/6ut6dQ2S+jKlm1oN1qq6ppO5y/TFRQ1e\r\n
      qn7kjIGzUT80fANDFqdhAoIBAQD1+cGiWXRQhUrJc5X3ngH1zHoLWpmSZcUUDFn/\r\n
      bV/CChd2M43fOpneIQETZ1oS7BsU3y92kTw63ytYOUg7C5iT5/r9ZoBGq0HZSbll\r\n
      riRJWGiajr2aYCmIes++CrfUvCcD6+l8QMZ3s8eXdk80GX+vt1xEfRpWV9e9huJK\r\n
      K1e8wXfFmPAmxUi63IePscdc+SVQGeooMYDnMwLWvxpAtp5mGOaQc4D5dviWXjSE\r\n
      Z/PJa+gectpD1iDIPUXm3o17ivE2UYFia8/FCGUN6Yz7ucRKF+2SPO8hLefk5UvJ\r\n
      Lxlkh67MXKkneDqRU9C82Qmcfz5nQLQadC0nbE44YeXrnlIdAoIBAQDu1AWMIe6f\r\n
      7TZYCWnTa3nT6penJ9CMaGDPI/62dKTmGnI4oo3u9DGGrnuWbcFFCQA02vcYdpuw\r\n
      CVy6mkP/yqN5VSV3EHZiJUA0aKIxot3o3YOiobpVYn9hwvzzOdMZO4SOuevNfY1c\r\n
      qmnLGhYoDvR1c2yaudCf/BDwQqlLoSg9F5X57bRtwaRyUjhtXVKXWb59qtiwwrvp\r\n
      1vPjxciEIxAtgSXtIUQz3ljDRNUHjpyfYM3ska5jkxMIPNYUYFMX2x+Gxn9PZEG3\r\n
      Im391BRynZsnkvJO6i4i5N1xsPK5SyPiKBnlMxW/6ZLi5aAQHV3cc2KLzV+T+s2B\r\n
      v9LTAyO7nWo5AoIBAASA/jqqyKZwyl3F8AkIq6CEjfeHQSidFG65iyxSJF65MJTJ\r\n
      fN+Jgye+Evb3/X47NIO9UnEpV6D8VR7YbaonHDQZG09ogRDKMfp4jxx9g8yUAdZS\r\n
      psYc3KXTGdqw94y9pTk9KJlN1lR6xjzPvcOGdAATq2zVnZXXJewifCI/iOu73yWP\r\n
      F1aeZiaFwzWuW6goJ7a/wrnZrjKNjI/CEAj/TwcvjYk3lDT9KLAYKX4DKUOW5jko\r\n
      gTacxRzlglIn4Q9SC/iipWvX7YX+EVuf2yUA0cdJiOAUnYxN+uEGEc0tP5nHoju7\r\n
      tp0yZmAi2L+cecCT0+CwHpwdZHZEVWpS4JLf40ECggEBALFSZIgGDZlaU5YL7zHV\r\n
      Q5APRugKDLKjMPW7IPwxINnj2tioAL/hOQBpfkNTXEM4ipmz1fCo57FNUjcOINzD\r\n
      hJqqmHWNmIgIZmJDKeG2rhKenYTblXCeADwCvTKNxWmfoi0iZ6ybwqCBuqjcxoSZ\r\n
      jfHCcGl0+yw9yAnLRM1ta2XopCb70ZIIS2PCHjk9J/xN2ryNY/PhsgnN2ilMiTNq\r\n
      oTFYCWPF5lCojrj020KQJUPEaUBzbcpqwZ/FI6HfXvKAdCjqKk40/wHNI2Np2oC6\r\n
      +h7o4NWs0/J+gNhP6/edjZf19DwTsNtbvf6PRUeRtkXeudVY99T0Sy9B0HNxik9b\r\n
      cikCggEAM2wassiP1i0Gc3wrbNLHyQN+yqMaAp0xF+8l0fU3T8zPL/tYDcITnZPY\r\n
      pEFV/aodP9X7XFuQD0iGTOTGDXiMSLPOLI/ifmwbT41rgIN9x14MpU2EtWeVz7sx\r\n
      ZIFMt98rHx6BsZx/DnSFDQ8iqrKF3u+OOv7s6j+8odz4Rq53+16vMev5VUMOPq+E\r\n
      aQn8SDKkOjZzwb9QGB9bXS5s9yyj4pLyggQ0O5S2ugZjUcmCecNpktN8bUR3I9VQ\r\n
      KWkcQa9yCpidp/JYrQtlbqAPiIzptA4T4RNh+F6pKbmw7hNMIPipPzbQezEMaBOn\r\n
      Cgb38EldyAVGjCzRGfhu9SNU9B03bg==\r\n
      -----END PRIVATE KEY-----
      """
    +publicKey: """
      -----BEGIN PUBLIC KEY-----\r\n
      MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA5XnqLc+UwYjJQmLCWCR1\r\n
      TcY7577dKrEANvNge73agU2wEXw+PYij4jCMIFNsoQiNKE0kMHNmcvQEPt9a8Jrw\r\n
      cfFb3C4ELyqTcz1YTEI3pSu5OYj4j3P1tbKGmrnqat2MECoBqHeHOVYfXzCJ0gDX\r\n
      zizlEqN6VM32kGhhL0HOQ2yow4CI7L/ziiNWnG87tOuykMyE4bvtQb3KkGKaNlMe\r\n
      Vtt5zapK0Wfvs/69TCNo0t78IuTksM+H1oSzyVxOpcKJHOm/7gGXu7C0+kELY3ry\r\n
      55jMkSFZ5sW7RzzEn4S3c/LLEIaDQnwJDJwYw1F99UkrOu6VPL+TtxZ9h3fqhVgo\r\n
      60RMEqQQHduCDSairI0muo96Cy/F8PB2X/sekETyXIf3NxTVkbTNm/Z/FbAEIg/f\r\n
      OaWn8nkNU6iHuIkoyNIlIMtloMDtAtWdDzW0M0JkZNBDgJcSF4z5gdtvT1ePjnGc\r\n
      S0/aYT/64ndULfUaPti3ZEvWanvHNiR3iSnOTb//Djl+bkPwfNiV57l2Iv6FRCW+\r\n
      beNhvLtyCJGDORvxrdN91lOnW8ijgZnZ212j8PSwtzO6KKd8sgm91Ay34IP152Vb\r\n
      2cUjwj5YeRtS29K+O7Iiqv9JPWEbmtABbFYNHYan7sLG+hvR8eRInLj7LjiI1yDQ\r\n
      U45ZxOEnTM9GSbe2y48JSnUCAwEAAQ==\r\n
      -----END PUBLIC KEY-----
      """
    +apFetchedAt: null
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1686560440 {#13226
      date: 2023-06-12 11:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
]
Attributes
[]
Component
App\Twig\Components\UserInlineComponent {#13196
  +user: Proxies\__CG__\App\Entity\User {#13178
    +avatar: null
    +cover: null
    +email: "kbin@j0h.nl"
    +username: "Sprite_tm"
    +roles: [
      "ROLE_ADMIN"
    ]
    +followersCount: 0
    +homepage: "front"
    +about: "Hi! I'm Sprite_tm. You may know me from sites like https://spritesmods.com."
    +lastActive: DateTime @1707547382 {#13225
      date: 2024-02-10 07:43:02.0 +01:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: true
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13227 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13229 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13231 …}
    +entries: Doctrine\ORM\PersistentCollection {#13233 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13235 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13237 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13239 …}
    +posts: Doctrine\ORM\PersistentCollection {#13241 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13243 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13245 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13247 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13249 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13251 …}
    +follows: Doctrine\ORM\PersistentCollection {#13253 …}
    +followers: Doctrine\ORM\PersistentCollection {#13255 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13257 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13259 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13261 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13263 …}
    +reports: Doctrine\ORM\PersistentCollection {#13265 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13267 …}
    +violations: Doctrine\ORM\PersistentCollection {#13269 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13271 …}
    +awards: Doctrine\ORM\PersistentCollection {#13273 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13275 …}
    +categories: Doctrine\ORM\PersistentCollection {#13277 …}
    -id: 1
    -password: "$2y$13$ZX7Aou2QOPRGkHPp4y5x8OWfxZMoT1BGH7bRLlPP7mwZFTkfiaPGG"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13279 …}
    +apId: null
    +apProfileId: null
    +apPublicUrl: null
    +apFollowersUrl: null
    +apInboxUrl: null
    +apDomain: null
    +apPreferredUsername: null
    +apDiscoverable: null
    +apManuallyApprovesFollowers: null
    +privateKey: """
      -----BEGIN PRIVATE KEY-----\r\n
      MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQDleeotz5TBiMlC\r\n
      YsJYJHVNxjvnvt0qsQA282B7vdqBTbARfD49iKPiMIwgU2yhCI0oTSQwc2Zy9AQ+\r\n
      31rwmvBx8VvcLgQvKpNzPVhMQjelK7k5iPiPc/W1soaauepq3YwQKgGod4c5Vh9f\r\n
      MInSANfOLOUSo3pUzfaQaGEvQc5DbKjDgIjsv/OKI1acbzu067KQzIThu+1BvcqQ\r\n
      Ypo2Ux5W23nNqkrRZ++z/r1MI2jS3vwi5OSwz4fWhLPJXE6lwokc6b/uAZe7sLT6\r\n
      QQtjevLnmMyRIVnmxbtHPMSfhLdz8ssQhoNCfAkMnBjDUX31SSs67pU8v5O3Fn2H\r\n
      d+qFWCjrREwSpBAd24INJqKsjSa6j3oLL8Xw8HZf+x6QRPJch/c3FNWRtM2b9n8V\r\n
      sAQiD985pafyeQ1TqIe4iSjI0iUgy2WgwO0C1Z0PNbQzQmRk0EOAlxIXjPmB229P\r\n
      V4+OcZxLT9phP/rid1Qt9Ro+2LdkS9Zqe8c2JHeJKc5Nv/8OOX5uQ/B82JXnuXYi\r\n
      /oVEJb5t42G8u3IIkYM5G/Gt033WU6dbyKOBmdnbXaPw9LC3M7oop3yyCb3UDLfg\r\n
      g/XnZVvZxSPCPlh5G1Lb0r47siKq/0k9YRua0AFsVg0dhqfuwsb6G9Hx5EicuPsu\r\n
      OIjXINBTjlnE4SdMz0ZJt7bLjwlKdQIDAQABAoICAAlWo8QHfYs+sMoF0Njbavam\r\n
      SYvNxZxWJacW0mdWu4ylh7O+dZ31cI3k4d7y5inLeksYkI90MsgczAtu9XlzJLPO\r\n
      WamlKcBtoCCBb5Vy4GbVV61SuKLF2krxn+6uAC8nIusJepXLf3JC4fXyuLkWFbIr\r\n
      O4s9od3Pn+gSh1nv+J/fzSJfmbLgwN1vQLgPAsQDD3o7CHFTP318ZsDnclUhnst0\r\n
      FQnckzzgWO3fQP7XNg3WyzX0UKYtW97L+bEJE55FQ2Us0gWyhOU7dLH2casztqzc\r\n
      F/8T91+fzlZAz9OaCAks6Tyb7L2I5KlhtNRF/bU8rAiy6tnVBgLeZG9d3upcQxX0\r\n
      L+SMPWg55qERGI5mO+BxFdUnVtcmswziKmySYtzgm+c4jmPS5cWhGB9HFCTW2S0x\r\n
      GoVA2cZGWjMTrbZQhgJjBqzp76fhLtXTufd328sYmX7fBYKEWFYNwrEJaWYUNl/V\r\n
      yEyl0aMQWKhVokx6eCqnuDZUc77LeuGuCleIdhQ53NYHrXMCmgVyLfmGdrOS3Uh6\r\n
      RrAYmnvvMkAUTOQajW2csC345PmgBOjE7vB7349ylKUkXvN4L+9xZCYaVjBt3O24\r\n
      aRoQSQDGhk+NIaYleiFx+u7dJSryxdx/6ut6dQ2S+jKlm1oN1qq6ppO5y/TFRQ1e\r\n
      qn7kjIGzUT80fANDFqdhAoIBAQD1+cGiWXRQhUrJc5X3ngH1zHoLWpmSZcUUDFn/\r\n
      bV/CChd2M43fOpneIQETZ1oS7BsU3y92kTw63ytYOUg7C5iT5/r9ZoBGq0HZSbll\r\n
      riRJWGiajr2aYCmIes++CrfUvCcD6+l8QMZ3s8eXdk80GX+vt1xEfRpWV9e9huJK\r\n
      K1e8wXfFmPAmxUi63IePscdc+SVQGeooMYDnMwLWvxpAtp5mGOaQc4D5dviWXjSE\r\n
      Z/PJa+gectpD1iDIPUXm3o17ivE2UYFia8/FCGUN6Yz7ucRKF+2SPO8hLefk5UvJ\r\n
      Lxlkh67MXKkneDqRU9C82Qmcfz5nQLQadC0nbE44YeXrnlIdAoIBAQDu1AWMIe6f\r\n
      7TZYCWnTa3nT6penJ9CMaGDPI/62dKTmGnI4oo3u9DGGrnuWbcFFCQA02vcYdpuw\r\n
      CVy6mkP/yqN5VSV3EHZiJUA0aKIxot3o3YOiobpVYn9hwvzzOdMZO4SOuevNfY1c\r\n
      qmnLGhYoDvR1c2yaudCf/BDwQqlLoSg9F5X57bRtwaRyUjhtXVKXWb59qtiwwrvp\r\n
      1vPjxciEIxAtgSXtIUQz3ljDRNUHjpyfYM3ska5jkxMIPNYUYFMX2x+Gxn9PZEG3\r\n
      Im391BRynZsnkvJO6i4i5N1xsPK5SyPiKBnlMxW/6ZLi5aAQHV3cc2KLzV+T+s2B\r\n
      v9LTAyO7nWo5AoIBAASA/jqqyKZwyl3F8AkIq6CEjfeHQSidFG65iyxSJF65MJTJ\r\n
      fN+Jgye+Evb3/X47NIO9UnEpV6D8VR7YbaonHDQZG09ogRDKMfp4jxx9g8yUAdZS\r\n
      psYc3KXTGdqw94y9pTk9KJlN1lR6xjzPvcOGdAATq2zVnZXXJewifCI/iOu73yWP\r\n
      F1aeZiaFwzWuW6goJ7a/wrnZrjKNjI/CEAj/TwcvjYk3lDT9KLAYKX4DKUOW5jko\r\n
      gTacxRzlglIn4Q9SC/iipWvX7YX+EVuf2yUA0cdJiOAUnYxN+uEGEc0tP5nHoju7\r\n
      tp0yZmAi2L+cecCT0+CwHpwdZHZEVWpS4JLf40ECggEBALFSZIgGDZlaU5YL7zHV\r\n
      Q5APRugKDLKjMPW7IPwxINnj2tioAL/hOQBpfkNTXEM4ipmz1fCo57FNUjcOINzD\r\n
      hJqqmHWNmIgIZmJDKeG2rhKenYTblXCeADwCvTKNxWmfoi0iZ6ybwqCBuqjcxoSZ\r\n
      jfHCcGl0+yw9yAnLRM1ta2XopCb70ZIIS2PCHjk9J/xN2ryNY/PhsgnN2ilMiTNq\r\n
      oTFYCWPF5lCojrj020KQJUPEaUBzbcpqwZ/FI6HfXvKAdCjqKk40/wHNI2Np2oC6\r\n
      +h7o4NWs0/J+gNhP6/edjZf19DwTsNtbvf6PRUeRtkXeudVY99T0Sy9B0HNxik9b\r\n
      cikCggEAM2wassiP1i0Gc3wrbNLHyQN+yqMaAp0xF+8l0fU3T8zPL/tYDcITnZPY\r\n
      pEFV/aodP9X7XFuQD0iGTOTGDXiMSLPOLI/ifmwbT41rgIN9x14MpU2EtWeVz7sx\r\n
      ZIFMt98rHx6BsZx/DnSFDQ8iqrKF3u+OOv7s6j+8odz4Rq53+16vMev5VUMOPq+E\r\n
      aQn8SDKkOjZzwb9QGB9bXS5s9yyj4pLyggQ0O5S2ugZjUcmCecNpktN8bUR3I9VQ\r\n
      KWkcQa9yCpidp/JYrQtlbqAPiIzptA4T4RNh+F6pKbmw7hNMIPipPzbQezEMaBOn\r\n
      Cgb38EldyAVGjCzRGfhu9SNU9B03bg==\r\n
      -----END PRIVATE KEY-----
      """
    +publicKey: """
      -----BEGIN PUBLIC KEY-----\r\n
      MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA5XnqLc+UwYjJQmLCWCR1\r\n
      TcY7577dKrEANvNge73agU2wEXw+PYij4jCMIFNsoQiNKE0kMHNmcvQEPt9a8Jrw\r\n
      cfFb3C4ELyqTcz1YTEI3pSu5OYj4j3P1tbKGmrnqat2MECoBqHeHOVYfXzCJ0gDX\r\n
      zizlEqN6VM32kGhhL0HOQ2yow4CI7L/ziiNWnG87tOuykMyE4bvtQb3KkGKaNlMe\r\n
      Vtt5zapK0Wfvs/69TCNo0t78IuTksM+H1oSzyVxOpcKJHOm/7gGXu7C0+kELY3ry\r\n
      55jMkSFZ5sW7RzzEn4S3c/LLEIaDQnwJDJwYw1F99UkrOu6VPL+TtxZ9h3fqhVgo\r\n
      60RMEqQQHduCDSairI0muo96Cy/F8PB2X/sekETyXIf3NxTVkbTNm/Z/FbAEIg/f\r\n
      OaWn8nkNU6iHuIkoyNIlIMtloMDtAtWdDzW0M0JkZNBDgJcSF4z5gdtvT1ePjnGc\r\n
      S0/aYT/64ndULfUaPti3ZEvWanvHNiR3iSnOTb//Djl+bkPwfNiV57l2Iv6FRCW+\r\n
      beNhvLtyCJGDORvxrdN91lOnW8ijgZnZ212j8PSwtzO6KKd8sgm91Ay34IP152Vb\r\n
      2cUjwj5YeRtS29K+O7Iiqv9JPWEbmtABbFYNHYan7sLG+hvR8eRInLj7LjiI1yDQ\r\n
      U45ZxOEnTM9GSbe2y48JSnUCAwEAAQ==\r\n
      -----END PUBLIC KEY-----
      """
    +apFetchedAt: null
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1686560440 {#13226
      date: 2023-06-12 11:00:40.0 +02:00
    }
    +__isInitialized__: true
     …2
  }
  +showAvatar: true
}
related_magazines App\Twig\Components\RelatedMagazinesComponent 14.0 MiB 6.80 ms
Input props
[
  "magazine" => "askelectronics@discuss.tchncs.de"
  "tag" => null
]
Attributes
[]
Component
App\Twig\Components\RelatedMagazinesComponent {#13387
  +limit: 4
  +tag: null
  +magazine: "askelectronics@discuss.tchncs.de"
  +type: "magazine"
  +title: "related_magazines"
  +refreshedRandom: false
  -repository: App\Repository\MagazineRepository {#334 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -twig: Twig\Environment {#1252 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
active_users App\Twig\Components\ActiveUsersComponent 14.0 MiB 20.43 ms
Input props
[
  "magazine" => App\Entity\Magazine {#266
    +icon: Proxies\__CG__\App\Entity\Image {#247 …}
    +name: "askelectronics@discuss.tchncs.de"
    +title: "askelectronics"
    +description: """
      **For questions about component-level electronic circuits, tools and equipment.**\n
      \n
      Rules\n
      -----\n
      \n
      1: Be nice.\n
      \n
      2: Be on-topic (eg: *Electronic*, not *electrical*).\n
      \n
      3: No commercial stuff, buying, selling or valuations.\n
      \n
      4: Be safe.\n
      \n
      ---
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 154
    +entryCommentCount: 1230
    +postCount: 1
    +postCommentCount: 4
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729413608 {#276
      date: 2024-10-20 10:40:08.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#238 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
    +entries: Doctrine\ORM\PersistentCollection {#181 …}
    +posts: Doctrine\ORM\PersistentCollection {#139 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
    +bans: Doctrine\ORM\PersistentCollection {#118 …}
    +reports: Doctrine\ORM\PersistentCollection {#104 …}
    +badges: Doctrine\ORM\PersistentCollection {#82 …}
    +logs: Doctrine\ORM\PersistentCollection {#72 …}
    +awards: Doctrine\ORM\PersistentCollection {#61 …}
    +categories: Doctrine\ORM\PersistentCollection {#1820 …}
    -id: 11
    +apId: "askelectronics@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
    +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
    +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "askelectronics"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1727247714 {#270
      date: 2024-09-25 09:01:54.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687144409 {#272
      date: 2023-06-19 05:13:29.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\ActiveUsersComponent {#13513
  +magazine: App\Entity\Magazine {#266
    +icon: Proxies\__CG__\App\Entity\Image {#247 …}
    +name: "askelectronics@discuss.tchncs.de"
    +title: "askelectronics"
    +description: """
      **For questions about component-level electronic circuits, tools and equipment.**\n
      \n
      Rules\n
      -----\n
      \n
      1: Be nice.\n
      \n
      2: Be on-topic (eg: *Electronic*, not *electrical*).\n
      \n
      3: No commercial stuff, buying, selling or valuations.\n
      \n
      4: Be safe.\n
      \n
      ---
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 154
    +entryCommentCount: 1230
    +postCount: 1
    +postCommentCount: 4
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729413608 {#276
      date: 2024-10-20 10:40:08.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#238 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
    +entries: Doctrine\ORM\PersistentCollection {#181 …}
    +posts: Doctrine\ORM\PersistentCollection {#139 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
    +bans: Doctrine\ORM\PersistentCollection {#118 …}
    +reports: Doctrine\ORM\PersistentCollection {#104 …}
    +badges: Doctrine\ORM\PersistentCollection {#82 …}
    +logs: Doctrine\ORM\PersistentCollection {#72 …}
    +awards: Doctrine\ORM\PersistentCollection {#61 …}
    +categories: Doctrine\ORM\PersistentCollection {#1820 …}
    -id: 11
    +apId: "askelectronics@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
    +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
    +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "askelectronics"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1727247714 {#270
      date: 2024-09-25 09:01:54.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687144409 {#272
      date: 2023-06-19 05:13:29.0 +02:00
    }
  }
  -userRepository: App\Repository\UserRepository {#603 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -twig: Twig\Environment {#1252 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
user_avatar App\Twig\Components\UserAvatarComponent 14.0 MiB 0.61 ms
Input props
[
  "user" => App\Entity\User {#13763
    +avatar: Proxies\__CG__\App\Entity\Image {#13762 …}
    +cover: null
    +email: "jarrodsfarrell@hoosier.social"
    +username: "@jarrodsfarrell@hoosier.social"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      Grounded tech enthusiast, Linux enjoyer, and Indy 500 wannabe that lives in south-east Indiana.  \n
      Go pride. [#LGBTQ](https://hoosier.social/tags/LGBTQ)
      """
    +lastActive: DateTime @1690728142 {#13766
      date: 2023-07-30 16:42:22.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13761 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13759 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13757 …}
    +entries: Doctrine\ORM\PersistentCollection {#13755 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13753 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13751 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13749 …}
    +posts: Doctrine\ORM\PersistentCollection {#13747 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13745 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13743 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13741 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13739 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13737 …}
    +follows: Doctrine\ORM\PersistentCollection {#13735 …}
    +followers: Doctrine\ORM\PersistentCollection {#13733 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13731 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13729 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13727 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13725 …}
    +reports: Doctrine\ORM\PersistentCollection {#13723 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13721 …}
    +violations: Doctrine\ORM\PersistentCollection {#13719 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13717 …}
    +awards: Doctrine\ORM\PersistentCollection {#13715 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13713 …}
    +categories: Doctrine\ORM\PersistentCollection {#13711 …}
    -id: 20657
    -password: "$2y$13$XNERcrvg1/EZkZQbKQ6R6efd5bjo3rlAJRSz0lDRnfkNCV76hr5Me"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13709 …}
    +apId: "jarrodsfarrell@hoosier.social"
    +apProfileId: "https://hoosier.social/users/jarrodsfarrell"
    +apPublicUrl: "https://hoosier.social/@jarrodsfarrell"
    +apFollowersUrl: "https://hoosier.social/users/jarrodsfarrell/followers"
    +apInboxUrl: "https://hoosier.social/inbox"
    +apDomain: "hoosier.social"
    +apPreferredUsername: "jarrodsfarrell"
    +apDiscoverable: false
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1690726862 {#13765
      date: 2023-07-30 16:21:02.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1688878027 {#13764
      date: 2023-07-09 06:47:07.0 +02:00
    }
  }
  "width" => 65
  "height" => 65
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#13569
  +width: 65
  +height: 65
  +user: App\Entity\User {#13763
    +avatar: Proxies\__CG__\App\Entity\Image {#13762 …}
    +cover: null
    +email: "jarrodsfarrell@hoosier.social"
    +username: "@jarrodsfarrell@hoosier.social"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      Grounded tech enthusiast, Linux enjoyer, and Indy 500 wannabe that lives in south-east Indiana.  \n
      Go pride. [#LGBTQ](https://hoosier.social/tags/LGBTQ)
      """
    +lastActive: DateTime @1690728142 {#13766
      date: 2023-07-30 16:42:22.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13761 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13759 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13757 …}
    +entries: Doctrine\ORM\PersistentCollection {#13755 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13753 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13751 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13749 …}
    +posts: Doctrine\ORM\PersistentCollection {#13747 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13745 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13743 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13741 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13739 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13737 …}
    +follows: Doctrine\ORM\PersistentCollection {#13735 …}
    +followers: Doctrine\ORM\PersistentCollection {#13733 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13731 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13729 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13727 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13725 …}
    +reports: Doctrine\ORM\PersistentCollection {#13723 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13721 …}
    +violations: Doctrine\ORM\PersistentCollection {#13719 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13717 …}
    +awards: Doctrine\ORM\PersistentCollection {#13715 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13713 …}
    +categories: Doctrine\ORM\PersistentCollection {#13711 …}
    -id: 20657
    -password: "$2y$13$XNERcrvg1/EZkZQbKQ6R6efd5bjo3rlAJRSz0lDRnfkNCV76hr5Me"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13709 …}
    +apId: "jarrodsfarrell@hoosier.social"
    +apProfileId: "https://hoosier.social/users/jarrodsfarrell"
    +apPublicUrl: "https://hoosier.social/@jarrodsfarrell"
    +apFollowersUrl: "https://hoosier.social/users/jarrodsfarrell/followers"
    +apInboxUrl: "https://hoosier.social/inbox"
    +apDomain: "hoosier.social"
    +apPreferredUsername: "jarrodsfarrell"
    +apDiscoverable: false
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1690726862 {#13765
      date: 2023-07-30 16:21:02.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1688878027 {#13764
      date: 2023-07-09 06:47:07.0 +02:00
    }
  }
  +asLink: true
}
user_avatar App\Twig\Components\UserAvatarComponent 14.0 MiB 0.46 ms
Input props
[
  "user" => App\Entity\User {#13645
    +avatar: Proxies\__CG__\App\Entity\Image {#13644 …}
    +cover: null
    +email: "skillissuer@discuss.tchncs.de"
    +username: "@skillissuer@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: "i should be writing"
    +lastActive: DateTime @1721044672 {#13648
      date: 2024-07-15 13:57:52.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13643 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13641 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13639 …}
    +entries: Doctrine\ORM\PersistentCollection {#13637 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13635 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13633 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13631 …}
    +posts: Doctrine\ORM\PersistentCollection {#13629 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13627 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13625 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13623 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13621 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13619 …}
    +follows: Doctrine\ORM\PersistentCollection {#13617 …}
    +followers: Doctrine\ORM\PersistentCollection {#13615 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13613 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13611 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13609 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13607 …}
    +reports: Doctrine\ORM\PersistentCollection {#13605 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13603 …}
    +violations: Doctrine\ORM\PersistentCollection {#13601 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13599 …}
    +awards: Doctrine\ORM\PersistentCollection {#13597 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13595 …}
    +categories: Doctrine\ORM\PersistentCollection {#13593 …}
    -id: 39464
    -password: "$2y$13$wQAP4Gif3ESopfZf00xAU.zwr9iTTX.ev3twB9omsse0v00sxuD/G"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13591 …}
    +apId: "skillissuer@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/skillissuer"
    +apPublicUrl: "https://discuss.tchncs.de/u/skillissuer"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "skillissuer"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1728245617 {#13647
      date: 2024-10-06 22:13:37.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1691480767 {#13646
      date: 2023-08-08 09:46:07.0 +02:00
    }
  }
  "width" => 65
  "height" => 65
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#13849
  +width: 65
  +height: 65
  +user: App\Entity\User {#13645
    +avatar: Proxies\__CG__\App\Entity\Image {#13644 …}
    +cover: null
    +email: "skillissuer@discuss.tchncs.de"
    +username: "@skillissuer@discuss.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: "i should be writing"
    +lastActive: DateTime @1721044672 {#13648
      date: 2024-07-15 13:57:52.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13643 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13641 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13639 …}
    +entries: Doctrine\ORM\PersistentCollection {#13637 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13635 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13633 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13631 …}
    +posts: Doctrine\ORM\PersistentCollection {#13629 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13627 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13625 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13623 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13621 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13619 …}
    +follows: Doctrine\ORM\PersistentCollection {#13617 …}
    +followers: Doctrine\ORM\PersistentCollection {#13615 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13613 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13611 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13609 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13607 …}
    +reports: Doctrine\ORM\PersistentCollection {#13605 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13603 …}
    +violations: Doctrine\ORM\PersistentCollection {#13601 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13599 …}
    +awards: Doctrine\ORM\PersistentCollection {#13597 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13595 …}
    +categories: Doctrine\ORM\PersistentCollection {#13593 …}
    -id: 39464
    -password: "$2y$13$wQAP4Gif3ESopfZf00xAU.zwr9iTTX.ev3twB9omsse0v00sxuD/G"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13591 …}
    +apId: "skillissuer@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/u/skillissuer"
    +apPublicUrl: "https://discuss.tchncs.de/u/skillissuer"
    +apFollowersUrl: null
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "skillissuer"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1728245617 {#13647
      date: 2024-10-06 22:13:37.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1691480767 {#13646
      date: 2023-08-08 09:46:07.0 +02:00
    }
  }
  +asLink: true
}
user_avatar App\Twig\Components\UserAvatarComponent 14.0 MiB 0.45 ms
Input props
[
  "user" => App\Entity\User {#13960
    +avatar: Proxies\__CG__\App\Entity\Image {#13957 …}
    +cover: Proxies\__CG__\App\Entity\Image {#13958 …}
    +email: "TCB13@lemmy.world"
    +username: "@TCB13@lemmy.world"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: ""
    +lastActive: DateTime @1729518803 {#13780
      date: 2024-10-21 15:53:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13955 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13953 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13951 …}
    +entries: Doctrine\ORM\PersistentCollection {#13949 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13947 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13945 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13943 …}
    +posts: Doctrine\ORM\PersistentCollection {#13941 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13939 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13937 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13935 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13933 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13931 …}
    +follows: Doctrine\ORM\PersistentCollection {#13929 …}
    +followers: Doctrine\ORM\PersistentCollection {#13927 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13925 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13923 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13921 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13919 …}
    +reports: Doctrine\ORM\PersistentCollection {#13917 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13915 …}
    +violations: Doctrine\ORM\PersistentCollection {#13913 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13911 …}
    +awards: Doctrine\ORM\PersistentCollection {#13909 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13907 …}
    +categories: Doctrine\ORM\PersistentCollection {#13905 …}
    -id: 43677
    -password: "$2y$13$67WvGuLt4FPbc4trvxnH0ODZHTvTlMWI7kaafAJZUzYiSsXw.KDqi"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13903 …}
    +apId: "TCB13@lemmy.world"
    +apProfileId: "https://lemmy.world/u/TCB13"
    +apPublicUrl: "https://lemmy.world/u/TCB13"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.world/inbox"
    +apDomain: "lemmy.world"
    +apPreferredUsername: "TCB13"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729566764 {#13961
      date: 2024-10-22 05:12:44.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1693492241 {#13959
      date: 2023-08-31 16:30:41.0 +02:00
    }
  }
  "width" => 65
  "height" => 65
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#13794
  +width: 65
  +height: 65
  +user: App\Entity\User {#13960
    +avatar: Proxies\__CG__\App\Entity\Image {#13957 …}
    +cover: Proxies\__CG__\App\Entity\Image {#13958 …}
    +email: "TCB13@lemmy.world"
    +username: "@TCB13@lemmy.world"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: ""
    +lastActive: DateTime @1729518803 {#13780
      date: 2024-10-21 15:53:23.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13955 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13953 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13951 …}
    +entries: Doctrine\ORM\PersistentCollection {#13949 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13947 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13945 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13943 …}
    +posts: Doctrine\ORM\PersistentCollection {#13941 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13939 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13937 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13935 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13933 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13931 …}
    +follows: Doctrine\ORM\PersistentCollection {#13929 …}
    +followers: Doctrine\ORM\PersistentCollection {#13927 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13925 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13923 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13921 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13919 …}
    +reports: Doctrine\ORM\PersistentCollection {#13917 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13915 …}
    +violations: Doctrine\ORM\PersistentCollection {#13913 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13911 …}
    +awards: Doctrine\ORM\PersistentCollection {#13909 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13907 …}
    +categories: Doctrine\ORM\PersistentCollection {#13905 …}
    -id: 43677
    -password: "$2y$13$67WvGuLt4FPbc4trvxnH0ODZHTvTlMWI7kaafAJZUzYiSsXw.KDqi"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13903 …}
    +apId: "TCB13@lemmy.world"
    +apProfileId: "https://lemmy.world/u/TCB13"
    +apPublicUrl: "https://lemmy.world/u/TCB13"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.world/inbox"
    +apDomain: "lemmy.world"
    +apPreferredUsername: "TCB13"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1729566764 {#13961
      date: 2024-10-22 05:12:44.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1693492241 {#13959
      date: 2023-08-31 16:30:41.0 +02:00
    }
  }
  +asLink: true
}
user_avatar App\Twig\Components\UserAvatarComponent 14.0 MiB 0.47 ms
Input props
[
  "user" => App\Entity\User {#13704
    +avatar: Proxies\__CG__\App\Entity\Image {#13703 …}
    +cover: null
    +email: "birdcat@lemmy.ml"
    +username: "@birdcat@lemmy.ml"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      Appreciate and upvote every reply to my comments/posts if I can detect any effort being put into it; even if I think you completely missed what I tried to say or strongly disagree with your opinion.\n
      \n
      Occasionally I cannot resist shitposting, hyperbolic, ironic, sarcastic or populist rhetoric; no /s
      """
    +lastActive: DateTime @1696696022 {#13707
      date: 2023-10-07 18:27:02.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13702 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13700 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13698 …}
    +entries: Doctrine\ORM\PersistentCollection {#13696 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13694 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13692 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13690 …}
    +posts: Doctrine\ORM\PersistentCollection {#13688 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13686 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13684 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13682 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13680 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13678 …}
    +follows: Doctrine\ORM\PersistentCollection {#13676 …}
    +followers: Doctrine\ORM\PersistentCollection {#13674 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13672 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13670 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13668 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13666 …}
    +reports: Doctrine\ORM\PersistentCollection {#13664 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13662 …}
    +violations: Doctrine\ORM\PersistentCollection {#13660 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13658 …}
    +awards: Doctrine\ORM\PersistentCollection {#13656 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13654 …}
    +categories: Doctrine\ORM\PersistentCollection {#13652 …}
    -id: 21796
    -password: "$2y$13$ACNmoGKWwRgm/Njn146GG.b25O8.XXYtlu6ZukGNMl7KWiROcYuzK"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13650 …}
    +apId: "birdcat@lemmy.ml"
    +apProfileId: "https://lemmy.ml/u/birdcat"
    +apPublicUrl: "https://lemmy.ml/u/birdcat"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ml/inbox"
    +apDomain: "lemmy.ml"
    +apPreferredUsername: "birdcat"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1719824521 {#13706
      date: 2024-07-01 11:02:01.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1689039812 {#13705
      date: 2023-07-11 03:43:32.0 +02:00
    }
  }
  "width" => 65
  "height" => 65
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#14020
  +width: 65
  +height: 65
  +user: App\Entity\User {#13704
    +avatar: Proxies\__CG__\App\Entity\Image {#13703 …}
    +cover: null
    +email: "birdcat@lemmy.ml"
    +username: "@birdcat@lemmy.ml"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      Appreciate and upvote every reply to my comments/posts if I can detect any effort being put into it; even if I think you completely missed what I tried to say or strongly disagree with your opinion.\n
      \n
      Occasionally I cannot resist shitposting, hyperbolic, ironic, sarcastic or populist rhetoric; no /s
      """
    +lastActive: DateTime @1696696022 {#13707
      date: 2023-10-07 18:27:02.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: true
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: false
    +notifyOnNewEntryCommentReply: false
    +notifyOnNewPost: false
    +notifyOnNewPostReply: false
    +notifyOnNewPostCommentReply: false
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13702 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13700 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13698 …}
    +entries: Doctrine\ORM\PersistentCollection {#13696 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13694 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13692 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13690 …}
    +posts: Doctrine\ORM\PersistentCollection {#13688 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13686 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13684 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13682 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13680 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13678 …}
    +follows: Doctrine\ORM\PersistentCollection {#13676 …}
    +followers: Doctrine\ORM\PersistentCollection {#13674 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13672 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13670 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13668 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13666 …}
    +reports: Doctrine\ORM\PersistentCollection {#13664 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13662 …}
    +violations: Doctrine\ORM\PersistentCollection {#13660 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13658 …}
    +awards: Doctrine\ORM\PersistentCollection {#13656 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13654 …}
    +categories: Doctrine\ORM\PersistentCollection {#13652 …}
    -id: 21796
    -password: "$2y$13$ACNmoGKWwRgm/Njn146GG.b25O8.XXYtlu6ZukGNMl7KWiROcYuzK"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13650 …}
    +apId: "birdcat@lemmy.ml"
    +apProfileId: "https://lemmy.ml/u/birdcat"
    +apPublicUrl: "https://lemmy.ml/u/birdcat"
    +apFollowersUrl: null
    +apInboxUrl: "https://lemmy.ml/inbox"
    +apDomain: "lemmy.ml"
    +apPreferredUsername: "birdcat"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1719824521 {#13706
      date: 2024-07-01 11:02:01.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1689039812 {#13705
      date: 2023-07-11 03:43:32.0 +02:00
    }
  }
  +asLink: true
}
user_avatar App\Twig\Components\UserAvatarComponent 14.0 MiB 0.40 ms
Input props
[
  "user" => App\Entity\User {#13586
    +avatar: Proxies\__CG__\App\Entity\Image {#13585 …}
    +cover: Proxies\__CG__\App\Entity\Image {#13584 …}
    +email: "vfrmedia@social.tchncs.de"
    +username: "@vfrmedia@social.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      Old roaming Tom Cat (zwerfkater) but still young at heart. Toots EN, (NL,FR,DE). [#DevOpa](https://social.tchncs.de/tags/DevOpa) - interested more in retro tech / culture / aesthetics than new stuff. Also transport and public infrastructure in general (with a UK/European focus)\n
      \n
      Welcome to the secret goose shed!\n
      \n
      Avatar is a tabby point Siamese cat - header picture is a Stentor FM radio transmitter designed in the Netherlands; popular with small pirate radio broadcasters in late 1980s
      """
    +lastActive: DateTime @1692636225 {#13589
      date: 2023-08-21 18:43:45.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13583 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13581 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13531 …}
    +entries: Doctrine\ORM\PersistentCollection {#13533 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13540 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13541 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13543 …}
    +posts: Doctrine\ORM\PersistentCollection {#13545 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13542 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13535 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13553 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13550 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13558 …}
    +follows: Doctrine\ORM\PersistentCollection {#13555 …}
    +followers: Doctrine\ORM\PersistentCollection {#13563 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13565 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13567 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13975 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13969 …}
    +reports: Doctrine\ORM\PersistentCollection {#13782 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13771 …}
    +violations: Doctrine\ORM\PersistentCollection {#13977 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13976 …}
    +awards: Doctrine\ORM\PersistentCollection {#13973 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13970 …}
    +categories: Doctrine\ORM\PersistentCollection {#13967 …}
    -id: 41651
    -password: "$2y$13$MR/jvQLw20snj7dhCUOzrerIeJOUi.vmMEXqlAliA6M/KYuWQH.Sa"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13966 …}
    +apId: "vfrmedia@social.tchncs.de"
    +apProfileId: "https://social.tchncs.de/users/vfrmedia"
    +apPublicUrl: "https://social.tchncs.de/@vfrmedia"
    +apFollowersUrl: "https://social.tchncs.de/users/vfrmedia/followers"
    +apInboxUrl: "https://social.tchncs.de/inbox"
    +apDomain: "social.tchncs.de"
    +apPreferredUsername: "vfrmedia"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692636225 {#13588
      date: 2023-08-21 18:43:45.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692554254 {#13587
      date: 2023-08-20 19:57:34.0 +02:00
    }
  }
  "width" => 65
  "height" => 65
  "asLink" => true
]
Attributes
[]
Component
App\Twig\Components\UserAvatarComponent {#14077
  +width: 65
  +height: 65
  +user: App\Entity\User {#13586
    +avatar: Proxies\__CG__\App\Entity\Image {#13585 …}
    +cover: Proxies\__CG__\App\Entity\Image {#13584 …}
    +email: "vfrmedia@social.tchncs.de"
    +username: "@vfrmedia@social.tchncs.de"
    +roles: []
    +followersCount: 0
    +homepage: "front"
    +about: """
      Old roaming Tom Cat (zwerfkater) but still young at heart. Toots EN, (NL,FR,DE). [#DevOpa](https://social.tchncs.de/tags/DevOpa) - interested more in retro tech / culture / aesthetics than new stuff. Also transport and public infrastructure in general (with a UK/European focus)\n
      \n
      Welcome to the secret goose shed!\n
      \n
      Avatar is a tabby point Siamese cat - header picture is a Stentor FM radio transmitter designed in the Netherlands; popular with small pirate radio broadcasters in late 1980s
      """
    +lastActive: DateTime @1692636225 {#13589
      date: 2023-08-21 18:43:45.0 +02:00
    }
    +markedForDeletionAt: null
    +fields: null
    +oauthGithubId: null
    +oauthGoogleId: null
    +oauthFacebookId: null
    +oauthKeycloakId: null
    +hideAdult: true
    +showSubscribedUsers: true
    +showSubscribedMagazines: true
    +showSubscribedDomains: true
    +preferredLanguages: []
    +featuredMagazines: null
    +showProfileSubscriptions: false
    +showProfileFollowings: true
    +markNewComments: false
    +notifyOnNewEntry: false
    +notifyOnNewEntryReply: true
    +notifyOnNewEntryCommentReply: true
    +notifyOnNewPost: false
    +notifyOnNewPostReply: true
    +notifyOnNewPostCommentReply: true
    +addMentionsEntries: false
    +addMentionsPosts: true
    +isBanned: false
    +isVerified: false
    +isDeleted: false
    +isBot: false
    +spamProtection: true
    +customCss: null
    +ignoreMagazinesCustomCss: false
    +moderatorTokens: Doctrine\ORM\PersistentCollection {#13583 …}
    +magazineOwnershipRequests: Doctrine\ORM\PersistentCollection {#13581 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#13531 …}
    +entries: Doctrine\ORM\PersistentCollection {#13533 …}
    +entryVotes: Doctrine\ORM\PersistentCollection {#13540 …}
    +entryComments: Doctrine\ORM\PersistentCollection {#13541 …}
    +entryCommentVotes: Doctrine\ORM\PersistentCollection {#13543 …}
    +posts: Doctrine\ORM\PersistentCollection {#13545 …}
    +postVotes: Doctrine\ORM\PersistentCollection {#13542 …}
    +postComments: Doctrine\ORM\PersistentCollection {#13535 …}
    +postCommentVotes: Doctrine\ORM\PersistentCollection {#13553 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#13550 …}
    +subscribedDomains: Doctrine\ORM\PersistentCollection {#13558 …}
    +follows: Doctrine\ORM\PersistentCollection {#13555 …}
    +followers: Doctrine\ORM\PersistentCollection {#13563 …}
    +blocks: Doctrine\ORM\PersistentCollection {#13565 …}
    +blockers: Doctrine\ORM\PersistentCollection {#13567 …}
    +blockedMagazines: Doctrine\ORM\PersistentCollection {#13975 …}
    +blockedDomains: Doctrine\ORM\PersistentCollection {#13969 …}
    +reports: Doctrine\ORM\PersistentCollection {#13782 …}
    +favourites: Doctrine\ORM\PersistentCollection {#13771 …}
    +violations: Doctrine\ORM\PersistentCollection {#13977 …}
    +notifications: Doctrine\ORM\PersistentCollection {#13976 …}
    +awards: Doctrine\ORM\PersistentCollection {#13973 …}
    +subscribedCategories: Doctrine\ORM\PersistentCollection {#13970 …}
    +categories: Doctrine\ORM\PersistentCollection {#13967 …}
    -id: 41651
    -password: "$2y$13$MR/jvQLw20snj7dhCUOzrerIeJOUi.vmMEXqlAliA6M/KYuWQH.Sa"
    -totpSecret: null
    -totpBackupCodes: []
    -oAuth2UserConsents: Doctrine\ORM\PersistentCollection {#13966 …}
    +apId: "vfrmedia@social.tchncs.de"
    +apProfileId: "https://social.tchncs.de/users/vfrmedia"
    +apPublicUrl: "https://social.tchncs.de/@vfrmedia"
    +apFollowersUrl: "https://social.tchncs.de/users/vfrmedia/followers"
    +apInboxUrl: "https://social.tchncs.de/inbox"
    +apDomain: "social.tchncs.de"
    +apPreferredUsername: "vfrmedia"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: false
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1692636225 {#13588
      date: 2023-08-21 18:43:45.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1692554254 {#13587
      date: 2023-08-20 19:57:34.0 +02:00
    }
  }
  +asLink: true
}
related_categories App\Twig\Components\RelatedCategoriesComponent 14.0 MiB 12.08 ms
Input props
[
  "magazine" => "askelectronics@discuss.tchncs.de"
  "tag" => null
]
Attributes
[]
Component
App\Twig\Components\RelatedCategoriesComponent {#14139
  +limit: 4
  +tag: null
  +magazine: "askelectronics@discuss.tchncs.de"
  +type: "related"
  +title: "related_categories"
  +refreshedRandom: false
  -repository: App\Repository\CategoryRepository {#14140 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -twig: Twig\Environment {#1252 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
}
related_posts App\Twig\Components\RelatedPostsComponent 14.0 MiB 5.07 ms
Input props
[
  "magazine" => "askelectronics@discuss.tchncs.de"
  "tag" => null
]
Attributes
[]
Component
App\Twig\Components\RelatedPostsComponent {#7893
  +limit: 4
  +tag: null
  +magazine: "askelectronics@discuss.tchncs.de"
  +type: "magazine"
  +post: null
  +title: "related_posts"
  +refreshedRandom: false
  -repository: App\Repository\PostRepository {#7895 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -twig: Twig\Environment {#1252 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -mentionManager: App\Service\MentionManager {#390 …}
}
related_entries App\Twig\Components\RelatedEntriesComponent 14.0 MiB 20.84 ms
Input props
[
  "magazine" => "askelectronics@discuss.tchncs.de"
  "tag" => null
]
Attributes
[]
Component
App\Twig\Components\RelatedEntriesComponent {#13082
  +limit: 4
  +tag: null
  +magazine: "askelectronics@discuss.tchncs.de"
  +type: "magazine"
  +entry: null
  +title: "related_entries"
  +refreshedRandom: false
  -repository: App\Repository\EntryRepository {#271 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -twig: Twig\Environment {#1252 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -mentionManager: App\Service\MentionManager {#390 …}
}
support_us_block App\Twig\Components\SupportUsBlock 14.0 MiB 0.24 ms
Input props
[]
Attributes
[]
Component
App\Twig\Components\SupportUsBlock {#9909
  +subject: ? App\Entity\Contracts\VotableInterface
  +url: ? string
  -twig: Twig\Environment {#1252 …}
  -cache: Symfony\Component\Cache\Adapter\TraceableTagAwareAdapter {#600 …}
  -requestStack: Symfony\Component\HttpFoundation\RequestStack {#1328 …}
  -partnerBlockRepository: App\Repository\PartnerBlockRepository {#9862 …}
}
featured_magazines App\Twig\Components\FeaturedMagazinesComponent 14.0 MiB 0.76 ms
Input props
[
  "magazine" => App\Entity\Magazine {#266
    +icon: Proxies\__CG__\App\Entity\Image {#247 …}
    +name: "askelectronics@discuss.tchncs.de"
    +title: "askelectronics"
    +description: """
      **For questions about component-level electronic circuits, tools and equipment.**\n
      \n
      Rules\n
      -----\n
      \n
      1: Be nice.\n
      \n
      2: Be on-topic (eg: *Electronic*, not *electrical*).\n
      \n
      3: No commercial stuff, buying, selling or valuations.\n
      \n
      4: Be safe.\n
      \n
      ---
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 154
    +entryCommentCount: 1230
    +postCount: 1
    +postCommentCount: 4
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729413608 {#276
      date: 2024-10-20 10:40:08.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#238 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
    +entries: Doctrine\ORM\PersistentCollection {#181 …}
    +posts: Doctrine\ORM\PersistentCollection {#139 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
    +bans: Doctrine\ORM\PersistentCollection {#118 …}
    +reports: Doctrine\ORM\PersistentCollection {#104 …}
    +badges: Doctrine\ORM\PersistentCollection {#82 …}
    +logs: Doctrine\ORM\PersistentCollection {#72 …}
    +awards: Doctrine\ORM\PersistentCollection {#61 …}
    +categories: Doctrine\ORM\PersistentCollection {#1820 …}
    -id: 11
    +apId: "askelectronics@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
    +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
    +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "askelectronics"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1727247714 {#270
      date: 2024-09-25 09:01:54.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687144409 {#272
      date: 2023-06-19 05:13:29.0 +02:00
    }
  }
]
Attributes
[]
Component
App\Twig\Components\FeaturedMagazinesComponent {#12340
  +magazine: App\Entity\Magazine {#266
    +icon: Proxies\__CG__\App\Entity\Image {#247 …}
    +name: "askelectronics@discuss.tchncs.de"
    +title: "askelectronics"
    +description: """
      **For questions about component-level electronic circuits, tools and equipment.**\n
      \n
      Rules\n
      -----\n
      \n
      1: Be nice.\n
      \n
      2: Be on-topic (eg: *Electronic*, not *electrical*).\n
      \n
      3: No commercial stuff, buying, selling or valuations.\n
      \n
      4: Be safe.\n
      \n
      ---
      """
    +rules: null
    +subscriptionsCount: 1
    +entryCount: 154
    +entryCommentCount: 1230
    +postCount: 1
    +postCommentCount: 4
    +isAdult: false
    +customCss: null
    +lastActive: DateTime @1729413608 {#276
      date: 2024-10-20 10:40:08.0 +02:00
    }
    +markedForDeletionAt: null
    +tags: null
    +moderators: Doctrine\ORM\PersistentCollection {#238 …}
    +ownershipRequests: Doctrine\ORM\PersistentCollection {#234 …}
    +moderatorRequests: Doctrine\ORM\PersistentCollection {#223 …}
    +entries: Doctrine\ORM\PersistentCollection {#181 …}
    +posts: Doctrine\ORM\PersistentCollection {#139 …}
    +subscriptions: Doctrine\ORM\PersistentCollection {#201 …}
    +bans: Doctrine\ORM\PersistentCollection {#118 …}
    +reports: Doctrine\ORM\PersistentCollection {#104 …}
    +badges: Doctrine\ORM\PersistentCollection {#82 …}
    +logs: Doctrine\ORM\PersistentCollection {#72 …}
    +awards: Doctrine\ORM\PersistentCollection {#61 …}
    +categories: Doctrine\ORM\PersistentCollection {#1820 …}
    -id: 11
    +apId: "askelectronics@discuss.tchncs.de"
    +apProfileId: "https://discuss.tchncs.de/c/askelectronics"
    +apPublicUrl: "https://discuss.tchncs.de/c/askelectronics"
    +apFollowersUrl: "https://discuss.tchncs.de/c/askelectronics/followers"
    +apInboxUrl: "https://discuss.tchncs.de/inbox"
    +apDomain: "discuss.tchncs.de"
    +apPreferredUsername: "askelectronics"
    +apDiscoverable: true
    +apManuallyApprovesFollowers: null
    +privateKey: null
    +publicKey: null
    +apFetchedAt: DateTime @1727247714 {#270
      date: 2024-09-25 09:01:54.0 +02:00
    }
    +apDeletedAt: null
    +apTimeoutAt: null
    +visibility: "visible             "
    +createdAt: DateTimeImmutable @1687144409 {#272
      date: 2023-06-19 05:13:29.0 +02:00
    }
  }
  -twig: Twig\Environment {#1252 …}
  -repository: App\Repository\MagazineRepository {#334 …}
}