I just wanted some thoughts from some more seasoned Arduino and micro electronics DIY'ers. A few years back i made an automated cat feeder that utilized servos and some rudimentary time keeping techniques. I did it for the sake of getting my sleep back from my cats waking me up when they were hungry. That being said i didn't put as much thought into the design and to meet my power needs i just utilized a 500w ATX spare power supply i had laying around just to get the project done( just a little overkill... ).
All that being said i am looking to re-vamp and redo my project with a few enhancements. One of my biggest issues is the original design just counted processing cycles to keep time and just worked on a 12 hr countdown timer to feed my pets every 12 hrs. It wasn't the most accurate way of keeping time and any power surges or blips would cause the timer to reset completely which depending when the timer reset could cause my pets to not be fed for 23.
So far i have been unsuccessful in my attempts to google something to meet my power needs for my new project. What i need is something more substantial than what a wall wart can provide but not as overkill as an ATX computer power supply. Additionally i was hoping to have a back up battery supply if possible but not a must have. My component list includes:
-Arduino Uno
-esp8266
-SainSmart LCD2004 with i2c chip
-L298N motor driver
-NEMA 17 17hs4401-s stepper motor (1.7 A max)
-misc passive components
I need DC supply voltages of 3.3V, 5V, and 12V. I know i can easily get 3.3 V source with use of a voltage regulator from a 5V source, but finding something that can provide both 12v and 5V seems to be hard to come by. Most rechargeable circuits/shields i have found are for Lithium ions of 3.7 V or 5V but doesn't really help for the 12 V source. I really don't want to get into having to create my own charging circuit for a 12V battery pack ( i don't trust myself enough for that). Ideally id just like the battery to be able to temporarily handle the constant load of the arduino and lcd which would just be displaying and keeping the time and possibly be able to run the stepper motor 1 time for a few seconds to feed. This would be under the assumption my power went out for 12 hrs or less ( i live in the city and am off the same circuit as medical facilities so my power rarely goes out at all and has never been off more than 6 hrs).
Even without the battery pack, does anyone have a suggestion for a power supply that can provide both a 5v and 12v Source that could handle a momentary load of 20 watts and a steady state load of 5 watts (these are rough estimates)?
TL;DR: I need recommendations for a power supply for my project that can provide both 5V and 12V supplies with a continuous load of about 5 watts and a peak load of 20 watts. Thanks!
A 17hs4401-s stepper and an L298 on a 12volt supply is an impossible combination.
That stepper has 1.5ohm coils, meaning it's going to draw 12/1.5= 8Amp per phase.
The L298 is a brushed DC motor driver, not a stepper driver.
Can't you use a servo, and run everything from 5volt.
Why two micros, while one can do the job.
An ESP8266 based board could get exact time of the internet, and drive the servo and I2C display.
Leo..
12V at a good solid 1.0A will drive the whole thing adequately. Maybe 1.5A or 2.0A if you want to be sure there is a big margin. It should be possible to find wall-warts with this power.
Proper stepper drivers like the A4988 will act like a switchmode supply so the output current is higher than the input.
Then a good 12V to 5V switchmode converter will power the LCD and the Arduino's 5V input.
The ESP8266 is the only component I'm not sure about. I know it takes significant current at 3.3V when transmitting WiFi.
Get a RTC module with a coin cell battery. That will keep time if the power ever goes out.
Wawa:
A 17hs4401-s stepper and an L298 on a 12volt supply is an impossible combination.
That stepper has 1.5ohm coils, meaning it's going to draw 12/1.5= 8Amp per phase.
The L298 is a brushed DC motor driver, not a stepper driver.
Can't you use a servo, and run everything from 5volt.
Why two micros, while one can do the job.
An ESP8266 based board could get exact time of the internet, and drive the servo and I2C display.
Leo..
Thank you for the response. But now i am confused, the L298N is very specifically sold as a h-bridge bi-polar stepper motor driver. Are we talking about the same thing? All the research i have done and tutorials i have viewed show this module being wired to and driving a bipolar stepper motor with an Arduino. The module says it has a max supply of 2 amps and the stepper motor specs says it has a max draw of 1.7 amps. Am i missing something?
I would like to stay away from a servo this time because i want something that can rotate a full 360 degrees to drive the feeder mechanism. Last time i used a servo i ended up having food that would get stuck in the mechanism and never dispensed and would stay in there indefinitely. I would like to avoid that this time.
The ESP8266 does not meet my I/O needs alone. I have a dozen of the esp8266-01 modules to play with and a spare Arduino anyway. I can split the processing load between the two and pass data via I2C. Thanks again for your feedback.
The LM298 is only suitable for steppers with high resistance. BYJ48, for example. Even then, it is not ideal.
Pretty much anything with a NEMA designation is going to be low resistance. You will see odd voltage ratings like 3.2V. Note that the NEMA number is only a specific size of the motor mounting screws so this is not an ironclad rule.
Wawa:
A 17hs4401-s stepper and an L298 on a 12volt supply is an impossible combination.
That stepper has 1.5ohm coils, meaning it's going to draw 12/1.5= 8Amp per phase.
The L298 is a brushed DC motor driver, not a stepper driver.
regardless of the supply voltage, even running at 24V, if the current sense resistors to allow the chip to chop the current, were properly set, then the driver would not deliver more than it's rated current.
the L298 is an old design, and does not have the extra features of the newer driver chips, but that is similar to the ATmega 328 is old and obsolete compared to the ESP8266 with WiFi built in or ESP32 with both blueTooth and WiFi...
the A4988 uses the exact same dual H-Bridge layout (but FET's instead of transistors)
granted it requires 4 pins on the stepper controller
and it has a 2 amp package limit per coil (depending on model)
and it does not do microstepping...
but the ATmega does not do bluetooth, or WiFi.....
so, if you do not need micro-stepping, and you do not need to use 2 pins...
also, the more favored A4988 also requires and external sense resistor....
as for microstepping, you do not gain positional accuracy, only decreased vibration on ramping up to speed.
as with everything, application drives design.
as for using a stepper for the project... I do not see the requirement for a stepper and think using a stepper is a poor choice in this application.
FunnyAmericanVT:
Thank you for the response. But now i am confused, the L298N is very specifically sold as a h-bridge bi-polar stepper motor driver. Are we talking about the same thing? All the research i have done and tutorials i have viewed show this module being wired to and driving a bipolar stepper motor with an Arduino. The module says it has a max supply of 2 amps and the stepper motor specs says it has a max draw of 1.7 amps. Am i missing something?
yes and no.
any higher power will generate heat and the more current stepper drivers use FET with significantly lower resistance than the transistor based L298.
they all use the same dual H-bridge design.
they all use the same sense resistor / chopper circuits
so the L298 will get hotter for the same load.
also, the more favored stepper driver chips use only 2 pins, step and direction so they take less of the controller resources.
needing only one pin for stepping, means only one pulse output, again less resources in the controller.
the L298 does not do microstepping. microstepping is used to get a motor up to speed and at higher speeds is not needed, potential in the way of a higher RPM. I have not seen the use of the extra pins to alter the microstepping down to half steps, but then that would consume more pins and more resources.
it all boils down to applications. if FET's were just better, they would have replaced transistors long ago. but then application creeps in.
the more common stepper drivers used with Arduino's are for the toy projects, robot cars and non-contact CNC machines.
but, then people use really poor choices for stepper motors with really high nameplate voltages some as high as 5 volts or more ! just silly !
once you get into the high power CNC machines on metal cutting lathes and milling machines, you just into the 60 to 130 volt DC realm and heavy stepper motors.
Stepper motors is almost a complete field of study in itself.
as a note, the RATIO of nameplate voltage too power supply should be as high as possible for more performance.
the curve starts falling off when you are over 30:1.
a 5V motor with a 5V supply might as well use relays, as there is no benefit to use a driver circuit.
charging a coil is the goal, and if you can charge that coil 4 times faster because you have a chopper and a power supply 4 times over nameplate, then you get more performance.
if you drive it at nameplate voltage you get no gain in performance.
10 times over voltage and your motor will snap and pop and drive your machines with authority !
but, for a pet feeder, I would use a simple geared motor and a cam with micro-switch and save all the headache.
much simpler power supply , much simple driver, much less cost..... much easier to make. Pet Feeder
Yes the datasheet for the L298 does show two suggested circuits for a current-controlled stepper driver. It suggests the L297 or L6506. I've never seen an Arduino module with either of those chips. Without further detail from the OP, it is 99% likely that they have the plain L298 module which is unsuitable for steppers.
Conversely, an A4988 module could not function without the sense resistors so it is always going to control the stepper current.
I disagree with the statement about microstepping but that is not relvant to the power supply question that was asked.
I think the OP has already given sufficient explanations for why they want a stepper. Let's get back to finding a power supply that will work for that.
I really appreciate all of the good feedback! I must apologize, i thought i had done my research it has become obvious i was a little hasty in my selections and assumptions. Mainly my issue with the stepper was i was using a commercial cereal style food dispenser to dispense the food and to achieve this in m previous project i used a servo. Like many of you have indicated, servos are very simple to connect to and control and also provide high levels of torque. I shy'd away from motors last time because as i am finding, are much more complex and can be pricey, especially when trying to achieve higher levels of torque. also i found that the servo, being limited to 180 degrees would actually have a section in between the fins of the dispenser that would hold food indefinitely. This concerned me not just from a quality standpoint but also a sanitary standpoint.
All that being said i believe i hastily settled on a stepper motor as they seemed to provide decent levels of torque and were readily available given their popularity in the 3d printing community. There seemed to be a lot of good tutorials and examples online. I will happily take a suggestion for a driver and an alternate motor to use for this project. Admittedly i chose a .46 NM stepper motor because it wasn't that much larger or expensive than something of a lower value but it is probably a bit overkill. i could probably settle for something half that in torque. If there are any suggestions on a driver and motor choice, that could greatly simplify my power supply needs without having to have a 12 V source. I really appreciate all the good feedback, you probably just saved me from hours of head scratching or lighting my project on fire!
FunnyAmericanVT:
The ESP8266 does not meet my I/O needs alone. I have a dozen of the esp8266-01 modules to play with and a spare Arduino anyway. I can split the processing load between the two and pass data via I2C.
I was talking about a complete 8266 board, like the $5 WeMos D1 mini or NodeMCU.
Internet time, I2C display, and a servo shouldn't be too much of a challenge.
Powered by a powerbank with a cellphone charger is another option.
Shouldn't draw more than 0.5watt, and could run for >24hours through a powercut.
I think we should see some pictures of your current feeder/servo setup.
Leo..
If there are any suggestions on a driver and motor choice, that could greatly simplify my power supply needs without having to have a 12 V source
A small DC motor with a gearbox could probably work well on 5V. It could have a very high gear ratio because you don't need much more than 1RPM. That means low power required.
Use a sensor such as a QRE1113 and a dot of white paint on the rotor to tell you when to stop the motor.
Even an ESP-01 may be able to run this on its own: it has four pins broken out. Two pins for I2C; two for the stepper (one for direction, one for the steps - should be enough). A NodeMCU or WeMOS would be easier.
For the power supply: you can go from 12V to 5V or 3.3V easily through a buck converter (very efficient, little power loss).
You can normally power an ESP-01 from an Arduino's 3.3V output. It takes about 200 mA when transmitting, but that are bursts only. More like 15 mA or so continuous. You do have to make sure the Arduino's TX pin has a voltage divider added to step down the 5V signal.
Indeed it'd be easier if you can find a stepper or servo that takes 5V, and then use that to power a NodeMCU or WeMOS board as well, using the on-board regulator. Then all you need to power the project is 5V power supply and those are easy to find in just about any current rating.
After reading the above posts i have some questions.
Are you currently using this setup?
How long has it been running?
Have you noticed problems with the system not related to the power failures?
If the power stays on does the existing timer setup work?
If the answers are! "Yes, Quite a while, No, Yes", then lets leave the existing system alone for now and consentrait on the power supply issue as asked by the poster for now.
Later they can look at possable faults in the working system.
(Improvements are a never-ending cycle)
I would look into a 12v battery (Sealed Lead Acid is old tech but still readily available and easy to work with)
An off the shelf trickle charger for the SLA and a buck converter to drop from 12 to 5v. They are stable and very cheap on ebay i have ones that will supply 2A no problem.
A 12v 4ah with a trickle charger sounds like it would do the job and will probably run for a day with no charge. Then when the power is back on the charger recharges the battery.
If its not going to be enough, then go to a 6ah battery. I can not see your system designed to operate maximum load once every 12 hours needing more than that.
The SLA will go from 10.5 v (at dead flat) up to 14.4v at maximum on a normal charger (while reaching peak charge).
Note that trickle chargers should stay around 13.5v all the time.
FunnyAmericanVT:
All that being said i believe i hastily settled on a stepper motor as they seemed to provide decent levels of torque and were readily available given their popularity in the 3d printing community.
stepper motors are PIGS for power. they use more power sitting still than moving !
since you want to take was essentially an X/Y PROBLEM, of the parts you chose and now want to put the application as the goal, that will make your final project easier.
Now, you need to post links and photos and sketches.
What is the drive train ?
What is the feed mechanism ?
There are lots of low voltage, low power geared DC motors available. Since one of the main goals for the application of battery power is to only use power when you need it, and then, only as much power as needed to attain the results. We would need some mechanical values on which to cogitate.
eg: two PVC pipes. the larger one would have a hole in it that is almost as large at the smaller one's ID.
The hole goes all the way through
The two should have a very close fit.
The smaller one would have one hole and be capped on the ends.
Rotate so the hole is up, the food spills into the smaller pipe
Rotate it so the hole lines up with the lower hole, the food falls our.
Neither you or your pets would care if that took 3 seconds or 30.
#2) A Fish feeder has a large disk with divisions like slices of pizza.
You fill it on Sunday and it will move, one slice at a time. lining the open bottom over the hole.
again, no one cares if it take a few minutes.
Pairing a simple mechanical movement with a drive that uses minimal power is a design goal.
Did you know that the original panama canal gates are over 600 tons and can be driven by one 25 hp motor. your car has a motor that is probably over 50hp. you get the idea.
So i had avoided putting too much detail in my original post as to not make it too lengthy but as i suspected it only left more questions. So my original design is kind of irrelevant in this case because i want to change pretty much everything but the application. The original design used a simple library that used a countdown timer that kept time by calculating process cycles based on the cpu clock frequency. It tended to drift quite a bit as you can imagine and i would have to restart it every few weeks depending how bad the drift was. It worked well enough that it would feed my cats if i was not going to be home but sometimes they would still wake me up depending how bad the drift was.
Additionally i used a servo but due to portioning control i ended up only turning the servo 60 degrees one direction for one feeding then back 60 degrees the other direction the next time. I was not tracking this with any sensors or a variable that would survive a power blip or outage (sometimes lightning storms would mess it up as well) so depending what position it was in and when it got reset the cats would get fed double. Also as previously mentioned since it only turned 60 degrees there was a section of fins that would never dispense food, this will make more sense by seeing the picture of the dispenser design.
Original design (which is very rough i know, it was supposed to only be temporarily on a breadboard and cardboard shoot until i had time to finish it. It has been temporary for 5 yrs... i also used to have a second cat hence the second feeder tube but he died suddenly a few months ago):
I haven't had time to put much down electronically or on paper yet, i have just been formulating ideas in my head and doing some research. The idea is to either use the existing shaft or create my own d shaft that drives the rubber valve with modification to allow it to be belt driven or directly coupled to a motor shaft. An important detail i left out which has been pointed out, in the old design and new design, i do not need a constant holding torque on the motor. In the old design i would attach the servos long enough to move it from its current position to its destination then de-attach them. Similarly with the new design my intent was to merely apply a control signal to the motor to move it 60 degrees 2-3 times a day (only takes a few seconds of loading), otherwise the motor would remain de-energized. This should minimize the loading to the power supply and only require a peak current a few times a day. I don't know what the actual torque will require so i was just leaning on the side of having way more than necessary so i would have flexibility in food types and weights.
I also intend to add a push button or two and a rotary encoder to allow options for # of times a day to be fed as well as specific times of feeding through use of menus to allow variables to be stored to EEPROM(in case of power loss). I intend to use the ESP8266 to periodically go out and get the time from the NTP servers and set a system clock to keep time. Additionally i intend to a have a menu to allow for manually inputting wifi SSID and Password that would also be saved to EEPROM. If i cannot get a battery system to work i intend to possibly save a few binary variables to the EEPROM 2-3 times a day that way in case power is lost. i would then have some code to determine the last time food was dispensed and have it immediately dispense food if it missed a feeding time. (i know the EEPROM has a limited life span but even if i wrote to it 3 times a day everyday that should still give me ~10 yrs of life out of it).
I know that there may be some better ways to do some of this but i'm doing some of this because i like learning new things. I don't merely want to remake my original design with some improvements I want to improve my design and learn in the process. Part of the intent of this design is to make it such that i could make one of these for a friend and they wouldn't have to mess with code to input feeding times or WIFI login data. I want to make it completely usable from the LCD, rotary knob, and push buttons. I hope this helps answer some of the questions. Thanks again for all the responses!
Wawa:
I was talking about this complete 8266 board, like the $5 WeMos D1 mini or NodeMCU.
Internet time, I2C display, and a servo shouldn't be too much of a challenge.
Powered by a powerbank with a cellphone charger is another option.
Shouldn't draw more than 0.5watt, and could run for >24hours through a powercut.
I think we should see some pictures of your current feeder/servo setup.
Leo..
If you really want to put a cherry on top, connect it to solar and make it independent! We actually have a single solar cell on our balcony that plugs into a normal outlet.
But the whole setup looks very impressive to me. I could've used this when I went on vacation earlier this month Had to ask my parents to look after our cats.