| 1 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
| 2 |
DENIED
|
moderate
|
Proxies\__CG__\App\Entity\Entry {#1582
+user: Proxies\__CG__\App\Entity\User {#2463 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#2448 …}
+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
\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
\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
\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 {#1722
date: 2023-09-15 14:30:42.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#2459 …}
+votes: Doctrine\ORM\PersistentCollection {#2457 …}
+reports: Doctrine\ORM\PersistentCollection {#1561 …}
+favourites: Doctrine\ORM\PersistentCollection {#2385 …}
+notifications: Doctrine\ORM\PersistentCollection {#2372 …}
+badges: Doctrine\ORM\PersistentCollection {#1907 …}
+children: [
App\Entity\EntryComment {#1606
+user: App\Entity\User {#265 …}
+entry: Proxies\__CG__\App\Entity\Entry {#1582 …2}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+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 {#1428
date: 2023-08-25 13:55:19.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@nilclass@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#1572 …}
+nested: Doctrine\ORM\PersistentCollection {#1581 …}
+votes: Doctrine\ORM\PersistentCollection {#1579 …}
+reports: Doctrine\ORM\PersistentCollection {#1577 …}
+favourites: Doctrine\ORM\PersistentCollection {#1573 …}
+notifications: Doctrine\ORM\PersistentCollection {#1650 …}
-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 {#1440
date: 2023-08-25 09:44:06.0 +02:00
}
+createdAt: DateTimeImmutable @1692949313 {#1434
date: 2023-08-25 09:41:53.0 +02:00
}
+"title": 26778
}
]
-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 {#1698
date: 2023-08-25 09:07:12.0 +02:00
}
+createdAt: DateTimeImmutable @1692947137 {#1732
date: 2023-08-25 09:05:37.0 +02:00
}
+__isInitialized__: true
…2
} |
|
Show voter details
|
| 3 |
DENIED
|
edit
|
Proxies\__CG__\App\Entity\Entry {#1582
+user: Proxies\__CG__\App\Entity\User {#2463 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#2448 …}
+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
\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
\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
\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 {#1722
date: 2023-09-15 14:30:42.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#2459 …}
+votes: Doctrine\ORM\PersistentCollection {#2457 …}
+reports: Doctrine\ORM\PersistentCollection {#1561 …}
+favourites: Doctrine\ORM\PersistentCollection {#2385 …}
+notifications: Doctrine\ORM\PersistentCollection {#2372 …}
+badges: Doctrine\ORM\PersistentCollection {#1907 …}
+children: [
App\Entity\EntryComment {#1606
+user: App\Entity\User {#265 …}
+entry: Proxies\__CG__\App\Entity\Entry {#1582 …2}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+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 {#1428
date: 2023-08-25 13:55:19.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@nilclass@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#1572 …}
+nested: Doctrine\ORM\PersistentCollection {#1581 …}
+votes: Doctrine\ORM\PersistentCollection {#1579 …}
+reports: Doctrine\ORM\PersistentCollection {#1577 …}
+favourites: Doctrine\ORM\PersistentCollection {#1573 …}
+notifications: Doctrine\ORM\PersistentCollection {#1650 …}
-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 {#1440
date: 2023-08-25 09:44:06.0 +02:00
}
+createdAt: DateTimeImmutable @1692949313 {#1434
date: 2023-08-25 09:41:53.0 +02:00
}
+"title": 26778
}
]
-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 {#1698
date: 2023-08-25 09:07:12.0 +02:00
}
+createdAt: DateTimeImmutable @1692947137 {#1732
date: 2023-08-25 09:05:37.0 +02:00
}
+__isInitialized__: true
…2
} |
|
Show voter details
|
| 4 |
DENIED
|
moderate
|
Proxies\__CG__\App\Entity\Entry {#1582
+user: Proxies\__CG__\App\Entity\User {#2463 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#2448 …}
+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
\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
\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
\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 {#1722
date: 2023-09-15 14:30:42.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#2459 …}
+votes: Doctrine\ORM\PersistentCollection {#2457 …}
+reports: Doctrine\ORM\PersistentCollection {#1561 …}
+favourites: Doctrine\ORM\PersistentCollection {#2385 …}
+notifications: Doctrine\ORM\PersistentCollection {#2372 …}
+badges: Doctrine\ORM\PersistentCollection {#1907 …}
+children: [
App\Entity\EntryComment {#1606
+user: App\Entity\User {#265 …}
+entry: Proxies\__CG__\App\Entity\Entry {#1582 …2}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+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 {#1428
date: 2023-08-25 13:55:19.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@nilclass@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#1572 …}
+nested: Doctrine\ORM\PersistentCollection {#1581 …}
+votes: Doctrine\ORM\PersistentCollection {#1579 …}
+reports: Doctrine\ORM\PersistentCollection {#1577 …}
+favourites: Doctrine\ORM\PersistentCollection {#1573 …}
+notifications: Doctrine\ORM\PersistentCollection {#1650 …}
-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 {#1440
date: 2023-08-25 09:44:06.0 +02:00
}
+createdAt: DateTimeImmutable @1692949313 {#1434
date: 2023-08-25 09:41:53.0 +02:00
}
+"title": 26778
}
]
-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 {#1698
date: 2023-08-25 09:07:12.0 +02:00
}
+createdAt: DateTimeImmutable @1692947137 {#1732
date: 2023-08-25 09:05:37.0 +02:00
}
+__isInitialized__: true
…2
} |
|
Show voter details
|
| 5 |
DENIED
|
ROLE_USER
|
null |
|
Show voter details
|
| 6 |
DENIED
|
moderate
|
App\Entity\EntryComment {#1606
+user: App\Entity\User {#265 …}
+entry: Proxies\__CG__\App\Entity\Entry {#1582
+user: Proxies\__CG__\App\Entity\User {#2463 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#2448 …}
+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
\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
\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
\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 {#1722
date: 2023-09-15 14:30:42.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#2459 …}
+votes: Doctrine\ORM\PersistentCollection {#2457 …}
+reports: Doctrine\ORM\PersistentCollection {#1561 …}
+favourites: Doctrine\ORM\PersistentCollection {#2385 …}
+notifications: Doctrine\ORM\PersistentCollection {#2372 …}
+badges: Doctrine\ORM\PersistentCollection {#1907 …}
+children: [
App\Entity\EntryComment {#1606}
]
-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 {#1698
date: 2023-08-25 09:07:12.0 +02:00
}
+createdAt: DateTimeImmutable @1692947137 {#1732
date: 2023-08-25 09:05:37.0 +02:00
}
+__isInitialized__: true
…2
}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+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 {#1428
date: 2023-08-25 13:55:19.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@nilclass@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#1572 …}
+nested: Doctrine\ORM\PersistentCollection {#1581 …}
+votes: Doctrine\ORM\PersistentCollection {#1579 …}
+reports: Doctrine\ORM\PersistentCollection {#1577 …}
+favourites: Doctrine\ORM\PersistentCollection {#1573 …}
+notifications: Doctrine\ORM\PersistentCollection {#1650 …}
-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 {#1440
date: 2023-08-25 09:44:06.0 +02:00
}
+createdAt: DateTimeImmutable @1692949313 {#1434
date: 2023-08-25 09:41:53.0 +02:00
}
+"title": 26778
} |
|
Show voter details
|
| 7 |
DENIED
|
edit
|
App\Entity\EntryComment {#1606
+user: App\Entity\User {#265 …}
+entry: Proxies\__CG__\App\Entity\Entry {#1582
+user: Proxies\__CG__\App\Entity\User {#2463 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#2448 …}
+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
\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
\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
\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 {#1722
date: 2023-09-15 14:30:42.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#2459 …}
+votes: Doctrine\ORM\PersistentCollection {#2457 …}
+reports: Doctrine\ORM\PersistentCollection {#1561 …}
+favourites: Doctrine\ORM\PersistentCollection {#2385 …}
+notifications: Doctrine\ORM\PersistentCollection {#2372 …}
+badges: Doctrine\ORM\PersistentCollection {#1907 …}
+children: [
App\Entity\EntryComment {#1606}
]
-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 {#1698
date: 2023-08-25 09:07:12.0 +02:00
}
+createdAt: DateTimeImmutable @1692947137 {#1732
date: 2023-08-25 09:05:37.0 +02:00
}
+__isInitialized__: true
…2
}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+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 {#1428
date: 2023-08-25 13:55:19.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@nilclass@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#1572 …}
+nested: Doctrine\ORM\PersistentCollection {#1581 …}
+votes: Doctrine\ORM\PersistentCollection {#1579 …}
+reports: Doctrine\ORM\PersistentCollection {#1577 …}
+favourites: Doctrine\ORM\PersistentCollection {#1573 …}
+notifications: Doctrine\ORM\PersistentCollection {#1650 …}
-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 {#1440
date: 2023-08-25 09:44:06.0 +02:00
}
+createdAt: DateTimeImmutable @1692949313 {#1434
date: 2023-08-25 09:41:53.0 +02:00
}
+"title": 26778
} |
|
Show voter details
|
| 8 |
DENIED
|
moderate
|
App\Entity\EntryComment {#1606
+user: App\Entity\User {#265 …}
+entry: Proxies\__CG__\App\Entity\Entry {#1582
+user: Proxies\__CG__\App\Entity\User {#2463 …}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+image: null
+domain: Proxies\__CG__\App\Entity\Domain {#2448 …}
+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
\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
\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
\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 {#1722
date: 2023-09-15 14:30:42.0 +02:00
}
+ip: null
+adaAmount: 0
+tags: null
+mentions: null
+comments: Doctrine\ORM\PersistentCollection {#2459 …}
+votes: Doctrine\ORM\PersistentCollection {#2457 …}
+reports: Doctrine\ORM\PersistentCollection {#1561 …}
+favourites: Doctrine\ORM\PersistentCollection {#2385 …}
+notifications: Doctrine\ORM\PersistentCollection {#2372 …}
+badges: Doctrine\ORM\PersistentCollection {#1907 …}
+children: [
App\Entity\EntryComment {#1606}
]
-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 {#1698
date: 2023-08-25 09:07:12.0 +02:00
}
+createdAt: DateTimeImmutable @1692947137 {#1732
date: 2023-08-25 09:05:37.0 +02:00
}
+__isInitialized__: true
…2
}
+magazine: Proxies\__CG__\App\Entity\Magazine {#1574 …}
+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 {#1428
date: 2023-08-25 13:55:19.0 +02:00
}
+ip: null
+tags: null
+mentions: [
"@nilclass@discuss.tchncs.de"
]
+children: Doctrine\ORM\PersistentCollection {#1572 …}
+nested: Doctrine\ORM\PersistentCollection {#1581 …}
+votes: Doctrine\ORM\PersistentCollection {#1579 …}
+reports: Doctrine\ORM\PersistentCollection {#1577 …}
+favourites: Doctrine\ORM\PersistentCollection {#1573 …}
+notifications: Doctrine\ORM\PersistentCollection {#1650 …}
-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 {#1440
date: 2023-08-25 09:44:06.0 +02:00
}
+createdAt: DateTimeImmutable @1692949313 {#1434
date: 2023-08-25 09:41:53.0 +02:00
}
+"title": 26778
} |
|
Show voter details
|
| 9 |
DENIED
|
ROLE_ADMIN
|
null |
|
Show voter details
|
| 10 |
DENIED
|
ROLE_MODERATOR
|
null |
|
Show voter details
|