# URGENT - Uni Projct - Autonomous model car - CIRCUIT

Status
Not open for further replies.

##### New Member
Any help is greatly appreciated.

Basically i need to make a autonomous model car to hit a wall at an unknown distance and return to its original position.

My idea was to potentially have a capacitor charge and discharge 2 different motors, with a DPDT switch to reverse the polarity of the 2nd motor so that it reverses.

A circuit diagram would be incredibly helpful.

#### alec_t

##### Well-Known Member
This presumably is a school/college assignment?
have a capacitor charge and discharge 2 different motors
I have no idea what you mean. You can't 'charge' a motor.
Why do you need two motors?
What will the first motor do when the second one is reversed?

##### New Member
Because it has to hit a wall at unknown distance i thought a capacitor could charge on the way there. Then when it hits the wall it starts to discharge in reverse so it goes back to original position.

i have attached what i kind of had in mind.

#### Attachments

• 101.9 KB Views: 82

#### audioguru

##### Well-Known Member
I think you will have one motor to drive the car forwards and reverse. Then the second motor is a generator that measures the distance by charging a capacitor while the car drives forwards then the capacitor discharges while the car drives in reverse and causes the car to stop when it is completely discharged. Then you need an electronic circuit to measure the capacitor voltage as it discharges and to stop the car when it detects a full discharge.

The battery must power the driving motor in reverse because even a huge capacitor cannot produce enough power to drive the car.

##### New Member
What would the circuit look like and how exactly would i measure the voltage for when the capacitor discharges? What type of capacitor would i need?

Also would a DPDT switch need to be put into the circuit to reverse the car when it hits the wall?

The motor i am going to use is a "Single Output Shaft Inline Motor and Gearbox 1:200" that has power of 3-12V DC.

Last edited:

#### audioguru

##### Well-Known Member
A simple circuit can use a comparator IC to measure the discharging capacitor voltage.
Use any capacitor that is charged by another motor used as a generator on one of the wheels.
The DPDT switch can reverse the motor and activate the comparator circuit.

##### New Member
Excuse my knowledge, quality of image and representation of the components but is this something it would look like?

#### Attachments

• 142.8 KB Views: 72

#### cowboybob

##### Well-Known Member

Have you built the car yet?

If not, I'd suggest (for simplicity) that you start with a car that has only one motor, with the idea that you'll simply reverse the voltage for the return trip. With a 1:200 gear ratio, the second motor, unless powered, will introduce far to much resistance to movement to make the car practical.

Then test it to get an idea of how well it works (speed, power, etc.). Then we can work on the circuit needed to do the task as you have described it. And I might add that controlling the return trip to stop at the starting point is doable, of course, but might it surprise you as to what is likely to be needed.

If you've already built the car, please share with us how you built it and in what configuration. Photos would be helpful.

Also, do you have any test equipment, for instance, a Volt/ammeter?

#### audioguru

##### Well-Known Member
You show the drive motor powered only for a fraction of a second while the capacitor charges then the drive motor stops. Also, you show a single pole switch (SPDT) that completely disconnects the drive motor when it is switched to the comparator. But your comparator circuit looks like a simple resistor that will do nothing.
Why try to do an electrical/electronic project when you know nothing about them?

#### JimB

##### Super Moderator
A few questions for clarification...

The title of the thread says "Uni Projct", can you tell us what you are studying at university?
How long is the course and at what stage are you in the course?
What are you trying to demonstrate with this project?
You say that this is "URGENT", when is it due to be submitted?

Answers to these questions may help to shape the replies here in the forum.

JimB

##### New Member
I am a first year Mech. Eng. student.
We are not trying to demonstrate anything, it's just a project.
It is to be submitted tomorrow.

#### Les Jones

##### Well-Known Member
I think the idea of measuring the distance an storing the information aa a charge on a capacitor is a non starter. I would suggest putting a sensor on the motor to count revolutions. Use the pulses to increment a counter when the car is moving forward and decrement them when it is reversing. When the counter reaches it's starting value (Which could be chosen to be zero.) the motor is stopped. Using a microcontroller would be the simplest way to implement this.

Les.

##### New Member
Thanks for that, seems much simpler than the capacitor design
Are there motors that already have these sensors on or if not how would I attach it to the motor?
And how would I reverse the motor and have the pulses decrement when the model vehicle is in contact with the wall?

#### alec_t

##### Well-Known Member
Google should find you motors with sensors ('shaft encoders'). An H-bridge of transistors can be used to reverse a motor. Incrementing/decrementing a count is a standard software procedure.

##### New Member
Would I still need a DPDT switch then?
And do you recommend a certain programme?
Thanks

#### Les Jones

##### Well-Known Member
You wil not need the DPDT switch as the reversing of the motor can be done using a H-bridge as alec_t suggested. You will need some form of switch or sensor to detect when it reaches the wall. You can get motors with quadrature encoders which give direction information as well as the number of positiones moved. You may get away with just simple sensor that gives one (Or more.) pulses per revolution. You would then use the direction informaton to decide if a pulse increments od decrements the counter. I have used this system to control a roller blind. It had to initially be tought the count coresponding to the up and down positions. It has worked perfectly for several years.
You will have to write your own software for the microcontroller. I would suggest one of the PIC16F series or Atmel ATtiny series of microcontrollers. You could do this without a microcontroller but it would take quite a number of ICs.

Les.

#### alec_t

##### Well-Known Member
If this project is due to be submitted tomorrow I assume it's an 'on paper only' one?

##### New Member
yeah pretty much, just come up with the design of the vehicle, circuit diagrams and parts list.

It would be much appreciated if you could assist me on designing the circuit for this

Last edited:

#### audioguru

##### Well-Known Member
If the car has at least one wheel that is not driven by the motor then a simple revolution counter can be made on it. Then the main driven wheels can slip or "burn rubber" and the distance measured by this revolution counter will be accurate.
I was thinking that you were going to let the car slam into the wall at the end which changes the position of the DPDT switch to change the motor direction.