# Need help: Circuit containing a capacitor

Discussion in 'General Electronics Chat' started by JamesP, Feb 18, 2015.

1. ### JamesP Thread Starter New Member

Feb 18, 2015
15
0
Basically I need to make a vehicle move a set distance touch a wall and reverse the same distance and stop all on its own. Im looking to have a motor powering the front wheels and a motor powering the rear wheels. So I am thinking, a battery to power the motor to move forwards and as it is doing so it charges a capacitor, the capacitor will then power the rear motor to make it reverse. When it touches a wall I was thinking of having a switch which cuts the signal from the battery to the front motor and thus sending the charge in the capacitor to the motor to make it reverse. Can I make this work and if so how exactly??

2. ### #12 Expert

Nov 30, 2010
16,679
7,321
You already figured out the reversing switch, but losses in power transfer will cost you in accuracy. Like, theoretical, it's all the same. Reality intrudes.

3. ### wayneh Expert

Sep 9, 2010
12,379
3,236
Short answer, no. You won't capture more than a small fraction of what you need for the reverse trip, and it all comes out of the battery anyway. Why not just reverse the motor?

#12 likes this.
4. ### #12 Expert

Nov 30, 2010
16,679
7,321
This isn't dead simple. You can't store the used up power in a capacitor and re-use it to run backwards. You have to use a current mirror to store some new energy (from the battery) in the accumulating capacitor and use that to go backwards or use that to control an amplifier that controls the amount of new energy that goes to the reverse motor. Or you can do it by measuring time, or distance...each method getting more complicated and more accurate.

5. ### JamesP Thread Starter New Member

Feb 18, 2015
15
0
Thanks for the responses. How do I go about reversing the motor?? This is my first time doing something like this

6. ### #12 Expert

Nov 30, 2010
16,679
7,321
You can use the microswitch on the front bumper to activate a latching relay which reverses the power from the battery, but how you gonna know when to stop?

7. ### JamesP Thread Starter New Member

Feb 18, 2015
15
0
Yeah that is the problem, having it stop at the correct time. That was why I was wondering if it would have been possible to do it with a capacitor

8. ### wayneh Expert

Sep 9, 2010
12,379
3,236
Ah, I totally missed the bit about returning to the same spot. Are you looking for accuracy in this? I was just picturing a toy that reverses with no concern for precise return.
I'm thinking stepper motor.

9. ### JamesP Thread Starter New Member

Feb 18, 2015
15
0
Yeah it has to be fairly accurate. It must come back the same distance and stop as close as possible to where it started

10. ### #12 Expert

Nov 30, 2010
16,679
7,321
That will work if the tires don't slip. Count the steps to get to the reversing switch, reverse and do that many steps backwards. Sounds like a job for a microprocessor.

Way less parts and way more accurate than an analog approach.

11. ### JamesP Thread Starter New Member

Feb 18, 2015
15
0
I do not think I would know where to begin with a microprocessor. Do you mean a stepper motor would work if the tyres don't slip? Would it vaguely know what distance to reverse and stop?

12. ### #12 Expert

Nov 30, 2010
16,679
7,321
A stepper motor knows exactly how many steps it took.

13. ### JamesP Thread Starter New Member

Feb 18, 2015
15
0
So I could do battery>stepper motor>switch to activate a latching relay and just use the one motor?

14. ### wayneh Expert

Sep 9, 2010
12,379
3,236
Yes, but you'll need a way to count steps and then use that for the return trip.

15. ### #12 Expert

Nov 30, 2010
16,679
7,321
You have to use circuits to make the pulses that drive the stepper motor and count the steps. When the reversing switch actuates, the counter runs backwards while telling the pulser to send pulses to the stepper motor. When the counter gets to zero, it stops. But, yes, you can use only one motor. Steppers run backwards just fine.

16. ### JamesP Thread Starter New Member

Feb 18, 2015
15
0
'You have to use circuits to make the pulses that drive the stepper motor and count the steps'

Hmm im not sure I know what you mean or what extra I would need

17. ### #12 Expert

Nov 30, 2010
16,679
7,321
A microprocessor and an H-bridge.

This is not, "first project" quality. It will take you days just to learn how to program a microprocessor.

18. ### JamesP Thread Starter New Member

Feb 18, 2015
15
0
Okay, thanks very much for all your help! I will do a bit more research into using these parts

19. ### crutschow Expert

Mar 14, 2008
13,488
3,372
You could conceivably do it with an up-down counter such as a CD4029, CD4192, CD4516, or CD4520, and some logic.
The counter would count up the motor steps until it reverses.
The with the motor reversed, the counter is set to count back down until it reaches zero.
That should get you back fairly close to where you started.

20. ### #12 Expert

Nov 30, 2010
16,679
7,321
Ah...good. A fresh perspective with a lot of experience.
Still not a first project recommendation, but only half the work of learning a microprocessor language AND how to design with IC's.