Go Down

Topic: ESP8266 ESP-01 with L293D for wirelessly controlled motorized blinds. (Read 169 times) previous topic - next topic

tomasbird

Hello,

I'd like to create Wi-Fi controlled window blinds using ESP8266 ESP-01 and L293D motor driver. I found few guides online that use similar setup, but usually they use Arduino or ATiny85 to control the driver. However the ESP-01 supposedly has a microcontroller built in (BergMicro 25Q80ASSIG) that you can opt to use and I was wondering if it's possible to use it to control the L293D?

I was playing around in Fritzig and the general breadboard came up like so, but I am unsure how to connect the ESP with the motor driver or if it is possible with this configuration at all...

(Please keep in mind that the last and only time I used breadboard, or came even close to anything related to the electrical engineering domain, was during one optional class few years back at the university. So this entire schema might be all wrong. Any suggestions/hints/etc are greatly appreciated)

the ESP8266 ESP-01 is the following one:


Also I am struggling to find a good option for the power supply. A 9V rechargable batteries are as expensive as the rest of the parts, but I haven't figured out a better solution yet - I am looking for something small and easily rechargable.

groundFungus

#1
Jul 02, 2020, 06:08 pm Last Edit: Jul 02, 2020, 06:10 pm by groundFungus
Your fritzing did not make it. 

This ESP8266 Beginner's guide may be of interest.

The L293 logic supply voltage is 4.5 minimum.  So you will need a 5V supply for it as well as 3.3V for the ESP and level shifters on the ESP inputs.  Also they are ancient and inefficient technology (crap).  Polulu has  a wide range of motor drivers that will work at 3.3V logic levels.
You will save everyone's time if you read and follow the forum guidelines.https://forum.arduino.cc/index.php/topic,148850.0.html

tomasbird

#2
Jul 03, 2020, 02:57 pm Last Edit: Jul 03, 2020, 03:00 pm by tomasbird
Your fritzing did not make it. 

This ESP8266 Beginner's guide may be of interest.

The L293 logic supply voltage is 4.5 minimum.  So you will need a 5V supply for it as well as 3.3V for the ESP and level shifters on the ESP inputs.  Also they are ancient and inefficient technology (crap).  Polulu has  a wide range of motor drivers that will work at 3.3V logic levels.
Thank you for the ESP beginner's guide. I quickly strolled thru it yesterday and it is very informative, exactly what I need. I will read it thoroughly over the weekend and reevaluate my schema.

About the voltage thresholds - I did know that, so I tried to use voltage regulators. 3.3V one for the ESP and 5V for the L293. Since you advise to avoid the L293 I will search for different, more modern driver and then I wouldn't need two regulators but just one.

I kept the full 9V for the stepper motor to get the most out of it. I am afraid that the motor might not be strong enough to pull the blinds weight and I read somewhere increasing voltage might help and the motor should handle it for short period of times despite being 5V - or is this completely wrong assumption?

groundFungus

Sorry, I assumed that you had a DC brushed motor, not a stepper.  Can you post a data sheet for the stepper.  Steppers use completely different driver than DC motors.  With modern stepper motors the voltage is almost irrelevant.  The stepper driver can take higher voltages (36V or more) then they control the current to the motor.  The driver will be set to control the coil current per the motor specification.
You will save everyone's time if you read and follow the forum guidelines.https://forum.arduino.cc/index.php/topic,148850.0.html

tomasbird

For the stepper motor I have two options available. I'm sure I could have more if I searched amazon, but these two are available at the local electronics store.


groundFungus

#5
Jul 03, 2020, 05:31 pm Last Edit: Jul 03, 2020, 05:35 pm by groundFungus
The first thing to consider when choosing a motor is the required torque.  Then how fast does the motor have to turn.  With a stepper, the faster you spin it the less torque it will put out.  So you need to know the torque at the speed that it has to run.

I see that you want to run the project with batteries.  Steppers and batteries do not mix real well because they are not real efficient and, to hold position, they must remain energized.  For blinds, I have seen DC motors with worm drive recommended.  The worm drive resists back driving very well so will hold position without power and worm drives have high gear ratios, meaning a smaller motor can provide lots of torque.

That said, if I had to choose, I would use a Nema17 motor.  I am familiar with those motors, they likely have more torque than the  28byj-48 and drivers for them are cheap and widely available.  Pololu also has stepper drivers.  Choose the motor and then find an appropriate driver.
You will save everyone's time if you read and follow the forum guidelines.https://forum.arduino.cc/index.php/topic,148850.0.html

tomasbird

#6
Jul 03, 2020, 06:25 pm Last Edit: Jul 03, 2020, 06:26 pm by tomasbird
Because I'd love to keep it all completely wireless (otherwise I would need to drag wires to all 3 of my windows...) batteries were the first choice. The idea was to use a rechargeable battery that I could charge via usb-c or microUSB using power bank. I do not know if this is too naive or if there is a better power supply option for the entire thing.

I did not know that stepper motor requires constant power to keep still, so thank you for that. I guess that pretty much removes the stepper motor out of the equation. DC motor with the worm gear does sound appealing, I have found quite a lot of them but only on aliexpress/banggood/similar, for example this one - I was looking at the 6V 40RPM version. These do not require any driver?

groundFungus

Quote
These do not require any driver?
Yes, all motors will need a driver to work with a ESP8266.  The ESP8266 only outputs 10mA (max recommended), far to little to drive a motor.  The link to Pololu DC motor drivers in reply #1 has a selection of drivers.  To choose a driver, you need to know the motor supply voltage and the stall (starting) current.  The stall current should be listed on the motor's data sheet.  If not it can be estimated by measuring the motor coil resistance and dividing the supply voltage by the measured resistance.
You will save everyone's time if you read and follow the forum guidelines.https://forum.arduino.cc/index.php/topic,148850.0.html

tomasbird

Yes, all motors will need a driver to work with a ESP8266.  The ESP8266 only outputs 10mA (max recommended), far to little to drive a motor.  The link to Pololu DC motor drivers in reply #1 has a selection of drivers.  To choose a driver, you need to know the motor supply voltage and the stall (starting) current.  The stall current should be listed on the motor's data sheet.  If not it can be estimated by measuring the motor coil resistance and dividing the supply voltage by the measured resistance.
I see, in the datasheet of the motor I found it requires stall current of 1.8A


So I could chose the the basic DRV8838 that is rated for continuous 1.7A and peak 1.8A?

dave-in-nj

I did not know that stepper motor requires constant power to keep still,
depending on the application. if you use a stepper with a worm gear and the gear train can lock the device in position, you can turn a stepper off.
however, you lose step count so you would need end switches for a blinds application.  it's one of those, you can do it, but we don't recommend it. things.
steppers have a nameplate voltage.  if you use that voltage, you can use simple MOSFETS to drive.
however, to get power and control you would want to use 5x nameplate voltage and a chopper style driver.
the L298 is 'old' but so are most of us.    it is a chopper and has current feedback and limiting, however, the newer drivers are like new cars compared to the 1957 Chevy that is the L298
as a note, the ATMEGA chips were released in 1998, have no low power core, are single core, have not RF or WiFi built in, so are just as ancient as the L298.
however, if you measure a device by if it can get the work done.   it is every bit as capable as the Atmega 328.

groundFungus

The DRV8838 would probably be OK. 
You will save everyone's time if you read and follow the forum guidelines.https://forum.arduino.cc/index.php/topic,148850.0.html

Go Up