A little help with my LF robot

Ok, so this is my first project both with electronics and arduino. I'm working at a line follower robot. I use 5 IR sensors (phototransistor + led), 2 motors (differential drive), and 1 motor driver. It also needs to avoid obstacles, so I put a 4-pin proximity sensor, like |100x50. For power supply, I think I'll use one 9V battery to power the Arduino (Uno), and a 4-pack of 1.5V (=6V) batteries to power the motors and the distance sensor. This is my schematic:

Uploaded with ImageShack.us

What do you suggest:

  1. What voltages do sonars like that usually work? Is it okay if I give it 6V, or do I need to add a 5V voltage regulator for it? Could you help me powering all the components? I don't really know how much current can the arduino give :-?

  2. Should I use the L293D integrated motor driver or use the H bridge from the right? (I just have no idea what transistors to buy for it..)

  3. Someone told me that I should use Eagle instead of Fritzing - for PCB layout.. does it worth the switch..?

ANY SUGGESTION IS WELCOME :)

Hi,

cyb3rman: 1. What voltages do sonars like that usually work? Is it okay if I give it 6V, or do I need to add a 5V voltage regulator for it? Could you help me powering all the components? I don't really know how much current can the arduino give :-?

Presuming the ultrasonic sensor is the HC-SR04, the datasheet says it uses 15mA at 5V. Since the Arduino is able to power 20mA per pin, and that has a regulated 5V supply so that sensor will be able to be powered and run directly from the Arduino.

cyb3rman: 2. Should I use the L293D integrated motor driver or use the H bridge from the right? (I just have no idea what transistors to buy for it..)

That's entirely your call, but if you can stretch the budget to something prebuilt that will remove one potential set of headaches from your future. Once again you'll need to consult the datasheet for the L293D to ensure that it has the capability to supply enough power to control the motors you're using. There are beefier alternatives out there if not.

cyb3rman: 3. Someone told me that I should use Eagle instead of Fritzing - for PCB layout.. does it worth the switch..?

That depends... Fritzing is easy to use, and has a PCB manufacturing service at the end of the process and if you're looking to produce quick images of a breadboard with your circuit laid out on it, you get that too. Eagle makes great looking schematics, has loads of parts available in libraries available from a bunch of sources online, and can create the gerber files for sending to a wide range of PCB fabricators. It does have a steeper learning curve, but it's a far more capable design product. It has a huge ecosystem of plug-ins to expand its capabilities too. Depends if you need to add another big learning curve to the one you're already due to face with this project in my view. If you're wanting to use a PCB fabricator other than the Fritzing guys, I am not certain their software can do that... At the end of the day there's nothing to stop you using both - the price is right after all :)

Hope that helps, Geoff

Hei! Thanks a lot for your answer. I still have a few questions, though.

  1. What does this mean, in the datasheet of the sonar?

" The module is not suggested to connect directly to electric, if connected electric, the GND terminal should be connected the module first, otherwise, it will affect the normal work of the module. "

  1. I only know the voltage rating of the motors (6V - they are from a cassette player). Is there a way I can measure the current they draw? If I measure their resistance with a multimeter, I=U/R will give me the drawn current?

  2. When I connect the sonar directly to arduino, should I still use the capacitor in parallel with it? And are the other capacitors placed correctly?

Thanks!

cyb3rman:

  1. What does this mean, in the datasheet of the sonar?

" The module is not suggested to connect directly to electric, if connected
electric, the GND terminal should be connected the module first, otherwise,
it will affect the normal work of the module. "

That is an outstanding example of datasheet chinglish isn’t it :slight_smile: My presumption is it means it shouldn’t be connected directly to your power source. Hopefully someone more knowledgeable than I will be able to explain what this warning means. I’ve never seen it before, so just went and checked the most recent project I have here that used an ultrasonic, and sure enough I’ve got it powered by the +5V rail on the Arduino. Perhaps the warning is as simple as it needs a smooth regulated supply. Certainly the Arduino will provide you with that.

cyb3rman:
2. I only know the voltage rating of the motors (6V - they are from a cassette player). Is there a way I can measure the current they draw? If I measure their resistance with a multimeter, I=U/R will give me the drawn current?

Do you have a multimeter that can measure current? If so, hook the motor up to a sturdy 6V source and put the multimeter in series with the motor. That would be the way I’d do it to be certain as I’m rusty on the theory but expect a motor being a capacitive load might not directly conform to the maths you’re expecting.

cyb3rman:
3. When I connect the sonar directly to arduino, should I still use the capacitor in parallel with it? And are the other capacitors placed correctly?

I’m sure the decoupling capacitor wouldn’t hurt, but I always use a ceramic for that (not the polarised capacitor you have in your schematic). In addition to the capacitor on your motor you’ll also probably want to include a flyback diode to protect your other components.

Cheers ! Geoff

Thx, again!

So I wanted to fix the wheels directly to the motor axis.. but I realised that they would turn too fast and not have enough torque. I know that the voltage gives the speed of the motor, and the current passing throught it, the torque.

Is there a way to increase current, but, at the same time to decrease the voltage? Or do I have to use a gearing system (which I don't know to build and would increase the costs significantly)

Another cheap method to reduce RPM and increase torque: Mount the motor so that it shaft is parallel to the wheel's axle and the motor's shaft contact the outer edge of the wheel. The reduction ratio is the wheel's diameter divider by the motor's shaft diameter. The torque is increase by the inverse of the speed reduction ratio minus some frictional looses. The trickiest part is adjusting the motor shaft pressure on the wheel. Too little and the shaft slips, too much and the motor won't turn.

Best was that the cost was very low.

Here is an examples of the motor shaft to wheel I described above and is shown in the picture: