<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://baszerr.eu/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>BaSzErr - blog:2024:01:15</title>
        <description></description>
        <link>https://baszerr.eu/</link>
        <lastBuildDate>Sun, 26 Apr 2026 13:31:41 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>https://baszerr.eu/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
            <title>BaSzErr</title>
            <link>https://baszerr.eu/</link>
        </image>
        <item>
            <title>2024-01-15_-_the_button_story</title>
            <link>https://baszerr.eu/doku.php?id=blog:2024:01:15:2024-01-15_-_the_button_story</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;the_button_story&quot;&gt;2024-01-15 - the button story&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
a couple of days ago i finally received by new PCBs for &lt;a href=&quot;https://github.com/el-bart/lemurs_bobik&quot; class=&quot;urlextern&quot; title=&quot;https://github.com/el-bart/lemurs_bobik&quot; rel=&quot;ugc nofollow&quot;&gt;Lemur&amp;#039;s bobik&lt;/a&gt; project. that&amp;#039;s an &lt;a href=&quot;https://baszerr.eu/doku.php?id=blog:2022:07:10:2022-07-10_-_lemur_s_bobik&quot; class=&quot;wikilink1&quot; title=&quot;blog:2022:07:10:2022-07-10_-_lemur_s_bobik&quot; data-wiki-id=&quot;blog:2022:07:10:2022-07-10_-_lemur_s_bobik&quot;&gt;old one, that started as a COVID-time project&lt;/a&gt; – started in 2020, when COVID hit, but final touches were done only in 2022. the new (2023/2024) incarnation did not have old restrictions, so i (finally) went for all-SMD, even though i kept the original PCB size, so that i do not need to re-print the entire enclosure, just to mount the thing. ;)
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://baszerr.eu/lib/exe/detail.php?id=blog%3A2024%3A01%3A15%3A2024-01-15_-_the_button_story&amp;amp;media=blog:2024:01:15:pcb.jpg&quot; class=&quot;media&quot; title=&quot;blog:2024:01:15:pcb.jpg&quot;&gt;&lt;img src=&quot;https://baszerr.eu/lib/exe/fetch.php?w=400&amp;amp;tok=cd6f72&amp;amp;media=blog:2024:01:15:pcb.jpg&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;PCB v2.1&quot; alt=&quot;PCB v2.1&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
over the weekend i&amp;#039;ve assembled the whole thing. since buttons are located on the separate board, and there&amp;#039;s nothing more there, i&amp;#039;ve kept the original (home made) PCB for that. whole thing is now powered with 6S LiPo batter pack, so that steppers (finally) have the voltage they like. ;)
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://baszerr.eu/lib/exe/detail.php?id=blog%3A2024%3A01%3A15%3A2024-01-15_-_the_button_story&amp;amp;media=blog:2024:01:15:ready_top.jpg&quot; class=&quot;media&quot; title=&quot;blog:2024:01:15:ready_top.jpg&quot;&gt;&lt;img src=&quot;https://baszerr.eu/lib/exe/fetch.php?w=400&amp;amp;tok=a076cb&amp;amp;media=blog:2024:01:15:ready_top.jpg&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;whole electronics assembled&quot; alt=&quot;whole electronics assembled&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
however the new PCB change 1 important thing, related to buttons. PCB is in shutdown mode, unless a button is pressed. if so, µC keeps PCB awake for 2mins. if there&amp;#039;s no button press, it will power itself off again.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://baszerr.eu/lib/exe/detail.php?id=blog%3A2024%3A01%3A15%3A2024-01-15_-_the_button_story&amp;amp;media=blog:2024:01:15:pcb_buttons.png&quot; class=&quot;media&quot; title=&quot;blog:2024:01:15:pcb_buttons.png&quot;&gt;&lt;img src=&quot;https://baszerr.eu/lib/exe/fetch.php?media=blog:2024:01:15:pcb_buttons.png&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;PCB schematics - buttons part&quot; alt=&quot;PCB schematics - buttons part&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
on the schematics, power is provided from 6S LiPo cell to U5 voltage stabilizer, through Q1 P-MOSFET transistor. the gimmick is that stabilizer is powering on µC only, if one of the buttons is pressed or when Q3 N-MOSFET is opened. so the SW path goes like this – each button press auto-powers-on U5 and thus µC (+LED ;)), and when µC is up, it immediately opens Q3, so that power is preserved, even if button is released. on top of that D7 &lt;a href=&quot;https://en.wikipedia.org/wiki/zener diode&quot; class=&quot;interwiki iw_wp&quot; title=&quot;https://en.wikipedia.org/wiki/zener diode&quot;&gt;zener diode&lt;/a&gt; is used to ensure that Q1&amp;#039;s source-gate voltage is never breached, even if &amp;gt;1 button is pressed. additional D2-D6 diodes are there to protect µC&amp;#039;s I/O pins from ~22V voltage, when buttons are release (i.e. circuit is opened).
&lt;/p&gt;

&lt;p&gt;
so far, so good. the problem is that after this change, my original code for reading button presses became super noise and started to report a lot of false readings (or – mostly no read at all). took me a moment to realize, i need a better de-noising algo for reading it, as new setup is now R+C circuit.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;https://baszerr.eu/lib/exe/detail.php?id=blog%3A2024%3A01%3A15%3A2024-01-15_-_the_button_story&amp;amp;media=blog:2024:01:15:pcb_keys.png&quot; class=&quot;media&quot; title=&quot;blog:2024:01:15:pcb_keys.png&quot;&gt;&lt;img src=&quot;https://baszerr.eu/lib/exe/fetch.php?media=blog:2024:01:15:pcb_keys.png&quot; class=&quot;media&quot; loading=&quot;lazy&quot; title=&quot;PCB with keys -- one key and de-noising cap&quot; alt=&quot;PCB with keys -- one key and de-noising cap&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
C is there to short-circuit mechanical switches, on PCB. but C5 + R15 makes rising edge a bit slower than before, where C5 + key was directly connected to I/O pin!
&lt;/p&gt;

&lt;p&gt;
fast forward 2h+. with ~3 iterations of in-SW noise-removal algo, it works much better… yet far from perfect. today i was desperate enough to connect oscilloscope to see what&amp;#039;s going on… and guess what – turned out that “forward” and “start” buttons were completely trashed and did not react to ~1/2 of presses! when pressed, it also tend to generate noisy output. well… in a hindsight this toy has been heavily abused by my sons for ~3 years now – failing mechanical button shall not be a surprise…
&lt;/p&gt;

&lt;p&gt;
after replacing all 5 buttons (just to be on a safe side), it all now works like a charm! lessons learned – while guessing is fun, when in doubt – just measure…
&lt;/p&gt;

&lt;/div&gt;
</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Mon, 15 Jan 2024 20:22:26 +0000</pubDate>
        </item>
    </channel>
</rss>
