<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Voltage &amp;mdash; Paul Sutton</title>
    <link>https://personaljournal.ca/paulsutton/tag:Voltage</link>
    <description>Personal Blog</description>
    <pubDate>Tue, 05 May 2026 18:20:49 +0000</pubDate>
    <item>
      <title>Voltage Dividers</title>
      <link>https://personaljournal.ca/paulsutton/voltage-dividers</link>
      <description>&lt;![CDATA[Voltage Dividers&#xA;&#xA;This is a repost, with some python code for a very basic,  (as in it worked when I last ran it)  voltage divider calculator. &#xA;&#xA;A voltage divider is a simple circuit which turns a large voltage into a smaller one. Using just two series resistors and an input voltage, we can create an output voltage that is a fraction of the input. &#xA;&#xA;Voltage dividers are one of the most fundamental circuits in electronics. If learning Ohm&#39;s law was like being introduced to the ABC&#39;s, learning about voltage dividers would be like learning how to spell cat. [1]&#xA;&#xA;Circuit diagram&#xA;&#xA;The formula for a voltage divider is &#xA;&#xA;$$Vout1 ={ R1\over{R1+R2} } \times Vsup $$&#xA;&#xA;and&#xA;&#xA;$$Vout2 ={ R2\over{R1+R2} } \times Vsup $$&#xA;&#xA;At the next STEM group meeting, I plan to have some of my boards available. These can be connected together with either dupont cables or with crocodile clip cables.  Then voltages can be measured with a multimeter. &#xA;&#xA;boards&#xA;&#xA;Links&#xA;&#xA;Sparkfun voltage dividers&#xA;&#xA;Code&#xA;&#xA;I wrote this a while back,  so including the code &#39;as is&#39; below.&#xA;&#xA;!/usr/bin/env python3&#xA;voltage divider calculator&#xA;http://www.ohmslawcalculator.com/voltage-divider-calculator&#xA;&#xA;print(&#34;Voltage Divider Calculator&#34;)&#xA;print(&#34;Version 1.0&#34;)&#xA;print(&#34;By Paul Sutton&#34;)&#xA;print(&#34;zleap@disroot.org&#34;)&#xA;print(&#34;http://www.zleap.net&#34;)&#xA;print&#xA;print(&#34;Formula = Vout = Vin  R2 / R1 + R2&#34;)&#xA;print&#xA;print(&#34;Enter values&#34;)&#xA;supvol = int(input(&#39;Enter Supply Voltage (v): &#39;))&#xA;str(supvol)&#xA;r1 = int(input( &#39;Enter R1 value (Ohms) : &#39; ))&#xA;r2 = int(input( &#39;Enter R2 value (Ohms) : &#39; ))&#xA;print ( &#39;Supply Voltage(V):&#39;, supvol )&#xA;print ( &#39;R1(Ohms : &#39;, r1 )&#xA;print ( &#39;R2(Ohms : &#39;, r2 )&#xA;print(r2 / (r1 + r2))&#xA;mainsum = (r2 / (r1 + r2))&#xA;outvolt = (supvol  mainsum)&#xA;print ( &#39;Output Voltage = :&#39;, outvolt )&#xA;&#xA;This is an improved version by Mark on IRC&#xA;&#xA;!/usr/bin/env python3&#xA;msg = &#34;&#34;&#34;Voltage Divider Calculator (v1.1)&#xA;Formula: Voltage out is &#34;Voltage in  Resistor 2 / Resistor 1 + Resistor 2&#34;&#xA;You entered:&#xA;    Voltage in {voltage}&#xA;    Resistor 1 {resistor1}&#xA;    Resistor 2 {resistor2}&#xA;Which equals:&#xA;    {output}&#xA;Output voltage is: &#34;{output}&#34;, rounded (nearest 10) is &#34;{rounded}&#34;!&#xA;&#34;&#34;&#34;&#xA;error = &#34;&#34;&#34;Usage: python3 {script} voltage in resistor 1 resister 2.&#xA;Example: python3 {script} 5000 2000 4000&#xA;Seeing an Error?&#xA;ValueError: You enter an invalid value (or left it empty).&#xA;&#34;&#34;&#34;&#xA;def main(args):&#xA;    script = args.pop(0)&#xA;    try:&#xA;        voltage, resistor1, resistor2 = list(map(int, args))&#xA;        output = voltage  (resistor2 / (resistor1 + resistor2))&#xA;    except ValueError:&#xA;        print(error.format(script=script))&#xA;        raise&#xA;    print(msg.format(voltage=voltage, resistor1=resistor1,&#xA;                     resistor2=resistor2, output=output,&#xA;                     rounded=round(output)))&#xA;if name == &#39;main&#39;:&#xA;    import sys&#xA;    sys.exit(main(sys.argv))&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Voltage Dividers</p>

<p>This is a repost, with some python code for a very basic,  (as in it worked when I last ran it)  voltage divider calculator.</p>

<pre><code>A voltage divider is a simple circuit which turns a large voltage into a smaller one. Using just two series resistors and an input voltage, we can create an output voltage that is a fraction of the input. 

Voltage dividers are one of the most fundamental circuits in electronics. If learning Ohm&#39;s law was like being introduced to the ABC&#39;s, learning about voltage dividers would be like learning how to spell cat. [1]
</code></pre>

<p><img src="https://git.qoto.org/zleap/documents/-/raw/master/stemgroup/voldiv.png" alt="Circuit diagram"></p>

<p>The formula for a voltage divider is</p>

<p>$$Vout_1 ={ R1\over{R1+R2} } \times Vsup $$</p>

<p>and</p>

<p>$$Vout_2 ={ R2\over{R1+R2} } \times Vsup $$</p>

<p>At the next <a href="https://www.torbaylibraries.org.uk/web/arena/paigntonlibrary" rel="nofollow">STEM group meeting</a>, I plan to have some of my boards available. These can be connected together with either dupont cables or with crocodile clip cables.  Then voltages can be measured with a multimeter.</p>

<p><img src="https://git.qoto.org/zleap/documents/-/raw/master/stemgroup/board1.JPG" alt="boards"></p>

<p><strong>Links</strong></p>
<ol><li><a href="https://learn.sparkfun.com/tutorials/voltage-dividers/all" rel="nofollow">Sparkfun voltage dividers</a></li></ol>

<p><strong>Code</strong></p>

<p>I wrote this a while back,  so including the code &#39;as is&#39; below.</p>

<pre><code>#!/usr/bin/env python3
#voltage divider calculator
# http://www.ohmslawcalculator.com/voltage-divider-calculator

print(&#34;Voltage Divider Calculator&#34;)
print(&#34;Version 1.0&#34;)
print(&#34;By Paul Sutton&#34;)
print(&#34;zleap@disroot.org&#34;)
print(&#34;http://www.zleap.net&#34;)
print
print(&#34;Formula = Vout = Vin * R2 / R1 + R2&#34;)
print
print(&#34;Enter values&#34;)
supvol = int(input(&#39;Enter Supply Voltage (v): &#39;))
#str(supvol)
r1 = int(input( &#39;Enter R1 value (Ohms) : &#39; ))
r2 = int(input( &#39;Enter R2 value (Ohms) : &#39; ))
print ( &#39;Supply Voltage(V):&#39;, supvol )
print ( &#39;R1(Ohms : &#39;, r1 )
print ( &#39;R2(Ohms : &#39;, r2 )
#print(r2 / (r1 + r2))
mainsum = (r2 / (r1 + r2))
outvolt = (supvol * mainsum)
print ( &#39;Output Voltage = :&#39;, outvolt )
</code></pre>

<p>This is an improved version by Mark on IRC</p>

<pre><code>#!/usr/bin/env python3
msg = &#34;&#34;&#34;Voltage Divider Calculator (v1.1)
Formula: Voltage out is &#34;Voltage in * Resistor 2 / Resistor 1 + Resistor 2&#34;
You entered:
    Voltage in {voltage}
    Resistor 1 {resistor1}
    Resistor 2 {resistor2}
Which equals:
    {output}
Output voltage is: &#34;{output}&#34;, rounded (nearest 10) is &#34;{rounded}&#34;!
&#34;&#34;&#34;
error = &#34;&#34;&#34;Usage: python3 {script} &lt;voltage in&gt; &lt;resistor 1&gt; &lt;resister 2&gt;.
Example: python3 {script} 5000 2000 4000
Seeing an Error?
ValueError: You enter an invalid value (or left it empty).
&#34;&#34;&#34;
def main(args):
    script = args.pop(0)
    try:
        voltage, resistor1, resistor2 = list(map(int, args))
        output = voltage * (resistor2 / (resistor1 + resistor2))
    except ValueError:
        print(error.format(script=script))
        raise
    print(msg.format(voltage=voltage, resistor1=resistor1,
                     resistor2=resistor2, output=output,
                     rounded=round(output)))
if __name__ == &#39;__main__&#39;:
    import sys
    sys.exit(main(sys.argv))

</code></pre>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/voltage-dividers</guid>
      <pubDate>Sun, 24 Apr 2022 06:30:00 +0000</pubDate>
    </item>
    <item>
      <title>Transistor Amplifier</title>
      <link>https://personaljournal.ca/paulsutton/transistor-amplifier</link>
      <description>&lt;![CDATA[Transistor Amplifier&#xA;&#xA;I have finished building a transistor Amplifier.  This is in preparation for the next STEM group meeting, on April 9th. &#xA;&#xA;trans amp&#xA;&#xA;As this contains a voltage divider,  I have also built a few more resistor boards, with the view of presenting an activity around this.&#xA;&#xA;resistor board&#xA;&#xA;Links&#xA;&#xA;Paignton Library STEM Group&#xA;Discourse Discussion&#xA;Tuxiversity&#xA;Science Forums&#xA;Preproom&#xA;Qoto Mastodon&#xA;Social coding&#xA;Science Daily&#xA;&#xA;TAGS&#xA;&#xA;#Technology,#STEM,#Amplifier,#Voltage,#Divider,#STEMGroup.&#xA;&#xA;img src=&#34;https://socialhub.activitypub.rocks/uploads/default/original/2X/d/dd8ee2842d572bad100cde42f7c98232e69ea9f7.png&#34; target=&#34;_blank&#34; &#xA;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xA;&#xA;a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-sa/4.0/&#34;img alt=&#34;Creative Commons Licence&#34; style=&#34;border-width:0&#34; src=&#34;https://i.creativecommons.org/l/by-sa/4.0/88x31.png&#34; //abr /This work is licensed under a a rel=&#34;license&#34; href=&#34;http://creativecommons.org/licenses/by-sa/4.0/&#34;Creative Commons Attribution-ShareAlike 4.0 International License/a&#xA;&#xA;hr&#xD;&#xA;&#xD;&#xA;table&#xD;&#xA;thead&#xD;&#xA;trtda rel=&#34;me&#34; href=&#34;https://qoto.org/@zleap&#34;Mastodon/a/td&#xD;&#xA;tda href=&#34;https://wiki.ircnow.org/?n=Shelllabs.Intro&#34;ShellLabs/td&#xD;&#xA;tda href=&#34;https://joinmastodon.org/&#34;Join Mastodon/a/td/tr/thead/table&#xD;&#xA;center&#xD;&#xA;AI statement : b Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. /b&#xD;&#xA;/center&#xD;&#xA;&#xD;&#xA;a href=&#34;https://liberapay.com/PaulSutton/donate&#34;img alt=&#34;Donate using Liberapay&#34; src=&#34;https://liberapay.com/assets/widgets/donate.svg&#34;/a&#xD;&#xA;]]&gt;</description>
      <content:encoded><![CDATA[<p>Transistor Amplifier</p>

<p>I have finished building a transistor Amplifier.  This is in preparation for the next STEM group meeting, on April 9th.</p>

<p><img src="https://git.qoto.org/zleap/documents/-/raw/master/stemgroup/transistoramp1.JPG" alt="trans amp"></p>

<p>As this contains a voltage divider,  I have also built a few more resistor boards, with the view of presenting an activity around this.</p>

<p><img src="https://git.qoto.org/zleap/documents/-/raw/master/stemgroup/board1.JPG" alt="resistor board"></p>

<p><strong>Links</strong></p>
<ul><li><a href="https://personaljournal.ca/paigntonlibrarystemgroup/" rel="nofollow">Paignton Library STEM Group</a></li>
<li><a href="https://discourse.qoto.org/" rel="nofollow">Discourse Discussion</a></li>
<li><a href="https://forum.tuxiversity.org/" rel="nofollow">Tuxiversity</a></li>
<li><a href="https://www.scienceforums.net/" rel="nofollow">Science Forums</a></li>
<li><a href="https://www.preproom.org/" rel="nofollow">Preproom</a></li>
<li><a href="https://www.qoto.org" rel="nofollow">Qoto Mastodon</a></li>
<li><a href="https://coding.social/" rel="nofollow">Social coding</a></li>
<li><a href="https://www.sciencedaily.com" rel="nofollow">Science Daily</a></li></ul>

<p><strong>TAGS</strong></p>

<p><a href="/paulsutton/tag:Technology" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Technology</span></a>,<a href="/paulsutton/tag:STEM" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">STEM</span></a>,<a href="/paulsutton/tag:Amplifier" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Amplifier</span></a>,<a href="/paulsutton/tag:Voltage" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Voltage</span></a>,<a href="/paulsutton/tag:Divider" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Divider</span></a>,<a href="/paulsutton/tag:STEMGroup" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">STEMGroup</span></a>.</p>

<p><a href="https://torresjrjr.com/archive/2020-07-19-guide-to-the-fediverse" rel="nofollow"><img src="https://socialhub.activitypub.rocks/uploads/default/original/2X/d/dd8ee2842d572bad100cde42f7c98232e69ea9f7.png"></a></p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>

<p><a href="http://creativecommons.org/licenses/by-sa/4.0/" rel="nofollow"><img alt="Creative Commons Licence" style="border-width:0" src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png"/></a><br/>This work is licensed under a <a href="http://creativecommons.org/licenses/by-sa/4.0/" rel="nofollow">Creative Commons Attribution-ShareAlike 4.0 International License</a></p>

<hr>

<p><table>
<thead>
<tr><td><a href="https://qoto.org/@zleap" rel="nofollow">Mastodon</a></td>
<td><a href="https://wiki.ircnow.org/?n=Shelllabs.Intro" rel="nofollow">ShellLabs</td>
<td><a href="https://joinmastodon.org/" rel="nofollow">Join Mastodon</a></td></tr></thead></table>

AI statement : <b> Consent is NOT granted to use the content of this blog for the purposes of AI training or similar activity.  Consent CANNOT be assumed, it has to be granted. </b>
</p>

<p><a href="https://liberapay.com/PaulSutton/donate" rel="nofollow"><img alt="Donate using Liberapay" src="https://liberapay.com/assets/widgets/donate.svg"></a></p>
]]></content:encoded>
      <guid>https://personaljournal.ca/paulsutton/transistor-amplifier</guid>
      <pubDate>Tue, 29 Mar 2022 06:30:00 +0000</pubDate>
    </item>
  </channel>
</rss>