Hello Everyone,
This is my first time on the forums, so if you have any tips on ways I could more effectively communicate my issues/questions please let me know! Fair warning: If my descriptions seem vague or unclear it is probably due to the fact that my understanding of those components/functions is also unclear. Hopefully I can stumble my way through this, so here we go..
I wanted to build an automatic food dispenser like the cheap plastic ones you see at Petsmart. My idea was to build a hopper that funnels food into an auger driven by an electric motor. After doing some research, I read that BIPOLAR stepper motors generally provide more torque. So I purchased this motor:
I purchased this motor because I thought its voltage rating would be close enough to the 3.3V port on the UNO R3 to function properly (first rookie mistake). The other components I used in my project were the LCD1602 provided in my starter kit, 3 pushbuttons, an H-Bridge (L293D), and the other supplemental components required to operate the first three devices. I created a schematic using Fritzing and attached a screenshot to this post. This was my first time using Fritzing so I apologize for how disgusting it probably looks to you all. I also attached the code I wrote to control the system. I realized after typing out the ungodly if statements that I should have used switch case, but it works so I am cool with it.
To power the system, I purchased a DC adapter that operates at 9V and 1.0 A. I am powering the L293D logic with the 5V port and also powering the LCD with the same 5V port. I have the 3.3 V output port powering the Motor Voltage Input on the L293D.
So the issue that I am having is with the stepper. The stepper only rotates at set speeds of 80 - 110 rpm. Any lower than 80: It just vibrates. Any higher than 110: It just vibrates. In that range however, it rotates fine SOMETIMES. However, other times it does some odd things:
- If I apply resistance to the rotation, it will REVERSE direction
- Sometimes it gets "stuck"
- After it gets "stuck", the next time it tries to rotate it goes in the REVERSE direction
Now after looking deeper into the hardware, I realized a couple things:
- The L293D "likes" motor input voltages over 4.5V
- The current supplied by the 3.3V output of the arduino is like 50 mA
- I really don't know as much as I thought about electronics...
So what I am thinking is that the H-Bridge is not outputting enough amperage to the bipolar windings. I tried measuring this across the windings, but the measurement was bouncing around. The upper value of the range was only like 1 mA though, so I think this is the problem.
A potential solution I am exploring is to change my Motor Voltage Input from the 3.3V port directly to the DC ADAPTER by connecting to the bottom of the Arduino power input port. This would give my H-Bridge a higher voltage to work with (which is well within its operating range that it likes), and a larger/steadier current supply. Since the motor will only be operating once every 7 hours for less than 5 seconds, I don't think the motor will overheat but once again I am probably making a rookie mistake.
Does anyone have any suggestions? If you would like to see the Fritzing file shoot me a message.
Thank you for your time!!
Toby_Feeder.ino (16.2 KB)