Making an Arduino car using a Mega

Hi there,

I have just signed up to seek help and advice about my project I have been planning for a while now. I am a beginner when it comes to electronics but I like to challenge myself (sometimes to much) and My project is no exception. I am week in areas such as the power supply, programming, and working out things like diodes and resisters so if anyone could please help me, that would be great.

I am from Australia so all of the Arduinos, sensors and Modules would be from Duinotech

About my Project

My project is (to put it basically) a remote control car.
(it can do a lot of things but essentially is is an Arduino car/robot)

**I have 3 Questions I'd like to ask **
The robot/car will be using a Mega 2560 r3 and I'd like to know the following when it comes to wiring it...

  1. Attaching Motors
    It can't be a car without motors to drive the wheels so I have 4 DC Motors and a "Servo and Motor Controller Module"

My Question is...

  • How do I connect the "Servo and Motor Controller Module" to my Mega when it was designed to go directly on top of an Uno?
  1. Making use of most of the pins
    When I was looking for references to help with placements of wires and connections, all the projects didn't use all of the Arduino pins (Uno or Mega) when I am thinking of using most if not all of the pins.

My Questions for this are...

  • Would there be any setbacks in using most or all of the pins (I don't know how many pins I am using but it is more than what the Uno gives)?

  • What is the use of the multiple 'GND' and Power pins ('5V')? Do I need to connect them all together like a breadboard?

  • If I use so many pins, How much power would it need? (I do only want to have 1 battery source. i.e. power from this battery/battery pack) What battery would it need as I'd like it to have a rechargeable feature?

  1. LED's
    Once I work out how many 'left over' pins I have left to play with I want to add decorations to my car in the form of LED's to make it look more like a car.

My Question is...

  • How do I set up everything for it to have lights? (from layout to connecting to programming)

I want to put an unknown number of LED's per Pin and have it set so when the mega tells the Pin to have the LED's on (no matter the brightness), they all at the same brightness.

their will be about 9 'groups' with a few of them that will change their brightness levels (off/low/high) like beam lights on cars. (high beam/low beam)

Please let me know if their are other considerations I need to take into account when using this amount (plus more that I haven't talked about her. I.e. Sensors and unknown feature parts)

Sorry It is a big entry. I have more questions where that came from but, this is ok for now and I'll post more questions if I've either haven't solved questions I haven't asked yet or have new ones that I cant find answers to.

Thanks in Advance,

Being in Australia I would not restrict your self to Duinotech as there are many more options available in Australia, also quick delivery from elsewhere (Australia and other), generally cheaper and somethime better specs.

This is a big project you are planning I suggest you do prototype each of your needs as a separate task and join up the work bits later. You'll find each of the subset activities will generally have examples in Arduino IDE and you'll learn as you go. Start simple.

Hi @dacho,
Thanks for your response.

Although I do want to find the best value for things, I actually don't like online shopping and ordering so I try to avoid it as much as possible. I have split it into mini projects that I will test one at a time when it is up to wiring, programming and testing. I am asking these in preparation of combining all of them to reach my end goal. Hence why I posted those questions

It would be a lot easier to answer 1 if you provided a link to the specific "Servo and Motor Controller Module" that you are using. There are loads of them all different but many shields made for Unos will also simply plug in and work on a Mega. Then again some won't.

There is no problem using all the pins. The amount of power you need depends on what is connected to the pins and how much power that requires. But digital pins can only directly supply limited current. Motors and other high power components need to be powered separately.

E.g. 1 or 2 LEDs can be connected directly to a digital pin via a resistor. More than 2 per pin needs additional components. Details will depend on how many "unknown" turns out to mean.

You can't really do design using just generalities. Without knowing any details of your motors or any other components you will have it's impossible to know what battery you might need.


Hi Steve,
Thanks for your response.

Here is the module I was talking about...

Here is what I have planned so far...

I have currently got...

  • An Arduino Mega 2560 r3 (from Duinotech) as it's main board

  • 4x DC Geared Motors
    - Motor Nominal Voltage: 10V
    - Max. efficiency current: 70mA
    - Full load current: 250mA

  • 2x Servo motors (with more possibly to come)
    - 500 degrees/second at 6V
    - at 4.8V
    they are the Arduino compatible 9G Micro Servos
    (They will be used mainly to hold/move either an Ultrasonic sensor module or a line tracer sensor module each)

  • As mentioned before, I will also be using 2 Dual Ultrasonic Sensor modules, 5 single Line trace Sensor Modules and 1 Triple reflectance sensor module.

I'm also going to add...

  • 2 Colour Sensor modules

  • Lights as decorations

I am still working on part that will...

  • Part's I might have forgotten after completing this.

  • Make it be like a walkie talkie/remote control spy robot where you can here through the remote what the robot is hearing and as well as being able to talk through the remote and the robot.

  • A way that the robot can follow the remote even if the signal is blocked without using a device, data or the internet (as I will mostly play with it where there is no signal i.e. in the bush or a secluded place)

  • Keeping in mind with the 1st 2 points in this section, how will the remote and Robot communicate

  • Parts of the remote like mentioned before as well as which Arduino to use as the remote.

As for a bit of fun, I was also wanting to add a laser Diode module so users can have fun with pets (i.e. cats).

Fingers crossed I can do it all successfully without the need for multiple Arduinos and as cost effective as possible.

That's certainly more interesting but you don't seem to have anything that will allow any remote controlling. You will need to work out your requirements for that particularly the range you need. Are you planning to build the transmitter and receiver yourself or use standard RC components? Either way, transmitting audio back from the car to the transmitter is probably not going to be possible.

That motor shield looks like it should be compatible with the Mega. It uses the old and not very efficient L293D ICs for motor control and if you have 10V motors then you'll probably want a 3S 11.1V Lipo to drive the motors coupled with a 5V DC-DC converter to power all the 5V components including the Arduino.

I have no idea what you mean by "A way that the robot can follow the remote even if the signal is blocked without using a device, data or the internet".

It's a complex project and you will have to break it up into smaller parts and test the individual parts. Trying to do a project that complex in one go almost never works. E.g. perhaps start by getting just the motor shield and motors working with a basic test program or perhaps just test all those sensors to check you can get sensible data from them.


Hi Steve,

yes I will be making the remote control as well.

when I was talking about the follow feature, I basically want it to have a "follow" mode where it can...

Plan A: follow the signals that come from the remote and try and follow/ get to the remote.

Plan B: follow a specific shape like a pet or a shadow (without using and Raspberry Pi).

taking into account that the signal can be hidden (like behind a person or in a bag) as well as using it without using a device (phone, tablet, computer, etc.), data or the internet.

that is the plan. What do you mean by "a 3S 11.1V Lipo to drive the motors coupled with a 5V DC-DC converter to power all the 5V components including the Arduino." (connecting wise)?

The motor shield has external power input. The main battery connects to that and also to the input of a 5V converter which produces a 5V output for the other components. Or if you don't know what a lipo battery or a DC-DC converter is then Google will help.


How does that work? (I'm a visual person)

I suggest a Google of "Arduino Car". There's quite a lot out there.

That's a shame because I'm not. Good luck anyway.


Bringing the PMs back into the thread…

“ It’s quite a sophisticated project for a beginner,”, but definitely doable.

But not from America! Totally absurd shipping costs.

Why a Mega 2560? And do you definitely not intend to use WiFi?

That is how my brain works. Thanks for letting me know that it is doable.

I am a leader in Scouts so my end goal (not only the fun of making it and playing it) is that I can get the kids to play with it. whether it is at the hall or at a campsite (hence Why I want it to not be connected to anything but itself and not being able to obstruct it's environment).

What do you mean by "PM's"?

I agree with the issue with America.

I got the Mega 2560 as it was the biggest that the store had as I knew that the project would need a lot of parts to be put together.

Yes definitely no Wifi (I also don't want to create subscriptions that I need to pay for). See my latest reply from @lastchanename for why.

PMs are ‘Personal Messages (direct to each other) not shown in the thread… like our earlier discussion.

Wifi or other comms are almost the last thing you need to think about in detail at the moment, but you have added a possible factor for consideration…. outdoor / camp operation..?

The will require larger diameter tyres, and either geared down, or larger motors to traverse the irregular terrain of sticks, leaves and pebbles.

No idea what that has to do with WiFI. :face_with_raised_eyebrow:

Nor any notion of why it has anything to do with camping. :worried:

What I mean is that I don't want to pay for data.
When it comes to the camping side, I would be camping at places where their is little to no signal and no internet access.

Hi Cassowary and welcome to the forum. I'm also a beginner and what has helped me a lot is to find tutorials on YouTube. I guess you will not find all your answers in a single video but there are many good channels. Personally I like the channels of DroneBot Workshop for absolute beginners and Andreas Spiess when you are up and going but there are many more... Good luck!

And I am pointing out that you are terribly confused if you imagine that "WiFi" means Internet access. :worried:

WiFi - like Bluetooth, LoRa and Zigbee - is a means of wirelessly connecting two or more devices but implements the highest data rate of the group.

You refer to "a remote control car". This implies you intend two separate "things" connected by wireless; your car and a remote controller. While there are various approaches to doing this, many or most of such current applications use some version of WiFi, and the ESP8266 is an extremely low-cost and extremely practical approach to implementing WiFi.

Now the ESP8266 is substantially more capable in computing power - speed, program memory and RAM - than a Mega 2560, so if you are likely to use WiFi in your application, it makes sense rather than inventing a protocol for communication between an ESP8266 and an Arduino, to start instead with the more powerful processor which integrates the WiFi. :sunglasses: