Can an ItsyBitsy drive a servo? If not, what should I use in

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
RogerInHawaii
 
Posts: 65
Joined: Wed Oct 22, 2014 1:27 am

Can an ItsyBitsy drive a servo? If not, what should I use in

Post by RogerInHawaii »

I'm using an Adafruit ItsyBitsy 32u4 - 5V 16MHz PRODUCT ID: 3677 and trying to use it to drive a Micro servo PRODUCT ID: 169.

And, man, am I having problems.

I'm just using the sample program, SWEEP, found at https://www.arduino.cc/en/Tutorial/Libr ... ples/Sweep.

The program compiles OK in the Arduino IDE and I can upload it to the ItsyBitsy, via the appropriate COM Port, and have it start running, which causes the servo to "sweep" from 0 degrees to 180 degrees and then back to 0 degrees, and it keeps doing that, over and over again. But after a few "sweeps" I can hear my Windows computer make its "device has disconnected" sound followed by its "new device has been connected" sound, and a little dialog pops up indicating that an UNIDENTIFIED DEVICE was connected.
Malfunction.png
Malfunction.png (40.28 KiB) Viewed 157 times
And then my program on the ItsyBitsy STOPS RUNNING !!.

I can start it running again by hitting the Reset button on the ItsyBitsy but, again, after running for a short while it stops again, again with that warning message from Windows.

This disconnect/re-connect of the ItsyBitsy from the COM Port seems really weird. The SWEEP sketch is not attempting to do anything explicitly with the COM Port. It is ONLY driving the servo.

I came across some information about how the ItsyBitsy does NOT have actual USB hardware but rather handles it only in software. So I'm wondering if there's some weird interaction between the library code that's driving the servo and the USB library code that handles the COM Port, EVEN THOUGH nothing explicitly should be happening in regards to the COM Port connection. One reason that I suspect that it's the USB library code (simulating USB hardware) is that I can very successfully run this SWEEP sketch on an Arduino Mega (which DOES have USB hardware), but not on my Adafruit ItsyBitsy (which does NOT have USB hardware and handles it in software).

It appears to me that I actually CANNOT use the ItsyBitsy to reliably drive the servo. But I really do need a very tiny microrpocessor to handle it. It all has to fit inside a model rocket body tube.

I'd appreciate some suggestions as to which Adafruit product would be best for my application, which HAS the USB hardware so it will avoid the problems I've encountered with the ItsyBitsy, but will still be a really tiny board. Oh, and I'm also connecting the MPU6050 6-DoF Accelerometer and Gyro device to it so whatever CPU board I use it needs to also have the SCL and SDA pins.

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: Can an ItsyBitsy drive a servo? If not, what should I us

Post by Franklin97355 »

If I remember correctly the 32u4 uses software uSB connection and you may be taxing it using the servo too much. Try putting delays in your code to allow the IB to rest and recover. See if that improves the resetting.

User avatar
RogerInHawaii
 
Posts: 65
Joined: Wed Oct 22, 2014 1:27 am

Re: Can an ItsyBitsy drive a servo? If not, what should I us

Post by RogerInHawaii »

Thank you for replying. I did try exactly that. The basic SWEEP program waits 15 milliseconds between servo movement instructions. I increased that all the way up to 5 seconds and it still had the same bad symptoms of somehow disconnecting and re-connecting the COM part and terminating the sketch.

I agree that there seems to be some interference between the control of the servo and whatever USB code is running but it doesn't seem to be resolvable and just seems to be way too sensitive. Multiple runs of the sketch produce random results. I sure don't want to be controlling my model rocket with such inconsistent behaviors.

I really do think I need a CPU board that has actual USB hardware. I just need some advice as to WHICH board to use, given the need for it to be really small, control the servo consistently, AND connect to the GYRO board as well.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Can an ItsyBitsy drive a servo? If not, what should I us

Post by adafruit_support_bill »

If you disconnect the servo and run the program, do you still see the problem? If not, it is not a software problem.

Another common issue with servos (and other motors) is electrical interference that can cause the processor to reset. This is especially common when supplying power to the servo directly from the processor.

User avatar
RogerInHawaii
 
Posts: 65
Joined: Wed Oct 22, 2014 1:27 am

Re: Can an ItsyBitsy drive a servo? If not, what should I us

Post by RogerInHawaii »

Thank you, one and all, for taking the time to offer suggestions.

I'm still trying a lot of different approaches with is ItsyBitsy.

HOWEVER, I would still appreciate RECOMMENDATIONS for an alternative to the ItsyBitsy that has actual USB hardware, given the need for it to be really small, control the servo consistently, AND connect to the MPU6050 6-DoF Accelerometer and Gyro device as well.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Can an ItsyBitsy drive a servo? If not, what should I us

Post by adafruit_support_bill »

The 32U4 does have native USB in hardware and is more than capable of running a servo and an IMU at the same time. What you need is a proper diagnosis of the problem you are seeing.

Have you tried running your program with the servo disconnected as suggested above? It is a very simple test that will very likely show that it is not a problem with the processor at all.

User avatar
sj_remington
 
Posts: 998
Joined: Mon Jul 27, 2020 4:51 pm

Re: Can an ItsyBitsy drive a servo? If not, what should I us

Post by sj_remington »

If you are trying to power the servo from the USB port or the Arduino 5V output, that can be a serious problem, as servos inject voltage spikes into the power supply. The Itsy Bitsy (#3677) on board voltage regulator is inadequate and is not specified to supply the starting current required by any servo. Even the tiny SG92R has a start/stall current of 650 mA.

The servo should be powered separately (4xAA pack works well). Don't forget to connect all the grounds.

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”