# Sketch not saving in Arduino Uno r3

**URL:** <https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367>\
**Category:** General Electronics\
**Created:** [March 8, 2023, 2:42pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367 "2023-03-08T14:42:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![awsafabtahi](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/awsafabtahi/32/929858_2.png) [@awsafabtahi](https://forum.arduino.cc/u/awsafabtahi)\
**Post date:** [March 8, 2023, 2:42pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/1 "2023-03-08T14:42:40Z")

</div>

Hello,

I have uploaded a code to Arduino Uno r3 and it works while it is plugged into my laptop, but when I unplug it and power it using my external power source, the code doesn't work as if it wasn't saved.

Please help me.

---

<div class="post-metadata">

**Author:** ![hiibrarahmad](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/hiibrarahmad/32/929935_2.png) [@hiibrarahmad](https://forum.arduino.cc/u/hiibrarahmad)\
**Post date:** [March 8, 2023, 2:44pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/3 "2023-03-08T14:44:57Z")

</div>

> [@awsafabtahi](#):
>
> Hello,
> 
> I have uploaded a code to Arduino Uno r3 and it works while it is plugged into my laptop, but when I unplug it and power it using my external power source, the code doesn't work as if it wasn't saved.
> 
> Please help me.

It sounds like your Arduino Uno is not properly saving the code to its memory when it's being powered by the external power source. Here are some steps you can try to troubleshoot the issue:

1. Make sure that the external power source you're using is providing enough power to run the Arduino board and any other components connected to it. The recommended voltage range for the Arduino Uno is 7-12V, and it can draw up to 500mA of current.
2. Check that the connections between the Arduino board and the external power source are secure and properly wired. Make sure that the positive and negative terminals of the power source are correctly connected to the Vin and GND pins on the Arduino board, respectively.
3. Check that the power source you're using is capable of delivering a stable voltage and current. If the power source is not regulated or has a high ripple voltage, it may cause the Arduino board to malfunction.
4. Try resetting the Arduino board by briefly shorting the RESET pin to the GND pin using a jumper wire. This will force the board to restart and may help it to properly save the code to its memory.
5. Make sure that the code you're uploading to the Arduino board is error-free and does not contain any syntax errors or logical bugs. You can verify the code by compiling it in the Arduino IDE before uploading it to the board.  
and double-check for connections

If none of these steps work, you may need to replace the Arduino board or seek further assistance from the manufacturer or a technical support forum.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [March 8, 2023, 2:45pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/4 "2023-03-08T14:45:15Z")

</div>

Does it work again immediately you plug it back into USB ?

---

<div class="post-metadata">

**Author:** ![awsafabtahi](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/awsafabtahi/32/929858_2.png) [@awsafabtahi](https://forum.arduino.cc/u/awsafabtahi)\
**Post date:** [March 8, 2023, 2:49pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/5 "2023-03-08T14:49:54Z")

</div>

yes it does

---

<div class="post-metadata">

**Author:** ![awsafabtahi](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/awsafabtahi/32/929858_2.png) [@awsafabtahi](https://forum.arduino.cc/u/awsafabtahi)\
**Post date:** [March 8, 2023, 2:50pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/6 "2023-03-08T14:50:28Z")

</div>

it does

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [March 8, 2023, 2:53pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/7 "2023-03-08T14:53:06Z")

</div>

How exactly do you connect it to your external power source and what voltage does it supply ?

---

<div class="post-metadata">

**Author:** ![awsafabtahi](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/awsafabtahi/32/929858_2.png) [@awsafabtahi](https://forum.arduino.cc/u/awsafabtahi)\
**Post date:** [March 8, 2023, 2:56pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/8 "2023-03-08T14:56:00Z")

</div>

I have mounted a microcontroller(L293D) and connected 4x1.5V batteries to +M and GND. The microcontroller and Arduino turn on (their LEDs) when I turn on the external power source.

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [March 8, 2023, 3:00pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/9 "2023-03-08T15:00:58Z")

</div>

> [@awsafabtahi](#):
>
> a microcontroller(L293D)

The L293D is a motor controller, not a microcontroller. Presumably the +M connection is on the L293D board but where does it connect to on the Arduino ?

---

<div class="post-metadata">

**Author:** ![awsafabtahi](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/awsafabtahi/32/929858_2.png) [@awsafabtahi](https://forum.arduino.cc/u/awsafabtahi)\
**Post date:** [March 8, 2023, 3:06pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/10 "2023-03-08T15:06:31Z")

</div>

My bad, you are correct. I am still very new to this and I'm doing robotics for the first time for a school project. Yes, the +M connection is on the L293D board but I don't know where it connects on the Arduino because I have mounted the male pins under the motor controller on the digital pins and power pins.  
 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/b/5/d/b5df1ac2dc7c7a07003bcab2de8db975ac90aab4.jpeg)

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/6/2/3/623338b46c4673fe803db93e43025188c5a2c832.jpeg)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 4, 2023, 3:06pm UTC](https://forum.arduino.cc/t/sketch-not-saving-in-arduino-uno-r3/1099367/11 "2023-09-04T15:06:53Z")

</div>

Closed on September 4, 2023, 3:06pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
