<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Arduino Archives - CyberBlogSpot</title>
	<atom:link href="https://cyberblogspot.com/category/arduino/feed/" rel="self" type="application/rss+xml" />
	<link>https://cyberblogspot.com/category/arduino/</link>
	<description>Not just another blogspot site</description>
	<lastBuildDate>Mon, 20 Feb 2023 03:48:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>

<image>
	<url>https://cyberblogspot.com/wp-content/uploads/2018/08/cropped-iphone-iphone3gs-32x32.jpg</url>
	<title>Arduino Archives - CyberBlogSpot</title>
	<link>https://cyberblogspot.com/category/arduino/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Use ESP-01 Wi-Fi Relay Module</title>
		<link>https://cyberblogspot.com/how-to-use-esp-01-wi-fi-relay-module/</link>
					<comments>https://cyberblogspot.com/how-to-use-esp-01-wi-fi-relay-module/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 15 Feb 2023 10:13:18 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ESP-01]]></category>
		<category><![CDATA[ESP-01 Module]]></category>
		<category><![CDATA[ESP-01 Programmer]]></category>
		<category><![CDATA[ESP-01 Relay]]></category>
		<category><![CDATA[ESP-01 Relay Module]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[ESP8266 Controller App]]></category>
		<category><![CDATA[ESPlorer IDE]]></category>
		<category><![CDATA[ESPlorer Integrated Development Environment]]></category>
		<category><![CDATA[Lua]]></category>
		<category><![CDATA[MIT App Inventor]]></category>
		<category><![CDATA[NodeMCU]]></category>
		<category><![CDATA[NodeMCU Firmware]]></category>
		<category><![CDATA[NodeMCU Flasher]]></category>
		<category><![CDATA[Smartphone]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=6181</guid>

					<description><![CDATA[<p>The ESP-01 Wi-Fi module shown in Figure 1 is a widely known member of the ESP8266 microcontroller board family. Because of its low cost and small size, it is usually used for applications where only a few GPIOs (General Purpose Input / Output) are needed. One such application is the ESP-01 Wi-Fi Relay Module shown&#8230;&#160;<a href="https://cyberblogspot.com/how-to-use-esp-01-wi-fi-relay-module/" rel="bookmark">Read More &#187;<span class="screen-reader-text">How to Use ESP-01 Wi-Fi Relay Module</span></a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-use-esp-01-wi-fi-relay-module/">How to Use ESP-01 Wi-Fi Relay Module</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The ESP-01 Wi-Fi module shown in Figure 1 is a widely known member of the <a href="https://en.wikipedia.org/wiki/ESP8266" target="_blank" rel="noreferrer noopener">ESP8266</a> microcontroller board family.  Because of its low cost and small size, it is usually used for applications where only a few GPIOs (General Purpose Input / Output) are needed.  One such application is the ESP-01 Wi-Fi Relay Module shown in Figure 2.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-text-align-center">Did you know that there are two (2) versions of ESP-01 Wi-Fi modules? Check out the article:<br><a href="https://cyberblogspot.com/difference-between-esp-01-and-esp-01s/" target="_blank" rel="noreferrer noopener">Difference Between ESP-01 and ESP-01S</a></p>
</blockquote>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-module-400x350-1-jpg.webp"><img fetchpriority="high" decoding="async" width="402" height="352" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-module-400x350-1-jpg.webp" alt="A picture of an ESP-01 Wi-Fi module used as a microcontroller for the ESP-01 Wi-Fi relay module." class="wp-image-6183" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-module-400x350-1-jpg.webp 402w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-module-400x350-1-300x263.webp 300w" sizes="(max-width: 402px) 100vw, 402px" /></a><figcaption class="wp-element-caption">Figure 1.  ESP-01 ESP8266 Wi-Fi Module</figcaption></figure></div>


<p>The ESP-01 Wi-Fi relay module is used as a smart switch for remotely turning on and off any device connected to it.  A pre-programmed ESP-01 module is inserted into the relay module to serve as a microcontroller for the relay.  The attached ESP-01 module also provides the Wi-Fi capability to the relay module to enable a computer or a smartphone to control the relay module remotely or wirelessly.     </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-no-esp-01-440-jpg.webp"><img decoding="async" width="442" height="352" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-no-esp-01-440-jpg.webp" alt="Picture of an ESP-01 Wi-Fi relay module without the ESP-01 module." class="wp-image-6184" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-no-esp-01-440-jpg.webp 442w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-no-esp-01-440-300x239.webp 300w" sizes="(max-width: 442px) 100vw, 442px" /></a><figcaption class="wp-element-caption">Figure 2.  ESP-01 Wi-Fi Relay Module</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-400-jpg.webp"><img decoding="async" width="402" height="352" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-400-jpg.webp" alt="Picture showing the ESP-01 Wi-Fi relay module with the ESP-01 module." class="wp-image-6182" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-400-jpg.webp 402w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-400-300x263.webp 300w" sizes="(max-width: 402px) 100vw, 402px" /></a><figcaption class="wp-element-caption">Figure 3.  ESP-01 Wi-Fi Relay Module with ESP-01 Module</figcaption></figure></div>


<h2 class="wp-block-heading">ESP-01 Module Programmer</h2>



<p class="has-text-align-left">In order to use the ESP-01 Wi-Fi relay module, a programmer is needed to program the ESP-01 module.  An example of an ESP-01 programmer is shown in Figure 3.  If you do not a have an ESP-01 programmer module, you can make one if you have a USB-to-serial converter.  Or simply use an Arduino board as an ESP-01 programmer if you have an available Arduino board.  For details on how to make a DIY ESP-01 programmer, see the article:<a href="https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/" target="_blank" rel="noreferrer noopener"> ESP-01 and ESP-01S Pinout and Configuration</a> </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-programmer-400-jpg.webp"><img loading="lazy" decoding="async" width="402" height="295" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-programmer-400-jpg.webp" alt="Picture of an ESP-01 programmer module for use in pre-programming an ESP-01 module to be used on ESP-01 Wi-Fi relay module." class="wp-image-6186" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-programmer-400-jpg.webp 402w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-programmer-400-300x220.webp 300w" sizes="auto, (max-width: 402px) 100vw, 402px" /></a><figcaption class="wp-element-caption">Figure 4.  ESP-01 USB-to-Serial Converter Programmer</figcaption></figure></div>


<h2 class="wp-block-heading">Schematic Diagram of ESP-01 Wi-Fi Relay Module</h2>



<p>Before we start programming the ESP-01 module to be used on the ESP-01 Wi-Fi relay module, let us first study the schematic diagram of the ESP-01 Wi-Fi relay module.  There are two (2) versions of ESP-01 Wi-Fi relay modules.  Version 1 is shown in Figure 5 and Version 4 is shown in Figure 6.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-schematic-diagram-650.png"><img loading="lazy" decoding="async" width="650" height="572" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-schematic-diagram-650.png" alt="Schematic diagram of the ESP-01 Wi-Fi relay module version 1." class="wp-image-6189" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-schematic-diagram-650.png 650w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-schematic-diagram-650-300x264.png 300w" sizes="auto, (max-width: 650px) 100vw, 650px" /></a><figcaption class="wp-element-caption">Figure 5. Schematic Diagram of ESP-01 Wi-Fi Relay Module Version 1</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-schematic-diagram-version4-650.png"><img loading="lazy" decoding="async" width="647" height="572" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-schematic-diagram-version4-650.png" alt="Schematic diagram of the newer ESP-01 Wi-Fi relay module version 4 ." class="wp-image-6190" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-schematic-diagram-version4-650.png 647w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-wi-fi-relay-module-schematic-diagram-version4-650-300x265.png 300w" sizes="auto, (max-width: 647px) 100vw, 647px" /></a><figcaption class="wp-element-caption">Figure 6. Schematic Diagram of ESP-01 Wi-Fi Relay Module Version 4</figcaption></figure></div>


<p>An examination of the two (2) schematic diagrams above will show that the difference in the two versions has something to do with the relay driver.  On version 1, the relay is driven by an NPN junction transistor.  On the other hand, on version 4, the relay is driven by an N-channel MOSFET transistor.  Also, in version 4, the MOSFET driving the relay is in turn being driven by an opto-coupler.</p>



<p>In terms of programming, we should note that on both versions, the relay is activated by the ESP-01 module thru port <strong>GPIO0</strong>.  However, on Version 1, the relay uses <strong>ACTIVE HIGH</strong> logic levels.  That is, a logic HIGH on GPIO0 will activate the relay and a logic LOW will deactivate it.  On the other hand, on a Version 4 model, the relay is activated using <strong>ACTIVE LOW</strong> signals.  This means that a logic HIGH will turn OFF the relay and a logic LOW will turn it ON.  In short, the two versions use opposite signals for activating the relay.  These differing signals should be taken into account when programming the ESP-01 module.  Or else, turning ON the relay may result to it being turned OFF instead.  And vice versa, turning the relay OFF may cause the relay to turn ON.        </p>



<h2 class="wp-block-heading">How to Program the ESP-01 Module for Use with the Wi-Fi Relay Module </h2>



<p>In this article, we will pre-program the ESP-01 module with NodeMCU or Lua program.  Afterwards, we will create a smartphone app to control the ESP-01 Wi-Fi relay module remotely.  It is also possible to program the ESP-01 module with the Arduino IDE.  If you would prefer an Arduino IDE program for the ESP-01 module, please see &#8211; <a href="https://cyberblogspot.com/how-to-control-esp-01-without-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 Without a Router</a>.</p>



<h3 class="wp-block-heading">Flashing the NodeMCU Firmware on ESP-01 Module</h3>



<p>First, we need to install the NodeMCU firmware into the ESP-01 module.  There are several ways to do this but we will use the one that I think is the easiest.  Download the <a href="https://github.com/nodemcu/nodemcu-flasher" target="_blank" rel="noreferrer noopener">NodeMCU Flasher from Github</a>.  Extract the zip file and run the file &#8220;ESP8266Flasher.exe&#8221;.  There are two versions of ESP8266Flasher.exe, a Win32 and a Win64 version.  Select the appropriate version for your computer. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-main-final.png"><img loading="lazy" decoding="async" width="572" height="333" src="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-main-final.png" alt="Screenshot of NodeMCU Flasher for installing NodeMCU firmware on an ESP-01 module." class="wp-image-6215" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-main-final.png 572w, https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-main-final-300x175.png 300w" sizes="auto, (max-width: 572px) 100vw, 572px" /></a><figcaption class="wp-element-caption">Figure 7.  NodeMCU Flasher</figcaption></figure></div>


<p>Plug in your ESP-01 programmer with the ESP-01 module to your computer&#8217;s USB port.  The NodeMCU Flasher should be able to detect the ESP-01 programmer and automatically change the COM Port setting.  If this is your first time to use your ESP-01 programmer, you may have to install the device driver for it. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-com-port-setting.png"><img loading="lazy" decoding="async" width="572" height="333" src="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-com-port-setting.png" alt="A picture of the NodeMCU Firmware Programmer for the ESP8266 modules like the ESP-01 module to be used for the ESP-01 Wi-Fi relay module." class="wp-image-6216" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-com-port-setting.png 572w, https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-com-port-setting-300x175.png 300w" sizes="auto, (max-width: 572px) 100vw, 572px" /></a><figcaption class="wp-element-caption">Figure 8. NodeMCU Flasher Detects the Correct COM Port</figcaption></figure></div>


<p>Click on Config tab of the NodeMCU Flasher and verify that you have the settings INTERNAL://NODEMCU and hex 0x00000.  The INTERNAL://NODEMCU setting tells the NodeMCU Flasher to use the NodeMCU firmware that comes with the NodeMCU Flasher installation (the firmware file can be found under the Resources/Binaries directory).  Meanwhile, the setting <strong>0x00000</strong> is the memory starting location where the NodeMCU firmware will be installed.  See Figure 9 for the correct settings. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-config-tab.png"><img loading="lazy" decoding="async" width="572" height="333" src="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-config-tab.png" alt="A picture of the NodeMCU Flasher with the Config tab showing the correct settings." class="wp-image-6217" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-config-tab.png 572w, https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-config-tab-300x175.png 300w" sizes="auto, (max-width: 572px) 100vw, 572px" /></a><figcaption class="wp-element-caption">Figure 9.  NodeMCU Flasher with the Config Settings</figcaption></figure></div>


<p>Next, click on the Advanced tab of the NodeMCU Flasher.  Change the Flash size to 1Mbyte and the SPI mode to QIO.  These two (2) settings are specific to ESP-01 modules, see Figure 10 below.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-advanced-setting.png"><img loading="lazy" decoding="async" width="572" height="333" src="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-advanced-setting.png" alt="NodeMCU Flasher with the Advanced settings changed for the ESP-01 Wi-Fi module" class="wp-image-6219" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-advanced-setting.png 572w, https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-advanced-setting-300x175.png 300w" sizes="auto, (max-width: 572px) 100vw, 572px" /></a><figcaption class="wp-element-caption">Figure 10.  NodeMCU Flasher Advanced Settings</figcaption></figure></div>


<p>Click back on the Operation tab and click on the Flash(F) button to start flashing the NodeMCU firmware to the ESP-01 module.  Please refer to Figure 11.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-start-flash.png"><img loading="lazy" decoding="async" width="572" height="333" src="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-start-flash.png" alt="The NodeMCU Flasher ready to flash the NodeMCU firmware on an ESP-01 Wi-Fi module." class="wp-image-6220" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-start-flash.png 572w, https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-start-flash-300x175.png 300w" sizes="auto, (max-width: 572px) 100vw, 572px" /></a><figcaption class="wp-element-caption">Figure 11.  NodeMCU Flasher Prior to Flashing</figcaption></figure></div>


<p>Wait for the progress bar to be filled up and you should see a green checkmark at the bottom left of the NodeMCU Flasher screen as depicted in Figure 12.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-finished-uploading.png"><img loading="lazy" decoding="async" width="572" height="333" src="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-finished-uploading.png" alt="Picture of the NodeMCU Flasher with the green checkmark indicating a successful firmware flashing." class="wp-image-6218" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-finished-uploading.png 572w, https://cyberblogspot.com/wp-content/uploads/2023/02/nodemcu-flasher-finished-uploading-300x175.png 300w" sizes="auto, (max-width: 572px) 100vw, 572px" /></a><figcaption class="wp-element-caption">Figure 12.  NodeMCU Flasher with Green Checkmark</figcaption></figure></div>


<p>We have now successfully installed the NodeMCU firmware on the ESP-01 module, so we will go to the next procedure.</p>



<h3 class="wp-block-heading">ESPlorer Integrated Development Environment</h3>



<p>ESPlorer is an Integrated Development Environment (IDE) used for programming ESP8266 modules like ESP-01 with NodeMCU and Micropython.  Download the <a href="https://github.com/4refr0nt/ESPlorer/releases" target="_blank" rel="noreferrer noopener">ESPlorer from Github</a>.  Extract the zip file and run the file &#8220;ESPlorer.bat&#8221;.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-main.png"><img loading="lazy" decoding="async" width="1024" height="576" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-main-1024x576.png" alt="The ESPlorer Integrated Development Environment for programming the ESP-01 module" class="wp-image-6221" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-main-1024x576.png 1024w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-main-300x169.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-main-768x432.png 768w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-main.png 1368w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Figure 13.  The ESPlorer Integrated Development Environment</figcaption></figure></div>


<p>Make sure that the proper COM port for your ESP-01 programmer is selected and the baud rate setting is 9600 baud (see Figure 14).  Then click on the Open button.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-settings-open-button-740x440-1.png"><img loading="lazy" decoding="async" width="741" height="442" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-settings-open-button-740x440-1.png" alt="Picture of ESPlorer IDE showing the correct setting before opening the communication port" class="wp-image-6224" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-settings-open-button-740x440-1.png 741w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-settings-open-button-740x440-1-300x179.png 300w" sizes="auto, (max-width: 741px) 100vw, 741px" /></a><figcaption class="wp-element-caption">Figure 14.  ESPlorer IDE with the Correct Settings</figcaption></figure></div>


<p>If the ESPlorer can&#8217;t autodetect the NodeMCU firmware, reset the ESP-01 module by pressing the reset button on your ESP-01 programmer.  Or click on the RTS button on the ESPlorer IDE twice.  When you click the RTS button on the ESPlorer IDE, it sends a RESET signal to the connected ESP-01 programmer module.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-cant-autodetect.png"><img loading="lazy" decoding="async" width="742" height="440" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-cant-autodetect.png" alt="ESPlorer IDE showing the message can't autodetect firmware." class="wp-image-6225" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-cant-autodetect.png 742w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-cant-autodetect-300x178.png 300w" sizes="auto, (max-width: 742px) 100vw, 742px" /></a><figcaption class="wp-element-caption">Figure 15.  ESPlorer IDE with Error Message</figcaption></figure></div>


<p>After resetting the ESP-01 module, you should see a message with the NodeMCU firmware version.  This verifies that you have successfully flashed the ESP-01 module with the NodeMCU firmware in the preceding procedure.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-text-align-center">If the ESPlorer IDE cannot detect your NodeMCU firmware, see the article:<br><a href="https://cyberblogspot.com/esplorer-cant-autodetect-firmware/" target="_blank" rel="noreferrer noopener">ESPlorer Can’t Autodetect Firmware</a></p>
</blockquote>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-detected.png"><img loading="lazy" decoding="async" width="742" height="442" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-detected.png" alt="ESPlorer IDE showing a successful firmware detection signifying readiness to accept scripts for programming the ESP-01 module to used for the ESP-01 Wi-Fi relay module." class="wp-image-6226" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-detected.png 742w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-detected-300x179.png 300w" sizes="auto, (max-width: 742px) 100vw, 742px" /></a><figcaption class="wp-element-caption">Figure 16.  ESPlorer IDE with the NodeMCU Firmware Detected</figcaption></figure></div>


<h3 class="wp-block-heading">The Lua Program</h3>



<p>Copy and paste the following Lua program on the left pane of the ESPlorer IDE.</p>



<pre class="EnlighterJSRAW">print(&quot;Ready to start soft ap&quot;)

local str=wifi.ap.getmac();
local ssidTemp=string.format(&quot;%s%s%s&quot;,string.sub(str,10,11),string.sub(str,13,14),string.sub(str,16,17));

cfg={}
cfg.ssid=&quot;ESP8266_&quot;..ssidTemp;
cfg.pwd=&quot;12345678&quot;
wifi.ap.config(cfg)

cfg={}
cfg.ip=&quot;192.168.1.1&quot;;
cfg.netmask=&quot;255.255.255.0&quot;;
cfg.gateway=&quot;192.168.1.1&quot;;
wifi.ap.setip(cfg);
wifi.setmode(wifi.SOFTAP)

str=nil;
ssidTemp=nil;
collectgarbage();

print(&quot;Soft AP started&quot;)
print(&quot;Heep:(bytes)&quot;..node.heap());
print(&quot;MAC:&quot;..wifi.ap.getmac()..&quot;\r\nIP:&quot;..wifi.ap.getip());

led1 = 3
led2 = 4
gpio.mode(led1, gpio.OUTPUT)
gpio.mode(led2, gpio.OUTPUT)
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
    conn:on(&quot;receive&quot;, function(client,request)
        local buf = &quot;&quot;;
        buf = buf..&quot;HTTP/1.1 200 OK\n\n&quot;
        local _, _, method, path, vars = string.find(request, &quot;(&#091;A-Z]+) (.+)?(.+) HTTP&quot;);
        if(method == nil)then
            _, _, method, path = string.find(request, &quot;(&#091;A-Z]+) (.+) HTTP&quot;);
        end
        local _GET = {}
        if (vars ~= nil)then
            for k, v in string.gmatch(vars, &quot;(%w+)=(%w+)&amp;*&quot;) do
                _GET&#091;k] = v
            end
        end
        
        if(_GET.pin == &quot;ON1&quot;)then
              gpio.write(led1, gpio.HIGH);
			  print(&quot;led1 on&quot;)
        elseif(_GET.pin == &quot;OFF1&quot;)then
              gpio.write(led1, gpio.LOW);
			print(&quot;led1 off&quot;)
        elseif(_GET.pin == &quot;ON2&quot;)then
              gpio.write(led2, gpio.HIGH);
			print(&quot;led2 on&quot;)
        elseif(_GET.pin == &quot;OFF2&quot;)then
              gpio.write(led2, gpio.LOW);
			print(&quot;led2 off&quot;)
        end
        client:send(buf);
        client:close();
        collectgarbage();
    end)
end)</pre>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-copy-and-paste-program.png"><img loading="lazy" decoding="async" width="625" height="769" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-copy-and-paste-program.png" alt="Figure 17 is a picture of the ESPlorer Integrated Development Environment showing a Lua script." class="wp-image-6228" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-copy-and-paste-program.png 625w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-copy-and-paste-program-244x300.png 244w" sizes="auto, (max-width: 625px) 100vw, 625px" /></a><figcaption class="wp-element-caption">Figure 17.  ESPlorer IDE with Lua Script</figcaption></figure></div>


<p>Save the file to your computer.  Click the Save button on the top left pane (1).  Name the file as &#8220;init.lua&#8221; (2).  Then click on the Save button on the Save screen (3).</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-save-init-lua.png"><img loading="lazy" decoding="async" width="627" height="767" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-save-init-lua.png" alt="ESPlorer IDE annotated with instructions for saving a Lua script." class="wp-image-6230" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-save-init-lua.png 627w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-save-init-lua-245x300.png 245w" sizes="auto, (max-width: 627px) 100vw, 627px" /></a><figcaption class="wp-element-caption">Figure 18.  ESPlorer IDE Annotated on How to Save a Script</figcaption></figure></div>


<p>After saving the program to your hard disk, the ESPlorer IDE uploaded the file init.lua to your ESP-01 module and ran the program (dofile(&#8220;init.lua&#8221;)).</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-init-lua-done.png"><img loading="lazy" decoding="async" width="742" height="452" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-init-lua-done.png" alt="ESPlorer IDE with the Lua script or program executed successfully." class="wp-image-6232" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-init-lua-done.png 742w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-init-lua-done-300x183.png 300w" sizes="auto, (max-width: 742px) 100vw, 742px" /></a><figcaption class="wp-element-caption">Figure 19.  ESPlorer IDE After Running Script</figcaption></figure></div>


<h3 class="wp-block-heading">Testing the ESP-01 Module Access Point</h3>



<p>Before we proceed to building the smartphone app to control the ESP-01 Wi-Fi relay module, let us first check if we have successfully programmed the ESP-01 module. </p>



<p>Get your smartphone and scan for Wi-Fi devices.  With my Android smartphone, I would go to the &#8220;Settings/Network and Internet/Wi-Fi&#8221; setting.  See Figure 20.  You should see the Wi-Fi SSID &#8220;ESP8266_XXXXXX&#8221; where XXXXXX is the last six digits of your ESP-01 module&#8217;s MAC address.</p>



<p>  </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-wi-fi-list-350.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-wi-fi-list-350.png" alt="Picture of a smartphone showing the nearby Wi-Fi devices." class="wp-image-6234" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-wi-fi-list-350.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-wi-fi-list-350-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 20.  Smartphone Showing Nearby Wi-Fi Devices</figcaption></figure></div>


<p>Connect your smartphone to the ESP-01 access point by entering the password &#8220;12345678&#8221; (Figure 21).</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-password-keyin-350.png"><img loading="lazy" decoding="async" width="350" height="615" src="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-password-keyin-350.png" alt="Screenshot of a smartphone showing how to enter the password in order to connect to the ESP-01 Wi-Fi module." class="wp-image-6236" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-password-keyin-350.png 350w, https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-password-keyin-350-171x300.png 171w" sizes="auto, (max-width: 350px) 100vw, 350px" /></a><figcaption class="wp-element-caption">Figure 21.  Smartphone with Password Entry</figcaption></figure></div>


<p>Figure 22 below shows the smartphone connected to the ESP-01 module&#8217;s access point.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-esp8266-connected-350.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-esp8266-connected-350.png" alt="Smartphone showing a successful connection with the ESP-01 module access point." class="wp-image-6235" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-esp8266-connected-350.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-esp8266-connected-350-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 22.  Smartphone Connected to the ESP-01 Module</figcaption></figure></div>


<p>Click on the gear icon to display the network details.  Your smartphone will be assigned an IP address of 192.168.1.2.  The gateway is the IP address of the ESP-01 access point.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-esp8266-network-properties-350-final.png"><img loading="lazy" decoding="async" width="352" height="615" src="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-esp8266-network-properties-350-final.png" alt="Smartphone showing the network details of the connection with the ESP-01 access point." class="wp-image-6239" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-esp8266-network-properties-350-final.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/02/android-smartphone-esp8266-network-properties-350-final-172x300.png 172w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 23.  Smartphone Showing Network Details</figcaption></figure></div>


<p>Now we are ready to create the smartphone app to control the ESP-01 Wi-Fi relay module.</p>



<h2 class="wp-block-heading">How to Create the Smartphone App to Control the ESP-01 Wi-Fi Relay Module</h2>



<p>We are going to use the MIT App Inventor 2 to create a smartphone app to control the ESP-01 Wi-Fi relay module.  First, we need to download the MIT App Inventor 2 Companion App to our smartphones.  We will need it to facilitate installing the created controller app to our smartphones.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/mit-app-inventor-companion-2-350.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/01/mit-app-inventor-companion-2-350.png" alt="Screenshot of MIT App Inventor 2 Companion App to be used for downloading the completed ESP8266 Controller smartphone app for controlling the ESP-01 Wi-Fi relay module remotely." class="wp-image-6021" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/mit-app-inventor-companion-2-350.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/01/mit-app-inventor-companion-2-350-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 24.  MIT App Inventor 2 Companion App</figcaption></figure></div>


<p>Next, download the source code from Github &#8211; <a href="https://github.com/cyberblogspot/esp8266controller/archive/refs/heads/main.zip" target="_blank" rel="noreferrer noopener">ESP8266 Controller.</a>  Extract the file <strong>ESP8266_Controller.aia</strong>.</p>



<p>Go to <a href="https://appinventor.mit.edu/" target="_blank" rel="noreferrer noopener">MIT App Inventor</a> website and click on the Create Apps! button.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-website.png"><img loading="lazy" decoding="async" width="802" height="524" src="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-website.png" alt="Screenshot of the MIT App Inventor website to be used for programming the ESP-01 Wi-Fi module." class="wp-image-6244" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-website.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-website-300x196.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-website-768x502.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 25.  The MIT App Inventor Website</figcaption></figure></div>


<p>Import the project <strong>ESP8266_Controller.aia</strong> (the file downloaded from Github).</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-800x425-1.png"><img loading="lazy" decoding="async" width="802" height="427" src="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-800x425-1.png" alt="MIT App Inventor 2 screen showing how to import a project file." class="wp-image-6245" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-800x425-1.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-800x425-1-300x160.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-800x425-1-768x409.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 26.  MIT App Inventor Project Import</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-filename.png"><img loading="lazy" decoding="async" width="802" height="427" src="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-filename.png" alt="MIT App Inventor screen showing how to export the project file ESP8266_controller.aia." class="wp-image-6246" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-filename.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-filename-300x160.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-import-filename-768x409.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 27.  MIT App Inventor with Import Project Screen</figcaption></figure></div>


<p> The ESP8266 controller app designers view.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-800-finally-jpg.webp"><img loading="lazy" decoding="async" width="802" height="495" src="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-800-finally-jpg.webp" alt="Picture of the MIT App Inventor showing the designer screen for the ESP8266 Controller app to be use for controlling the ESP-01 Wi-Fi relay module." class="wp-image-6251" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-800-finally-jpg.webp 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-800-finally-300x185.webp 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-800-finally-768x474.webp 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 28.  MIT App Inventor with the Imported ESP8266 Controller Project</figcaption></figure></div>


<p>If you want to modify how the program works, go to the Blocks view.</p>



<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-blocks-view-jpg.webp"><img loading="lazy" decoding="async" width="800" height="570" src="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-blocks-view-jpg.webp" alt="Screenshot of the MIT App Inventor in Blocks mode showing the ESP8266 Controller's program blocks." class="wp-image-6252" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-blocks-view-jpg.webp 800w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-blocks-view-300x214.webp 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-loaded-project-blocks-view-768x547.webp 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a><figcaption class="wp-element-caption">Figure 29.  MIT App Inventor Showing the Blocks Screen</figcaption></figure>



<p>Compile and build the app by clicking the Build/Android App(apk) item on the menu.  Refer to Figure 30 below.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app.png"><img loading="lazy" decoding="async" width="802" height="427" src="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app.png" alt="MIT App Inventor screengrab showing how to build the ESP8266 Controller app for the ESP-01 Wi-Fi relay module." class="wp-image-6253" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app-300x160.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app-768x409.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 30.  MIT App Inventor Showing How to Start the Build Operation</figcaption></figure></div>


<p>After a successful build, a bar code will appear on your computer&#8217;s screen (see Figure 31).  Scan the bar code with your smartphone using the MIT App Inventor Companion app.  Follow the instructions on your smartphone to install the ESP8266 Controller app.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app-bar-code.png"><img loading="lazy" decoding="async" width="802" height="552" src="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app-bar-code.png" alt="Picture of MIT App Inventor screen display showing the bar code for downloading the ESP8266 Controller smartphone app for the ESP-01 Wi-Fi relay module." class="wp-image-6254" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app-bar-code.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app-bar-code-300x206.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/mit-app-inventor-build-android-app-bar-code-768x529.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 31.  MIT App Inventor with the Bar Code</figcaption></figure></div>


<h3 class="wp-block-heading">How to Use the ESP8266 Controller App to Control the ESP-01 Wi-Fi Relay Module</h3>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp8266controller-350.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp8266controller-350.png" alt="Screenshot of the completed ESP8266 Controller smartphone app ready for use with the ESP-01 Wi-Fi relay module." class="wp-image-6256" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp8266controller-350.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp8266controller-350-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 32.  ESP8266 Controller App</figcaption></figure></div>


<p>Remove the ESP-01 module from the programmer module and insert it into the ESP-01 Wi-Fi relay module.  Provide power to the relay module.  Next, connect the smartphone to the ESP-01 access point as discussed above on testing the ESP-01 module access point.  Then, open the ESP8266 Controller app and set the IP address to &#8220;192.168.1.1&#8221;.     </p>



<p>You may now enjoy playing around with your new smart switch ESP-01 Wi-Fi relay module using the ESP8266 Controller smartphone app.</p>



<h2 class="wp-block-heading">Related Articles on How to Use ESP-01 Wi-Fi Relay Module</h2>



<p><a href="https://cyberblogspot.com/how-to-program-esp-01-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ESP-01 with Arduino IDE</a><br><a href="https://cyberblogspot.com/how-to-set-up-arduino-ide-for-esp8266-programming/" target="_blank" rel="noreferrer noopener">How to Set up Arduino IDE for ESP8266 Programming</a>                                          <br><a href="https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/" target="_blank" rel="noreferrer noopener">How to Test an ESP-01 ESP8266 Module</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-thru-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 thru a Router</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-without-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 Without a Router</a><br><a href="https://cyberblogspot.com/esp-01-with-rtc-and-lcd-display/" target="_blank" rel="noreferrer noopener">ESP-01 with RTC and LCD Display</a><br><a href="https://cyberblogspot.com/how-to-save-and-restore-esp8266-and-esp32-firmware/" target="_blank" rel="noreferrer noopener">How to Save and Restore ESP8266 and ESP32 Firmware</a><br><a href="https://cyberblogspot.com/nodemcu-v3-esp8266-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">NodeMCU V3 ESP8266 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-test-a-nodemcu-v3-esp8266-dev-board/" target="_blank" rel="noreferrer noopener">How to Test a NodeMCU V3 ESP8266 Dev Board</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone-2/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a></p>



<h2 class="wp-block-heading">References on How to Use ESP-01 Wi-Fi Relay Module</h2>



<p><a href="https://en.wikipedia.org/wiki/ESP8266" target="_blank" rel="noreferrer noopener">ESP8266 on Wikipedia</a><br><a href="https://shopee.ph/ESP8266-5V-WiFi-Relay-Module-DS18B20-DHT11-RGB-LED-Controller-IoT-Smart-Home-Remote-Control-ESP-01-i.226548939.4418214828?sp_atk=93a14c50-5044-48f4-8b47-f30b230f9f15&amp;xptdk=93a14c50-5044-48f4-8b47-f30b230f9f15" target="_blank" rel="noreferrer noopener">ESP-01 Wi-Fi Relay Module on Shopee</a><br></p>
<p>The post <a href="https://cyberblogspot.com/how-to-use-esp-01-wi-fi-relay-module/">How to Use ESP-01 Wi-Fi Relay Module</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/how-to-use-esp-01-wi-fi-relay-module/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ESPlorer Can&#8217;t Autodetect Firmware</title>
		<link>https://cyberblogspot.com/esplorer-cant-autodetect-firmware/</link>
					<comments>https://cyberblogspot.com/esplorer-cant-autodetect-firmware/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 13 Feb 2023 09:55:54 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ESP-01]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[ESPlorer]]></category>
		<category><![CDATA[NodeMCU]]></category>
		<category><![CDATA[NodeMCU Firmware]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=6194</guid>

					<description><![CDATA[<p>The ESPlorer error &#8220;can&#8217;t autodetect firmware because proper answer not received (maybe unknown firmware)&#8221; appears on the right pane of the ESPlorer IDE screen. This happens right after flashing an ESP8266 module such as ESP-01 module with NodeMCU firmware. See Figure 1. By following the message on the screen to reset the module, the result&#8230;&#160;<a href="https://cyberblogspot.com/esplorer-cant-autodetect-firmware/" rel="bookmark">Read More &#187;<span class="screen-reader-text">ESPlorer Can&#8217;t Autodetect Firmware</span></a></p>
<p>The post <a href="https://cyberblogspot.com/esplorer-cant-autodetect-firmware/">ESPlorer Can&#8217;t Autodetect Firmware</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The ESPlorer error &#8220;can&#8217;t autodetect firmware because proper answer not received (maybe unknown firmware)&#8221; appears on the right pane of the ESPlorer IDE screen.  This happens right after flashing an ESP8266 module such as ESP-01 module with NodeMCU firmware.  See Figure 1.   </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-840.png"><img loading="lazy" decoding="async" width="842" height="689" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-840.png" alt="Screenshot of ESPlorer IDE showing the ESPlorer cant autodetect firmware error." class="wp-image-6196" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-840.png 842w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-840-300x245.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-840-768x628.png 768w" sizes="auto, (max-width: 842px) 100vw, 842px" /></a><figcaption class="wp-element-caption">Figure 1.  ESPlorer IDE Screen Showing the Error Message</figcaption></figure></div>


<p>By following the message on the screen to reset the module, the result is a gibberish message with the words &#8220;MEM  CHECK FAIL&#8221; at the end.  See Figure 2.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-2-800.png"><img loading="lazy" decoding="async" width="802" height="691" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-2-800.png" alt="Screenshot of ESPlorer IDE showing the ESPlorer can't autodetect firmware error and the mem check fail error" class="wp-image-6197" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-2-800.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-2-800-300x258.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-screen-cant-autodetect-error-2-800-768x662.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 2.  ESPlorer IDE Screen with Gibberish Message</figcaption></figure></div>


<h2 class="wp-block-heading">Cause of the Error Can&#8217;t Autodetect Firmware</h2>



<p>This error can often be mistaken for a failed NodeMCU firmware flashing.  But whether you used the NodeMCU Flasher or the Espressif Download Tool or manually used ESPTool.py to flash the NodeMCU firmware, you will get the same error.</p>



<p>The error is caused by a wrong BAUD rate setting on the ESPlorer IDE and NOT on a defective firmware flashing.  See Figure 3.  The baud rate setting is at <strong>115200</strong> baud when it should be only <strong>9600</strong> baud. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting.png"><img loading="lazy" decoding="async" width="851" height="727" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting.png" alt="Picture of ESPlorer IDE showing the baud rate setting that is causing the  ESPlorer Cant Autodetect Firmware" class="wp-image-6205" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting.png 851w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting-300x256.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting-768x656.png 768w" sizes="auto, (max-width: 851px) 100vw, 851px" /></a><figcaption class="wp-element-caption">Figure 3.  ESPlorer IDE with Annotated Baud Rate Setting</figcaption></figure></div>


<h2 class="wp-block-heading">How to Fix the Error Can&#8217;t Autodetect Firmware</h2>



<p>To fix the error &#8220;can&#8217;t autodetect firmware&#8221;, close the connection and change the baud rate to 9600 baud.  Then reset the ESP8266 module by pressing the reset button or simply click the <strong>RTS</strong> button on the ESPtool IDE twice.  Figure 4 shows the fixed error and with the NodeMCU firmware being detected correctly.      </p>



<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting-fixed.png"><img loading="lazy" decoding="async" width="851" height="731" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting-fixed.png" alt="Picture of ESPlorer IDE with the fixed error ESPlorer Can't Autodetect Firmware" class="wp-image-6206" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting-fixed.png 851w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting-fixed-300x258.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-baud-rate-setting-fixed-768x660.png 768w" sizes="auto, (max-width: 851px) 100vw, 851px" /></a><figcaption class="wp-element-caption">Figure 4.  ESPlorer IDE with Baud Rate Setting Fixed</figcaption></figure>



<h2 class="wp-block-heading">Important Note on ESPlorer Can&#8217;t Autodetect Firmware</h2>



<p>If you flash your ESP8266 board with the newer NodeMCU firmware, the correct BAUD rate to use is <strong>115200 </strong>baud.  See Figure 5 that shows the ESPlorer IDE with NodeMCU firmware version 1.5 and Figure 6 with NodeMCU firmware version 3.0.  Both are using <strong>115200</strong> baud rates.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-1.5.png"><img loading="lazy" decoding="async" width="742" height="731" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-1.5.png" alt="Screenshot of ESPlorer IDE with the NodeMCU firmware version 1.5 but without Cant Autodetect Firmware" class="wp-image-6208" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-1.5.png 742w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-1.5-300x296.png 300w" sizes="auto, (max-width: 742px) 100vw, 742px" /></a><figcaption class="wp-element-caption">Figure 5.  ESPlorer IDE with NodeMCU Firmware Version 1.5</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-version3.png"><img loading="lazy" decoding="async" width="743" height="733" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-version3.png" alt="Screenshot of ESPlorer IDE with the NodeMCU firmware version 3.0 but without Cant Autodetect Firmware" class="wp-image-6209" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-version3.png 743w, https://cyberblogspot.com/wp-content/uploads/2023/02/esplorer-ide-firmware-version3-300x296.png 300w" sizes="auto, (max-width: 743px) 100vw, 743px" /></a><figcaption class="wp-element-caption">Figure 6.  ESPlorer IDE with NodeMCU Firmware Version 3</figcaption></figure></div>


<h2 class="wp-block-heading">What is ESPlorer?</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/ESPlorer-panels.png"><img loading="lazy" decoding="async" width="1024" height="597" src="https://cyberblogspot.com/wp-content/uploads/2023/02/ESPlorer-panels-1024x597.png" alt="Screenshot of ESPlorer IDE showing the different IDE panels for the article ESPlorer Can't Autodetect Firmware" class="wp-image-6204" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/ESPlorer-panels-1024x597.png 1024w, https://cyberblogspot.com/wp-content/uploads/2023/02/ESPlorer-panels-300x175.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/ESPlorer-panels-768x448.png 768w, https://cyberblogspot.com/wp-content/uploads/2023/02/ESPlorer-panels.png 1318w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Figure 7.  ESPlorer IDE Panels</figcaption></figure></div>


<p>ESPlorer is a multi-platform Integrated Development  Environment (IDE) for programming ESP8266 modules.  It is primarily used for programming ESP8266 modules with NodeMCU (Lua) and MicroPython.  It can also be used to program ESP8266 modules with AT commands.  Additionally, it can also program RN2483 LoRa modules.</p>



<h2 class="wp-block-heading">Related Articles</h2>



<p><a href="https://cyberblogspot.com/how-to-program-esp-01-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ESP-01 with Arduino IDE</a><br><a href="https://cyberblogspot.com/how-to-set-up-arduino-ide-for-esp8266-programming/" target="_blank" rel="noreferrer noopener">How to Set up Arduino IDE for ESP8266 Programming</a>                                          <br><a href="https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/" target="_blank" rel="noreferrer noopener">How to Test an ESP-01 ESP8266 Module</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-thru-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 thru a Router</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-without-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 Without a Router</a><br><a href="https://cyberblogspot.com/esp-01-with-rtc-and-lcd-display/" target="_blank" rel="noreferrer noopener">ESP-01 with RTC and LCD Display</a><br><a href="https://cyberblogspot.com/how-to-save-and-restore-esp8266-and-esp32-firmware/" target="_blank" rel="noreferrer noopener">How to Save and Restore ESP8266 and ESP32 Firmware</a><br><a href="https://cyberblogspot.com/nodemcu-v3-esp8266-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">NodeMCU V3 ESP8266 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-test-a-nodemcu-v3-esp8266-dev-board/" target="_blank" rel="noreferrer noopener">How to Test a NodeMCU V3 ESP8266 Dev Board</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone-2/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a></p>



<h2 class="wp-block-heading">References</h2>



<p><a href="https://esp8266.ru/esplorer/" target="_blank" rel="noreferrer noopener">esp8266 &#8211; Developer Community</a><br><a href="https://nodemcu.readthedocs.io/en/release/" target="_blank" rel="noreferrer noopener">NodeMCU Documentation</a></p>
<p>The post <a href="https://cyberblogspot.com/esplorer-cant-autodetect-firmware/">ESPlorer Can&#8217;t Autodetect Firmware</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/esplorer-cant-autodetect-firmware/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Use AT-09 BLE with Arduino and Smartphone</title>
		<link>https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone-2/</link>
					<comments>https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone-2/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 13 Feb 2023 02:20:43 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=6202</guid>

					<description><![CDATA[<p>The AT-09 BLE module is a Bluetooth Low Energy transceiver that uses the BLE chip CC2541. It is compatible with the popular HM-10 BLE Bluetooth module. The module is used to provide Bluetooth capability to microcontrollers lacking Bluetooth support. As an example, we will connect an AT-09 BLE board on an Arduino board and use&#8230;&#160;<a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone-2/" rel="bookmark">Read More &#187;<span class="screen-reader-text">How to Use AT-09 BLE with Arduino and Smartphone</span></a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone-2/">How to Use AT-09 BLE with Arduino and Smartphone</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The AT-09 BLE module is a Bluetooth Low Energy transceiver that uses the BLE chip CC2541.  It is compatible with the popular HM-10 BLE Bluetooth module.  The module is used to provide Bluetooth capability to microcontrollers lacking Bluetooth support.  As an example, we will connect an AT-09 BLE board on an Arduino board and use a smartphone to control an LED on the Arduino board.  </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/at-09-ble-module-front-jpg.webp"><img loading="lazy" decoding="async" width="502" height="447" src="https://cyberblogspot.com/wp-content/uploads/2023/01/at-09-ble-module-front-jpg.webp" alt="Picture of AT-09 BLE module used in this article How to Use AT-09 BLE with Arduino and Smartphone" class="wp-image-5875" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/at-09-ble-module-front-jpg.webp 502w, https://cyberblogspot.com/wp-content/uploads/2023/01/at-09-ble-module-front-300x267.webp 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 1.  AT-09 BLE Module Front View</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/at-09-ble-module-back-jpg.webp"><img loading="lazy" decoding="async" width="502" height="448" src="https://cyberblogspot.com/wp-content/uploads/2023/01/at-09-ble-module-back-jpg.webp" alt="Back view of the AT-09 BLE module for use with an Arduino board and smartphone to control an LED on the Arduino board " class="wp-image-5877" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/at-09-ble-module-back-jpg.webp 502w, https://cyberblogspot.com/wp-content/uploads/2023/01/at-09-ble-module-back-300x268.webp 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 2.  AT-09 BLE Module Back View</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Wiring Diagram to Use AT-09 BLE with Arduino and Smartphone</h2>



<p>To use an AT-09 BLE with Arduino and a smartphone, connect the AT-09 module to the Arduino board using the schematic diagram below.  In this article, I am using an Arduino Nano board as an example.  However, you may use any Arduino board that is available.  As a matter of fact, you may use ANY microcontroller at your disposal.  On my next project, I would connect an AT-09 BLE module to an <a href="https://cyberblogspot.com/how-to-program-attiny85-with-arduino-ide/" target="_blank" rel="noreferrer noopener">ATtiny85</a> chip for a low-current car central door lock system.        </p>



<p>As shown by the Fritzing breadboard and the KiCad schematic diagram below, there are only four terminals that we need to connect.  These are the RX, TX, GND, and VCC.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09_bb.png"><img loading="lazy" decoding="async" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09_bb-1024x529.png" alt="Fritzing breadboard diagram of an AT-09 BLE Bluetooth module connected to an Arduino Nano board." class="wp-image-5871" width="768" height="397" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09_bb-1024x529.png 1024w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09_bb-300x155.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09_bb-768x396.png 768w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09_bb-1536x793.png 1536w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09_bb.png 1755w" sizes="auto, (max-width: 768px) 100vw, 768px" /></a><figcaption class="wp-element-caption">Figure 3.  Arduino Nano with AT-09 BLE Board on Breadboard</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09-kicad-schematic-600.png"><img loading="lazy" decoding="async" width="602" height="455" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09-kicad-schematic-600.png" alt="Schematic diagram of the connection between an Arduino Nano microcontroller board and an AT-09 BLE Bluetooth module" class="wp-image-5873" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09-kicad-schematic-600.png 602w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-with-ble-at09-kicad-schematic-600-300x227.png 300w" sizes="auto, (max-width: 602px) 100vw, 602px" /></a><figcaption class="wp-element-caption">Figure 4.  Schematic Diagram of Arduino Nano and AT-09 BLE Module</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Referring to Figure 4 above, the Arduino Nano&#8217;s D2 and D3 terminals are labelled as RX (Receiver) and TX (Transmitter) respectively.  These terminals will simulate a UART port and will be assigned as RX and TX ports thru software (software serial).  The choice of D2 and D3 is arbitrary and you may use any two (2) available digital IO pins except D0 and D1 (hardware serial ports).  </p>



<p>The ports D0 and D1 (RX and TX) may not be used because we will use the Arduino IDE Serial Monitor.  Remember that the ports D0 and D1 are connected to the USB port of the Arduino board and are connected to your computer for uploading sketches.  Therefore, in order to use the Serial Monitor, the ports D0 and D1 must be free (unused, no external circuitry).  We will use the Serial Monitor as input and output device for interacting with the AT-09 BLE module.</p>



<p>Take note that the Arduino Nano&#8217;s RX and TX (D2 and D3) terminals are cross-wired with the RX and TX terminals of the AT-09 BLE module.  That is, the RX terminal of the Arduino Nano connects to the TX terminal of the AT-09 BLE module.  Vice versa, the TX terminal of the Arduino Nano is wired to the RX terminal of the AT-09 BLE module.</p>



<p>Resistors R1 and R2 are used as logic level translators.  The circuit reduces the 5V output from the Arduino Nano&#8217;s TX port to the 3V logic level needed by the AT-09 BLE board.  However, the RX port does not need a logic level translation since it is receiving a lower 3V logic that it can sufficiently handle.</p>



<h2 class="wp-block-heading">Smartphone App for Use with AT-09 BLE Module and Arduino Board          </h2>



<p>There are many smartphone apps available for controlling a Bluetooth module but as a starter, we will use the <a href="https://play.google.com/store/apps/details?id=com.argonremote.bluetoothcontroller&amp;hl=en" target="_blank" rel="noreferrer noopener">Arduino Bluetooth Controller (HM-10 Module)</a>.  Since this app is specifically for HM-10 module and the AT-09 module being compatible with the HM-10 module, the app works perfectly well with the AT-09 BLE module.  If you want to make your own Android smartphone app, you can create one even if you are not a programmer.  Take a look at <a href="https://appinventor.mit.edu/" target="_blank" rel="noreferrer noopener">MIT App Inventor</a>. </p>



<p>Before we start programming the Arduino board, download and install the Arduino Bluetooth Controller from the Google Play Store.  There are many similarly named Bluetooth controllers on the Google Play Store, so look for the one made by Argon Dev.  See Figure 5 below.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/google-play-store-controller-apps-list-annotated-350.png"><img loading="lazy" decoding="async" width="350" height="622" src="https://cyberblogspot.com/wp-content/uploads/2023/01/google-play-store-controller-apps-list-annotated-350.png" alt="Picture of the Google Play Store list of Arduino Bluetooth controller for use with AT-09 BLE module, Arduino board, and a smartphone" class="wp-image-5896" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/google-play-store-controller-apps-list-annotated-350.png 350w, https://cyberblogspot.com/wp-content/uploads/2023/01/google-play-store-controller-apps-list-annotated-350-169x300.png 169w" sizes="auto, (max-width: 350px) 100vw, 350px" /></a><figcaption class="wp-element-caption">Figure 5. Google Play Store Bluetooth Controller List</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Quick Test on AT-09 BLE Module</h3>



<p>After downloading the Bluetooth controller app, power up the Arduino board by plugging it into the computer&#8217;s USB port.  When the AT-09 BLE module is powered up, you should see the onboard LED flashing.  The flashing LED light indicates it is transmitting and advertising its presence.  Open the Bluetooth controller app.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-search-350.png"><img loading="lazy" decoding="async" width="350" height="622" src="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-search-350.png" alt="Picture of the Arduino Bluetooth Controller app showing how to connect to the AT-09 BLE Bluetooth module in order to communicate with an Arduino Nano board using an Android smartphone." class="wp-image-5897" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-search-350.png 350w, https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-search-350-169x300.png 169w" sizes="auto, (max-width: 350px) 100vw, 350px" /></a><figcaption class="wp-element-caption">Figure 6. Arduino Bluetooth Controller Search</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Click on the search icon.  See Figure 6 above.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-connected-350.png"><img loading="lazy" decoding="async" width="350" height="622" src="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-connected-350.png" alt="Picture of the Android smartphone app showing that the a connection has been made between the smartphone and the AT-09 BLE module." class="wp-image-5898" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-connected-350.png 350w, https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-connected-350-169x300.png 169w" sizes="auto, (max-width: 350px) 100vw, 350px" /></a><figcaption class="wp-element-caption">Figure 7.  Arduino Bluetooth Controller Showing the AT-09 Module Connection</figcaption></figure></div>


<p>When the AT-09 BLE module connects to the Bluetooth controller, you should see the displayed message turning into green, similar to the one displayed on Figure 7.  BT05 is the Bluetooth device name of the AT-09 BLE module and the 12-digit hex number is its Bluetooth MAC address.  Also, look at the AT-09 BLE module.  You should see the LED on the board stop flashing and stay steadily lit.</p>



<p>If you can connect to the AT-09 BLE module using a smartphone, you can now proceed to programming the Arduino board.  We will first program the Arduino Nano to play around with the AT commands.  After that, we will insert additional codes to the sketch to control the Arduino&#8217;s onboard LED using the smartphone.</p>



<h2 class="wp-block-heading">The AT-09 BLE Module AT Commands</h2>



<p>AT commands are instructions sent to the Bluetooth module to display and change its configuration.  For example, if we want to display or change its device name, we send it the command AT+NAME.  If we want to display its Bluetooth MAC address, we use the command AT+LADDR.  We will learn more about these AT commands after uploading the following sketch to the Arduino board.</p>



<pre class="EnlighterJSRAW">/* cyberblogspot.com 21Jan2023
 *  
 * Program to send AT commands to AT-09 BLE module
 * and display the responses on the Serial Monitor
 * 
 * RX and TX cross wired 
 * 2k and 3k voltage divider on AT-09 RX (reduce 5V to 3V)
 */

#include &lt;SoftwareSerial.h&gt;
SoftwareSerial bleSerial(2, 3); //D2 is RX, D3 is TX

char bleData;  //storage for AT-09 data   
String mData;  //storage for AT-09 and serial monitor data

void setup() {
  Serial.begin(115200);   //initialize serial monitor
  bleSerial.begin(9600);  //and BLE serial port, default AT-09 baud rate is 9600 baud
  
  Serial.println(&quot;AT-09 BLE module ready&quot;);
}

void loop() {
  if (Serial.available()) {      
    mData = Serial.readString(); //read serial monitor input
    Serial.println(mData);       //echo keyboard input to serial monitor
    bleSerial.println(mData);    //send keyboard input to AT-09 module
  }

  bleSerial.listen();                  //listen to the AT-09 port
  while (bleSerial.available() &gt; 0) {  //if AT-09 data available
    bleData = bleSerial.read();        //read character and
    mData = String(bleData);           //convert to string format 
    Serial.print(mData);               //display to serial monitor
  }
}</pre>



<p>The sketch above will let us type AT commands on the Arduino IDE&#8217;s Serial Monitor and send it to the AT-09 BLE module.  Anything that we type on the Serial Monitor will be echoed back (displayed) on the Serial Monitor.  At the same time, it will be sent to the AT-09 module.  When the AT-09 module replies in response to the AT commands sent, it will also be displayed on the Serial Monitor.</p>



<p>The program starts by including the library SoftwareSerial.  It is a built-in Arduino library so you do not need to download or install it.</p>



<pre class="EnlighterJSRAW">#include &lt;SoftwareSerial.h&gt;</pre>



<p>Next, we create the SoftwareSerial object bleSerial.</p>



<pre class="EnlighterJSRAW">SoftwareSerial bleSerial(2, 3); //D2 is RX, D3 is TX</pre>



<p>As per discussion above on the wiring diagram (see Figure 4 above), the digital IO port D2 will be used as an RX port and digital IO port D3 will become a TX port.  Because the hardware UART ports D1 and D2 are being used by the Serial Monitor, we are creating an additional UART port via software.  This additional port is where the AT-09 BLE module is connected. </p>



<pre class="EnlighterJSRAW">void setup() {
  Serial.begin(115200);   //initialize serial monitor
  bleSerial.begin(9600);  //and BLE serial port, default AT-09 baud rate is 9600 baud
  
  Serial.println(&quot;AT-09 BLE module ready&quot;);
}</pre>



<p>In the setup() routine, the hardware UART port &#8220;Serial&#8221; and the software UART port &#8220;bleSerial&#8221; are initialized.  Note that the &#8220;bleSerial&#8221; speed is set to 9600 baud only because the module is configured to use that speed by default.</p>



<pre class="EnlighterJSRAW">void loop() {
  if (Serial.available()) {      
    mData = Serial.readString(); //read serial monitor input
    Serial.println(mData);       //echo keyboard input to serial monitor
    bleSerial.println(mData);    //send keyboard input to AT-09 module
  }

  bleSerial.listen();                  //listen to the AT-09 port
  while (bleSerial.available() &gt; 0) {  //if AT-09 data available
    bleData = bleSerial.read();        //read character and
    mData = String(bleData);           //convert to string format 
    Serial.print(mData);               //display to serial monitor
  }
}</pre>



<p>Finally on the loop() procedure, the program is very simple.  The program checks if there is input on the Serial Monitor.  If there is, it sends the data to the AT-09 BLE module.  In the same manner but vice versa, it checks for any available data from the AT-09 module and sends it to the Serial Monitor.</p>



<p>Upload the sketch to the Arduino board and then open the Arduino IDE Serial Monitor.  Change the Serial Monitor settings to &#8220;No line ending&#8221; and &#8220;115200 baud&#8221; as in Figure 8.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-settings.png"><img loading="lazy" decoding="async" width="601" height="381" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-settings.png" alt="Screenshot of the Arduino IDE serial monitor showing how to configure it for use with an Arduino Nano and AT-09 BLE Bluetooth module." class="wp-image-5902" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-settings.png 601w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-settings-300x190.png 300w" sizes="auto, (max-width: 601px) 100vw, 601px" /></a><figcaption class="wp-element-caption">Figure 8.  Arduino IDE Serial Monitor Settings</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Type &#8220;AT&#8221; and press the ENTER key, and you should get the message &#8220;OK&#8221;.  That means that the AT-09 BLE module is accepting AT commands.</p>



<p>Type &#8220;AT+VERSION&#8221; and the firmware version of the AT-09 module will be displayed on the Serial Monitor.</p>



<p>Type &#8220;AT+NAME&#8221; and the response should be the default device name of &#8220;BT05&#8221;.</p>



<p>Type &#8220;AT+LADDR&#8221; and see the module&#8217;s local address or Bluetooth MAC address.</p>



<p>Type &#8220;AT+UUID&#8221; and the Universal Unique Identifier is displayed which is hex FFE0.</p>



<p>Type &#8220;AT+PIN&#8221; and the serial monitor will display the default PIN of 123456 used for pairing with other Bluetooth devices.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-page1-finally1.png"><img loading="lazy" decoding="async" width="649" height="381" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-page1-finally1.png" alt="Screenshot of the Serial Monitor showing the AT commands used for configuring the AT-09 Bluetooth Low Energy module" class="wp-image-5910" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-page1-finally1.png 649w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-page1-finally1-300x176.png 300w" sizes="auto, (max-width: 649px) 100vw, 649px" /></a><figcaption class="wp-element-caption">Figure 9.  Arduino IDE Serial Monitor Example AT Commands</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Finally, type &#8220;AT+HELP&#8221; and the Serial Monitor will display all the available AT commands that the AT-09 BLE module supports.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-athelp.png"><img loading="lazy" decoding="async" width="646" height="728" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-athelp.png" alt="Screenshot of the serial monitor showing all the supported AT commands of the AT-09 BLE module." class="wp-image-5905" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-athelp.png 646w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-athelp-266x300.png 266w" sizes="auto, (max-width: 646px) 100vw, 646px" /></a><figcaption class="wp-element-caption">Figure 10.  Arduino IDE Serial Monitor Showing the AT Commands Set</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Now, open the Arduino Bluetooth Controller.  Connect to the AT-09 BLE module, type the word &#8220;hi&#8221;, and press the SEND button.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-1-350.png"><img loading="lazy" decoding="async" width="350" height="622" src="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-1-350.png" alt="Another picture or screenshot of the Arduino Bluetooth Controller app sending a message to the Arduino board." class="wp-image-5951" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-1-350.png 350w, https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller-1-350-169x300.png 169w" sizes="auto, (max-width: 350px) 100vw, 350px" /></a><figcaption class="wp-element-caption">Figure 11.  Arduino Bluetooth Controller Showing How to Send a Message</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>You should see the word &#8220;hi&#8221; in the Arduino Serial Monitor as shown in Figure 12.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal1-annotated.png"><img loading="lazy" decoding="async" width="649" height="381" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal1-annotated.png" alt="Screenshot of the Arduino IDE Serial Monitor showing the received message from the smartphone" class="wp-image-5954" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal1-annotated.png 649w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal1-annotated-300x176.png 300w" sizes="auto, (max-width: 649px) 100vw, 649px" /></a><figcaption class="wp-element-caption">Figure 12.  Arduino IDE Serial Monitor Showing the Received Message</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Type &#8220;hello&#8221; on the Arduino Serial Monitor.  You will see the word &#8220;hello&#8221; on your smartphone.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller2-350-with-annotation.png"><img loading="lazy" decoding="async" width="350" height="622" src="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller2-350-with-annotation.png" alt="Picture of the Arduino Bluetooth Controller showing the received message transmitted from the AT-09 BLE module and the Arduino Nano board." class="wp-image-5953" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller2-350-with-annotation.png 350w, https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller2-350-with-annotation-169x300.png 169w" sizes="auto, (max-width: 350px) 100vw, 350px" /></a><figcaption class="wp-element-caption">Figure 13.  Arduino Bluetooth Controller App Showing the Received Message</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>It must be clear now that you can send messages from your smartphone to your Arduino board.  And the other way around, you can send messages from the Arduino board to your smartphone.</strong></p>



<p>Let us go back to the Serial Monitor and type the AT command &#8220;AT+HELP&#8221; again.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal-athelp-again-annotated.png"><img loading="lazy" decoding="async" width="649" height="381" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal-athelp-again-annotated.png" alt="Another screenshot of the Serial Monitor showing how to type an AT-09 BLE AT command." class="wp-image-5955" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal-athelp-again-annotated.png 649w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal-athelp-again-annotated-300x176.png 300w" sizes="auto, (max-width: 649px) 100vw, 649px" /></a><figcaption class="wp-element-caption">Figure 14.  Arduino IDE Serial Monitor with AT Command Input</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>The word &#8220;AT+HELP&#8221; was echoed back on the Serial Monitor as expected (Figure 15).  It was also sent to the smartphone app Arduino Bluetooth Controller (Figure 16).  However, the AT-09 BLE module did not respond to the AT command &#8220;AT+HELP&#8221; to display the list of AT commands.  This shows that the AT-09 BLE module will only respond to AT commands when it is not connected to any device.  And to prove this to yourself, disconnect the Arduino Bluetooth Controller from the AT-09 module and type the &#8220;AT+HELP&#8221; again on the Serial Monitor and see what happens.  </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal3.png"><img loading="lazy" decoding="async" width="649" height="381" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal3.png" alt="Screenshot of the Arduino IDE serial monitor showing another received message from the keyboard." class="wp-image-5956" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal3.png 649w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-terminal3-300x176.png 300w" sizes="auto, (max-width: 649px) 100vw, 649px" /></a><figcaption class="wp-element-caption">Figure 15.  Arduino IDE Serial Monitor Showing the Received Message</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller3-350-annotated.png"><img loading="lazy" decoding="async" width="350" height="622" src="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller3-350-annotated.png" alt="Screenshot of the Arduino Bluetooth Controller with the received AT+HELP AT command from the Arduino board." class="wp-image-5958" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller3-350-annotated.png 350w, https://cyberblogspot.com/wp-content/uploads/2023/01/bluetooth-controller3-350-annotated-169x300.png 169w" sizes="auto, (max-width: 350px) 100vw, 350px" /></a><figcaption class="wp-element-caption">Figure 16.  Arduino Bluetooth Controlling Showing the Receive AT Command</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Controlling the Arduino Onboard LED with Smartphone</h2>



<p>Now, we are ready to control the the AT-09 BLE module on the Arduino board using our smartphone.  We are going to turn on and off the built-in LED on the Arduino Nano board.  To do this, we will add a few lines of code to our sketch.</p>



<pre class="EnlighterJSRAW">pinMode(13, OUTPUT);    //set D13 as output where built-in LED is connected
digitalWrite(13, LOW);  //initially turn off LED</pre>



<p>In the setup() procedure, we will insert the two lines of code shown above.  Since the Arduino Nano built-in LED is connected to the digital IO port D13, we will set it up as an OUTPUT port.  Then send a digitalWrite() command to initially turn it off.</p>



<pre class="EnlighterJSRAW">if (mData == &quot;0&quot;) {
    digitalWrite(13, LOW);   //turn off LED
  }

  if (mData == &quot;1&quot;) {
    digitalWrite(13, HIGH);  //turn on LED
  }</pre>



<p>Then, we will also insert codes in the loop() procedure to check the messages that are being received by the AT-09 BLE module and the Arduino board.  If a &#8220;0&#8221; message is received, the Arduino board turns off the LED, and if a &#8220;1&#8221; message comes in, the LED will be turned on.</p>



<p>Figure 17 shows how the additional codes are inserted into the previous sketch.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/how-to-use-at-09-ble-with-arduino-and-smartphone-source-code.png"><img loading="lazy" decoding="async" width="779" height="1024" src="https://cyberblogspot.com/wp-content/uploads/2023/01/how-to-use-at-09-ble-with-arduino-and-smartphone-source-code-779x1024.png" alt="Screenshot of the program to be used for sending commands from the smartphone to the AT-09 BLE and the Arduino board." class="wp-image-5959" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/how-to-use-at-09-ble-with-arduino-and-smartphone-source-code-779x1024.png 779w, https://cyberblogspot.com/wp-content/uploads/2023/01/how-to-use-at-09-ble-with-arduino-and-smartphone-source-code-228x300.png 228w, https://cyberblogspot.com/wp-content/uploads/2023/01/how-to-use-at-09-ble-with-arduino-and-smartphone-source-code-768x1010.png 768w, https://cyberblogspot.com/wp-content/uploads/2023/01/how-to-use-at-09-ble-with-arduino-and-smartphone-source-code.png 800w" sizes="auto, (max-width: 779px) 100vw, 779px" /></a><figcaption class="wp-element-caption">Figure 17.  Screenshot of the Source Code Showing the Inserted Additional Codes</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>The complete Arduino IDE source code on how to use AT-09 BLE module with Arduino and smartphone. </p>



<pre class="EnlighterJSRAW">/* cyberblogspot.com 21Jan2023
 *  
 * Program to send AT commands to AT-09 BLE module
 * and display the responses on the Serial Monitor
 * 
 * RX and TX cross wired 
 * 2k and 3k voltage divider on AT-09 RX (reduce 5V to 3V)
 */

#include &lt;SoftwareSerial.h&gt;
SoftwareSerial bleSerial(2, 3); //D2 is RX, D3 is TX

char bleData;  //storage for AT-09 data   
String mData;  //storage for AT-09 and serial monitor data

void setup() {
  Serial.begin(115200);   //initialize serial monitor
  bleSerial.begin(9600);  //and BLE serial port, default AT-09 baud rate is 9600 baud

  pinMode(13, OUTPUT);    //set D13 as output where built-in LED is connected
  digitalWrite(13, LOW);  //initially turn off LED
  
  Serial.println(&quot;AT-09 BLE module ready&quot;);
}

void loop() {
  if (Serial.available()) {      
    mData = Serial.readString(); //read serial monitor input
    Serial.println(mData);       //echo keyboard input to serial monitor
    bleSerial.println(mData);    //send keyboard input to AT-09 module
  }

  bleSerial.listen();                  //listen to the AT-09 port
  while (bleSerial.available() &gt; 0) {  //if AT-09 data available
    bleData = bleSerial.read();        //read character and
    mData = String(bleData);           //convert to string format 
    Serial.print(mData);               //display to serial monitor
  }
  
  if (mData == &quot;0&quot;) {
    digitalWrite(13, LOW);   //turn off LED
  }

  if (mData == &quot;1&quot;) {
    digitalWrite(13, HIGH);  //turn on LED
  } 
}</pre>



<h2 class="wp-block-heading">How to Set Up the Arduino Bluetooth Controller</h2>



<p>To set up the Arduino Bluetooth Controller, open the app and click on the plus icon (+) to open the template designer.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-1-350-annotated.png"><img loading="lazy" decoding="async" width="350" height="622" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-1-350-annotated.png" alt="Picture of the Arduino Bluetooth Controller showing how open the template creator in order to use the AT-09 BLE with Arduino board and a smartphone." class="wp-image-5961" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-1-350-annotated.png 350w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-1-350-annotated-169x300.png 169w" sizes="auto, (max-width: 350px) 100vw, 350px" /></a><figcaption class="wp-element-caption">Figure 18.  Arduino Bluetooth Controlling Showing How to Start Adding a Template</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Enter the Name, Text, Description, and select a color.  You may use a different name, description and color but the text must be &#8220;1&#8221;, in order to match with the code of the sketch.  Then click on Save button.  Refer to Figure 19 below.  </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-2-350-annotated.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-2-350-annotated.png" alt="Picture of the Arduino Bluetooth Controller showing how to save the newly created template." class="wp-image-5962" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-2-350-annotated.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-2-350-annotated-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 19.  Arduino Bluetooth Controller Showing How to Save a Template</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Figure 20 shows the saved template with the completed first button.  If you made a mistake, long press on the saved button, delete it, and start all over again.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-3-350.png"><img loading="lazy" decoding="async" width="350" height="622" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-3-350.png" alt="Screenshot of the Arduino Bluetooth Controller with the template for sending a message to use AT-09 BLE with Arduino and smartphone" class="wp-image-5963" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-3-350.png 350w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-3-350-169x300.png 169w" sizes="auto, (max-width: 350px) 100vw, 350px" /></a><figcaption class="wp-element-caption">Figure 20.  Arduino Bluetooth Controller with the First Item on the Template</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Repeat the above procedure for the second button.  Refer to Figure 21 below.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-4-350.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-4-350.png" alt="Picture of the Arduino Bluetooth Controller with the second button of the template for sending messages" class="wp-image-5964" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-4-350.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-4-350-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 21.  Arduino Bluetooth Controller Showing the Creation of Second Button  </figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>After saving the second button, you should have a display similar to Figure 22.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-5-350-1.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-5-350-1.png" alt="Picture of the Arduino Bluetooth Controller showing the completed template for use with AT-09, Arduino board, and an Android smartphone" class="wp-image-5966" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-5-350-1.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-bluetooth-controller-5-350-1-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 22.  Arduino Bluetooth Controller with the Finished Two-Button Template</figcaption></figure></div>


<div style="height:25px" aria-hidden="true" class="wp-block-spacer"></div>



<p>That completes the setup for the Arduino Bluetooth Controller and you may now test it for use with AT-09 BLE, Arduino and a smartphone.</p>



<h2 class="wp-block-heading">Related Articles on How to Use AT-09 BLE with Arduino and Smartphone</h2>



<p><a href="https://cyberblogspot.com/how-to-use-arduino-as-isp-programmer/" target="_blank" rel="noreferrer noopener">How to Use Arduino as ISP Programmer</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-thru-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 thru a Router</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-without-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 Without a Router</a><br><a href="https://cyberblogspot.com/how-to-install-esptool-on-windows-10/" target="_blank" rel="noreferrer noopener">How to Install Esptool on Windows 10</a><br><a href="https://cyberblogspot.com/how-to-save-and-restore-esp8266-and-esp32-firmware/" target="_blank" rel="noreferrer noopener">How to Save and Restore ESP8266 and ESP32 Firmware</a><br><a href="https://cyberblogspot.com/nodemcu-v3-esp8266-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">NodeMCU V3 ESP8266 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/nodemcu-esp-32s-pin-configuration/" target="_blank" rel="noreferrer noopener">NodeMCU ESP-32S Pin Configuration</a><br><a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">Digispark ATtiny85 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program Digispark ATtiny85 Board with Arduino IDE</a> <br><a href="https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/" target="_blank" rel="noreferrer noopener">How to Enable Serial Monitor on Digispark ATtiny85</a>                       </p>



<h2 class="wp-block-heading">References on How to Use AT-09 BLE with Arduino and Smartphone</h2>



<p><a href="https://en.wikipedia.org/wiki/Bluetooth_Low_Energy" target="_blank" rel="noreferrer noopener">Bluetooth Low Energy on Wikipedia</a><br><a href="http://wiki.amperka.ru/_media/%D0%BF%D1%80%D0%BE%D0%B4%D1%83%D0%BA%D1%82%D1%8B:troyka-ble:hm-10_datasheet.pdf" target="_blank" rel="noreferrer noopener">HM-10 Datasheet</a><br><a href="https://play.google.com/store/apps/details?id=com.argonremote.bluetoothcontroller&amp;hl=en&amp;gl=US" target="_blank" rel="noreferrer noopener">Arduino Bluetooth Controller (HM-10 Module)</a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone-2/">How to Use AT-09 BLE with Arduino and Smartphone</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ESP-01 and ESP-01S Pinout and Configuration</title>
		<link>https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/</link>
					<comments>https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 06 Feb 2023 19:59:12 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Board ESP-01 Programmer]]></category>
		<category><![CDATA[DIY ESP-01 Programmer]]></category>
		<category><![CDATA[ESP-01]]></category>
		<category><![CDATA[ESP-01 Adapter]]></category>
		<category><![CDATA[ESP-01 ESP8266]]></category>
		<category><![CDATA[ESP-01 Pinout]]></category>
		<category><![CDATA[ESP-01 Programmer]]></category>
		<category><![CDATA[ESP-01 Specification]]></category>
		<category><![CDATA[ESP-01 USB-to-serial converter programmer]]></category>
		<category><![CDATA[ESP-01S]]></category>
		<category><![CDATA[ESP-01S Pinout]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[Pinout]]></category>
		<category><![CDATA[Specification]]></category>
		<category><![CDATA[USB-to-Serial Converter]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=4635</guid>

					<description><![CDATA[<p>ESP-01 and its latest version ESP-01S are popular microcontrollers with Wi-Fi networking capabilities. They are part of the ESP8266 family of microcontrollers manufactured by Espressif Systems. In this article, we will learn the ESP-01 and ESP-01S pinout and configuration in actual applications. ESP-01 Wi-Fi Module Specifications Power Supply:Voltage 3.0V ~ 3.6VCurrent &#62;300mA Current Consumption: Continuous&#8230;&#160;<a href="https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/" rel="bookmark">Read More &#187;<span class="screen-reader-text">ESP-01 and ESP-01S Pinout and Configuration</span></a></p>
<p>The post <a href="https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/">ESP-01 and ESP-01S Pinout and Configuration</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1.png"><img loading="lazy" decoding="async" width="502" height="302" src="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1.png" alt="A picture of an ESP-01 module showing the pinout." class="wp-image-4638" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1.png 502w, https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1-300x180.png 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 1.  ESP-01 ESP8266 Microcontroller Board Pinout</figcaption></figure></div>


<p>ESP-01 and its latest version ESP-01S are popular microcontrollers with Wi-Fi networking capabilities.  They are part of the ESP8266 family of microcontrollers manufactured by Espressif Systems.  In this article, we will learn the ESP-01 and ESP-01S pinout and configuration in actual applications.</p>



<h2 class="wp-block-heading">ESP-01 Wi-Fi Module Specifications</h2>



<p><strong>Power Supply:</strong><br>Voltage 3.0V ~ 3.6V<br>Current &gt;300mA</p>



<p><strong>Current Consumption: </strong><br>Continuous Transmission: Average: ~ 71mA, Peak: 300mA<br>Modem Sleep: ~20mA<br>Light Sleep: ~2mA<br>Deep Sleep: ~0.02mA</p>



<p><strong>SPI Flash Memory:</strong><br>Default 8Mbit (1MB)</p>



<p><strong>Interface:</strong><br>UART/GPIO</p>



<p><strong>IO Port:</strong><br>2</p>



<p><strong>UART Baud Rate:</strong><br>Support 300 ~ 4608000 bps<br>Default 115200 bps</p>



<p><strong>Frequency Range:</strong><br>2412 ~ 2484MHz</p>



<p><strong>Transmit Power:</strong><br>802.11b: 16±2 dBm (@11Mbps)<br>802.11g: 14±2 dBm (@54Mbps)<br>802.11n: 13±2 dBm (@HT20, MCS7)</p>



<p><strong>Receiving Sensitivity:</strong><br>CCK, 1 Mbps : -90dBm<br>CCK, 11 Mbps: -85dBm<br>6 Mbps (1/2 BPSK): -88dBm<br>54 Mbps (3/4 64-QAM): -70dBm<br>HT20, MCS7 (65 Mbps, 72.2 Mbps): -67dBm</p>



<p>For a complete specifications, you may refer to the <a href="http://esp-01_product_specification_en.pdf" target="_blank" rel="noreferrer noopener">ESP-01 Product Specification PDF</a>.</p>



<h2 class="wp-block-heading">ESP-01 and ESP-01S Pinout  </h2>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-text-align-center">Have you just bought a new ESP-01 Wi-Fi module?  Take a look at<br><a href="https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/" target="_blank" rel="noreferrer noopener">How to Test an ESP-01 ESP8266 Module</a></p>



<p class="has-text-align-center"><br>Learn how to differentiate between ESP-01 and ESP-01S Wi-Fi modules, see:<br><a href="https://cyberblogspot.com/difference-between-esp-01-and-esp-01s/" target="_blank" rel="noreferrer noopener">Difference Between ESP-01 and ESP-01S</a></p>
</blockquote>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1.png"><img loading="lazy" decoding="async" width="502" height="302" src="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1.png" alt="" class="wp-image-4638" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1.png 502w, https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1-300x180.png 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 2.  ESP-01 Module Pinout A</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-b.png"><img loading="lazy" decoding="async" width="502" height="302" src="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-b.png" alt="Pinout of ESP-01 and ESP-01S with the male header pins on the right." class="wp-image-4640" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-b.png 502w, https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-b-300x180.png 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 3.  ESP-01 Module Pinout B</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-c.png"><img loading="lazy" decoding="async" width="402" height="526" src="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-c.png" alt="Picture showing the pinout of ESP-01 and ESP-01S with the board oriented so that the header pins are at the bottom." class="wp-image-4644" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-c.png 402w, https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-c-229x300.png 229w" sizes="auto, (max-width: 402px) 100vw, 402px" /></a><figcaption class="wp-element-caption">Figure 4.  ESP-01 Module Pinout C</figcaption></figure></div>


<h2 class="wp-block-heading">ESP-01 Pin Descriptions</h2>



<p><strong>TX </strong>&#8211; UART0 data send (transmit) pin, also known as <strong>GPIO1</strong>.<br><strong>RX</strong> &#8211; UART0 data receive pin, also known as <strong>GPIO3</strong>.<br><strong>CH_PD</strong> &#8211; Chip Power Down (also known as <strong>CH_EN</strong> or Chip Enable) &#8211; Chip enable pin, active high <br><strong>RST</strong> &#8211; External reset pin, active low<br><strong>GPIO2</strong> &#8211; General Purpose Input / Output<br><strong>GPIO0</strong> &#8211; General Purpose Input / Output<br><strong>VCC</strong> &#8211; +3.3 Volts Supply Positive <br><strong>GND</strong> &#8211; Ground &#8211; Supply negative</p>



<h2 class="wp-block-heading">ESP-01 Module Breadboarding and Adapters</h2>



<p>When breadboarding, you can not insert the ESP-01 module as it is.  A few years ago, you do all sort of tricks to breadboard an ESP-01 module, from bending the header pins to making your own DIY adapter.  Luckily, now you can buy a cheap breadboard adapter for the ESP-01 module.  See Figure 5.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-breadboard-adapter-jpg.webp"><img loading="lazy" decoding="async" width="402" height="342" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-breadboard-adapter-jpg.webp" alt="A picture of an ESP-01 and ESP-01S adapter module with an ESP-01 board inserted into it." class="wp-image-6140" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-breadboard-adapter-jpg.webp 402w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-breadboard-adapter-300x255.webp 300w" sizes="auto, (max-width: 402px) 100vw, 402px" /></a><figcaption class="wp-element-caption">Figure 5.  Breadboard Adapter for ESP-01 Module</figcaption></figure></div>


<p>If you will be connecting the ESP-01 board to an Arduino board, you must remember two (2) things:</p>



<ul class="wp-block-list">
<li>Do not supply the ESP-01 module with the 3.3V output from the Arduino board &#8211; the ESP-01 module, as per specification above, may require up to 300mA of current.  The 3.3V regulator on the Arduino board may overheat and may become damaged. </li>



<li>Provide logic level translation between the ESP-01 and the Arduino board &#8211; the Arduino board uses 5V logic while the ESP-01 module uses 3.3V logic. </li>
</ul>



<p>A good ESP-01 adapter that can satisfy the requirements for interfacing with Arduino boards is shown in Figure 6.  It has a built-in 3.3V regulator and two (2) bi-directional logic level converters for the RX and TX pins.  The schematic diagram for the adapter is shown in Figure 7.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-adapter-with-voltage-regulator-and-logic-translator-400-jpg.webp"><img loading="lazy" decoding="async" width="402" height="334" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-adapter-with-voltage-regulator-and-logic-translator-400-jpg.webp" alt="Picture of another ESP-01 and ESP-01S adapter that is complete with a 3.3V voltage regulator and bi-directional logic level converters." class="wp-image-6142" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-adapter-with-voltage-regulator-and-logic-translator-400-jpg.webp 402w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-adapter-with-voltage-regulator-and-logic-translator-400-300x249.webp 300w" sizes="auto, (max-width: 402px) 100vw, 402px" /></a><figcaption class="wp-element-caption">Figure 6.  ESP-01 Adapter with Voltage Regulator and Logic Translator</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-adapter-schematic-diagram-676-jpg.webp"><img loading="lazy" decoding="async" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-adapter-schematic-diagram-676-jpg.webp" alt="Schematic diagram of the ESP-01 and ESP-01S Wi-Fi modules adapter shown in Figure 6. " class="wp-image-6144" width="507" height="346" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-adapter-schematic-diagram-676-jpg.webp 676w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-adapter-schematic-diagram-676-300x205.webp 300w" sizes="auto, (max-width: 507px) 100vw, 507px" /></a><figcaption class="wp-element-caption">Figure 7.  Schematic Diagram of ESP-01 Adapter</figcaption></figure></div>


<h2 class="wp-block-heading">ESP-01 Programmers</h2>



<p><strong>ESP-01 USB-to-Serial Converter Programmer Module </strong></p>



<p>Unlike the other ESP8266 boards, ESP-01 boards need a programmer to be uploaded with programs or sketches from the Arduino IDE.  An inexpensive programmer is shown below in Figure 8.  The programmer uses a Silabs 2104 serial to USB converter chip.  With this programmer, you just plug it into your computer&#8217;s USB port, select the proper COM port and start uploading sketches.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/New-ESP-01-Flasher.jpg"><img loading="lazy" decoding="async" width="502" height="370" src="https://cyberblogspot.com/wp-content/uploads/2021/04/New-ESP-01-Flasher.jpg" alt="A USB-to-serial converter programmer for the ESP-01 and ESP-01S modules." class="wp-image-4714" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/New-ESP-01-Flasher.jpg 502w, https://cyberblogspot.com/wp-content/uploads/2021/04/New-ESP-01-Flasher-300x221.jpg 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 8.  ESP-01 Programmer or Flasher</figcaption></figure></div>


<p><strong>DIY USB-to-Serial Converter Programmer</strong></p>



<p>If you do not have a programmer module but you have an available USB-to-serial converter, you can wire it up as an ESP-01 programmer.  The schematic diagram of a DIY programmer is shown in Figure 9.  With this programmer, you need to put the ESP-01 module into programming mode before uploading a sketch.  This is done by holding down the Flash switch, pressing and releasing the Reset switch, and then releasing the Flash switch.   </p>



<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-flasher-with-cp2102-1K.png"><img loading="lazy" decoding="async" width="1002" height="402" src="https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-flasher-with-cp2102-1K.png" alt="Schematic diagram of a DIY USB-to-serial converter programmer for the ESP-01/ESP-01S." class="wp-image-4694" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-flasher-with-cp2102-1K.png 1002w, https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-flasher-with-cp2102-1K-300x120.png 300w, https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-flasher-with-cp2102-1K-768x308.png 768w" sizes="auto, (max-width: 1002px) 100vw, 1002px" /></a><figcaption class="wp-element-caption">Figure 9.  DIY USB-to-Serial Converter Programmer</figcaption></figure>



<p>Shown below in Figures 10, 11, and 12 is my DIY ESP-01 programmer.  The USB-to-serial converter connects to the programmer board via the 4-pin male header on the board.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/DIY-esp-01-flasher-500-rotated-e1619233048704.jpg"><img loading="lazy" decoding="async" width="500" height="412" src="https://cyberblogspot.com/wp-content/uploads/2021/04/DIY-esp-01-flasher-500-rotated-e1619233048704.jpg" alt="Picture of an assembled DIY programmer for the ESP-01 ESP8266 Wi-Fi modules." class="wp-image-4711" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/DIY-esp-01-flasher-500-rotated-e1619233048704.jpg 500w, https://cyberblogspot.com/wp-content/uploads/2021/04/DIY-esp-01-flasher-500-rotated-e1619233048704-300x247.jpg 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><figcaption class="wp-element-caption">Figure 10.  My DIY ESP-01 Programmer </figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/flasher-with-esp01-500-1.jpg"><img loading="lazy" decoding="async" width="500" height="356" src="https://cyberblogspot.com/wp-content/uploads/2021/04/flasher-with-esp01-500-1.jpg" alt="Picture of a DIY USB-to-serial converter programmer with an ESP-01 module inserted on the female header." class="wp-image-4708" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/flasher-with-esp01-500-1.jpg 500w, https://cyberblogspot.com/wp-content/uploads/2021/04/flasher-with-esp01-500-1-300x214.jpg 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><figcaption class="wp-element-caption">Figure 11.  My DIY ESP-01 Programmer with an ESP-01 Module</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/cp2102-usb-serial-converter.jpg"><img loading="lazy" decoding="async" width="502" height="471" src="https://cyberblogspot.com/wp-content/uploads/2021/04/cp2102-usb-serial-converter.jpg" alt="Picture of an USB-to-serial converter for use with ESP-01 DIY programmer." class="wp-image-4657" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/cp2102-usb-serial-converter.jpg 502w, https://cyberblogspot.com/wp-content/uploads/2021/04/cp2102-usb-serial-converter-300x281.jpg 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 12.  USB-to-serial Converter</figcaption></figure></div>


<p><strong>Arduino Board as ESP-01 Programmer</strong><br>Another option for an ESP-01 programmer is to use an Arduino board.  You may use any available Arduino board such as Arduino Uno, Arduino Nano, etc.</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/arduino-uno-as-esp-01-programmer.png"><img loading="lazy" decoding="async" width="1024" height="366" src="https://cyberblogspot.com/wp-content/uploads/2023/02/arduino-uno-as-esp-01-programmer-1024x366.png" alt="Schematic diagram of Arduino Uno used as an ESP-01 programmer that includes the pinout of both the ESP-01 and the Arduino Uno board." class="wp-image-6147" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/arduino-uno-as-esp-01-programmer-1024x366.png 1024w, https://cyberblogspot.com/wp-content/uploads/2023/02/arduino-uno-as-esp-01-programmer-300x107.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/arduino-uno-as-esp-01-programmer-768x275.png 768w, https://cyberblogspot.com/wp-content/uploads/2023/02/arduino-uno-as-esp-01-programmer.png 1202w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Figure 13.  Schematic Diagram of Arduino Uno as ESP-01 Programmer</figcaption></figure></div>


<p>The idea here is to use the Arduino board&#8217;s built-in USB-to-serial converter.  The schematic diagram in Figure 13 is the same as the DIY ESP-01 programmer in Figure 9, but the USB-to-serial converter was replaced with an Arduino Uno.  </p>



<p>As previously discussed above, the 3.3V output from the Arduino board should not be used.  Instead, a 3.3V voltage regulator was provided for the ESP-01 module.  Also, a logic level converter was used consisting of a 2.2K resistor in series with a 3.3K resistor acting as a voltage divider.  This protects the RX pin of the ESP-01 module from being exposed to a 5V signal from the Arduino board.  Note that the TX pin of the ESP-01 module was connected directly to the TX pin of the Arduino board.  We can do away with the logic level converter because the TX pin is acting as an output (outgoing signal).</p>



<p>You may have noticed that the TX and RX pins of the Arduino board are connected to the corresponding TX and RX pins of the ESP-01 module.  But in the DIY programmer in Figure 9, the TX and RX terminals are cross-wired.  That is, the TX pin of the USB-to-serial converter is connected to the RX pin of the ESP-01 module  and ,vice versa, the RX pin of the USB-to-serial converter is connected to the TX pin of the ESP-01 module.</p>



<p>If you want to find out why the Arduino board&#8217;s RX and TX pins are wired straight thru and not crossed over with the ESP-01 board, consult an Arduino board schematic and look at how the MCU chip and the USB-to-serial converter chip are wired.  I am leaving this one as an exercise for the reader.  </p>



<h2 class="wp-block-heading">Related Articles on ESP-01 and ESP-01S Pinout and Configuration</h2>



<p><a href="https://cyberblogspot.com/how-to-program-esp-01-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ESP-01 with Arduino IDE</a><br><a href="https://cyberblogspot.com/how-to-set-up-arduino-ide-for-esp8266-programming/" target="_blank" rel="noreferrer noopener">How to Set up Arduino IDE for ESP8266 Programming</a>                                          <br><a href="https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/" target="_blank" rel="noreferrer noopener">How to Test an ESP-01 ESP8266 Module</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-thru-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 thru a Router</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-without-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 Without a Router</a><br><a href="https://cyberblogspot.com/esp-01-with-rtc-and-lcd-display/" target="_blank" rel="noreferrer noopener">ESP-01 with RTC and LCD Display</a><br><a href="https://cyberblogspot.com/how-to-save-and-restore-esp8266-and-esp32-firmware/" target="_blank" rel="noreferrer noopener">How to Save and Restore ESP8266 and ESP32 Firmware</a><br><a href="https://cyberblogspot.com/nodemcu-v3-esp8266-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">NodeMCU V3 ESP8266 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-test-a-nodemcu-v3-esp8266-dev-board/" target="_blank" rel="noreferrer noopener">How to Test a NodeMCU V3 ESP8266 Dev Board</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a></p>



<h2 class="wp-block-heading">References on ESP-01 and ESP-01S Pinout and Configuration</h2>



<p><a href="https://docs.ai-thinker.com/_media/esp8266/docs/esp-01_product_specification_en.pdf" target="_blank" rel="noreferrer noopener">ESP-01 Specification</a><br><a href="https://www.microchip.ua/wireless/esp01.pdf" target="_blank" rel="noreferrer noopener">ESP-01 Datasheet</a> </p>
<p>The post <a href="https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/">ESP-01 and ESP-01S Pinout and Configuration</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/esp-01-and-esp-01s-pinout-and-configuration/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Difference Between ESP-01 and ESP-01S</title>
		<link>https://cyberblogspot.com/difference-between-esp-01-and-esp-01s/</link>
					<comments>https://cyberblogspot.com/difference-between-esp-01-and-esp-01s/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 05 Feb 2023 05:44:18 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino Board]]></category>
		<category><![CDATA[Arduino IDE]]></category>
		<category><![CDATA[ESP-01]]></category>
		<category><![CDATA[ESP-01 ESP8266]]></category>
		<category><![CDATA[ESP-01 Pinout]]></category>
		<category><![CDATA[ESP-01S]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[Programming Switch]]></category>
		<category><![CDATA[Pull-up Resistor]]></category>
		<category><![CDATA[Reset Switch]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=6118</guid>

					<description><![CDATA[<p>The ESP-01 Wi-Fi module is one of the most popular ESP8266-based microcontroller board. It is very inexpensive and widely available. If you are new with ESP-01 modules, or are contemplating on buying one, you are lucky for visiting this page. We have here all the necessary information on the difference between ESP-01 and ESP-01S Wi-Fi&#8230;&#160;<a href="https://cyberblogspot.com/difference-between-esp-01-and-esp-01s/" rel="bookmark">Read More &#187;<span class="screen-reader-text">Difference Between ESP-01 and ESP-01S</span></a></p>
<p>The post <a href="https://cyberblogspot.com/difference-between-esp-01-and-esp-01s/">Difference Between ESP-01 and ESP-01S</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1.png"><img loading="lazy" decoding="async" width="502" height="302" src="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1.png" alt="Picture of ESP-01 module showing the names of the different pins" class="wp-image-4638" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1.png 502w, https://cyberblogspot.com/wp-content/uploads/2021/04/esp-01-pinout-1-300x180.png 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 1.  ESP-01/ESP-01S ESP8266 Wi-Fi Module Pinout</figcaption></figure></div>


<p>The ESP-01 Wi-Fi module is one of the most popular ESP8266-based microcontroller board.  It is very inexpensive and widely available.  If you are new with ESP-01 modules, or are contemplating on buying one, you are lucky for visiting this page.  We have here all the necessary information on the difference between ESP-01 and ESP-01S Wi-Fi modules. </p>



<p>The ESP-01 module and the ESP-01S module are functionally the same.  However, knowing the difference between the two is very important because it can affect how you wire them to external circuits.  Also, the boards have different current consumption owing to their difference in the number of onboard LEDs.</p>



<h2 class="wp-block-heading">ESP-01S is a Newer Version</h2>



<p>First off, the ESP-01 module was the original version that was popularized almost a decade ago.  The ESP-01S is the newer version.  At the time of this writing, circa 2023, the original ESP-01 module is still widely available.  Most online stores would allow you to choose between an ESP-01 or an ESP-01S.  But some stores may sell you an ESP-01 for an ESP-01S, or vice versa.</p>



<h2 class="wp-block-heading">Difference in Physical Appearance</h2>



<p>At first glance, the two modules look the same.  However, a close examination of the boards will show the difference in the number of LEDs (Light Emitting Diodes).  Please see Figure 2 below.  In the original ESP-01, there are two (2) small LEDs.  On the other hand, the ESP-01S has a single, bigger LED.</p>



<p>The difference becomes more apparent when you supply power to the boards.  The ESP-01 board will have a red LED light turned on indicating the presence of power.  On the ESP-01S board, you will only see a blue LED flash for a while when the power is applied.   </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-jpg.webp"><img loading="lazy" decoding="async" width="802" height="602" src="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-jpg.webp" alt="A picture comparing the ESP-01 module with the ESP-01S module highlighting the difference in the indicator LEDs." class="wp-image-6077" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-jpg.webp 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-300x225.webp 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-768x576.webp 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 2.  Physical Comparison of ESP-01 and ESP-01S Modules</figcaption></figure></div>


<h2 class="wp-block-heading">The Blue LED Wiring Difference Between ESP-01 and ESP-01S</h2>



<p>Although both boards have a blue serial-activity LED, the blue LEDs are wired differently.  See Figure 3.  In the ESP-01 board, the blue LED is connected on the VCC and the TX pins, while on the ESP-01S, it is connected on the VCC and the GPIO2 pins.  On both boards, a 2.2K ohms resistor is used in series with the blue LED as a current limiter. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-vs-esp-01s-800.png"><img loading="lazy" decoding="async" width="802" height="578" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-vs-esp-01s-800.png" alt="Picture of the ESP-01 board side by side with the ESP-01S board showing the internal connections of the LEDs and the pull-up resistors" class="wp-image-6120" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-vs-esp-01s-800.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-vs-esp-01s-800-300x216.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-vs-esp-01s-800-768x553.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 3.  Internal Wiring Comparison of ESP-01 and ESP-01S Modules </figcaption></figure></div>


<h2 class="wp-block-heading">Pull-up Resistors on ESP-01S</h2>



<p>Another difference between ESP-01 and ESP-01S is the presence of three (3) pull-up resistors on the ESP-01S module.  Pull-up resistors are used to provide a logic HIGH signal to a circuit.  As shown on the right side of Figure 3 above, three (3) 12K-ohm resistors are connected from the VCC to the RESET, GPIO0, and CH_PD pins on the ESP-01S board.</p>



<p>Prior to the availability of the ESP-01S module, a popular ESP-01 wiring scheme for adding a reset switch and a programming switch is shown below in Figure 4.  First of all, in order to power up the ESP-01 board, you need to pull up the CH_PD (Chip Enable/Power Down) pin.  Next, you connect the RESET pin to the VCC because you do not want the RESET pin hanging and be vulnerable to noise causing unexpected resets.  And third, pulling up the GPIO0 pin to VCC will automatically run the program or sketch loaded on the ESP-01 module after a  power up or a reset.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-pull-up-resistors.png"><img loading="lazy" decoding="async" width="802" height="578" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-pull-up-resistors.png" alt="Schematic diagram of an ESP-01 with reset and programming switches." class="wp-image-6125" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-pull-up-resistors.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-pull-up-resistors-300x216.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-pull-up-resistors-768x553.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 4.  Schematic Diagram of ESP-01 with Reset and Programming Switches</figcaption></figure></div>


<p>On the newer ESP-01S module, the circuit shown above will be a lot more simple.  There is no need to externally supply the three (3) pull-up resistors.  See Figure 5.       </p>



<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-no-pull-up-resistors.png"><img loading="lazy" decoding="async" width="802" height="491" src="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-no-pull-up-resistors.png" alt="Schematic diagram of the board with reset switch and programming switch." class="wp-image-6127" srcset="https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-no-pull-up-resistors.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-no-pull-up-resistors-300x184.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/02/esp-01-schematic-with-no-pull-up-resistors-768x470.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 5.  Schematic Diagram of ESP-01S with Reset and Programming Switches  </figcaption></figure>



<h2 class="wp-block-heading">Summary on Difference Between ESP-01 and ESP-01S</h2>



<p>The ESP-01 and the ESP-01S Wi-Fi modules are functionally the same.  The ESP-01S module is a newer version of the original ESP-01 module.  The ESP-01 module has a red power indicator LED that is absent on the ESP-01S.  Both modules have a blue LED that indicates serial activity.  However, the blue LED is wired differently on each module&#8217;s version.  And finally, the ESP-01S module has three (3) on board pull-up resistors that are missing on an ESP-01 module.</p>



<h2 class="wp-block-heading">Related Articles</h2>



<p><a href="https://cyberblogspot.com/how-to-program-esp-01-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ESP-01 with Arduino IDE</a><br><a href="https://cyberblogspot.com/how-to-set-up-arduino-ide-for-esp8266-programming/" target="_blank" rel="noreferrer noopener">How to Set up Arduino IDE for ESP8266 Programming</a>                                          <br><a href="https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/" target="_blank" rel="noreferrer noopener">How to Test an ESP-01 ESP8266 Module</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-thru-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 thru a Router</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-without-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 Without a Router</a><br><a href="https://cyberblogspot.com/esp-01-with-rtc-and-lcd-display/" target="_blank" rel="noreferrer noopener">ESP-01 with RTC and LCD Display</a><br><a href="https://cyberblogspot.com/how-to-save-and-restore-esp8266-and-esp32-firmware/" target="_blank" rel="noreferrer noopener">How to Save and Restore ESP8266 and ESP32 Firmware</a><br><a href="https://cyberblogspot.com/nodemcu-v3-esp8266-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">NodeMCU V3 ESP8266 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-test-a-nodemcu-v3-esp8266-dev-board/" target="_blank" rel="noreferrer noopener">How to Test a NodeMCU V3 ESP8266 Dev Board</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a></p>



<h2 class="wp-block-heading">References on Difference Between ESP-01 and ESP-01S</h2>



<p><a href="https://en.wikipedia.org/wiki/ESP8266" target="_blank" rel="noreferrer noopener">ESP8266 on Wikipedia</a><br><a href="https://github.com/esp8266/esp8266-wiki/wiki/Boot-Process" target="_blank" rel="noreferrer noopener">ESP8266 Boot Process</a></p>
<p>The post <a href="https://cyberblogspot.com/difference-between-esp-01-and-esp-01s/">Difference Between ESP-01 and ESP-01S</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/difference-between-esp-01-and-esp-01s/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>How to Test an ESP-01 ESP8266 Module</title>
		<link>https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/</link>
					<comments>https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 01 Feb 2023 19:31:54 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino IDE]]></category>
		<category><![CDATA[AT Command]]></category>
		<category><![CDATA[AT Firmware]]></category>
		<category><![CDATA[ESP-01]]></category>
		<category><![CDATA[ESP-01 ESP8266]]></category>
		<category><![CDATA[ESP-01 Flasher]]></category>
		<category><![CDATA[ESP-01 Programmer]]></category>
		<category><![CDATA[ESP-01S]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[Schematic Diagram]]></category>
		<category><![CDATA[Serial Monitor]]></category>
		<category><![CDATA[Smartphone]]></category>
		<category><![CDATA[Wi-Fi]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=4652</guid>

					<description><![CDATA[<p>When you buy a new ESP-01 ESP8266 module, the very first thing to do is to test it. That is, you need to make sure that you have a good and working ESP-01 module. We will take a look at the different methods of testing the ESP-01 ESP8266 Wi-Fi module. Differences Between ESP-01 and ESP-01S&#8230;&#160;<a href="https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/" rel="bookmark">Read More &#187;<span class="screen-reader-text">How to Test an ESP-01 ESP8266 Module</span></a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/">How to Test an ESP-01 ESP8266 Module</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-with-border.jpg"><img loading="lazy" decoding="async" width="602" height="602" src="https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-with-border.jpg" alt="A picture of an ESP-01 ESP8266 module that is ready for testing" class="wp-image-4647" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-with-border.jpg 602w, https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-with-border-300x300.jpg 300w, https://cyberblogspot.com/wp-content/uploads/2021/04/ESP-01-with-border-150x150.jpg 150w" sizes="auto, (max-width: 602px) 100vw, 602px" /></a><figcaption class="wp-element-caption">Figure 1.  ESP-01 ESP8266 Module</figcaption></figure></div>


<p>When you buy a new ESP-01 ESP8266 module, the very first thing to do is to test it.  That is, you need to make sure that you have a good and working ESP-01 module.  We will take a look at the different methods of testing the ESP-01 ESP8266 Wi-Fi module.  </p>



<h2 class="wp-block-heading">Differences Between ESP-01 and ESP-01S ESP8266 Module</h2>



<p>Before we proceed, be aware that there are two (2) versions of ESP-01 modules.  The older ESP-01 module and the newer ESP-01S module.  Both modules are functionally the same.  However, there are two points worth mentioning here.  </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-jpg.webp"><img loading="lazy" decoding="async" width="802" height="602" src="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-jpg.webp" alt="Picture showing the differences between an ESP-01 and ESP-01S ESP8266 modules prior to testing" class="wp-image-6077" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-jpg.webp 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-300x225.webp 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-vs-esp-01s-side-by-side-768x576.webp 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 2.  ESP-01 Module and ESP-01S Module Comparison </figcaption></figure></div>


<p>First, the ESP-01 has two (2) LEDs, a red LED power indicator and a blue LED that indicates serial activity.  On the other hand, the newer ESP-01S has only one (1) LED, the blue LED light (see Figure 2 above).  Moreover, the blue LED serial activity indicator light is wired differently on each module.  That is, on an ESP-01 module, it is connected on the TX pin (GPIO1) while on the ESP-01S module, it is connected on the GPIO2 pin.  And as a side note, pins GPIO0 and GPIO1 are both serial TX capable pins (refer to the ESP-01S schematic diagram at the end of this article).   </p>



<p>Second, the ESP-01S module has three (3) additional on-board resistors used as pull-up resistors.  These pull-up resistors are 12K-ohm resistors each connected on the GPIO0, the RESET, and the CH_PD pins.  You may also want to refer again to the ESP-01S schematic diagram included at the end of this article.      </p>



<h2 class="wp-block-heading">Quick and Dirty Test</h2>



<p>The ESP-01 module is shipped with a program called AT firmware.  The firmware will let you send AT commands to configure and program the module.  More important, the module is configured as a Wi-Fi Access Point (AP) when shipped.  Therefore, a quick and dirty test is to power the ESP-01 module and use a smartphone to connect to the Access Point.</p>



<p>Power up the ESP-01 module as shown in Figure 3.  Notice that we need to connect the ESP-01 module to a 3.3V power supply.  Do not connect the ESP-01 module to the 3.3V output of an Arduino board.  Provide a separate 3.3V power supply with sufficient current capacity.  Also, note that a 10K ohms resistor is connected from the CH_PD pin to the VCC or the 3.3V supply.  The CH_PD (Chip Power Down / Enable Pin) pin has to be pulled up to the VCC for the module to function.  If you have the ESP-01S module, you do not need to connect a 10K ohm resistor on the CH_PD pin.  As per discussion above on the differences between the ESP-01 and the ESP-01S modules, the ESP-01S already has a 12K-ohm pull-up resistor on the CH_PD pin.       </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-with-power-supply.png"><img loading="lazy" decoding="async" width="602" height="377" src="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-with-power-supply.png" alt="A picture depicting how to supply power to the ESP-01 ESP8266 Wi-Fi module in order to do a quick test" class="wp-image-6078" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-with-power-supply.png 602w, https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01-with-power-supply-300x188.png 300w" sizes="auto, (max-width: 602px) 100vw, 602px" /></a><figcaption class="wp-element-caption">Figure 3.  ESP-01 8266 Module with Power Supply</figcaption></figure></div>


<p>After powering up, you should see the ESP-01 access point when you scan for Wi-Fi devices.  The default SSID of the ESP-01 module I am using is ESP_7B0F95.  See Figure 4.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-scan.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-scan.png" alt="Screenshot of a smartphone Wi-Fi settings showing the SSID of nearby Wi-Fi devices." class="wp-image-6082" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-scan.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-scan-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 4.  Smartphone Wi-Fi Scan</figcaption></figure></div>


<p>Connect to the ESP-01 Access Point.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-connected-350-final.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-connected-350-final.png" alt="Screenshot of an Android smartphone Wi-Fi settings showing the module as connected to the smartphone." class="wp-image-6084" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-connected-350-final.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-connected-350-final-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 5.  Smartphone Wi-Fi Connected to ESP-01 Access Point</figcaption></figure></div>


<p>Click on the Settings icon (gear icon) and see the network details of the ESP-01 module Access Point.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-esp-01-access-point-properties.png"><img loading="lazy" decoding="async" width="352" height="624" src="https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-esp-01-access-point-properties.png" alt="Screenshot of a smartphone Wi-Fi settings showing the network characteristics of the ESP-01 ESP8266 module acting as an access point." class="wp-image-6085" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-esp-01-access-point-properties.png 352w, https://cyberblogspot.com/wp-content/uploads/2023/01/smartphone-wi-fi-esp-01-access-point-properties-169x300.png 169w" sizes="auto, (max-width: 352px) 100vw, 352px" /></a><figcaption class="wp-element-caption">Figure 6.  The ESP-01 Access Point Network Properties</figcaption></figure></div>


<h2 class="wp-block-heading">AT Command Test</h2>



<p>For the next test, you need an ESP-01 programmer or flasher.  An inexpensive programmer/flasher is shown below in Figures 7.  In Figure 8, the ESP-01 module is shown inserted into the programmer/flasher.  If you do not have a programmer/flasher, it is possible to use an Arduino board as a programmer/flasher.  Also, if you have a USB-to-serial(TTL) converter, you could wire it up as an ESP-01 programmer/flasher.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/New-ESP-01-Flasher.jpg"><img loading="lazy" decoding="async" width="502" height="370" src="https://cyberblogspot.com/wp-content/uploads/2021/04/New-ESP-01-Flasher.jpg" alt="Picture of an inexpensive ESP-01 ESP8266 programmer/flasher for testing the ESP-01 module." class="wp-image-4714" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/New-ESP-01-Flasher.jpg 502w, https://cyberblogspot.com/wp-content/uploads/2021/04/New-ESP-01-Flasher-300x221.jpg 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 7.  An ESP-01 Programmer/Flasher</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2021/04/new-esp-01-flasher-wth-module-500.jpg"><img loading="lazy" decoding="async" width="500" height="379" src="https://cyberblogspot.com/wp-content/uploads/2021/04/new-esp-01-flasher-wth-module-500.jpg" alt="Picture showing the ESP-01 ESP8266 module inserted on an ESP-01 programmer/flasher." class="wp-image-4715" srcset="https://cyberblogspot.com/wp-content/uploads/2021/04/new-esp-01-flasher-wth-module-500.jpg 500w, https://cyberblogspot.com/wp-content/uploads/2021/04/new-esp-01-flasher-wth-module-500-300x227.jpg 300w" sizes="auto, (max-width: 500px) 100vw, 500px" /></a><figcaption class="wp-element-caption">Figure 8.  ESP-01 Module on a Programmer/Flasher</figcaption></figure></div>


<p>Insert the ESP-01 module to the programmer as shown in Figure 8 and plug the programmer to the computer.  If it is your first time to use your programmer/flasher, you may have to install its device driver.  Open the Arduino IDE and set the appropriate COM port for your programmer (Figure 9).  For the meantime, there is no need to set the Board type.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-port-selection.png"><img loading="lazy" decoding="async" width="602" height="420" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-port-selection.png" alt="Picture of the Arduino IDE showing how to select the proper COM port." class="wp-image-6087" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-port-selection.png 602w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-port-selection-300x209.png 300w" sizes="auto, (max-width: 602px) 100vw, 602px" /></a><figcaption class="wp-element-caption">Figure 9.  The Arduino IDE Showing How to Select COM port</figcaption></figure></div>


<p>Open the Serial Monitor and change the settings as shown in Figure 10.  The line ending setting must be set to both newline and carriage return, &#8220;Both NL &amp; CR&#8221;.  Additionally, the baud rate setting must be set to &#8220;115200 baud&#8221;.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-settings-1.png"><img loading="lazy" decoding="async" width="603" height="383" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-settings-1.png" alt="Screenshot of Arduino IDE serial monitor annotated with the proper line ending setting and baud rate setting." class="wp-image-6088" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-settings-1.png 603w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-settings-1-300x191.png 300w" sizes="auto, (max-width: 603px) 100vw, 603px" /></a><figcaption class="wp-element-caption">Figure 10.  The Arduino IDE Serial Monitor Settings</figcaption></figure></div>


<p>Now type &#8220;AT&#8221;, press the return key and the ESP-01 module should reply &#8220;OK&#8221;.</p>



<p>To view the ESP-01 module firmware version, type &#8220;AT+GMR&#8221;.</p>



<p>Type &#8220;AT+CIFSR&#8221; to view the Access Point&#8217;s IP address and network MAC address.  See Figure 11 for the output display.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-with-at-commands.png"><img loading="lazy" decoding="async" width="601" height="381" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-with-at-commands.png" alt="Screenshot of the Arduino IDE serial monitor showing the results of testing an ESP-01 8266 module with AT commands." class="wp-image-6089" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-with-at-commands.png 601w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-monitor-with-at-commands-300x190.png 300w" sizes="auto, (max-width: 601px) 100vw, 601px" /></a><figcaption class="wp-element-caption">Figure 11.  The Arduino IDE Serial Monitor Showing the Results of AT Commands</figcaption></figure></div>


<p>For a complete guide on the ESP-01 module AT commands, see <a href="https://room-15.github.io/blog/2015/03/26/esp8266-at-command-reference/" target="_blank" rel="noreferrer noopener">ESP8266 &#8211; AT Command Reference</a>.</p>



<h2 class="wp-block-heading">Programming with Arduino IDE</h2>



<p>In the next test, we will upload a modified version of the sample sketch Blink from the Arduino IDE.  The sketch should make the blue LED on the ESP-01 module turn on and off.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-text-align-center"><strong>IMPORTANT</strong><br>Uploading an Arduino sketch to the ESP-01 module will erase the AT firmware.  The AT commands will not work anymore after the upload.  If you want to be able to restore the original firmware, please see the article <br><a href="https://cyberblogspot.com/how-to-save-and-restore-esp8266-and-esp32-firmware/" target="_blank" rel="noreferrer noopener">How to Save and Restore ESP8266 and ESP32 Firmware</a>.</p>
</blockquote>



<p>With the ESP-01 module still in the programmer/flasher, open the Arduino IDE and change the Board setting to &#8220;Generic ESP8266 Module&#8221; as shown in Figure 12.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-board-selection-850.png"><img loading="lazy" decoding="async" width="852" height="465" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-board-selection-850.png" alt="Screenshot of the Arduino IDE showing how to set the board prior to testing the ESP-01 ESP8266 Wi-Fi module." class="wp-image-6092" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-board-selection-850.png 852w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-board-selection-850-300x164.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-board-selection-850-768x419.png 768w" sizes="auto, (max-width: 852px) 100vw, 852px" /></a><figcaption class="wp-element-caption">Figure 12.  The Arduino IDE Showing How to Set the MCU Board</figcaption></figure></div>


<p>Create a new sketch, copy and paste the blink program shown below.  Upload the sketch to the ESP-01 module.  The blue LED should start blinking after successfully uploading the sketch.</p>



<pre class="EnlighterJSRAW">/*
 * cyberblogspot.com 01Feb2023
 */

#define LED_BUILTIN 1                // GPIO1 for ESP-01, GPIO2 for ESP-01S
                                     // Change to 2 for ESP-01S module
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);   
}

void loop() {
  digitalWrite(LED_BUILTIN, LOW);   // Turn the LED on (ESP-01 LED is active low)
  delay(1000);                      
  digitalWrite(LED_BUILTIN, HIGH);  // Turn the LED off 
  delay(1000);                     
}</pre>



<h2 class="wp-block-heading">Schematic Diagram of ESP-01S ESP8266 Wi-Fi Module</h2>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01s-schematic-diagram-jpg.webp"><img loading="lazy" decoding="async" width="1024" height="570" src="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01s-schematic-diagram-1024x570.webp" alt="Schematic diagram of ESP-01S ESP8266 Wi-Fi module that can be used for reference purposes especially when testing the module" class="wp-image-6079" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01s-schematic-diagram-1024x570.webp 1024w, https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01s-schematic-diagram-300x167.webp 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01s-schematic-diagram-768x427.webp 768w, https://cyberblogspot.com/wp-content/uploads/2023/01/esp-01s-schematic-diagram-jpg.webp 1082w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Figure 13. ESP-01S Wi-Fi Module Schematic Diagram</figcaption></figure></div>


<h2 class="wp-block-heading">Related Articles on How to Test an ESP-01 ESP8266 Module</h2>



<p><a href="https://cyberblogspot.com/how-to-set-up-arduino-ide-for-esp8266-programming/" target="_blank" rel="noreferrer noopener">How to Set up Arduino IDE for ESP8266 Programming</a><br><a href="https://cyberblogspot.com/how-to-program-esp-01-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ESP-01 with Arduino IDE</a>                                       <br><a href="https://cyberblogspot.com/how-to-control-esp-01-thru-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 thru a Router</a><br><a href="https://cyberblogspot.com/how-to-control-esp-01-without-a-router/" target="_blank" rel="noreferrer noopener">How to Control ESP-01 Without a Router</a><br><a href="https://cyberblogspot.com/esp-01-with-rtc-and-lcd-display/" target="_blank" rel="noreferrer noopener">ESP-01 with RTC and LCD Display</a><br><a href="https://cyberblogspot.com/esp-01-esp8266-ntp-clock-with-lcd-display/" target="_blank" rel="noreferrer noopener">ESP-01 ESP8266 NTP Clock with LCD Display</a><br><a href="https://cyberblogspot.com/how-to-test-nodemcu-v3-using-esptool/" target="_blank" rel="noreferrer noopener">How to Test NodeMCU V3 Using Esptool</a><br><a href="https://cyberblogspot.com/nodemcu-v3-esp8266-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">NodeMCU V3 ESP8266 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a>               </p>



<h2 class="wp-block-heading">References on How to Test an ESP-01 ESP8266 Module</h2>



<p><a href="https://en.wikipedia.org/wiki/ESP8266" target="_blank" rel="noreferrer noopener">ESP8266 on Wikipedia</a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/">How to Test an ESP-01 ESP8266 Module</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/how-to-test-an-esp-01-esp8266-module/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Enable Serial Monitor on Digispark ATtiny85</title>
		<link>https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/</link>
					<comments>https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 18 Jan 2023 01:14:31 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino IDE]]></category>
		<category><![CDATA[ATtiny85]]></category>
		<category><![CDATA[CH304]]></category>
		<category><![CDATA[COM Port]]></category>
		<category><![CDATA[CP2104]]></category>
		<category><![CDATA[Digispark]]></category>
		<category><![CDATA[Digispark ATtiny85]]></category>
		<category><![CDATA[Digispark ATtiny85 Development Board]]></category>
		<category><![CDATA[FTDI]]></category>
		<category><![CDATA[PL2303]]></category>
		<category><![CDATA[Serial Monitor]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[USB Interface]]></category>
		<category><![CDATA[USB-to-Serial Converter]]></category>
		<category><![CDATA[USB-to-Serial TTL Converter]]></category>
		<category><![CDATA[USB-to-UART Converter]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=5739</guid>

					<description><![CDATA[<p>The Serial Monitor in Arduino IDE is an indispensable tool for debugging purposes. However, although a Digispark ATtiny85 development board has a USB interface, the Serial Monitor does not work with it. The main reason is that the USB interface in the Digispark board is not a serial COM port. The second reason is that&#8230;&#160;<a href="https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/" rel="bookmark">Read More &#187;<span class="screen-reader-text">How to Enable Serial Monitor on Digispark ATtiny85</span></a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/">How to Enable Serial Monitor on Digispark ATtiny85</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>The Serial Monitor in Arduino IDE is an indispensable tool for debugging purposes.  However, although a Digispark ATtiny85 development board has a USB interface, the Serial Monitor does not work with it.  The main reason is that the USB interface in the Digispark board is not a serial COM port.  The second reason is that the ATtiny85 chip does not have a UART port.  And third, the Digispark board lacks a UART to USB bridge circuitry to translate UART signals to USB signals.  In this article, we will take a look at how to enable the Serial Monitor when using a Digispark ATtiny85 development board.</p>



<p>To enable the Arduino IDE Serial Monitor on a Digispark ATtiny85 board, connect a USB-to-Serial converter.  Then use the SoftwareSerial library in the Arduino IDE to create a UART port on the ATtiny85 chip.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb.png"><img loading="lazy" decoding="async" width="802" height="542" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb.png" alt="Picture of Fritzing breadboard diagram showing how to connect the Digispark ATtiny85 board to a USB to serial converter to enable the serial monitor when working with Digispark ATtiny85" class="wp-image-5845" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb-300x203.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-fritzing-bb-768x519.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 1.  Fritzing Breadboard Diagram of Digispark ATtiny85 with a USB-to-Serial Converter</figcaption></figure></div>


<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-text-align-center">For Digispark ATtiny85 pinout guide, kindly see <a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">Digispark ATtiny85 Pinout and Configuration</a>.</p>
</blockquote>



<p></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter.png"><img loading="lazy" decoding="async" width="1002" height="477" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter.png" alt="Schematic diagram for connecting the Digispark ATtiny85 board to a USB to UART converter to enable the serial monitor of the Arduino IDE." class="wp-image-5754" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter.png 1002w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-300x143.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-usb-to-serial-converter-768x366.png 768w" sizes="auto, (max-width: 1002px) 100vw, 1002px" /></a><figcaption class="wp-element-caption">Figure 2.  Schematic Diagram of Digispark ATtiny85 and USB-to-Serial Converter Connection </figcaption></figure></div>


<p></p>



<h2 class="wp-block-heading">Step by Step Guide For Serial Monitor</h2>



<p><strong>STEP 1 &#8211; Connect a USB-to-Serial Converter</strong></p>



<p>First, connect a USB-to-serial converter to the Digispark ATtiny85 board as shown in Figure 1 and Figure 2.  </p>



<p>There are many inexpensive USB-to-serial converters on the Internet.  Examples of USB-to-serial converters are shown below in Figure 3.  These converters are sometimes referred to as USB-to-serial TTL converters or USB-to-UART converters.  Also, the converters use a variety of chips, hence, they may be referred to by their chip names.  Some of the popular USB-to-serial chip names that you may encounter are FTDI, CP2104, CH304, and PL2303.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/usb-to-serial-converters-jpg.webp"><img loading="lazy" decoding="async" width="502" height="402" src="https://cyberblogspot.com/wp-content/uploads/2023/01/usb-to-serial-converters-jpg.webp" alt="Picture of the different types of USB-to-serial converter used for activating the serial monitor on Digispark ATtiny85 when working with Arduino IDE" class="wp-image-5849" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/usb-to-serial-converters-jpg.webp 502w, https://cyberblogspot.com/wp-content/uploads/2023/01/usb-to-serial-converters-300x240.webp 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a><figcaption class="wp-element-caption">Figure 3.  USB-to-Serial Converters</figcaption></figure></div>


<p></p>



<p><strong>STEP 2 &#8211; Install the USB-to-Serial Converter Device Driver</strong></p>



<p>Download and install the device driver for your USB-to-serial converter.  Because USB-to-serial converters use different chips, you need to search the internet for the device driver for your particular USB-to-serial converter.</p>



<p>You can do a quick test if you have the right device driver installed.  Open the Arduino IDE and go to the Tools/Port menu.  You should see an additional port instead on only COM1 on the Serial Ports list when you plug in your USB-to-serial converter.  Please see Figure 4.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list.png"><img loading="lazy" decoding="async" width="802" height="520" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list.png" alt="Screenshot of the Arduino IDE showing the serial COM ports list." class="wp-image-5851" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list-300x195.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-serial-port-list-768x498.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 4.  Arduino IDE Showing Serial Ports List</figcaption></figure></div>


<p></p>



<p><strong>STEP 3 &#8211; Install the Board Core ATTinycore by Spence Konde</strong></p>



<p>Although we may use the original Digistump AVR board core, I prefer to use the ATTinyCore as it supports almost all of the ATtiny line of AVR chips.  Additionally, the ATTinyCore gives us the option to program the ATtiny85 in several ways: no bootloader, Optiboot, and Micronucleus (Digispark) modes.  If you need help in installing the ATTinyCore, please see <a href="https://cyberblogspot.com/how-to-install-attinycore-on-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Install ATTinyCore on Arduino IDE</a>.</p>



<p><strong>STEP 4 &#8211; Use Software Serial to Create UART Ports on ATtiny85</strong></p>



<p>Open the Arduino IDE and upload the sketch shown below.  If you need help in uploading the sketch using the board core ATtinyCore, you may visit <a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program Digispark ATtiny85 Board with Arduino IDE</a>.</p>



<p><strong>IMPORTANT NOTE</strong><br>Before hitting the Upload button to install the sketch, unplug <strong>both</strong> USB cables for the Digispark board and the USB-to-serial converter.  Plug in the USB cable for the Digispark board when prompted by the Arduino IDE.  When the sketch upload is done, unplug the USB cable from the Digispark board.  Connect the USB cable for the USB-to-serial converter and proceed to STEP 5 for testing the Serial Monitor. </p>



<pre class="EnlighterJSRAW">/* cyberblogspot.com 15Jan2023 */

#include &quot;SoftwareSerial.h&quot;

SoftwareSerial mySerial(1, 0);  //RX, TX  PB1, PB0

void setup() { 
  mySerial.begin(19200);
  
  mySerial.println(&quot;Change baud rate to 19200&quot;);
  mySerial.println(&quot;Type something and press ENTER&quot;);
}

void loop() {
  if (mySerial.available()){
    mySerial.println(mySerial.readString());
  }
}</pre>



<p></p>



<p>The sketch above needs no explanation.  Simply include the library header file for the SoftwareSerial library.  You do not have to download the SofwareSerial library as it should come with the ATtinyCore board core installation.</p>



<p>Regarding the code creating the SoftwareSerial object in line 5, </p>



<p>SoftwareSerial mySerial(1, 0);  //RX, TX  PB1, PB0</p>



<p>you may use any two (2) available ATtiny85 ports available.  In this case, I used PB1 for RX (receiver) and PB0 for TX (transmitter).</p>



<p><strong>STEP 5 &#8211; Test the Serial Monitor</strong></p>



<p>After uploading the sketch to the Digispark ATtiny85 board, unplug the USB cable from the Digispark board.  Plug in the USB cable for the USB-to-serial converter. </p>



<p>Then, select the correct COM port for your USB-to-serial converter in the Arduino IDE &#8220;Tools/Port&#8221; menu.  Test the program and you should now be able to use the Serial Monitor on the Digispark ATtiny85 board.</p>



<h2 class="wp-block-heading">References on How to Enable Serial Monitor on Digispark ATtiny85</h2>



<p><a href="https://en.wikipedia.org/wiki/USB-to-serial_adapter#:~:text=Most%20commonly%20the%20USB%20data,RS423%20adapters%20are%20less%20common." target="_blank" rel="noreferrer noopener">USB-to-serial adapter </a> &#8211; Wikipedia article on USB to Serial Converter<br><a href="https://cyberblogspot.com/how-to-install-arduino-ide-on-windows-10/" target="_blank" rel="noreferrer noopener">How to Install Arduino IDE on Windows 10</a><br><a href="https://cyberblogspot.com/how-to-install-attinycore-on-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Install ATTinyCore on Arduino IDE</a><br><a href="https://cyberblogspot.com/how-to-use-arduino-as-isp-programmer/" target="_blank" rel="noreferrer noopener">How to Use Arduino as ISP Programmer</a><br><a href="https://cyberblogspot.com/how-to-program-attiny85-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ATtiny85 with Arduino IDE</a><br><a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">Digispark ATtiny85 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program Digispark ATtiny85 Board with Arduino IDE</a><br><a href="https://cyberblogspot.com/digispark-usb-device-not-recognized/" target="_blank" rel="noreferrer noopener">Digispark USB Device Not Recognized</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/">How to Enable Serial Monitor on Digispark ATtiny85</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>How to Use Arduino as ISP Programmer</title>
		<link>https://cyberblogspot.com/how-to-use-arduino-as-isp-programmer/</link>
					<comments>https://cyberblogspot.com/how-to-use-arduino-as-isp-programmer/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 17 Jan 2023 05:26:02 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[Arduino as ISP]]></category>
		<category><![CDATA[Arduino Board]]></category>
		<category><![CDATA[Arduino IDE]]></category>
		<category><![CDATA[Arduino Nano]]></category>
		<category><![CDATA[Arduino Uno]]></category>
		<category><![CDATA[ArduinoISP]]></category>
		<category><![CDATA[ATtiny85]]></category>
		<category><![CDATA[ATTinyCore]]></category>
		<category><![CDATA[Bootloader]]></category>
		<category><![CDATA[Digispark]]></category>
		<category><![CDATA[Digispark ATtiny85]]></category>
		<category><![CDATA[ICSP]]></category>
		<category><![CDATA[ICSP Programmer]]></category>
		<category><![CDATA[In-Circuit Serial Programming]]></category>
		<category><![CDATA[In-System Programming]]></category>
		<category><![CDATA[ISP]]></category>
		<category><![CDATA[ISP Programmer]]></category>
		<category><![CDATA[MCU]]></category>
		<category><![CDATA[Microcontroller]]></category>
		<category><![CDATA[Micronucleus]]></category>
		<category><![CDATA[Micronucleus bootloader]]></category>
		<category><![CDATA[Serial Peripheral Interface]]></category>
		<category><![CDATA[Sketch]]></category>
		<category><![CDATA[SPI]]></category>
		<category><![CDATA[SPI Programming]]></category>
		<category><![CDATA[USBasp]]></category>
		<category><![CDATA[USBtinyISP]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=5774</guid>

					<description><![CDATA[<p>ISP (In-System Programming) programmers, which are also known as ICSP (In-Circuit Serial Programming) programmers, are used for burning bootloaders onto microcontroller (MCU) chips. They are also used for setting MCU chip fuses in order to change some of the chip&#8217;s functions. There are many cheap ISP programmers available on the internet. However, if you have&#8230;&#160;<a href="https://cyberblogspot.com/how-to-use-arduino-as-isp-programmer/" rel="bookmark">Read More &#187;<span class="screen-reader-text">How to Use Arduino as ISP Programmer</span></a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-use-arduino-as-isp-programmer/">How to Use Arduino as ISP Programmer</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>ISP (In-System Programming) programmers, which are also known as ICSP (In-Circuit Serial Programming) programmers, are used for burning bootloaders onto microcontroller (MCU) chips.  They are also used for setting MCU chip fuses in order to change some of the chip&#8217;s functions.  There are many cheap ISP programmers available on the internet.  However, if you have an Arduino board (Arduino Uno, Nano, etc.) lying around, you do not need to buy an ISP programmer.  You can easily turn an Arduino board into an ISP programmer.  This article will show you how to use an Arduino board as an ISP programmer.</p>



<p>To use an Arduino board as an ISP programmer, simply upload the Arduino IDE example sketch named &#8220;ArduinoISP&#8221;.  Next, connect the SPI pins of the Arduino board to the MCU chip or MCU board to be programmed.  Then, you can start using the Arduino board as an ISP programmer.</p>



<p>To illustrate the steps for the procedure, first, I will make an Arduino Nano board into an ISP programmer.  Then, I will show how to upload sketches and burn bootloaders to a Digispark ATtiny85 development board.</p>



<h2 class="wp-block-heading">Step by Step Guide on How to Use Arduino as ISP Programmer</h2>



<p><strong>STEP 1 &#8211; Connect your Arduino board to your computer&#8217;s USB port.</strong></p>



<p>Connect the Arduino board of your choice to your programming computer hosting the Arduino IDE.  In the next several steps, we will upload the ArduinoISP sketch to the board to make it an ISP programmer.  </p>



<p><strong>STEP 2 &#8211; Open your Arduino IDE and open the ArduinoISP sketch.</strong></p>



<p>Open your Arduino IDE.  If you are a beginner and you have not yet installed the Arduino IDE, please see <a href="https://cyberblogspot.com/how-to-install-arduino-ide-on-windows-10/" target="_blank" rel="noreferrer noopener">How to Install Arduino IDE on Windows 10</a>.  On the Main menu, select File/Examples/11.ArduinoISP/ArduinoISP.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-menu-800.png"><img loading="lazy" decoding="async" width="802" height="595" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-menu-800.png" alt="Screenshot of Arduino IDE showing how to open the example sketch ArduinoISP that turns an Arduino board into an ISP programmer" class="wp-image-5779" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-menu-800.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-menu-800-300x223.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-menu-800-768x570.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 1.  Screenshot of Arduino IDE Showing How to Open the ArduinoISP Sketch</figcaption></figure></div>


<p></p>



<p>You should see the screen shown below after clicking on the ArduinoISP on the Built-in Examples menu.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-sketch-800x595-1.png"><img loading="lazy" decoding="async" width="802" height="597" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-sketch-800x595-1.png" alt="Screenshot of Arduino IDE showing the ArduinoISP sketch" class="wp-image-5780" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-sketch-800x595-1.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-sketch-800x595-1-300x223.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-arduinoISP-sketch-800x595-1-768x572.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 2.  The ArduinoISP Sketch</figcaption></figure></div>


<p><br></p>



<p><strong>STEP 3 &#8211; Choose the name of your Arduino board from the Board Manager&#8217;s list.</strong></p>



<p>Go to Tools/Board/Arduino AVR Boards and select the type of Arduino board you are using.  As shown in the screenshot below, I chose Arduino Nano for my Arduino board. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-board-selection-835.png"><img loading="lazy" decoding="async" width="835" height="595" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-board-selection-835.png" alt="A screenshot of Arduino IDE showing how select the Arduino board before uploading the sketch that will turn the Arduino board into an ISP programmer." class="wp-image-5781" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-board-selection-835.png 835w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-board-selection-835-300x214.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-board-selection-835-768x547.png 768w" sizes="auto, (max-width: 835px) 100vw, 835px" /></a><figcaption class="wp-element-caption">Figure 3.  Picture Showing How to Select the Arduino Board</figcaption></figure></div>


<p><br></p>



<p><strong>STEP 4 &#8211; Set the proper COM serial port for your board.</strong></p>



<p>On the Tools menu, select Port.  Then select from the serial ports list the appropriate port for your Arduino board.  </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-com-port-selection.png"><img loading="lazy" decoding="async" width="802" height="597" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-com-port-selection.png" alt="Screenshot of Arduino IDE for selecting the correct serial COM port." class="wp-image-5782" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-com-port-selection.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-com-port-selection-300x223.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-com-port-selection-768x572.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 4.  Arduino IDE Showing the Serial Ports Selection</figcaption></figure></div>


<p><br></p>



<p><strong>STEP 5 &#8211; Click the Upload button.</strong></p>



<p>As a final step for uploading the ArduinoISP sketch to the Arduino board, click on the Upload button. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button.png"><img loading="lazy" decoding="async" width="802" height="597" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button.png" alt="Another screenshot of Arduino IDE depicting how to start the upload of the ArduinoISP sketch to make the Arduino Nano board into an ISP programmer" class="wp-image-5783" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button-300x223.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button-768x572.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 5.  Arduino IDE Illustrating How to Upload a Sketch</figcaption></figure></div>


<p></p>



<p>When you see the message &#8220;Done uploading&#8221;, congratulations!!! You now have a full-pledged ISP programmer. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-done-uploading.png"><img loading="lazy" decoding="async" width="802" height="729" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-done-uploading.png" alt="Screenshot of Arduino IDE with the message saying that the sketch upload is complete" class="wp-image-5784" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-done-uploading.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-done-uploading-300x273.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-done-uploading-768x698.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 6.  Arduino IDE Showing the Completion of the Sketch Upload</figcaption></figure></div>


<p><br></p>



<p>In the following steps, we are going to show how to use the Arduino board acting as an ISP programmer to:</p>



<ul class="wp-block-list">
<li>Program or upload a sketch to a Digispark ATtiny85 board</li>



<li>Burn an Optiboot bootloader</li>



<li>Burn a Micronucleus bootloader</li>
</ul>



<p><strong>STEP 6 &#8211; Connect the ISP programmer (the Arduino board) to the Digispark ATtiny85 development board.</strong></p>



<p>Like in any other ISP programmers, including the popular USBtinyISP and USBasp programmers, we use six (6) terminals of the ISP programmer to connect to the device to be programmed.  These terminals are:</p>



<ul class="wp-block-list">
<li>MOSI</li>



<li>MISO</li>



<li>SCLK</li>



<li>RESET</li>



<li>VCC</li>



<li>GND</li>
</ul>



<p>On the Arduino board acting as an ISP programmer, the corresponding terminals are as follow:</p>



<ul class="wp-block-list">
<li>D11 (MOSI)  &#8212;&gt; MOSI</li>



<li>D12 (MISO)  &#8212;&gt; MISO</li>



<li>D13 (SCLK)   &#8212;&gt; SCLK</li>



<li>D10 (SS)       &#8212;&gt; RESET</li>



<li>5V                &#8212;&gt; VCC</li>



<li>GND            &#8212;&gt; GND</li>
</ul>



<p>Now, based on the foregoing discussion, we can connect the Arduino board to the Digispark ATtiny85 board using the following terminals:</p>



<p class="has-text-align-left">Arduino Board &#8212;&gt;    Digispark ATtiny85 Board<br>D11 (MOSI)     &#8212;&gt;     PB0(MOSI)<br>D12 (MISO)     &#8212;&gt;     PB1(MISO)<br>D13 (SCLK)      &#8212;&gt;     PB2(SCLK)<br>D10 (SS)          &#8212;&gt;     PB5(RESET)<br>5V                   &#8212;&gt;      5V<br>GND               &#8212;&gt;      GND</p>



<p>For reference purposes, the Digispark ATtiny85 development board pinout is shown below.  For more information on Digispark ATtiny85, you may consult the <a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">Digispark ATtiny85 Pinout and Configuration</a>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final.png"><img loading="lazy" decoding="async" width="802" height="602" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final.png" alt="Digispark ATtiny85 pinout showing the physical pins, digital IO pins, ADC pins, PWM pins, I2C pins, SPI pins, USB pins, pin change interrupts, and hardware interrupt pin." class="wp-image-5546" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final-300x225.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final-768x576.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 7.  Digispark ATtiny85 Pinout</figcaption></figure></div>


<p></p>



<p>Shown below is the Fritzing breadboard diagram for connecting the Arduino Nano board to the Digispark ATtiny85 board.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-breadboard-fritzing.png"><img loading="lazy" decoding="async" width="802" height="473" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-breadboard-fritzing.png" alt="Picture showing the Arduino Nano connected to the Digispark ATtiny85 board." class="wp-image-5787" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-breadboard-fritzing.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-breadboard-fritzing-300x177.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-breadboard-fritzing-768x453.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 8.  Fritzing Breadboard Diagram of Arduino Nano Connected to a Digispark ATtiny85 Board</figcaption></figure></div>


<p><br></p>



<p>How to connect the Arduino Nano board to the Digispark ATtiny85 board illustrated by an old-school schematic diagram.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-schematic-fritzing-800.png"><img loading="lazy" decoding="async" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-schematic-fritzing-800.png" alt="Picture of the schematic diagram of Arduino Nano connected to a Digispark ATtiny85 for programming the Digispark using the Arduino as ISP programmer" class="wp-image-5794" width="602" height="635" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-schematic-fritzing-800.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-schematic-fritzing-800-284x300.png 284w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-nano-digispark-attiny85-schematic-fritzing-800-768x810.png 768w" sizes="auto, (max-width: 602px) 100vw, 602px" /></a><figcaption class="wp-element-caption">Figure 9.  Schematic Diagram of Arduino Nano Connected to a Digispark ATtiny85 Board</figcaption></figure></div>


<p></p>



<p>After connecting the Arduino board to the Digispark ATtiny85 board, we are now ready to test drive the Arduino board as an ISP programmer.  </p>



<p>Since we are going to work with the Digispark ATtiny85 board, you must have the board core ATTinyCore by Spence Konde installed on your Arduino IDE.  If you do not have the ATTinyCore installed yet, see the article <a href="https://cyberblogspot.com/how-to-install-attinycore-on-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Install ATTinyCore on Arduino IDE</a>.</p>



<p><strong>STEP 7 &#8211; Copy and Paste the Blink Program.</strong></p>



<p>Going back to the Arduino IDE, create a new sketch and then copy and paste the Blink program sketch shown below.</p>



<pre class="EnlighterJSRAW">/*
www.cyberblogspot.com
07Jan2022  
*/

#define LED_BUILTIN 1  //PB1 for Model A
                       //PB0 for Model B

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}</pre>



<p></p>



<p><strong>STEP 8 &#8211; Change the board from Arduino board to Digispark ATtiny85 board.</strong></p>



<p>Go to Tools/Board/ATTinyCore and select <strong>ATtiny25/45/85 (No bootloader)</strong>.  Take note that we are using the &#8220;No bootloader&#8221; option and NOT the &#8220;Micronucleus/Digispark&#8221; option.  This is because we are going to upload the Blink sketch via an ISP programmer (the Arduino board) and not thru the Digispark&#8217;s USB port.   </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-change-board-to-digispark.png"><img loading="lazy" decoding="async" width="935" height="597" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-change-board-to-digispark.png" alt="Screenshot of Arduino IDE with the list of ATTinyCore supported boards." class="wp-image-5808" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-change-board-to-digispark.png 935w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-change-board-to-digispark-300x192.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-change-board-to-digispark-768x490.png 768w" sizes="auto, (max-width: 935px) 100vw, 935px" /></a><figcaption class="wp-element-caption">Figure 10.  Arduino IDE with the ATTinyCore List of Supported Devices</figcaption></figure></div>


<p></p>



<p><strong>STEP 9 &#8211; Select the proper COM port.</strong></p>



<p>Go to Tools/Port and choose the correct COM port from the ports list.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-digispark-change-port.png"><img loading="lazy" decoding="async" width="802" height="597" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-digispark-change-port.png" alt="Screenshot of Arduino IDE showing how to select the proper COM port before using the Arduino board as ISP programmer." class="wp-image-5809" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-digispark-change-port.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-digispark-change-port-300x223.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-digispark-change-port-768x572.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 11.  Arduino IDE Showing How to Select the Serial COM Port  </figcaption></figure></div>


<p></p>



<p><strong>STEP 10 &#8211; Select the programmer type.</strong></p>



<p>On the Tools/Programmer menu, select <strong>Arduino as ISP</strong> as the programmer type.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-select-programmer-type.png"><img loading="lazy" decoding="async" width="951" height="597" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-select-programmer-type.png" alt="Screenshot of Arduino IDE prior to using the Arduino Nano board as an ISP programmer." class="wp-image-5811" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-select-programmer-type.png 951w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-select-programmer-type-300x188.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-select-programmer-type-768x482.png 768w" sizes="auto, (max-width: 951px) 100vw, 951px" /></a><figcaption class="wp-element-caption">Figure 12.  Arduino IDE Illustrating How to Select the Programmer Type</figcaption></figure></div>


<p></p>



<p><strong>STEP 11 &#8211; Upload the Blink program.</strong></p>



<p>Upload the Blink program by clicking on the Upload button.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button-blink-final.png"><img loading="lazy" decoding="async" width="802" height="597" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button-blink-final.png" alt="Picture of Arduino IDE showing how to upload the Blink sketch." class="wp-image-5813" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button-blink-final.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button-blink-final-300x223.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-IDE-upload-button-blink-final-768x572.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 13.  Arduino IDE Showing How to Start the Upload Process</figcaption></figure></div>


<p></p>



<p>When you see the message saying that the upload is done, your Digispark ATtiny85 board should start blinking the built-in LED.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-blink-upload-done.png"><img loading="lazy" decoding="async" width="800" height="729" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-blink-upload-done.png" alt="Another screenshot of Arduino IDE showing the message of completion of using the Arduino Nano board as ISP programmer." class="wp-image-5814" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-blink-upload-done.png 800w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-blink-upload-done-300x273.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-blink-upload-done-768x700.png 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a><figcaption class="wp-element-caption">Figure 14.  Arduino IDE with Upload Completion Message</figcaption></figure></div>


<p></p>



<h3 class="wp-block-heading">How to Burn Bootloader on Digispark ATtiny85 Using Arduino as ISP Programmer</h3>



<h4 class="wp-block-heading">Burn Optiboot Bootloader</h4>



<p><strong>STEP 1 &#8211; Select ATtiny45/85 (Optiboot) from the ATtinyCore list.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader.png"><img loading="lazy" decoding="async" width="1024" height="487" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-1024x487.png" alt="Screenshot of Arduino IDE showing how to select the Optiboot option" class="wp-image-5820" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-1024x487.png 1024w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-300x143.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-768x365.png 768w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader.png 1089w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a><figcaption class="wp-element-caption">Figure 15.  Arduino IDE Showing How to Select Optiboot</figcaption></figure></div>


<p></p>



<p><strong>STEP 2 &#8211; Verify that the proper COM port is selected.  </strong></p>



<p><strong>STEP 3 &#8211; Make sure that the programmer selected is &#8220;Arduino as ISP&#8221;.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page2.png"><img loading="lazy" decoding="async" width="802" height="526" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page2.png" alt="Picture of Arduino IDE showing the options before starting the Arduino board as an ISP programmer burning the Optiboot bootloader on a Digispark ATtiny85 development board." class="wp-image-5821" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page2.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page2-300x197.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page2-768x504.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 16.  Arduino IDE Prior to Burning a Bootloader</figcaption></figure></div>


<p> </p>



<p><strong>STEP 4 &#8211; Click &#8220;Burn bootloader&#8221; to start the burning process.</strong></p>



<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page3.png"><img loading="lazy" decoding="async" width="802" height="526" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page3.png" alt="A picture depicting how to burn a bootloader into a Digispark ATtiny85 board using an Arduino board as an ISP programmer." class="wp-image-5822" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page3.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page3-300x197.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-burn-optiboot-bootloader-page3-768x504.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 17.  Arduino IDE Depicting How to Burn a Bootloader</figcaption></figure>



<p></p>



<h3 class="wp-block-heading">Burn Micronucleus Bootloader</h3>



<p>To burn the Micronucleus bootloader onto the Digispark ATtiny85 board using the Arduino as ISP programmer, follow the steps above for burning the Optiboot bootloader.  However, instead of selecting <strong>ATtiny45/85 (Optiboot)</strong>, select <strong>ATtiny85 (Micronucleus / Digispark)</strong> from the ATtinyCore list of supported devices. </p>



<h2 class="wp-block-heading">References on How to Use Arduino as ISP Programmer</h2>



<p><a href="https://en.wikipedia.org/wiki/In-system_programming" target="_blank" rel="noreferrer noopener">In-System Programming (ISP)</a><br><a href="https://cyberblogspot.com/how-to-install-attinycore-on-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Install ATTinyCore on Arduino IDE</a><br><a href="https://cyberblogspot.com/how-to-program-attiny85-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ATtiny85 with Arduino IDE</a><br><a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">Digispark ATtiny85 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program Digispark ATtiny85 Board with Arduino IDE</a><br><a href="https://cyberblogspot.com/digispark-usb-device-not-recognized/" target="_blank" rel="noreferrer noopener">Digispark USB Device Not Recognized</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a>                                                                                   </p>
<p>The post <a href="https://cyberblogspot.com/how-to-use-arduino-as-isp-programmer/">How to Use Arduino as ISP Programmer</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/how-to-use-arduino-as-isp-programmer/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Digispark ATtiny85 Pinout and Configuration</title>
		<link>https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/</link>
					<comments>https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 09 Jan 2023 20:52:39 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[Analog to Digital Converter]]></category>
		<category><![CDATA[Arduino IDE]]></category>
		<category><![CDATA[ATtiny85]]></category>
		<category><![CDATA[ATtiny85 Breakout]]></category>
		<category><![CDATA[Digispark]]></category>
		<category><![CDATA[Digispark ATtiny85]]></category>
		<category><![CDATA[Digispark ATtiny85 Development Board]]></category>
		<category><![CDATA[Digispark ATtiny85 Pinout]]></category>
		<category><![CDATA[Digispark ATtiny85 Schematic Diagram]]></category>
		<category><![CDATA[Digistump]]></category>
		<category><![CDATA[Digital I/O]]></category>
		<category><![CDATA[Hardware Interrupt]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[Inter-Integrated Circuit]]></category>
		<category><![CDATA[Pin Change Interrupt]]></category>
		<category><![CDATA[Port B]]></category>
		<category><![CDATA[Pulse Width Modulation]]></category>
		<category><![CDATA[PWM]]></category>
		<category><![CDATA[Serial Peripheral Interface]]></category>
		<category><![CDATA[SPI]]></category>
		<category><![CDATA[Universal Serial Bus]]></category>
		<category><![CDATA[USB]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=5533</guid>

					<description><![CDATA[<p>A Digispark ATtiny85 development board is a microcontroller board with an ATtiny85 MCU chip. It is a favorite board for projects that require a small number of GPIOs. The board is basically an ATtiny85 chip that is provided with a voltage regulator and a USB interface. We will take a look at the Digispark ATtiny85&#8230;&#160;<a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/" rel="bookmark">Read More &#187;<span class="screen-reader-text">Digispark ATtiny85 Pinout and Configuration</span></a></p>
<p>The post <a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/">Digispark ATtiny85 Pinout and Configuration</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>A Digispark ATtiny85 development board is a microcontroller board with an ATtiny85 MCU chip.  It is a favorite board for projects that require a small number of GPIOs.  The board is basically an ATtiny85 chip that is provided with a voltage regulator and a USB interface.  We will take a look at the Digispark ATtiny85 pinout and the different configurations that it has to offer. </p>



<h2 class="wp-block-heading">Types of Digispark Boards</h2>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-jpg.webp"><img loading="lazy" decoding="async" width="802" height="486" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-jpg.webp" alt="A picture showing two (2) versions of Digispark ATtiny85 with the same pinout or configuration " class="wp-image-5550" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-jpg.webp 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-300x182.webp 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-768x465.webp 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 1.  USB Type-A Interface and Micro-USB Interface</figcaption></figure></div>


<p>Figure 1 shows the two (2) popular versions of the Digispark ATtiny85 development boards.  The one on the left uses a type-A USB connector to connect directly to the USB port of a PC or a laptop.  On the other hand, the board on the right has a micro-USB connector.  As a result, we need a micro-USB cable to connect this to a computer for programming purposes.  </p>



<p>It should be observed that both boards have the same pin layout.  We can breadboard them as long as we do not connect a header pin to the VIN terminal.     </p>


<div class="wp-block-image">
<figure class="aligncenter size-large is-resized"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-type3-jpg.webp"><img loading="lazy" decoding="async" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-type3-752x1024.webp" alt="A picture of another version of Digispark ATtiny85 development board" class="wp-image-5553" width="376" height="512" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-type3-752x1024.webp 752w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-type3-220x300.webp 220w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-type3-768x1045.webp 768w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-type3-jpg.webp 800w" sizes="auto, (max-width: 376px) 100vw, 376px" /></a><figcaption class="wp-element-caption">Figure 2.  Another Type of Digispark ATtiny85</figcaption></figure></div>


<p>Figure 2 is a picture of another type of Digispark ATtiny85 board.  As shown in the picture, the board does not have an ATtiny85 chip but instead only an 8-pin DIP socket.  We must provide a DIP-type ATtiny85 chip in order to use this board.  Also, the pin layout of this board is different.  This board is not breadboard friendly.  However, the pin layout is ICSP-programmer ready.  That is, the pins are arranged so as to accept the female connector of an AVR ICSP-programmer. </p>



<p>It must be mentioned here that technically, this board is not (yet) a Digispark ATtiny85 board.  A Digispark ATtiny85 board has an ATtiny85 chip that was burned with a Micronucleus bootloader.  In order to make this board a Digispark board, it needs an ATtiny85 chip that was pre-programmed with a Micronucleus bootloader.  Otherwise, an ATtiny85 without a bootloader can be inserted into the DIP socket and an ICSP programmer is used to burn a new Micronucleus bootloader into it.     </p>



<h2 class="wp-block-heading">Digispark ATtiny85 Specifications</h2>



<ul class="wp-block-list">
<li>Support for the&nbsp;Arduino&nbsp;IDE 1.0+ (OSX/Win/Linux)</li>



<li>Power via USB or External Source &#8211; 5v or 7-35v (12v or less recommended, automatic selection)</li>



<li>On-board 500ma 5V Regulator</li>



<li>Built-in USB</li>



<li>6 I/O Pins (2 are used for USB only if your program actively communicates over USB, otherwise you can use all 6 even if you are programming via USB)</li>



<li>8k Flash Memory (about 6k after bootloader)</li>



<li>I2C and SPI (vis USI)</li>



<li>PWM on 3 pins (more possible with Software PWM)</li>



<li>ADC on 4 pins</li>



<li>Power LED and Test/Status LED</li>
</ul>



<h2 class="wp-block-heading">Digispark ATtiny85 Pinout</h2>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final.png"><img loading="lazy" decoding="async" width="802" height="602" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final.png" alt="A picture showing the Digispark ATtiny85 pinout and configuration of its physical pins, digital I/O, ADC ports, and other pertinent information" class="wp-image-5546" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final-300x225.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final-768x576.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 3.  Digispark ATtiny85 Pinout</figcaption></figure></div>


<h2 class="wp-block-heading">Digispark ATtiny85 Pinout Description</h2>



<h3 class="wp-block-heading">ATtiny85 Breakout</h3>



<p>First of all, by referring to Figure 3, you will notice that the Digispark board serves as a breakout board for the ATtiny85 chip.  All of the eight pins of the ATtiny85 chip are accessible.  The physical pins of the ATtiny5 chip are designated by the gray-colored pinouts numbered 1 to 8.</p>



<h3 class="wp-block-heading">Six (6) Digital I/O Pins</h3>



<p>As per specification, the Digispark ATtiny85 board can be configured to use six (6) digital I/O ports.  These ports are shown in Figure 3 as yellow pins, labeled PB0 to PB5.  <strong>NOTE</strong>: Port B pin PB5 is by default configured as a RESET pin.  In order to use PB5 as an I/O port, an ATtiny85 fuse (RSTDISBL) has to be reset (changed from 1 to 0).  Please see <em>How to Reset ATtiny85 Fuses</em>. </p>



<h4 class="wp-block-heading">Arduino IDE Programming Notes</h4>



<p>In the Arduino IDE, pins PB0 to PB5, when used as digital I/O are referred to as 0 to 5.  That is,</p>



<pre class="EnlighterJSRAW">/*
cyberblogspot.com 09Jan2023
*/

bool a, b, c;

void setup() {
  // put your setup code here, to run once:
  pinMode(0, INPUT);   //set PB0 as input
  pinMode(1, INPUT);   //set PB1 as input
  pinMode(2, INPUT);   //set PB2 as input
  pinMode(3, OUTPUT);  //set PB3 as output
  pinMode(4, OUTPUT);  //set PB4 as output
  pinMode(5, OUTPUT);  //set PB5 as output
}

void loop() {
  // put your main code here, to run repeatedly:
  a = digitalRead(0);     //read PB0
  b = digitalRead(1);     //read PB1
  c = digitalRead(2);     //read PB2
  digitalWrite(3, LOW);   //set PB3 LOW
  digitalWrite(4, LOW);   //set PB4 LOW
  digitalWrite(5, HIGH);  //set PB5 HIGH
}</pre>



<h3 class="wp-block-heading">Four (4) Analog to Digital Converter (ADC) Ports</h3>



<p>Port B ports PB2 to PB5 can be configured as analog inputs.  These pins are shown in Figure 3 as orange pins.  The pins are labeled ADC0 to ADC3.  Be aware that the Port B numbers do not exactly match the ADC port numbers.  In other words, PB2 does not correspond ADC2, PB3 does not correspond to ADC3, and so on.  Instead,</p>



<ul class="wp-block-list">
<li>ADC0 is PB5</li>



<li>ADC1 is PB2</li>



<li>ADC2 is PB4</li>



<li>ADC3 is PB3</li>
</ul>



<h4 class="wp-block-heading">Arduino IDE Programming Notes</h4>



<p>When using the command <strong>analogRead()</strong>, Arduino IDE assumes you are using the ADC port numbers (0 for ADC0, 1 for ADC1, 2 for ADC2, and 3 for ADC3) and NOT the Port B numbers (0 for PB0, 1 for PB1, 2 for PB2, 3 for PB3, 4 for PB4, and 5 for PB5).  However, the <strong>pinMode()</strong> command expects you to use the Port B numbers.  This is one of ATtiny85&#8217;s peculiarities that is very confusing.  The example code below should clear this up. </p>



<pre class="EnlighterJSRAW">/*
cyberblogspot.com 09Jan2023
*/

int a, b, c, d;

void setup() {
// put your setup code here, to run once:
// the following four lines of code are actually not needed
// because by default the I/O pins are in Hi-Z INPUT mode
pinMode(2, INPUT); //set PB2 as input
pinMode(3, INPUT); //set PB3 as input
pinMode(4, INPUT); //set PB4 as input
pinMode(5, INPUT); //set PB5 as input
}

void loop() {
// put your main code here, to run repeatedly:
a = analogRead(0); //read ADC0 which is in PB5
b = analogRead(1); //read ADC1 which is in PB2
c = analogRead(2); //read ADC2 which is in PB4
d = analogRead(3); //read ADC3 which is in PB3
}</pre>



<h3 class="wp-block-heading">Three (3) Pulse Width Modulation (PWM) Outputs</h3>



<p>Referring again to Figure 3, there are three (3) PWM outputs available on Digispark ATtiny85 boards.  These are colored green in the pinout shown above and are labeled as PWM0, PWM1, and PWM4.  There is no typo error here.  The third PWM output is labeled as PWM4 because the PWM port numbers use the same Port B numbers.  To clarify, </p>



<ul class="wp-block-list">
<li>PWM0 is PB0</li>



<li>PWM1 is PB1</li>



<li>PWM4 is PB4</li>
</ul>



<h4 class="wp-block-heading">Arduino IDE Programming Notes</h4>



<p>The PWM output signal is generated by the command <strong>analogWrite()</strong>.  Although we are going to use the ports as analog outputs, we DO NOT use the ADC port numbers.  Rather, we use the PWM port numbers which are the same as the Port B numbers.  In other words, we are also using the Port B numbers in programming PWM in the Arduino IDE.  Please take a look at the following sketch.</p>



<pre class="EnlighterJSRAW">/*
cyberblogspot.com 09Jan2023
*/

void setup() {
  // put your setup code here, to run once:
  pinMode(0, OUTPUT);  //set PB0 (PWM0) as output  
  pinMode(1, OUTPUT;  //set PB1 (PWM1) as output
  pinMode(4, OUTPUT);  //set PB4 (PWM4) as output
}

void loop() {
  // put your main code here, to run repeatedly:
  analogWrite(0, 255);  //100% duty cycle PWM on PB0
  analogWrite(1, 128);  //50% duty cycle PWM on PB1
  analogWrite(4, 0);    //0% duty cycle PWM on PB4
}</pre>



<h2 class="wp-block-heading">SPI (Serial Peripheral Interface) Communication</h2>



<p>Ports PB0, PB1, and PB2 can be used for SPI communication:</p>



<ul class="wp-block-list">
<li>MOSI &#8211; PB0</li>



<li>MISO &#8211; PB1</li>



<li>SCLK &#8211; PB2 </li>
</ul>



<h2 class="wp-block-heading">I<sup>2</sup>C (Inter-Integrated Circuit) Communication</h2>



<p>Ports PB0 and PB2 can be used for I2C communication:</p>



<ul class="wp-block-list">
<li>SDA &#8211; PB0</li>



<li>SCK &#8211; PB2</li>
</ul>



<h2 class="wp-block-heading">USB (Universal Serial Bus) Communication</h2>



<p>Ports PB3 and PB4 can be used for USB communication:</p>



<ul class="wp-block-list">
<li>USB- is PB4</li>



<li>USB+ is PB3</li>
</ul>



<h2 class="wp-block-heading">Pin Change Interrupt and External Interrupt</h2>



<p>Finally, ports PB0 to PB5 can all be used for pin change interrupt and PB2 as external interrupt pin.</p>



<h2 class="wp-block-heading">Final Notes on Port B Pins</h2>



<p>PB5 has limited current sourcing capacity.  Also, when it is at output HIGH, it generates 3V instead of 5V on its output.</p>



<p>PB3 and PB4 are both used during programming (sketch upload).  Therefore, it may be necessary to temporarily disconnect the circuits connected to them to avoid interfering with the uploading of sketches.  Additionally, PB3 has a 1.5K pull-up resistor that is used for USB communication.</p>



<p>PB0 or PB1 has the built-in LED attached to it.  Version A boards use PB1 while version B boards use PB0.</p>



<h2 class="wp-block-heading">Digispark ATtiny85 Schematic Diagram</h2>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2022/01/digispark-schematic.png"><img loading="lazy" decoding="async" width="1002" height="577" src="https://cyberblogspot.com/wp-content/uploads/2022/01/digispark-schematic.png" alt="Schematic diagram of Digispark ATtiny85 whose pinout and configurations are described in this article" class="wp-image-5014" srcset="https://cyberblogspot.com/wp-content/uploads/2022/01/digispark-schematic.png 1002w, https://cyberblogspot.com/wp-content/uploads/2022/01/digispark-schematic-300x173.png 300w, https://cyberblogspot.com/wp-content/uploads/2022/01/digispark-schematic-768x442.png 768w" sizes="auto, (max-width: 1002px) 100vw, 1002px" /></a><figcaption class="wp-element-caption">Figure 4. Digispark ATtiny85 Schematic Diagram</figcaption></figure></div>


<h2 class="wp-block-heading">References on Digispark ATtiny85 Pinout and Configuration</h2>



<p><a href="http://digistump.com/wiki/digispark" target="_blank" rel="noreferrer noopener">http://digistump.com/wiki/digispark</a><br><a href="https://diyusthad.com/2021/07/digispark-attiny85.html" target="_blank" rel="noreferrer noopener">ATtiny85 External and Pin Change Interrupt</a><br><a href="https://cyberblogspot.com/how-to-install-arduino-ide-on-windows-10/" target="_blank" rel="noreferrer noopener">How to Install Arduino IDE on Windows 10</a><br><a href="https://cyberblogspot.com/how-to-install-attinycore-on-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Install ATTinyCore on Arduino IDE</a><br><a href="https://cyberblogspot.com/how-to-program-attiny85-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ATtiny85 with Arduino IDE</a><br><a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program Digispark ATtiny85 Board with Arduino IDE</a><br><a href="https://cyberblogspot.com/digispark-usb-device-not-recognized/" target="_blank" rel="noreferrer noopener">Digispark USB Device Not Recognized</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a></p>



<p> </p>



<p> </p>
<p>The post <a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/">Digispark ATtiny85 Pinout and Configuration</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>How to Program Digispark ATtiny85 Board with Arduino IDE</title>
		<link>https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/</link>
					<comments>https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 07 Jan 2023 12:18:43 +0000</pubDate>
				<category><![CDATA[Arduino]]></category>
		<category><![CDATA[ADC]]></category>
		<category><![CDATA[Analog to Digital Converter]]></category>
		<category><![CDATA[analogRead]]></category>
		<category><![CDATA[AnalogWrite]]></category>
		<category><![CDATA[Arduino IDE]]></category>
		<category><![CDATA[ATtiny85]]></category>
		<category><![CDATA[ATTinyCore]]></category>
		<category><![CDATA[Digispark]]></category>
		<category><![CDATA[Digispark ATtiny85]]></category>
		<category><![CDATA[Digispark ATtiny85 Development Board]]></category>
		<category><![CDATA[Digispark ATtiny85 Pinout]]></category>
		<category><![CDATA[Digistump]]></category>
		<category><![CDATA[digitalRead]]></category>
		<category><![CDATA[digitalWrite]]></category>
		<category><![CDATA[ICSP Programmer]]></category>
		<category><![CDATA[ISP Programmer]]></category>
		<category><![CDATA[Micronucleus]]></category>
		<category><![CDATA[Micronucleus bootloader]]></category>
		<category><![CDATA[pinMode]]></category>
		<category><![CDATA[Sketch]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=5316</guid>

					<description><![CDATA[<p>A bare chip ATtiny85 needs to be connected to an ICSP (aka ISP) programmer in order to upload Arduino sketches. To facilitate programming, Digistump created the Digispark ATtiny85 USB Development Board. The Digispark ATtiny85 board does not need an ICSP programmer. Instead, it is directly connected to the USB port of the computer hosting the&#8230;&#160;<a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/" rel="bookmark">Read More &#187;<span class="screen-reader-text">How to Program Digispark ATtiny85 Board with Arduino IDE</span></a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/">How to Program Digispark ATtiny85 Board with Arduino IDE</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-jpg.webp"><img loading="lazy" decoding="async" width="802" height="486" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-jpg.webp" alt="A picture showing two types of Digispark ATtiny85 development boards  for which this tutorial How to Program Digispark ATTiny85 Board with Arduino IDE is all about" class="wp-image-5550" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-jpg.webp 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-300x182.webp 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-types-768x465.webp 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 1.  Two Version of Digispark ATtiny85 Development Board</figcaption></figure>



<p>A bare chip ATtiny85 needs to be connected to an ICSP (aka ISP) programmer in order to upload Arduino sketches.  To facilitate programming, Digistump created the Digispark ATtiny85 USB Development Board.  The Digispark ATtiny85 board does not need an ICSP programmer.  Instead, it is directly connected to the USB port of the computer hosting the Arduino IDE.  This is the normal way of how to program a Digispark ATtiny85 board.</p>



<h2 class="wp-block-heading">Difference in Uploading the Sketch</h2>



<p>Although a Digispark ATtiny85 board plugs directly into a USB port like any other Arduino development board, there is a slight difference in uploading a program or a sketch.  While an Arduino board is connected first to the USB port prior to uploading a sketch, the Digispark board is connected to the USB port after initiating the upload sketch procedure.  That is, to upload a sketch to the Digispark board, you have to first press the &#8220;Upload&#8221; button on the Arduino IDE.   Afterwards, a message saying &#8220;Please plug in the device (will time out in 60 secs)&#8221; will appear on the Arduino IDE.  Then, you plug in the Digispark board and the sketch starts uploading.  Finally, when the sketch is successfully uploaded, Digispark will run the sketch automatically after five (5) seconds (not instantly as in other Arduino boards).  </p>



<h2 class="wp-block-heading">Configuring Arduino IDE for Digispark ATtiny85 Programming</h2>



<p>To program the Digispark ATtiny85 board, first, install the latest version of <a href="https://www.arduino.cc/en/software" target="_blank" rel="noreferrer noopener">Arduino IDE</a> if you do not have the Arduino IDE yet on your computer.  If you need help on installing the Arduino IDE, please see <a href="https://cyberblogspot.com/how-to-install-arduino-ide-on-windows-10/" target="_blank" rel="noreferrer noopener">How to Install Arduino IDE on Windows 10</a> if you are using Microsoft Windows.</p>



<p>Next, you need to install the <a href="https://github.com/SpenceKonde/ATTinyCore" target="_blank" rel="noreferrer noopener">ATtinyCore </a>on the Arduino IDE in order for Arduino IDE to recognize the Digispark ATtiny85 boards.  You may want to read the article <a href="https://cyberblogspot.com/how-to-install-attinycore-on-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Install ATtinyCore on Arduino IDE</a>.</p>



<h2 class="wp-block-heading">Uploading the Blink Program on Arduino IDE</h2>



<p><strong>STEP 1 &#8211; Open the Arduino IDE and select the proper board.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-attinycore-digispark-board-1000-cropped-finally.png"><img loading="lazy" decoding="async" width="1000" height="594" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-attinycore-digispark-board-1000-cropped-finally.png" alt="Screenshot of Arduino IDE showing a step in How to Program a Digispark ATtiny85 Development Board" class="wp-image-5577" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-attinycore-digispark-board-1000-cropped-finally.png 1000w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-attinycore-digispark-board-1000-cropped-finally-300x178.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-attinycore-digispark-board-1000-cropped-finally-768x456.png 768w" sizes="auto, (max-width: 1000px) 100vw, 1000px" /></a><figcaption class="wp-element-caption">Figure 2.  Arduino IDE Illustration on How to Select the Digispark ATtiny85 Board</figcaption></figure></div>


<p><strong>STEP 2 &#8211; Create a new sketch.  Then copy and paste the sketch below.</strong></p>



<pre class="EnlighterJSRAW">/*
www.cyberblogspot.com
07Jan2022  
*/

#define LED_BUILTIN 1  //PB1 for Model A
                       //PB0 for Model B

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}</pre>



<p><strong>STEP 3 &#8211; Click on the Upload button.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-upload-button-cropped-final.png"><img loading="lazy" decoding="async" width="1001" height="526" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-upload-button-cropped-final.png" alt="Screenshot of Arduino IDE showing the location of the Upload button to upload a sketch" class="wp-image-5578" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-upload-button-cropped-final.png 1001w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-upload-button-cropped-final-300x158.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-upload-button-cropped-final-768x404.png 768w" sizes="auto, (max-width: 1001px) 100vw, 1001px" /></a><figcaption class="wp-element-caption">Figure 3.  Arduino IDE with the Upload Button </figcaption></figure></div>


<p><strong>STEP 4 &#8211; Insert the Digispark ATtiny85 board into the USB port when the message to do so appears.</strong></p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="has-text-align-center">If the message &#8220;USB device not recognized&#8221; appears when you insert the Digispark ATtiny85 board, the board may not have the Micronucleus bootloader installed.  See the article <a href="https://cyberblogspot.com/digispark-usb-device-not-recognized/" target="_blank" rel="noreferrer noopener">Digispark USB Device Not Recognized</a> to resolve the issue.</p>
</blockquote>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-plug-device-message-final.png"><img loading="lazy" decoding="async" width="1003" height="729" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-plug-device-message-final.png" alt="Screenshot of Arduino IDE showing the fourth step in programming a Digispark ATtiny85 board" class="wp-image-5580" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-plug-device-message-final.png 1003w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-plug-device-message-final-300x218.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-plug-device-message-final-768x558.png 768w" sizes="auto, (max-width: 1003px) 100vw, 1003px" /></a><figcaption class="wp-element-caption">Figure 4.  Arduino IDE Showing the Message to Plug in the Digispark ATtiny85 Board</figcaption></figure></div>


<p>After the last step, you should see the messages as shown below and the LED on the Digispark ATtiny85 board should start blinking.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-micronucleus-done.png"><img loading="lazy" decoding="async" width="1002" height="729" src="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-micronucleus-done.png" alt="Screenshot of Arduino IDE after a successfule programming of Digispark ATtiny85 board" class="wp-image-5571" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-micronucleus-done.png 1002w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-micronucleus-done-300x218.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/arduino-ide-micronucleus-done-768x559.png 768w" sizes="auto, (max-width: 1002px) 100vw, 1002px" /></a><figcaption class="wp-element-caption">Figure 5.  Arduino IDE with the Messages of a Successful Sketch Upload</figcaption></figure></div>


<h2 class="wp-block-heading">Important Notes on Digispark ATtiny85 I/O Ports </h2>


<div class="wp-block-image">
<figure class="aligncenter size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final.png"><img loading="lazy" decoding="async" width="802" height="602" src="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final.png" alt="Pin configuration of Digispark ATtiny85 development board used in How to Program Digispark ATtiny85 Board with Arduino IDE" class="wp-image-5546" srcset="https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final-300x225.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/01/digispark-attiny85-pinout-original_final-768x576.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a><figcaption class="wp-element-caption">Figure 6.  Digispark ATtiny85 Pinout</figcaption></figure></div>


<p>According to specifications, Digispark ATtiny85 boards support a total of six (6) digital I/O ports.  However, there are several points to consider.  Please refer to the Digispark ATtiny85 pinout in Figure 6. </p>



<ul class="wp-block-list">
<li>PB5 is by default being used as a Reset pin, hence, unavailable as a digital IO.  ATtiny85 fuses have to be set to enable PB5 as an IO port.  Moreover, PB5, when used as an output port, have some peculiarities.  When it is at output HIGH, its output is 3V instead of 5V.  Aside from that, it has limited current sourcing capability unlike the other ports that can source up to 20 milliamperes (20mA).</li>



<li>Either PB0 or PB1 is used by the built-in LED depending on the Digispark model.  Model A uses PB1 while Model B uses PB0.  The explanation can be found here: <a href="http://digistump.com/board/index.php?topic=134.0" target="_blank" rel="noreferrer noopener">Digispark Model A vs Model B.</a>  </li>



<li>PB3 is used as USB+ for USB communication and has a 1.5K pull-up resistor.</li>



<li>PB4 is used as USB- also for USB communication. </li>
</ul>



<h2 class="wp-block-heading">How to Address or Reference Digispark ATtiny85 Ports in Program </h2>



<p>When programming the Digispark ATtiny85 in Arduino IDE, references to the IO ports differ between digital IO and analog input.  When using the ports as digital input or digital output, PB0 to PB5 are referred to by their port numbers.  That is, PB0 is 0, PB1 is 1, PB2 is 2, PB3 is 3, PB4 is 4, and PB5 is 5.  For example:</p>



<pre class="EnlighterJSRAW">pinMode(0, INPUT);  //PB0 is input
pinMode(1, INPUT);  //PB1 is input
pinMode(2, INPUT);  //PB2 is input
pinMode(3, OUTPUT);  //PB3 is output
pinMode(4, OUTPUT);  //PB4 is output
pinMode(5, OUTPUT);  //PB5 is output
bool x,y,z;
x = digitalRead(0);  //read PB0
y = digitalRead(1);  //read PB1
z = digitalRead(2);  //read PB2 
digitalWrite(3, HIGH);  //make PB3 HIGH  
digitalWrite(4, HIGH);  //make PB4 HIGH 
digitalWrite(5, LOW);  //make PB5 LOW</pre>



<p>However, when the ports are used as analog input, the port references are different.  Please refer to Digispark ATtiny85 pinout in Figure 6.  There are only four (4) ports usable as ADC input.  These are PB2, PB3, PB4, and PB5.  Their corresponding ADC port numbers are  ADC1, ADC3, ADC2, and ADC0.  In other words, </p>



<ul class="wp-block-list">
<li>PB2 is ADC1 </li>



<li>PB3 is ADC3</li>



<li>PB4 is ADC2 </li>



<li>PB5 is ADC0    </li>
</ul>



<p>As an example,</p>



<pre class="EnlighterJSRAW">//pinMode() always refer to the Port B numbers
//applicable to both digital and analog I/O
pinMode(5, INPUT);  //Make PB5 as input (ADC0)
pinMode(2, INPUT);  //Make PB2 as input  (ADC1)
pinMode(4, INPUT);  //Make PB4 as input (ADC2)
pinMode(3, INPUT);  //Make PB3 as input (ADC3)
int a, b, c, d; 
//Uses analog port numbers instead of Port B numbers
a = analogRead(0);  //Read PB5
b = analogRead(1);  //Read PB2
c = analogRead(2);  //Read PB4
d = analogRead(3);  //Read PB3</pre>



<p>Now, how about analogWrite()?  Does it use the analog port numbers too?  The answer is NO.</p>



<p>Again, referring to the Digispark ATtiny85 pinout above, there are three (3) ports capable of PWM outputs.  These are PB0, PB1, and PB4.  Let us look at an example of how to use them.</p>



<pre class="EnlighterJSRAW">//all port references are Port B numbers like digitalRead() and digitalWrite()
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
pinMode(4, OUTPUT); 
analogWrite(0, 255);  //100% duty cycle (fully on) PWM on PB0
analogWrite(1, 128);  //50% duty cycle PWM on PB1
analogWrite(4, 0);  //0% duty cycle (off) PWM on PB4</pre>



<h3 class="wp-block-heading">Summary on How to Address or Reference Digispark ATtiny85 Ports in Program</h3>



<p>To summarize, the commands pinMode(), digitalRead(), digitalWrite(), and analogWrite() all use the Port B number references.  Specifically, 0 for PB0, 1 for PB1, 2 for PB2, 3 for PB3, 4 for PB4, and 5 for PB5.  However, as an exception, analogRead() uses its own ADC port numbers.  Namely, 0 for PB5, 1 for PB2, 2 for PB4, and 3 for PB3.</p>



<h2 class="wp-block-heading">References on How to Program Digispark ATtiny85 Board with Arduino IDE</h2>



<p><br><a href="https://cyberblogspot.com/how-to-program-attiny85-with-arduino-ide/" target="_blank" rel="noreferrer noopener">How to Program ATtiny85 with Arduino IDE</a><br><a href="https://cyberblogspot.com/digispark-usb-device-not-recognized/" target="_blank" rel="noreferrer noopener">Digispark USB Device Not Recognized</a><br><a href="https://cyberblogspot.com/how-to-enable-serial-monitor-on-digispark-attiny85/" target="_blank" rel="noreferrer noopener">How to Enable Serial Monitor on Digispark ATtiny85</a><br><a href="https://cyberblogspot.com/digispark-attiny85-pinout-and-configuration/" target="_blank" rel="noreferrer noopener">Digispark ATtiny85 Pinout and Configuration</a><br><a href="https://cyberblogspot.com/how-to-use-at-09-ble-with-arduino-and-smartphone/" target="_blank" rel="noreferrer noopener">How to Use AT-09 BLE with Arduino and Smartphone</a><br><a href="https://www.arduino.cc/en/software" target="_blank" rel="noreferrer noopener">Arduino IDE Download Page</a><br><a href="https://github.com/SpenceKonde/ATTinyCore" target="_blank" rel="noreferrer noopener">ATtinyCore by SpenceKonde on Github</a><br><a href="http://digistump.com/board/index.php?topic=134.0" target="_blank" rel="noreferrer noopener">Digispark Model A Versus Model B</a><br></p>



<p> </p>
<p>The post <a href="https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/">How to Program Digispark ATtiny85 Board with Arduino IDE</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/how-to-program-digispark-attiny85-board-with-arduino-ide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
