<?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>CyberBlogSpot</title>
	<atom:link href="https://cyberblogspot.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://cyberblogspot.com/</link>
	<description>Not just another blogspot site</description>
	<lastBuildDate>Sun, 10 Nov 2024 09:35:48 +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>CyberBlogSpot</title>
	<link>https://cyberblogspot.com/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Difference Between ListView and ListBox in VB.Net</title>
		<link>https://cyberblogspot.com/difference-between-listview-and-listbox-in-vb-net/</link>
					<comments>https://cyberblogspot.com/difference-between-listview-and-listbox-in-vb-net/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 10 Nov 2024 09:35:46 +0000</pubDate>
				<category><![CDATA[Visual Basic]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=6659</guid>

					<description><![CDATA[<p>In VB.NET, both ListView and ListBox are controls used to display lists of items, but they have different features and use cases. Here&#8217;s a detailed comparison to help you understand the differences between the two: 1. ListBox Use Case: Use ListBox when you need a simple list for users to pick from, like a list&#8230;&#160;<a href="https://cyberblogspot.com/difference-between-listview-and-listbox-in-vb-net/" rel="bookmark">Read More &#187;<span class="screen-reader-text">Difference Between ListView and ListBox in VB.Net</span></a></p>
<p>The post <a href="https://cyberblogspot.com/difference-between-listview-and-listbox-in-vb-net/">Difference Between ListView and ListBox in VB.Net</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In VB.NET, both <strong><code>ListView</code></strong> and <strong><code>ListBox</code></strong> are controls used to display lists of items, but they have different features and use cases. Here&#8217;s a detailed comparison to help you understand the differences between the two:</p>



<h3 class="wp-block-heading"><strong>1. ListBox</strong></h3>



<ul class="wp-block-list">
<li><strong>Purpose</strong>: Used for displaying a simple list of items, primarily for single or multi-selection.</li>



<li><strong>Appearance</strong>: Displays items in a single column by default (like a plain list).</li>



<li><strong>Selection</strong>: Supports single and multi-selection modes.</li>



<li><strong>Item Display</strong>: Each item is typically displayed as plain text (without any columns or sub-items).</li>



<li><strong>Features</strong>:
<ul class="wp-block-list">
<li>Supports basic item selection (single or multiple).</li>



<li>Can bind to data sources for simple lists.</li>



<li>Can respond to events like <code>SelectedIndexChanged</code> and <code>DoubleClick</code>.</li>



<li>Limited customization in terms of item display (e.g., text only).</li>
</ul>
</li>
</ul>



<p><strong>Use Case</strong>: Use <code>ListBox</code> when you need a simple list for users to pick from, like a list of names, categories, or simple text items.</p>



<h4 class="wp-block-heading">Example Usage:</h4>



<pre class="EnlighterJSRAW">&#039; Adding items to a ListBox
ListBox1.Items.Add(&quot;Item 1&quot;)
ListBox1.Items.Add(&quot;Item 2&quot;)
ListBox1.Items.Add(&quot;Item 3&quot;)

&#039; Retrieving the selected item
Dim selectedItem As String = ListBox1.SelectedItem.ToString()</pre>



<h3 class="wp-block-heading"><strong>2. ListView</strong></h3>



<ul class="wp-block-list">
<li><strong>Purpose</strong>: Used for displaying a list of items with more complex structures, often with additional details like columns and sub-items.</li>



<li><strong>Appearance</strong>: Can display items in various views:
<ul class="wp-block-list">
<li><strong>Details</strong>: Shows columns (like a table).</li>



<li><strong>List</strong>: Similar to ListBox but with optional icons.</li>



<li><strong>LargeIcon</strong> and <strong>SmallIcon</strong>: Displays items with large or small icons.</li>



<li><strong>Tile</strong>: Displays items with both icons and details.</li>
</ul>
</li>



<li><strong>Selection</strong>: Supports single and multi-selection modes.</li>



<li><strong>Item Display</strong>: Allows for displaying multiple columns and sub-items (great for tabular data).</li>



<li><strong>Features</strong>:
<ul class="wp-block-list">
<li>Supports columns, sub-items, and rich item views.</li>



<li>Allows for customization with icons, checkboxes, and images.</li>



<li>Can be used to create a grid-like view, making it more flexible than <code>ListBox</code>.</li>



<li>Events like <code>SelectedIndexChanged</code>, <code>ItemActivate</code>, and <code>ColumnClick</code> allow for more complex interactions.</li>
</ul>
</li>
</ul>



<p><strong>Use Case</strong>: Use <code>ListView</code> when you need to display detailed or structured data, like a file explorer, a product list with prices, or any tabular data.</p>



<h4 class="wp-block-heading">Example Usage:</h4>



<pre class="EnlighterJSRAW">&#039; Setting up a ListView in Details mode
ListView1.View = View.Details
ListView1.Columns.Add(&quot;Name&quot;, 100)
ListView1.Columns.Add(&quot;Price&quot;, 70)

&#039; Adding items to a ListView
Dim item As New ListViewItem(&quot;Item 1&quot;)
item.SubItems.Add(&quot;$10&quot;)
ListView1.Items.Add(item)

&#039; Adding another item with sub-items
Dim item2 As New ListViewItem(&quot;Item 2&quot;)
item2.SubItems.Add(&quot;$20&quot;)
ListView1.Items.Add(item2)</pre>



<h4 class="wp-block-heading"><strong>Comparison Table</strong></h4>



<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2024/11/listbox-vs-listview-table.png"><img fetchpriority="high" decoding="async" width="752" height="366" src="https://cyberblogspot.com/wp-content/uploads/2024/11/listbox-vs-listview-table.png" alt="Table comparing the features of listbox and listview" class="wp-image-6662" srcset="https://cyberblogspot.com/wp-content/uploads/2024/11/listbox-vs-listview-table.png 752w, https://cyberblogspot.com/wp-content/uploads/2024/11/listbox-vs-listview-table-300x146.png 300w" sizes="(max-width: 752px) 100vw, 752px" /></a></figure>



<h3 class="wp-block-heading"><strong>When to Use Which?</strong></h3>



<ul class="wp-block-list">
<li>Use <strong><code>ListBox</code></strong> if you only need a simple, text-based list of items and do not require additional details like columns or icons.</li>



<li>Use <strong><code>ListView</code></strong> if you need to display more complex data with columns, icons, or multiple views. It&#8217;s ideal for displaying tabular data or lists with multiple attributes per item.</li>
</ul>



<h3 class="wp-block-heading"><strong>Conclusion</strong></h3>



<ul class="wp-block-list">
<li><strong>ListBox</strong> is straightforward and lightweight, ideal for simple lists.</li>



<li><strong>ListView</strong> is more versatile and feature-rich, suitable for more detailed data presentation.</li>
</ul>



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



<p><a href="https://cyberblogspot.com/specifying-data-type-when-adding-columns-to-a-datatable/" target="_blank" rel="noreferrer noopener">Specifying Data Type When Adding Columns to a DataTable</a><br><a href="https://cyberblogspot.com/how-to-create-a-custom-file-explorer-in-vb-net/">How to Create a Custom File in VB.Net</a> </p>
<p>The post <a href="https://cyberblogspot.com/difference-between-listview-and-listbox-in-vb-net/">Difference Between ListView and ListBox in VB.Net</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/difference-between-listview-and-listbox-in-vb-net/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Specifying Data Type When Adding Columns to a DataTable</title>
		<link>https://cyberblogspot.com/specifying-data-type-when-adding-columns-to-a-datatable/</link>
					<comments>https://cyberblogspot.com/specifying-data-type-when-adding-columns-to-a-datatable/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 10 Nov 2024 08:47:09 +0000</pubDate>
				<category><![CDATA[Visual Basic]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=6650</guid>

					<description><![CDATA[<p>When you create columns in a DataTable using the Add method, you need to specify the type (e.g., GetType(String)) because the DataTable needs to know what kind of data each column will store. Here&#8217;s a detailed explanation of why this is necessary: Reasons for Specifying the Column Type Example of Creating a DataTable with Specified&#8230;&#160;<a href="https://cyberblogspot.com/specifying-data-type-when-adding-columns-to-a-datatable/" rel="bookmark">Read More &#187;<span class="screen-reader-text">Specifying Data Type When Adding Columns to a DataTable</span></a></p>
<p>The post <a href="https://cyberblogspot.com/specifying-data-type-when-adding-columns-to-a-datatable/">Specifying Data Type When Adding Columns to a DataTable</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>When you create columns in a <strong>DataTable</strong> using the <code>Add</code> method, you need to specify the type (e.g., <code>GetType(String)</code>) because the <strong>DataTable</strong> needs to know what kind of data each column will store. Here&#8217;s a detailed explanation of why this is necessary:</p>



<h3 class="wp-block-heading"><strong>Reasons for Specifying the Column Type</strong></h3>



<pre class="EnlighterJSRAW">table.Columns.Add(&quot;WatchListName&quot;, GetType(String))  &#039; Stores text data
table.Columns.Add(&quot;Price&quot;, GetType(Decimal))         &#039; Stores decimal numbers
table.Columns.Add(&quot;Volume&quot;, GetType(Integer))        &#039; Stores integer numbers</pre>



<ol class="wp-block-list">
<li><strong>Data Storage and Memory Management</strong>:
<ul class="wp-block-list">
<li>The <strong>DataTable</strong> is a highly efficient data structure that stores data in memory. By specifying the data type of each column, the <strong>DataTable</strong> can allocate memory more efficiently.</li>



<li>If you specify <code>GetType(String)</code>, the <strong>DataTable</strong> knows to allocate memory suitable for storing text.</li>



<li>If you specify <code>GetType(Integer)</code>, it will store numeric values in a more compact format, using less memory than storing them as strings.</li>
</ul>
</li>



<li><strong>Data Integrity</strong>:
<ul class="wp-block-list">
<li>Specifying the type ensures that only data of that type can be stored in that column. This helps prevent data entry errors.</li>



<li>For example, if a column is defined as <code>GetType(Integer)</code>, trying to insert a string value like <code>"ABC"</code> will cause an error, which helps maintain the integrity of your data.</li>
</ul>
</li>



<li><strong>Performance Optimization</strong>:
<ul class="wp-block-list">
<li>The <strong>DataTable</strong> can perform operations like sorting, filtering, and searching more efficiently when it knows the data type of each column.</li>



<li>For example, sorting a column with <code>GetType(DateTime)</code> is faster and more accurate than sorting text representations of dates.</li>
</ul>
</li>



<li><strong>Type Safety</strong>:
<ul class="wp-block-list">
<li>By specifying a data type, you get the benefit of <strong>type safety</strong> at compile time. This means that the code will produce errors if you try to add data of the wrong type, which helps catch bugs early in the development process.</li>
</ul>
</li>



<li><strong>Compatibility with Databases</strong>:
<ul class="wp-block-list">
<li>When working with databases, columns in tables have specific data types (<code>VARCHAR</code>, <code>INT</code>, <code>DECIMAL</code>, etc.). By specifying types in your <strong>DataTable</strong>, you ensure compatibility when filling data from or sending data to a database.</li>
</ul>
</li>
</ol>



<h3 class="wp-block-heading"><strong>Example of Creating a DataTable with Specified Types</strong></h3>



<p>Here&#8217;s an example of creating a <strong>DataTable</strong> with multiple columns of different types:</p>



<pre class="EnlighterJSRAW">&#039; Create a new DataTable
Dim table As New DataTable(&quot;WatchLists&quot;)

&#039; Add columns with specific types
table.Columns.Add(&quot;WatchListName&quot;, GetType(String))   &#039; Text data
table.Columns.Add(&quot;Symbol&quot;, GetType(String))          &#039; Text data
table.Columns.Add(&quot;Price&quot;, GetType(Decimal))          &#039; Numeric data
table.Columns.Add(&quot;Volume&quot;, GetType(Integer))         &#039; Integer data
table.Columns.Add(&quot;LastUpdated&quot;, GetType(DateTime))   &#039; Date/Time data

&#039; Add a row of data to the table
Dim row As DataRow = table.NewRow()
row(&quot;WatchListName&quot;) = &quot;My WatchList&quot;
row(&quot;Symbol&quot;) = &quot;MER&quot;
row(&quot;Price&quot;) = 400.5D
row(&quot;Volume&quot;) = 1000
row(&quot;LastUpdated&quot;) = DateTime.Now
table.Rows.Add(row)</pre>



<h3 class="wp-block-heading"><strong>What Happens if You Don&#8217;t Specify a Type?</strong></h3>



<ul class="wp-block-list">
<li>If you don&#8217;t specify a type (e.g., <code>table.Columns.Add("WatchListName")</code>), the column will default to <strong><code>GetType(Object)</code></strong>.</li>



<li>This means it can store any type of data (e.g., strings, integers, dates), but it comes at the cost of reduced type safety, performance, and increased memory usage.</li>
</ul>



<h4 class="wp-block-heading">Example of Column Without Specified Type:</h4>



<pre class="EnlighterJSRAW">table.Columns.Add(&quot;UnspecifiedType&quot;) &#039; Defaults to Object type
table.Rows.Add(&quot;SomeText&quot;)           &#039; Works fine
table.Rows.Add(123)                  &#039; Also works, but not type-safe</pre>



<ul class="wp-block-list">
<li>Using <code>GetType(Object)</code> is more flexible but less efficient. It&#8217;s generally better to specify the correct type unless you truly need to store mixed types in a single column.</li>
</ul>



<h3 class="wp-block-heading"><strong>Conclusion</strong></h3>



<ul class="wp-block-list">
<li>Specifying the type when adding columns to a <strong>DataTable</strong> is essential for data integrity, performance optimization, type safety, and memory efficiency.</li>



<li>It&#8217;s a good practice to define the data type that best matches the data you intend to store in each column, similar to how you would define data types in a database table.</li>
</ul>
<p>The post <a href="https://cyberblogspot.com/specifying-data-type-when-adding-columns-to-a-datatable/">Specifying Data Type When Adding Columns to a DataTable</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/specifying-data-type-when-adding-columns-to-a-datatable/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Create a Custom File Explorer in VB.NET</title>
		<link>https://cyberblogspot.com/how-to-create-a-custom-file-explorer-in-vb-net/</link>
					<comments>https://cyberblogspot.com/how-to-create-a-custom-file-explorer-in-vb-net/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 10 May 2023 09:30:48 +0000</pubDate>
				<category><![CDATA[Visual Basic]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=6309</guid>

					<description><![CDATA[<p>File Explorer is an essential component of Windows that allows users to navigate, view, and manage files and folders stored on their computer. While the default File Explorer provided by Windows is functional, it may lack certain features or customizations that users require. In this article, we will explore how to create a custom File&#8230;&#160;<a href="https://cyberblogspot.com/how-to-create-a-custom-file-explorer-in-vb-net/" rel="bookmark">Read More &#187;<span class="screen-reader-text">How to Create a Custom File Explorer in VB.NET</span></a></p>
<p>The post <a href="https://cyberblogspot.com/how-to-create-a-custom-file-explorer-in-vb-net/">How to Create a Custom File Explorer in VB.NET</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>File Explorer is an essential component of Windows that allows users to navigate, view, and manage files and folders stored on their computer. While the default File Explorer provided by Windows is functional, it may lack certain features or customizations that users require. In this article, we will explore how to create a custom File Explorer in VB.NET, a versatile and powerful programming language that enables developers to build feature-rich applications.</p>



<p>To create a custom File Explorer in VB.NET, we will make use of the &#8220;vbUtilities&#8221; class library. This third-party library provides a set of useful tools and functionalities that can simplify the development process and enhance the capabilities of our application.  The library also includes pre-built user interface components that we can utilize to create a visually appealing and intuitive user interface. Using vbUtilities, we can save time and effort by avoiding the need to write custom code for these common functionalities and instead focus on the core business logic of our application.</p>



<p>You can download <a href="https://github.com/cyberblogspot/vbUtilities.git" target="_blank" rel="noreferrer noopener">vbUtilities from github.com</a>.</p>



<h2 class="wp-block-heading">STEP 1 &#8211; Create a VB Project</h2>



<p>Create a Windows Forms App (.NET Framework).  Make sure that &#8220;.NET Framework 4.8&#8221; is selected under &#8220;Framework&#8221;.  The vbUtilities is targetted for this specific .NET Framework version.  Name the project as &#8220;Custom File Explorer&#8221;.</p>



<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/05/create-vb.net-project.png"><img decoding="async" width="1014" height="675" src="https://cyberblogspot.com/wp-content/uploads/2023/05/create-vb.net-project.png" alt="" class="wp-image-6312" srcset="https://cyberblogspot.com/wp-content/uploads/2023/05/create-vb.net-project.png 1014w, https://cyberblogspot.com/wp-content/uploads/2023/05/create-vb.net-project-300x200.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/05/create-vb.net-project-768x511.png 768w, https://cyberblogspot.com/wp-content/uploads/2023/05/create-vb.net-project-930x620.png 930w" sizes="(max-width: 1014px) 100vw, 1014px" /></a></figure>



<h2 class="wp-block-heading">STEP 2 &#8211; Drop Controls on the Form</h2>



<p>Drop a TreeView control, a ListView control, a ComboBox control, and three (3) ImageList controls.  We may leave the names of the TreeView, ListView, and ComboBox controls with their default names (TreeView1, ListView1, and ComboBox1 respectively).  However, because we have three (3) ImageList controls, it is best to rename them to avoid confusion. </p>



<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-design1.png"><img decoding="async" width="999" height="519" src="https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-design1.png" alt="" class="wp-image-6314" srcset="https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-design1.png 999w, https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-design1-300x156.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-design1-768x399.png 768w" sizes="(max-width: 999px) 100vw, 999px" /></a></figure>



<p>The first ImageList will store the icons for the TreeView control.  Therefore, we should rename it as ilTreeView.  I renamed the second ImageList control as ilSmallIcons and the third ImageList as ilLargeIcons.  These two last ImageList will hold the icons for the ListView control.</p>



<h2 class="wp-block-heading">STEP 3 &#8211; Add a Reference to vbUtilities</h2>



<p>Download and unzip the <strong>vbUtilities </strong>class library from github.com.  Next, on the Visual Studio IDE, go to <strong>Project -> Add Reference</strong>.  On the Reference Manager window, click the <strong>Browse</strong> button on the lower right of the window.  Search for the <strong>vbUtilities.dll</strong> from the downloaded files and click the <strong>Add </strong>button.  When you are back on the Reference Manager, click the OK button to close the Reference Manager window.</p>



<h2 class="wp-block-heading">STEP 4 &#8211; Add Source Code</h2>



<p>Double click on the form, delete the existing code, and copy and paste the following source code.</p>



<pre class="EnlighterJSRAW">Imports vbUtilities
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        vbUtilities.CustomFileExplorer.InitializeCFE(&quot;C:\&quot;, TreeView1, ilTreeView, ListView1, ilSmallIcons, ilLargeIcons, ComboBox1)
    End Sub

    Private Sub TreeView1_BeforeCollapse(sender As Object, e As TreeViewCancelEventArgs) Handles TreeView1.BeforeCollapse
        vbUtilities.CustomFileExplorer.TreeView_BeforeCollapse(e)
    End Sub

    Private Sub TreeView1_BeforeExpand(sender As Object, e As TreeViewCancelEventArgs) Handles TreeView1.BeforeExpand
        vbUtilities.CustomFileExplorer.TreeView_BeforeExpand(e, ilTreeView)
    End Sub

    Private Sub TreeView1_AfterSelect(sender As Object, e As TreeViewEventArgs) Handles TreeView1.AfterSelect
        vbUtilities.CustomFileExplorer.TreeView_AfterSelect(e, ListView1, ilSmallIcons, ilLargeIcons)
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
        vbUtilities.CustomFileExplorer.ComboBox_SelectedIndexChanged(ComboBox1.SelectedItem, ListView1)
    End Sub
End Class</pre>



<h2 class="wp-block-heading">STEP 5 &#8211; Compile and Run</h2>



<p>Click the Start button on the Visual Studio IDE.</p>



<figure class="wp-block-image size-full"><a href="https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-output.png"><img loading="lazy" decoding="async" width="802" height="482" src="https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-output.png" alt="" class="wp-image-6319" srcset="https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-output.png 802w, https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-output-300x180.png 300w, https://cyberblogspot.com/wp-content/uploads/2023/05/custom-file-explorer-output-768x462.png 768w" sizes="auto, (max-width: 802px) 100vw, 802px" /></a></figure>
<p>The post <a href="https://cyberblogspot.com/how-to-create-a-custom-file-explorer-in-vb-net/">How to Create a Custom File Explorer in VB.NET</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/how-to-create-a-custom-file-explorer-in-vb-net/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Add Edit Delete in VB.Net Programming</title>
		<link>https://cyberblogspot.com/add-edit-delete-in-vb-net-programming/</link>
					<comments>https://cyberblogspot.com/add-edit-delete-in-vb-net-programming/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 14 Apr 2023 20:27:37 +0000</pubDate>
				<category><![CDATA[Visual Basic]]></category>
		<guid isPermaLink="false">https://cyberblogspot.com/?p=4769</guid>

					<description><![CDATA[<p>Add, edit, and delete are fundamental database operations which can be implemented in VB.Net in multitude of ways. They are usually collectively referred to as CRUD (Create, Read, Update and Delete). In this article, we are going to look at the different ways of accomplishing CRUD in VB.Net (Visual Basic). One of the straightforward way&#8230;&#160;<a href="https://cyberblogspot.com/add-edit-delete-in-vb-net-programming/" rel="bookmark">Read More &#187;<span class="screen-reader-text">Add Edit Delete in VB.Net Programming</span></a></p>
<p>The post <a href="https://cyberblogspot.com/add-edit-delete-in-vb-net-programming/">Add Edit Delete in VB.Net Programming</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Add, edit, and delete are fundamental database operations which can be implemented in VB.Net in multitude of ways.  They are usually collectively referred to as CRUD (Create, Read, Update and Delete).  In this article, we are going to look at the different ways of accomplishing CRUD in VB.Net (Visual Basic). </p>



<p>One of the straightforward way of adding,  editing, and deleting records in a database table is thru the direct execution of SQL commands.  That is, to add a record to an existing table, the SQL command INSERT is used.  Likewise, to edit a record, the SQL command UPDATE is executed. For record deletion, the SQL command is DELETE.  Finally for searching and reading of records, the SQL command SELECT is used.</p>



<h2 class="wp-block-heading">SQL Commands for  Reading, Adding, Editing, and Deleting Records</h2>



<h3 class="wp-block-heading">1.  SQL SELECT Statement</h3>



<p>Reading or retrieval of a table record or set of records</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="tsql" data-enlighter-title="">SELECT column1, column2, column3, ..., columnN
FROM table_name
WHERE condition;</pre></div>



<h3 class="wp-block-heading">VB.Net SqlCommand</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="">cmd.CommandText = &quot;SELECT * FROM table_name WHERE condition&quot;
cmd.ExecuteReader()</pre></div>



<h3 class="wp-block-heading">2.  SQL INSERT Statement </h3>



<p>Addition, creation, or insertion of a new table record</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="tsql" data-enlighter-linenumbers="false" data-enlighter-title="CREATE - INSERT INTO">INSERT INTO table_name (column1, column2, column3, ..., columnN)
VALUES (value1, value2, value3, ..., valueN);</pre></div>



<h3 class="wp-block-heading">VB.Net SqlCommand</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="">cmd.CommandText = &quot;INSERT INTO table_name (column1, column2, column3, ..., columnN)
                   VALUES (value1, value2, value3, ..., valueN) WHERE condition&quot;
cmd.ExecuteNonQuery()
</pre></div>



<h3 class="wp-block-heading">3.  SQL UPDATE Statement</h3>



<p>Editing or updating a table record</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="tsql" data-enlighter-title="">UPDATE table_name
SET column1 = value1, column2 = value2, column3 = value3, ..., columnN = valueN 
WHERE condition;</pre></div>



<h3 class="wp-block-heading">VB.Net SqlCommand</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="">cmd.CommandText = &quot;UPDATE table_name SET column1 = value1, column2 = value2,
                   column3 = value3, ..., columnN = valueN&quot;
cmd.ExecuteNonQuery
</pre></div>



<h3 class="wp-block-heading">4.  SQL DELETE Statement</h3>



<p>Delete a table record or set of records</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="tsql" data-enlighter-title="">DELETE FROM table_name WHERE condition;</pre></div>



<h3 class="wp-block-heading">VB.Net SqlCommand</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="">cmd.CommandText = &quot;DELETE FROM table_name WHERE condition&quot;
cmd.ExecuteNonQuery</pre></div>



<p>We can execute SQL commands in VB.Net by using an SqlCommand object.  However, an SqlCommand object needs an SqlConnection object.  Also, we need to provide the SqlConnection object with a connection string.  The connection string specifies how to connect to the database.</p>



<h2 class="wp-block-heading">Sample Add, Edit, Delete Program in VB.Net</h2>



<p>To illustrate the use of the different SQL commands, let us first create a simple SQL database.  For this tutorial, I am using a Visual Studio 2019 Community Edition.  In order to work with SQL databases in VS2019, you must install the Data Storage and Processing toolset.  If you did not install it when you installed your VS2019, re-run the installer.  Put a checkmark on Data Storage and Processing under the Other Toolsets list.</p>



<figure class="wp-block-image size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2021/06/vs2019-installer-data-storage-and-processing.jpg"><img loading="lazy" decoding="async" width="800" height="526" src="https://cyberblogspot.com/wp-content/uploads/2021/06/vs2019-installer-data-storage-and-processing.jpg" alt="" class="wp-image-4870" srcset="https://cyberblogspot.com/wp-content/uploads/2021/06/vs2019-installer-data-storage-and-processing.jpg 800w, https://cyberblogspot.com/wp-content/uploads/2021/06/vs2019-installer-data-storage-and-processing-300x197.jpg 300w, https://cyberblogspot.com/wp-content/uploads/2021/06/vs2019-installer-data-storage-and-processing-768x505.jpg 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>



<p>You may install an SQL server if you want.  There are two free editions of Microsoft SQL Server that you can use.  These are the Developer and Express editions.  They can be downloaded <a href="https://www.microsoft.com/en-us/sql-server/sql-server-downloads" target="_blank" rel="noreferrer noopener">here</a>.  </p>



<h3 class="wp-block-heading">Notes on Visual Studio Project Types</h3>



<h4 class="wp-block-heading">Windows Forms App versus Windows Forms App (.Net Framework)</h4>



<p>If you are new to Visual Studio, choosing a project type can be confusing.  Take a look at the screenshot below.  Both <strong>Windows Forms App</strong> and  <strong>Windows Forms App (.Net Framework)</strong> are used for creating WinForms.  Both types also mention &#8220;.Net&#8221;.  So, what&#8217;s the difference?</p>



<figure class="wp-block-image size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app.png"><img loading="lazy" decoding="async" width="941" height="247" src="https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app.png" alt="" class="wp-image-4872" srcset="https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app.png 941w, https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app-300x79.png 300w, https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app-768x202.png 768w" sizes="auto, (max-width: 941px) 100vw, 941px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app-dotnet-framework.png"><img loading="lazy" decoding="async" width="941" height="262" src="https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app-dotnet-framework.png" alt="" class="wp-image-4873" srcset="https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app-dotnet-framework.png 941w, https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app-dotnet-framework-300x84.png 300w, https://cyberblogspot.com/wp-content/uploads/2021/06/windows-forms-app-dotnet-framework-768x214.png 768w" sizes="auto, (max-width: 941px) 100vw, 941px" /></a></figure>



<p><strong>Windows Forms App (.Net Framework)</strong> is for creating apps targeting <strong>.Net Framework</strong>.  Whereas the plain <strong>Windows Forms App</strong> is for creating apps that use the <strong>.Net Core</strong>.  These will become clear after you select the project type.</p>



<figure class="wp-block-image size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-core.png"><img loading="lazy" decoding="async" width="800" height="276" src="https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-core.png" alt="" class="wp-image-4874" srcset="https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-core.png 800w, https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-core-300x104.png 300w, https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-core-768x265.png 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-framework.png"><img loading="lazy" decoding="async" width="800" height="509" src="https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-framework.png" alt="" class="wp-image-4875" srcset="https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-framework.png 800w, https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-framework-300x191.png 300w, https://cyberblogspot.com/wp-content/uploads/2021/06/dotnet-framework-768x489.png 768w" sizes="auto, (max-width: 800px) 100vw, 800px" /></a></figure>



<p>.Net Framework is the old and mature .Net that runs on the Windows platform.  In contrast, .Net Core is the new .Net that is cross-platform. </p>



<h3 class="wp-block-heading">Read</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="">Dim connStr As String = &quot;Data Source=localhost\SQLEXPRESS;
                         Initial Catalog=myDatabase;
                         Integrated Security=True;
                         Pooling=False&quot;
Dim conn As New SqlConnection(connStr)
Dim cmd As SqlCommand

cmd = conn.CreateCommand
cmd.CommandText = &quot;Select * from Employees&quot;</pre></div>



<p>After prepping the SqlCommand object as shown above, the actual execution of the SqlCommand depends on the type of the command.  In this case, because it is a SELECT command, we expect the command to return a set of values.  Therefore, we need an object to receive the results.</p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="">conn.Open()
Dim reader As SqlDataReader
reader = cmd.ExecuteReader</pre></div>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="">Imports System.Data.SqlClient
Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim connStr As String = &quot;Data Source=localhost\SQLEXPRESS;
                                 Initial Catalog=myDatabase;
                                 Integrated Security=True;
                                 Pooling=False&quot;
        Dim conn As New SqlConnection(connStr)
        Dim cmd As SqlCommand

        cmd = conn.CreateCommand
        cmd.CommandText = &quot;Select * from Employees&quot;

        conn.Open()
        Dim dt As New DataTable
        dt.Load(cmd.ExecuteReader())
        conn.Close()

        DataGridView1.DataSource = dt
    End Sub
End Class</pre></div>



<h3 class="wp-block-heading">ADD</h3>



<p>CREATE &#8211; or INSERT a record into a table.  The SQL command starts with the keywords INSERT INTO.  It is followed with the name of the table.  Then, the column names are specified inside a pair of parentheses.  Finally, the corresponding values for the columns are enumerated, again, inside a pair of parentheses.</p>



<h2 class="wp-block-heading">SQL INSERT COMMAND</h2>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="">Imports System.Data.SqlClient
Public Class frmAdd
    Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
        Dim connStr As String = &quot;Data Source=localhost\SQLEXPRESS;
                                Initial Catalog=myDatabase;
                                Integrated Security=True;
                                Pooling=False&quot;
        Dim conn As New SqlConnection(connStr)
        Dim cmd As SqlCommand

        &#039;DATA VALIDATION
        &#039;Check if all required fields are filled
        If Trim(txtEmployeeID.Text) = &quot;&quot; Or Trim(txtEmployeeName.Text) = &quot;&quot; Or Trim(txtAge.Text) = &quot;&quot; Then
            MsgBox(&quot;Please fill all fields&quot;, vbExclamation, &quot;Add Record Error&quot;)
            Exit Sub
        End If

        &#039;Check if EmployeeID is numeric
        If Not IsNumeric(txtEmployeeID.Text) Then
            MsgBox(&quot;Please enter a numeric value for Employee ID&quot;, vbExclamation, &quot;Add Record Error&quot;)
            Exit Sub
        End If

        &#039;Check if Age is numeric
        If Not IsNumeric(txtAge.Text) Then
            MsgBox(&quot;Please enter a numeric value for Age&quot;, vbExclamation, &quot;Add Record Error&quot;)
            Exit Sub
        End If

        &#039;Check if EmployeeID is already in use
        cmd = conn.CreateCommand
        cmd.CommandText = &quot;SELECT * FROM Employees WHERE EmployeeID = &#039;&quot; &amp; txtEmployeeID.Text &amp; &quot;&#039;&quot;

        conn.Open()
        Dim reader As SqlDataReader
        reader = cmd.ExecuteReader()

        If reader.HasRows Then
            MsgBox(&quot;Employee ID already exist&quot;, vbExclamation, &quot;Add Record Error&quot;)
            reader.Close()
            conn.Close()
            Exit Sub
        End If

        reader.Close()

        &#039;SAVE RECORD
        cmd.CommandText = &quot;INSERT INTO Employees (EmployeeID, EmployeeName, Age) 
                           VALUES (&quot; &amp; txtEmployeeID.Text &amp; &quot;,&quot; &amp; txtEmployeeName.Text &amp; &quot;,&quot; &amp; txtAge.Text &amp; &quot;)&quot;

        Dim result As Integer
        result = cmd.ExecuteNonQuery()

        If result &gt; 0 Then
            MsgBox(&quot;Record successfully saved&quot;, vbInformation, &quot;Add Record Info&quot;)
        Else
            MsgBox(&quot;Record save failed&quot;, vbCritical, &quot;Add Record Error&quot;)
        End If

        reader.Close()
        conn.Close()
    End Sub
End Class</pre></div>



<p>READ &#8211; or retrieve a record or a set of records.  The keyword for the SQL command is SELECT.  The column names are then enumerated.  Then, the keyword FROM followed by the table name.  As an option, a condition clause can be added to the command.</p>



<h3 class="wp-block-heading">VB.Net Code</h3>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="Read records and display on a datagridview and textboxes">Imports System.Data.SqlClient
Public Class frmRead
    Private Sub frmRead_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim connStr As String = &quot;Data Source=localhost\SQLEXPRESS;
                                 Initial Catalog=myDatabase;
                                 Integrated Security=True;
                                 Pooling=False&quot;
        Dim conn As New SqlConnection(connStr)
        Dim cmd As SqlCommand
        Dim dt As New DataTable

        cmd = conn.CreateCommand
        cmd.CommandText = &quot;Select * from Employees&quot;

        conn.Open()
        dt.Load(cmd.ExecuteReader)
        conn.Close()

        Dim drow As DataRow = dt.Rows(0)
        txtEmployeeID.Text = drow(0)
        txtEmployeeName.Text = drow(1)
        txtAge.Text = drow(2)

        DataGridView1.DataSource = dt
    End Sub
End Class</pre></div>



<p>UPDATE</p>



<p></p>



<p>DELETE</p>



<p><br><br></p>



<div class="wp-block-urvanov-syntax-highlighter-code-block"><pre class="EnlighterJSRAW" data-enlighter-language="vb" data-enlighter-title="My Description">&#039;
Private Sub dgv_RowsAdded(sender As Object, e As DataGridViewRowsAddedEventArgs) Handles dgv.RowsAdded
        rowIndex = e.RowIndex
        rowCount = e.RowCount
End Sub</pre></div>



<h2 class="wp-block-heading">Creating a Database</h2>



<p>Project&#8211;&gt;Add New Item&#8211;&gt;Service-based Database&#8211;&gt;Click Add button<br>In the Solution Explorer, a file name Database1.mdf will appear.  On the Server Explorer, the same file will appear under Data Connections<br><br>Rename the file into &#8220;StudentDatabase.mdf&#8221; on the Solution Explorer<br></p>



<h2 class="wp-block-heading">Creating a Table</h2>



<p>On the Server Explorer, expand the StudentDatabase.mdf, and right-click the Tables program to create a new Table</p>



<p>Opening a database.</p>



<p>PROBLEM WITH SQL QUERY WITH DATES, INPUTTED DATE FORMAT IS MODIFIED DURING SQL QUERY</p>



<p>FOR EXAMPLE INPUT 06/30/2021 BECOMES 30/06/2021, THEREBY GENERATING ERRORS</p>



<p>SOLUTION : CHANGE LANGUAGE SETTINGS TO US</p>



<p></p>



<p>EXECUTESCALAR CAUSING ERROR IF RESULT IS DBNULL</p>



<p>SOLUTION: MAKE THE RECEIVING VARIABLE AN OBJECT</p>



<p>dim result as long<br>result=cmd.executescalar  &#8217;causes error when result is dbnull or nothing<br></p>



<p>solution:</p>



<p>dim result as object</p>



<h2 class="wp-block-heading">Related Articles on Add Edit Delete in VB.Net Programming</h2>



<p><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></p>



<h2 class="wp-block-heading">References on Add Edit Delete in VB.Net Programming</h2>



<p><a href="https://en.wikipedia.org/wiki/Create,_read,_update_and_delete" target="_blank" rel="noreferrer noopener">CRUD on Wikipedia</a></p>
<p>The post <a href="https://cyberblogspot.com/add-edit-delete-in-vb-net-programming/">Add Edit Delete in VB.Net Programming</a> appeared first on <a href="https://cyberblogspot.com">CyberBlogSpot</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberblogspot.com/add-edit-delete-in-vb-net-programming/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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 loading="lazy" 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="auto, (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 loading="lazy" 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="auto, (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 loading="lazy" 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="auto, (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>
	</channel>
</rss>
