<?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>mosfet Archives | Microcontroller Tutorials</title>
	<atom:link href="https://www.teachmemicro.com/tag/mosfet/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.teachmemicro.com/tag/mosfet/</link>
	<description>Microcontroller Tutorials and Resources</description>
	<lastBuildDate>Sun, 15 Oct 2023 21:49:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>

<image>
	<url>https://www.teachmemicro.com/wp-content/uploads/2019/04/blue-icon-65x65.png</url>
	<title>mosfet Archives | Microcontroller Tutorials</title>
	<link>https://www.teachmemicro.com/tag/mosfet/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Controlling a Water Pump with WeMos D1 Mini</title>
		<link>https://www.teachmemicro.com/controlling-water-pump-via-wifi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=controlling-water-pump-via-wifi</link>
					<comments>https://www.teachmemicro.com/controlling-water-pump-via-wifi/#respond</comments>
		
		<dc:creator><![CDATA[Roland Pelayo]]></dc:creator>
		<pubDate>Wed, 03 Feb 2021 01:58:18 +0000</pubDate>
				<category><![CDATA[ESP8266 Tutorial]]></category>
		<category><![CDATA[gardening]]></category>
		<category><![CDATA[mosfet]]></category>
		<guid isPermaLink="false">https://www.teachmemicro.com/?p=4904</guid>

					<description><![CDATA[<p>I recently bought a mini Arduino water pump that runs on 3 to 6 V. Since it consumes very little current (130 mA @ 3V according to its specs), it seems perfect to be used for small projects featuring the ESP8266. In this tutorial, I will share how I managed to create a WiFi-controlled mini &#8230;</p>
<p>The post <a href="https://www.teachmemicro.com/controlling-water-pump-via-wifi/">Controlling a Water Pump with WeMos D1 Mini</a> appeared first on <a href="https://www.teachmemicro.com">Microcontroller Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I recently bought a mini <a href="https://sea.banggood.com/custlink/KGDhIOdRrv">Arduino water pump</a> that runs on 3 to 6 V. Since it consumes very little current (130 mA @ 3V according to its specs), it seems perfect to be used for small projects featuring the <a href="https://www.win-source.net/products/detail/espressif/esp8266ex.html">ESP8266</a>. In this tutorial, I will share how I managed to create a WiFi-controlled mini water pump.</p>
<p><span id="more-4904"></span></p>
<h3><strong>Mini Water Pump Specification</strong></h3>
<p>Here's some information about the pump:</p>
<ul>
<li>Operating Current : 130 ~ 220mA</li>
<li>Flow Rate : 80 ~ 120 L/H</li>
<li>Maximum Lift : 40 ~ 110 mm</li>
<li>Continuous Working Life: 500 hours</li>
<li>Driving Mode: DC, Magnetic Driving</li>
<li>Material: Engineering Plastic</li>
<li>Outlet Outside Diameter: 7.5 mm</li>
<li>Outlet Inside Diameter : 5 mm</li>
</ul>
<p>It is a <em>submersible</em> pump and should be used that way. It tends to heat too much that there's a risk of overheating if you turn it on unsubmerged.</p>
<h3><strong>Water Pump and WeMos D1 Mini Connection</strong></h3>
<p>The first thing I noticed is that it requires a wider tube pipe compared to the ones used by aquarium air pumps so I had to <a href="https://sea.banggood.com/custlink/3DDESLERCr">purchase one separately</a>. The operating current also makes it impossible to connect the wires directly to one of the GPIO pins of the ESP8266 (which maxes out at 12 mA). So naturally, I had to design a way to turn on/off the pump with enough power for it.</p>
<p><a href="https://www.teachmemicro.com/wp-content/uploads/2021/02/basic-esp8266-pump-circuit.jpg"><img decoding="async" class="aligncenter size-full wp-image-4905" src="https://www.teachmemicro.com/wp-content/uploads/2021/02/basic-esp8266-pump-circuit.jpg" alt="arduino water pump" width="633" height="455" srcset="https://www.teachmemicro.com/wp-content/uploads/2021/02/basic-esp8266-pump-circuit.jpg 633w, https://www.teachmemicro.com/wp-content/uploads/2021/02/basic-esp8266-pump-circuit-300x216.jpg 300w" sizes="(max-width: 633px) 100vw, 633px" /></a></p>
<p>Here I have a <a href="https://sea.banggood.com/custlink/3m3hZlEdca">2N7000 MOSFET</a> switch triggered by a signal coming from the WeMos D1. With this, the power through the pump is from the external power supply and not from the WeMos D1.</p>
<p>Next, I created a <a href="https://www.teachmemicro.com/wemos-d1-mini-wifi-server/">WiFi server application</a> so that I may able to control the pump through my smartphone. Basically, the WeMos D1 Mini broadcasts an access point and then I connect to that access point. I then visit an IP address using a web browser and there an interface is shown for controlling the water pump.</p>
<p>As of now, the only thing I can do is turn on or turn off the water pump. Inside this Arduino water pump is a motor so I may try to control it by using PWM. That would be an update in the days to come.</p>
<h3><strong>Full Sketch</strong></h3>
<p>Here's the full sketch for the WiFi server:</p>
<pre class="lang:arduino decode:true "><pre><code class="language-cpp">#include &lt;ESP8266WiFi.h&gt;
#include &lt;WiFiClient.h&gt;
#include &lt;ESP8266WebServer.h&gt;

const char* ssid = &quot;Pump Controller&quot;;
const char* password = &quot;12345678&quot;;

ESP8266WebServer server(80);

const int pump = 8;
static const String page PROGMEM = &quot;&lt;h1&gt;Water Pump Controller&lt;/h1&gt;&lt;p&gt;&lt;a href=\&quot;PumpOn\&quot;&gt;&lt;button&gt;ON&lt;/button&gt;&lt;/a&gt;&nbsp;&lt;a href=\&quot;PumpOff\&quot;&gt;&lt;button&gt;OFF&lt;/button&gt;&lt;/a&gt;&lt;/p&gt;&quot;;
 
void setup(void) {
  
  pinMode(pump, OUTPUT);
  digitalWrite(pump, 0);
  Serial.begin(115200);
 
  WiFi.softAP(ssid, password);
  Serial.println(&quot;&quot;);

  Serial.println(ssid);
  Serial.print(&quot;WiFi Server started at IP address: &quot;);
  Serial.println(WiFi.softAPIP());


  server.on(&quot;/&quot;, [](){
    server.send(200, &quot;text/html&quot;, page);
  });
  
  server.on(&quot;/PumpOn&quot;, [](){
    server.send(200, &quot;text/html&quot;, page);
    digitalWrite(pump, HIGH);
    delay(1000);
  });
  
  server.on(&quot;/PumpOff&quot;, [](){
    server.send(200, &quot;text/html&quot;, page);
    digitalWrite(pump, LOW);
    delay(1000);
  });

  server.begin();
  Serial.println(&quot;HTTP server started&quot;);
}

void loop(void) {
  server.handleClient();
}</code></pre></pre>
<p>The interface is just simple HTML but I'm planning more things for it in the future.</p>
<p><a href="https://www.teachmemicro.com/wp-content/uploads/2021/02/pump-controller-ui.jpg"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-4910" src="https://www.teachmemicro.com/wp-content/uploads/2021/02/pump-controller-ui-1024x644.jpg" alt="water pump controller ui" width="618" height="389" srcset="https://www.teachmemicro.com/wp-content/uploads/2021/02/pump-controller-ui-1024x644.jpg 1024w, https://www.teachmemicro.com/wp-content/uploads/2021/02/pump-controller-ui-300x189.jpg 300w, https://www.teachmemicro.com/wp-content/uploads/2021/02/pump-controller-ui-768x483.jpg 768w, https://www.teachmemicro.com/wp-content/uploads/2021/02/pump-controller-ui.jpg 1242w" sizes="auto, (max-width: 618px) 100vw, 618px" /></a></p>
<p>If you're interested in this project, updates will be made on its <a href="https://github.com/kurimawxx00/esp8266_water_pump_controller">repository</a>.</p>
<p>The post <a href="https://www.teachmemicro.com/controlling-water-pump-via-wifi/">Controlling a Water Pump with WeMos D1 Mini</a> appeared first on <a href="https://www.teachmemicro.com">Microcontroller Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.teachmemicro.com/controlling-water-pump-via-wifi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 

Served from: www.teachmemicro.com @ 2026-08-26 09:16:34 by W3 Total Cache
-->