I recently decided start working with the Photon and IoT in general and came across this Instructable cat feeder project. I went ahead and bought the Maker Kit to get acquainted with Particle and various hardware components.
I was successful at the “Gong” example in driving a servo. However, the kit’s servo, is not up to the task of driving a cat feeder and decided to get the servo the Instructable recommended, an LS-8101F. Here is the spec sheet. When I got it, I hooked it up based on the Instructable. I utilized the following code, similar to the “Gong”, to drive the servo:
Servo myservo;
int servoPin = A5; // variable to store servo pin
void setup()
{
myservo.attach(servoPin); // attach servo pin
Particle.function("feed",triggerFeed); // declare feed function
}
// feed function
// since feed can be invoked by 3 different methods (button, voice, schedule)
// we need to account for 3 different commands
int triggerFeed(String command)
{
myservo.write(0); //start turning the servo
delay(330); //how long the turn turns in ms (may need some adjusting)
myservo.write(92); //stop turning servo
}
So + was connected to VIN, - to ground, and control to A5. The Photon was powered by USB, connected to my 2012 MacBook. I was holding the servo in my hand and it did have a load.
Everything seemed to be in order, so I invoked the feed function and the servo started moving, quickly, but almost immediately the sound changed from sound sounding like it had a purpose, e.g., turning, only to sound like a voltage drop or the servo hit its hard stop, but the control line was still active. I then noticed that the Photon’s status light had gone dark and shortly after that, the Particle console told me that the service call had failed. The servo at this point was still active. I didn’t look close enough to see whether the servo was still turning or just making noise. I then removed the USB power and then plugged it back in, but now the Photon did not light nor did the servo react.
Afterward, I was able to test the VIN and 3V3 pins and found that the VIN still seemed to be fine, but the 3V3 pin was now dead. I submitted a ticket with Particle and they confirmed it was toast.
I did read in the comments for the Instructable that it sounds like someone else had a similar problem. Per my ticket with Particle, without a load, the Photon shouldn’t have had a problem driving this servo, though the spec sheet says it could draw up to 2.7 amps, well over what the particle can handle.
To avoid a repeat, I have purchased a 5V AC adapter that can provide 5 amps. If I use this and power both the Photon via VIN/GND and the servo in parallel, will I be OK to use this servo without future harm? Or do I need some electronics that will isolate the Photon from the servo.