Basic Connection Advice

Hi All.

Here's my first robot, 3d printed myself but have no idea how to connect or program it.

I can build/wire anything, but programming is well outside my pay grade.

I'm trying to do this with my son as he's in the school robotics team, I'd really appreciate some step by step simple advice.

It's actually pretty hard to find any noob language guides on the net.

Basically I've built what is supposed to be a tracked obstacle avoidance robot.

2x SpringRC continuous rotation servos are the motors.

I've powered them via a 3A UBEC, and have connected jumper leads to the signal lines so as to plug them straight into the Arduino UNO.

I've got 2x HC-SR04 sonar sensors slightly angled for left and right sensing, and have spliced power and ground jumper leads into "double adapters" so as to avoid using a breadboard.

Obviously I know where to plug the sensor power and ground leads, but could someone please simply state where I plug in the following:

  1. Left servo signal wire
  2. Right servo signal wire
  3. Left sonar echo wire
  4. Left sonar trigger wire
  5. Right sonar echo wire
  6. Right sonar trigger wire

If someone could literally spell it out for me this first time I'd really appreciate it.

My son seems to have an understanding of code from school (doesn't mean I won't be back later asking for help), but for now I'd just like to plug it all in and let him run with it and see how he goes.

If one of you wouldn't mind, it would be a great help.

Cheers in advance for any assistance.

Avoid using pins zero and one, but other than that, it doesn't really matter where you put them, just make sure you write them down.
I'd avoid the special purpose pins like I2C and SPI in case you want them for something else later.

This is the same project as in your other Thread

...R

Robin2:
This is the same project as in your other Thread

...R

Yes it is, but a different question.

The thing is assembled and powered up now.

I'm really hoping someone would just put a pin number beside the lines I listed this first time, it's not as simple for me as for some here as I've never seen/done any of this before.

I'm not being lazy, this is just new to me.

I did put a lot of work into the cad and printing by the way.

As AWOL mentioned it doesn't matter much which pins you use and they are easily changed.
In the program you tell the Arduino what pin each device is connected to, unlike most other devices that tell you what needs to be connected to each pin.

I'm surprised you can't find any tutorials since almost all are directed at beginners, but here a few you could try:
'duino Robotics
Jeremy Blum's Arduino Tutorials
Tronixstuff Arduino Tutorials

Hutkikz:
As AWOL mentioned it doesn't matter much which pins you use and they are easily changed.
In the program you tell the Arduino what pin each device is connected to, unlike most other devices that tell you what needs to be connected to each pin.

I'm surprised you can't find any tutorials since almost all are directed at beginners, but here a few you could try:
'duino Robotics
Jeremy Blum's Arduino Tutorials
Tronixstuff Arduino Tutorials

Thanks very much.

I am looking at tutorials right now, but to be honest they are very confusing.

As you'll see from the pics I've used 2 sonar sensors rather than one rotating on a servo, and most of the tutorials only show one.

I was under the impression that some of the pins were strictly for inputs and some for outputs, and that I'd have to use either digital or analog depending upon the type of device connected.

So if I went with:

  1. Left servo signal wire -2
  2. Right servo signal wire -4
  3. Left sonar echo wire -A1
  4. Left sonar trigger wire -A2
  5. Right sonar echo wire -A3
  6. Right sonar trigger wire -A4

That would be all good?

All pins(even the analog ones) can be used as digital input or output.

Some pins also have special functions such as Analog input, PWM output etc.

So yeah it's all good as long as you don't need the special function of a particular pin and even then it's just a matter of moving the wire to another pin

I would set up like:

  1. Left servo signal wire pin 4
  2. Right servo signal wire pin 5
  3. Left sonar echo wire pin 6
  4. Left sonar trigger wire pin 7
  5. Right sonar echo wire pin 8
  6. Right sonar trigger wire pin 9

Those pin assignments save the analog input pins, the I2C and SPI pins, 3 PWM pins and the external interrupts for future use. The rangefinders do not require analog pins.

groundfungus:
I would set up like:

  1. Left servo signal wire pin 4
  2. Right servo signal wire pin 5
  3. Left sonar echo wire pin 6
  4. Left sonar trigger wire pin 7
  5. Right sonar echo wire pin 8
  6. Right sonar trigger wire pin 9

Those pin assignments save the analog input pins, the I2C and SPI pins, 3 PWM pins and the external interrupts for future use. The rangefinders do not require analog pins.

Thank you so very much for your clear, straight answer.

Very much appreciated, I'll go that way.