Hello, I made an app to control a servomotor by bluetooth using arduino, the app works, but when pressing the button to move the servo, it sends the command many times and turns off the bluetooth module or it also turns off when starting the servo. I tried it with leds and it does not turn off, it is only when I use a servo motor, could someone help me? It is a project that I have, Thank you
Sounds like a power issue to me. How are you powering it all?
Hello nacraft 71
Make/Model/Specification of the Servo?
I suspect that Joel's suspicions about the power supply are in the right ball park. Also ensure that the board is adequately cooled.
at first I did it with the pc cable, with which I load the data and then with a 9v battery. I could have damaged something when using the pc cable that gives me less voltage ?.
this is the servo
Probably not damaged. Amps are as important as volts which is why I asked you for the specification (or a link).
https://datasheetspdf.com/pdf/791970/TowerPro/SG90/1
Is this, if I don't know what harm could it be? now I'm using it with a 9v battery but it's still the same.
How have you connected the servo the arduino? Are you connecting the 9v battery the arduino then the arduino pins to power the servo? Like ChrisWard said its not so much voltage as it is current. Arduino only gives something like 0.25A max current from its pins.
When using servos it much better practice to use an external/separate power to the arduino power.
You could test if this is the problem in 2 ways. By powering the arduino through the pc cable and the battery to a breadboard 5v power board then connect the servo power to that boards output. If you don't have one of those you can create a simple voltage divider circuit using resistors to get it the battery voltage down to 5v.
Test 2: you can follow an arduino tutorial for using a servo with a potentiometer and see if when you run that in your current setup that it runs without power loss. If that runs fine but the potentiometer code into your code and see if with everything you want still happening that the potentiometer still moves the servo.
Yeah so you can't draw much current the the way it's connected. Try powering the servo serperatly as mentioned in my previous comment.
Also it's a 5v servo. Why have you connected it to the 3v pin? That could also be the issue.
I took that image quickly from the internet, if actually I have it connected to 5v from the Arduino.
You say that I deprive it by connecting the 9v battery directly to the servo?
No don't connect the 9v directly to the servo. You need to create something called a voltage divider using resistors. Or use a 5v breadboard power unit like this:
Also just checking, have you moved over the header pin on the arduino from the usb power to the power jack power?
Actually, a lot depends on the purpose of your project too. If the Uno and the servo are together in a stationary platform, e.g. a box that does not move as apposed to a robot that goes everywhere, then the best power source would be a mains adaptor. (AC to DC, like a phone charger), because your Servo needs power the UNO can't deliver with a battery. Note also that the Servo should be connected to the PWM pin (Pulse Width Modulation).
See my website here:
https://www.professorcad.co.uk/appinventortips#TipsArduino
See this Forum Topic, which uses a similar servo (you will need to read the latter part of the Topic about power).
Yes my suggestion is meant more for a test to diagnose the problem. Not as a final solution.
Also @ChrisWard the diagram he showed does already have the servo connected to the PWM pin.
Hi Joel
I didn't trust the diagram because:
Ahh yes, forgot about that bit
A post was split to a new topic: I made an app its working but the Bluetooth module (HC-05) is disconnecting while I sliding the slider to control the servo motor