<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Using MOSFET with ESP32 to switch power to 28byj-48 stepper. - Motors &amp; Control				            </title>
            <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/</link>
            <description>Discussion board for Robotics, Arduino, Raspberry Pi and other DIY electronics and modules. Join us today!</description>
            <language>en-US</language>
            <lastBuildDate>Thu, 12 Nov 2026 20:31:06 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46735</link>
                        <pubDate>Sat, 06 Apr 2024 17:31:48 +0000</pubDate>
                        <description><![CDATA[Hi Bill @billo4th,
  Thanks for your kind reply. Good to hear you are making progress. Ordering from AliExpress does require a degree of patience. In a very modest way, I have tried to buy ...]]></description>
                        <content:encoded><![CDATA[<p>Hi Bill @billo4th,</p>
<p>  Thanks for your kind reply. Good to hear you are making progress. Ordering from AliExpress does require a degree of patience. In a very modest way, I have tried to buy some components to make a store of 'cheap' bits like resistors, small transistors and so on, so that I can throw a few parts together, without waiting. Of course, there will always be missing parts, but it's a start.</p>
<p>If you are not familiar with MOSFETs, then they are rather different from their bipolar cousins. They are worth looking up. Also, I suggest using a simulator to find out how a typical device behaves, although I appreciate that is a new learning curve for many.  I tend to use LTSPICE, which is free download from Analog Devices, but there are several alternatives which are also free.</p>
<p>Start with a part or parts you understand, even just a voltage source and a resistor. Build up some experience, then move to the parts that are less familiar. You may not find the model for an exact transistor number, but just look for one that looks fairly similar.</p>
<p>Of course, if there is a particular line or two on the data sheet that is confusing, etc. you can always try asking here.</p>
<p>Good luck with your PCB and your project as a whole. Please keep us informed of progress.</p>
<p>Best wishes, Dave</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>DaveE</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46735</guid>
                    </item>
				                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46734</link>
                        <pubDate>Sat, 06 Apr 2024 16:33:19 +0000</pubDate>
                        <description><![CDATA[Hi @davee ,
I finally received my components from Aliexpress. The SI2301 mosfet works perfectly. I&#039;m not sure how to interpret the datasheet for them, but they also work to switch the 3.3v ...]]></description>
                        <content:encoded><![CDATA[<p>Hi <a href="https://forum.dronebotworkshop.com/participant/davee/" target="_blank" rel="noopener">@davee</a> <span>,</span></p>
<p>I finally received my components from Aliexpress. The SI2301 mosfet works perfectly. I'm not sure how to interpret the datasheet for them, but they also work to switch the 3.3v power to my touchscreen LCD backlight. My device will be powered 24x7 but the display is only needed a few minutes a day. I was using a PN2907 for that, but now I can change it to a smd.</p>
<p>Thank you again for your circuit example and feedback. I feel ready to start on the PCB design.</p>
<p>Regards,</p>
<p>Bill</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>billo4th</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46734</guid>
                    </item>
				                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46366</link>
                        <pubDate>Sat, 16 Mar 2024 00:22:58 +0000</pubDate>
                        <description><![CDATA[Hi Dave @davee ,
I will most definitely be prototyping the circuit on a breadboard before considering the pcb design. I took your suggestion and switched the .1microF to 1206, and the tanta...]]></description>
                        <content:encoded><![CDATA[<p>Hi Dave <a href="https://forum.dronebotworkshop.com/participant/davee/" target="_blank" rel="noopener">@davee</a> ,</p>
<p>I will most definitely be prototyping the circuit on a breadboard before considering the pcb design. I took your suggestion and switched the .1microF to 1206, and the tantalum to <span>C 16V22UF</span><span>. I also have the R1 resistors in my cart, also 1206's. I just didn't add the link.</span></p>
<p>Thanks again, and I will follow up once I get the parts and test the circuit.</p>
<p> </p>
<p>Bill</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>billo4th</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46366</guid>
                    </item>
				                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46364</link>
                        <pubDate>Fri, 15 Mar 2024 20:34:23 +0000</pubDate>
                        <description><![CDATA[Hi @billo4th,
 I hope it all works!
 As I said, I strongly recommend prototyping the circuit, before ordering PCB design.
In which case, if you don&#039;t already have any, get a few adapters ...]]></description>
                        <content:encoded><![CDATA[<p>Hi @billo4th,</p>
<p> I hope it all works!</p>
<p> As I said, I strongly recommend prototyping the circuit, before ordering PCB design.</p>
<p>In which case, if you don't already have any, get a few adapters for the FETS ..</p>
<p>e.g. https://www.aliexpress.us/item/33016727218.html</p>
<p>I would probably have chosen 1206 size 0.1microF capacitors for my clumsy hands, but 0805 are not too bad.</p>
<p>And also I have corresponding adapters, for prototyping with the capacitors.</p>
<p>Don't forget the 'R1' pull-up resistors.</p>
<p>Good luck, Dave</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>DaveE</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46364</guid>
                    </item>
				                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46361</link>
                        <pubDate>Fri, 15 Mar 2024 19:11:39 +0000</pubDate>
                        <description><![CDATA[Hi Ron @zander,
Thank you for the warning. I&#039;m not concerned about the size of the components. The friend I am working with on this project has experience and the equipment to deal with the...]]></description>
                        <content:encoded><![CDATA[<p>Hi Ron <a href="https://forum.dronebotworkshop.com/participant/zander/" target="_blank" rel="noopener">@zander</a>,</p>
<p>Thank you for the warning. I'm not concerned about the size of the components. The friend I am working with on this project has experience and the equipment to deal with them.</p>
<p>Bill</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>billo4th</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46361</guid>
                    </item>
				                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46360</link>
                        <pubDate>Fri, 15 Mar 2024 18:36:25 +0000</pubDate>
                        <description><![CDATA[@billo4th Do you understand those are extremely tiny surface mount devices? You will most likely need an air gun and solder paste or an oven (could be home made) I didn&#039;t notice a size spec,...]]></description>
                        <content:encoded><![CDATA[@billo4th Do you understand those are extremely tiny surface mount devices? You will most likely need an air gun and solder paste or an oven (could be home made) I didn't notice a size spec, but at least some of them are the smallest (smaller than a grain of rice) so a soldering iron will not work.]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>Ron</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46360</guid>
                    </item>
				                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46359</link>
                        <pubDate>Fri, 15 Mar 2024 17:15:05 +0000</pubDate>
                        <description><![CDATA[Hi Dave @davee,
Thank you for the circuits, they look great. Like you mentioned, I&#039;m trying to do this on the cheap. I would like to build several units when I&#039;m done, so I was looking for ...]]></description>
                        <content:encoded><![CDATA[<p>Hi Dave <a href="https://forum.dronebotworkshop.com/participant/davee/">@davee</a>,</p>
<p>Thank you for the circuits, they look great. Like you mentioned, I'm trying to do this on the cheap. I would like to build several units when I'm done, so I was looking for quantities greater that eight. Just thought I'd run my selections by you before actually purchasing. The cost is not so much if the choices don't work out.</p>
<p><a href="https://www.aliexpress.us/item/3256805941178106.html?spm=a2g0o.cart.0.0.5fcd38daznUdly&amp;mp=1&amp;gatewayAdapt=glo2usa" target="_blank" rel="noopener">aliexpress.us - P-CH Mosfets.</a></p>
<p><a href="https://www.aliexpress.us/item/3256804813792693.html?spm=a2g0o.cart.0.0.15ad38da5036Px&amp;mp=1&amp;gatewayAdapt=glo2usa" target="_blank" rel="noopener">aliexpress.us - 100nf capacitors.</a></p>
<p><a href="https://www.aliexpress.us/item/3256806462382579.html?spm=a2g0o.cart.0.0.15ad38da5036Px&amp;mp=1&amp;gatewayAdapt=glo2usa" target="_blank" rel="noopener">aliexpress.us - Tantalum Capacitor 16V22UF</a></p>
<p> </p>
<p>Thanks,</p>
<p>Bill</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>billo4th</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46359</guid>
                    </item>
				                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46351</link>
                        <pubDate>Fri, 15 Mar 2024 02:27:49 +0000</pubDate>
                        <description><![CDATA[Hi Bill @billo4th,
  Thanks for the sketch ... that helps a lot in clarifying what you are doing.
I am pretty sure I understand your circuit, but just to be safe, I&#039;ll go through it.
----...]]></description>
                        <content:encoded><![CDATA[<p>Hi Bill @billo4th,</p>
<p>  Thanks for the sketch ... that helps a lot in clarifying what you are doing.</p>
<p>I am pretty sure I understand your circuit, but just to be safe, I'll go through it.</p>
<p>---------------</p>
<p>My interpretation of your sketch (please tell me if I have it wrong), is the ESP32 puts out a 4 bit code onto S0..S3, which selects a particular path inside the 4067.</p>
<p>e.g. just considering inside the 4067</p>
<p>with S0 = 0 S1= 1 S2=0 S3=0, then SIG connects C2 with an internal resistance of (say) 100 Ohms</p>
<p>C0, C1, C3,C4... C15 are all 'isolated' from SIG, and (everything else)</p>
<p>Since SIG is connected to 0V/GND, then C2 will have a low resistance path to ground.</p>
<p>I assume each of the relay inputs IN1 to IN8 has a pullup resistor to VCC, of say 10kOhms</p>
<p>So C2 will pull IN2 voltage to near 0V, while the other INs will all be 5V</p>
<p>Pulling IN2 to near 0V, will activate relay 2, and COM2 will connect to NO2, and hence NO2 will supply 5V to power Module 2, and hence to the associated ULN2003 and motor.</p>
<p>-----------------</p>
<p>I think we can replace the relay board with just one resistor and one p-channel MOSFET per relay replacement.</p>
<p>Note p-channel, not n-channel which the device you suggested was.</p>
<p>As a circuit sketch + simulation, I have two pictures to discuss:</p>
<p><strong>Motor Not selected and powered off</strong></p>
8649
<p> </p>
<p><strong>Motor Selected and powered on</strong></p>
8650
<p>The 'circuit' consists of two main components M1 and R1, which are required for each channel.</p>
<p>The other two resistors are simulation only parts to represent the rest of your system, and have names to describe their 'function'.</p>
<p>MuxResistance is the particular path resistance inside the 4067 chip, from the Cx pin to the Sig Pin.</p>
<p>In the 1st picture, it is assumed that the ESP32 had selected one of the other paths, so that resistance of this one was very high ... maybe 1GigaOhm.</p>
<p>In the 2nd picture, it is assumed that the ESP32 had selected this path, so that resistance of this one was low ... maybe 100 Ohm.</p>
<p>R_ULN2003_motor_load is a 25 Ohm resistor, representing a rough guess of the effective resistance through the chip and motor windings when both windings are powered.</p>
<p>I also added a couple of capacitors as a 'reminder' of what you might like to add to the power supply path to each ULN2003, in the hope of reducing the switching noise propagating too far afield. The values are just first guesses - estimating such things is notoriously difficult. If your existing setup works, then I hope the new one will also be fine.</p>
<p>------</p>
<p>Thus, in the 1st picture, R1 is able to pull the voltage on the gate of the MOSFET to almost 5V (with respect to GND/0V), but in the second picture, the gate voltage will be almost zero, because of the 100 Ohm path to GND through the 4067.</p>
<p>These gate voltages will be reflected in the path resistance of the MOSFET, from source to drain: In the first picture it may be more than 1GigaOhm, whilst in the second picture perhaps 0.2 Ohm.</p>
<p>The simulator has superimposed the voltages it calculated for each case.</p>
<p>----------</p>
<p>The MOSFET number was chosen from the list that come with the simulator, but it doesn't mean it is a practical part.</p>
<p>You will probably have discovered, the list of parts to choose from is enormous.</p>
<p>----------------------</p>
<p>Being a skinflint, some time ago, I went to AliExpress and ordered some parts I thought might be useful, principally on the basis of them being available in a substantial quantity for a couple of pounds/US $.</p>
<p>On this basis I have a strip of about 100 devices, which were claimed to be Si2301, probably labelled A1SHB, which I think is roughly similar to the simulated part. A quick check suggested maybe similar parts are available from Amazon UK, albeit at about 3 x the cost, but with quicker delivery.</p>
<p>Obviously, such purchases are something of a gamble, but so far my luck has held. If I was looking for a 'professional' result, then I would look to somewhere like Farnell, but if it is just for my personal amusement, it seems fine.</p>
<p>This data sheet will give you some idea of what they claim to be like.</p>
<p>https://www.vishay.com/docs/72066/si2301bds.pdf</p>
<p>I'll leave you to decide. I am sharing my limited experience, not making a recommendation. All responsibility of outcomes is yours.</p>
<p>-----------------</p>
<p>I would however recommend you prototype the hardware, before committing to a PCB design. Unexpected bugs have a habit of trying to hide.</p>
<p>Hope this helps, and good luck with your project.</p>
<p>Best wishes, Dave</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>DaveE</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46351</guid>
                    </item>
				                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46338</link>
                        <pubDate>Thu, 14 Mar 2024 16:48:16 +0000</pubDate>
                        <description><![CDATA[Hi Dave,
Thanks for the feedback. I&#039;ve included a sketch of the circuit. As I said initially, my goal is to replace the relays with some circuitry. The 5v supply is external to the ESP.

...]]></description>
                        <content:encoded><![CDATA[<p>Hi Dave,</p>
<p>Thanks for the feedback. I've included a sketch of the circuit. As I said initially, my goal is to replace the relays with some circuitry. The 5v supply is external to the ESP.</p>
8648
<p>Thanks,</p>
<p>Bill</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>billo4th</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46338</guid>
                    </item>
				                    <item>
                        <title>RE: Using MOSFET with ESP32 to switch power to 28byj-48 stepper.</title>
                        <link>https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46334</link>
                        <pubDate>Thu, 14 Mar 2024 16:05:42 +0000</pubDate>
                        <description><![CDATA[Hi @billo4th Bill,
You should be able to replace the relays with solid state parts.
You ask about protection, which means analysing the circuit you intend to build. You may not need anythi...]]></description>
                        <content:encoded><![CDATA[<p>Hi @billo4th Bill,</p>
<p>You should be able to replace the relays with solid state parts.</p>
<p>You ask about protection, which means analysing the circuit you intend to build. You may not need anything 'special', as the motors are only low power, but without a circuit diagram it is difficult to even imagine what issues are likely to appear. If you posted a sketch of the circuit, you might get some useful feedback.</p>
<p>I presume you will be making sure the power supply lines have adequate decoupling, and consider the physical paths, trying to make sure the lines carrying motor power are kept away from those associated with microcontroller power and the data lines.</p>
<p>You may note that Bill (@dronebot-workshop) says in the text at</p>
<p>https://dronebotworkshop.com/stepper-motors-with-arduino/</p>
<p>about driving the same stepper motor:</p>
<blockquote>
<p><span style="font-weight: 400;--wp-dark-mode-large-font-size: 19.2px">On the subject of power supplies one very important thing to note is that you should NEVER use the 5-volt power from your Arduino to power this (or any) stepper motor no matter how tempting it is. Even though the 28BYJ-48 doesn’t draw much current it will induce electrical “noise” onto its power supply lines and this could damage your Arduino.  Always use a separate power supply to power your stepper motors!</span></p>
</blockquote>
<p>============</p>
<p>You mentioned a transistor part number, so I looked up the data sheet.</p>
<p>  Looking at the MSS138 MOSFET data sheet: https://docs.rs-online.com/1ff3/0900766b80d22ec5.pdf</p>
8647
<p> (click image to enlarge)</p>
<p>this device is intended for circuits that have  5V to 10V available for driving the gate. </p>
<p>(Do not get confused by the looking at the Vgs(th) value, which is about the "worst case leakage current" when it is being switched off.) </p>
<p>The ESP32 is a 3.3V device, so drive voltages will typically be in the 3V to 3.3V range, which isn't enough to guarantee a low drain-source resistance when it is being driven 'on'.</p>
<p>(I am not saying the device cannot work, because this depends upon the circuit is expecting it to do, but rather this device is designed for a different situation, and not well suited to this one.)</p>
<p>-------</p>
<p>Choose MOSFETs where a low "Rds on" is specified with gate voltages of near 2.5 V, when the gate is being driven by 3.3V logic parts.</p>
<p>The data sheets of such devices sometimes use phrases like "logic gate compatible", which is a useful hint, but don't rely on it or ignore a device which doesn't mention it, check the numbers.</p>
<p>------------------------</p>
<p>You should be able to find some MOSFETs in a similar package, etc. to act as drop-in replacements.</p>
<p>Best wishes with your project, Dave</p>]]></content:encoded>
						                            <category domain="https://forum.dronebotworkshop.com/motors/">Motors &amp; Control</category>                        <dc:creator>DaveE</dc:creator>
                        <guid isPermaLink="true">https://forum.dronebotworkshop.com/motors/using-mosfet-with-esp32-to-switch-power-to-28byj-48-stepper/#post-46334</guid>
                    </item>
							        </channel>
        </rss>
		