Got a Project i'd love help in!

Look, this is a stretch. But I have little to no experience with coding/Arduino/electronics, only the design side. This is my idea/project which I have already started. (It's a Spider-man Wedshooter):

This is the idea:

This is the TinkerCad design I have made so far (it is only half motorized so far as this is the 1st prototype - only the dc motor no servo yet. The original can easily be replaced with a servo instead of a pulley trigger):

I've tried coding the servo and I got it down, but... I used a nano and completely busted it. It couldn't handle the servo and the push button. Idk why.

Anyway here's the code for that and my wiring before the nano went bust:


#include <Servo.h>
const byte ServoPin = 3;
const byte ButtonPin = 4;

Servo servo;

// * When I start the process,
void setup()
{
// the servo starts at 0 degrees
servo.write(25);

servo.attach(ServoPin);
pinMode(ButtonPin, INPUT_PULLUP);
// NOTE: The internal pull-up resistor will keep the
// pin reading HIGH when not connected. The pin
// will read LOW when connected to Ground through
// a closed switch.
}

void loop()
{
// * When I press down the button (hold)
if (digitalRead(ButtonPin) == LOW)
{
// the servo moves from 0 to 180 degrees, not more
servo.write(125);
delay(5);
}
else if (digitalRead(ButtonPin) == HIGH)// * When I let go of the button,
{
// the servo moves from 180 degrees back to 0 degrees
servo.write(25);
delay(5);
}
}

What I need:

Obviously, i would love to make this as small and versatile as possible so:

  • Smallest micro Controller or anything that can control a servo and a motor.
  • How to code/set them up
  • Smallest battery or small power supply (rechargeable if possible) to power it.
  • Any ideas or improvements in my design

THANK YOU SO MUCH!

What are my components:

Servo motor - Tower Pro SG51R
Dc motor - The tiny dc motor inside of the servo motor ^

I have seen the pictures in this post before

Have you got another topic open for the same project ?

it was taken down for some reason with no explanation. Thats why

I think an explanation was given, though:

They did leave your other thread open though: I think I fried my Arduino Nano!
It's still there for you to use...

Good, so you have a few of your design criteria set out already. That means you know where to start: think about system architecture (both hardware & software) and component choice. Assuming your question is not "can you please implement my project for me" (surely it isn't...right?), what is the specific question you want answered?

I'm new to arduino forums and i thought that each seperate question is a new topic. My bad. The questions were, which micro controllers are the smallest and are able to operate a servo and a DC motor. And what are the smallest batteries/power supplies i can use to power the micro controllers. And any ideas that could be used to improve my design.
many thanks.

archie

Ok, that's a good start. As to smallest: realize that today's microcontrollers come in pretty small packages as long as you stick to surface mount technology. Especially BGA versions of popular controllers are tiny, but QFN goes a long way too. If you want a fairly simple/straightforward microcontroller that fits in a small space and that virtually anyone here is familiar with, try something like the Atmega328 in a QFN package.
For the second part of your question: just about any microcontroller made since, let's say, the late 1980s will easily control a servo and motor. It's jut about the very first thing they were used for anyway, and servo/motor control isn't exactly processing-heavy in the majority of cases, and especially in your case.
One thing to be aware of is that I don't think you're ever going to find a microcontroller that will directly drive a servo and/or DC motor. So you will need to include some drive circuitry for those. I'm no expert in that area, but I know that hundreds if not thousands of ready-made modules, IC's etc. are out there for this. You typically work backwards when doing something like this: you first select the servos/motors you need to use (based on physical size, torque, power consumption etc) and then determine which kind of driver you need for it.

This is going to be a balancing act between them being small and them being powerful enough and having enough capacity to last any meaningful amount of time. A button cell is nice and small, but it likely won't work. A 16650 is a popular choice for a rechargeable solution, but likely too big for your taste. So probably it's going to be something in-between. Maybe a little rechargeable LiPo battery pack; there are several available from online stores.
Once you've decided on that, you can think of the charging circuitry and/or mounting box for it. Again, you engineer backwards: choose a component and determine what is necessary in terms of additional parts to make it work.

I totally disagree with that statement! I worked with engineers for 20 years with my assembly company. They all got their project to work first and then began to shrink the physical size while keeping the device working properly. As time and new devices became available, the product size would shrink more in physical size.
Paul

Exactly. So they defined what the project would do if it worked, then identified the critical building blocks that enabled those functions, and finally worked backwards to the auxiliary stuff.
What you say about downsizing is a different matter; of course you first validate a working model before you fit it into its final shape. But even your former colleagues wouldn't have worked on a lab model without being aware of any physical constraints they would face later on and proceed with a conceptual design that could never fit in the allotted space.

No, the engineers are all driven by company marketing and any change to make the product smaller is a plus for them. The physical constraints change over time and competition!
Paul

Yes, if there's one takeaway from about 60 years of research in innovation, it's that it only works if you make something somebody actually wants.

And doesn't count for hobbyists!
Paul

Thank God no, haha!