<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Nano boot power difference - Arduino				            </title>
            <link>https://forum.dronebotworkshop.com/arduino/nano-boot-power-difference/</link>
            <description>Discussion board for Robotics, Arduino, Raspberry Pi and other DIY electronics and modules. Join us today!</description>
            <language>en-US</language>
            <lastBuildDate>Sun, 10 May 2026 13:50:36 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Nano boot power difference</title>
                        <link>https://forum.dronebotworkshop.com/arduino/nano-boot-power-difference/#post-50554</link>
                        <pubDate>Fri, 31 Jan 2025 02:39:50 +0000</pubDate>
                        <description><![CDATA[@tfmccarthy Normally it doesn&#039;t make any difference, but I always turn on the auxiliary power first anyway, however in this case it was mandatory. Lesson learned and your diagnostic skills a...]]></description>
                        <content:encoded><![CDATA[<p>@<span>tfmccarthy Normally it doesn't make any difference, but I always turn on the auxiliary power first anyway, however in this case it was mandatory. Lesson learned and your diagnostic skills are functioning well.</span></p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/arduino/">Arduino</category>                        <dc:creator>Ron</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/arduino/nano-boot-power-difference/#post-50554</guid>
                    </item>
				                    <item>
                        <title>Nano boot power difference</title>
                        <link>https://forum.dronebotworkshop.com/arduino/nano-boot-power-difference/#post-50552</link>
                        <pubDate>Fri, 31 Jan 2025 02:04:18 +0000</pubDate>
                        <description><![CDATA[This is not a &quot;Gotcha&quot; question or anything like that. I want to know how I missed the issue the first time around and check my diagnostic skills. I wondered if this is a well known issue wh...]]></description>
                        <content:encoded><![CDATA[<p>This is not a "Gotcha" question or anything like that. I want to know how I missed the issue the first time around and check my diagnostic skills. I wondered if this is a well known issue which I've not encountered so far. (Note: It is difficult to formulate the question without giving away my answer.)</p>
<p><br />I encountered this issue after going through the process of assembling the LK Cokoino 4DOF Robot arm. The final step in the process is to upload the robot control sketch. That's when I encountered the issue.</p>
<p>Here's the question: </p>
<p>Given the circuit</p>
10105
<p>Question: Should the external power supply be ON or OFF when the USB cable is connected? Does it matter?</p>
<p>There is a note in the "Lesson 6 - Assembly the Robot" instructions (emphasis mine)</p>
<blockquote>
<h2>2.Adjust the angle of 4 servos to 90 degrees</h2>
<p>2.1 Please connect the 4 servos, the nano board, nano shield, and battery case with two 18650 batteries together, as shown in the figure below, <strong><em>and then connect them to the PC via a mini USB cable.</em></strong></p>
<p><span class="auto-style2">NOTE</span>:</p>
<p class="auto-style2">Servo 1, 2, 3, 4 are connected to Pin4, 5, 6, 7 of shield respectively Make sure your two 18650 batteries have enough power.</p>
<p class="auto-style2"><em><strong>Turn on the power switch of the shield since the current provided by the usb is not enough to drive the servos</strong></em></p>
</blockquote>
<p>I adjusted the servos angles using a servo tester rather than connect them to the Nano. Thus, I didn't encounter the issue until I uploaded the control sketch. But I noted the order as unremarkable: USB then power supply ON.</p>
<p>When I did upload the control sketch to the Nano from the USB, both the HAT power switch and the power supply are OFF.</p>
<p>The result was unexpected behavior: the buzzer sounded and wouldn't stop.</p>
<p>It took a considerable amount of time to diagnose and verify the cause of the symptom and the actual problem. I verified it's not a wiring problem and that the code is fragile but has no error, i.e., the code behavior is a symptom of, but not the problem.</p>
<h2>SPOILER AHEAD</h2>
<h2>Diagnostics</h2>
<p>When I examined the buzzer code I found</p>
<pre contenteditable="false">void buzzer(int H,int L){
  while(yR&lt;420){
    digitalWrite(buzzerPin,HIGH);
    delayMicroseconds(H);
    digitalWrite(buzzerPin,LOW);
    delayMicroseconds(L);
    yR = arm.JoyStickR.read_y();
    }
  while(yR&gt;600){
    digitalWrite(buzzerPin,HIGH);
    delayMicroseconds(H);
    digitalWrite(buzzerPin,LOW);
    delayMicroseconds(L);
    yR = arm.JoyStickR.read_y();
    }
}
</pre>
<p>Since I wasn't touching the joysticks, it was the state of the joysticks at boot time that was causing the buzzer to sound. The joystick was tested (and passed) in a previous step, so I went back and re-examined the results and that's when I discovered that the joystick positions never reached their maximum value and their "centered" values were lower than the midpoint. The wiring diagram for the joystick test was</p>
10106
<p>Of course, I followed this exactly, so the circuit was powered by the USB. At the time of the test, I noted the changing values but not the range of the values. Mea culpa.<br />Thus the code was reading the center position as a recording movement and repeatedly sounding the buzzer.</p>
<p><br />When I did notice the range error, I changed the power source to the bench power supply and the full range came through.</p>
<p><br />From that it became apparent that the Nano needed to be powered from the external power supply instead of the USB; thus, the power should be ON before the USB is connected.<br />When I did this the buzzer stopped and the arm operated as intended (but unsatisfactorily.)</p>
<p>I'm honestly not sure if I should have known this or not but I certainly do now.</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/arduino/">Arduino</category>                        <dc:creator>TFMcCarthy</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/arduino/nano-boot-power-difference/#post-50552</guid>
                    </item>
							        </channel>
        </rss>
		