Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

8051 microcontroller to control servo: any ideas?

Status
Not open for further replies.

ZX3ST

New Member
Hey everyone. I ran a search but came up with nothing, so maybe you can help.

I'm using an 8051 microcontroller to control the movement of a Radio Controlled Toy Car. Basically, I want to be able to program the movement and let it run its course.

I'm removing the RF control portion of the car. The controllers for the steering servo and the rear wheel will stay in place and both use PWM. So basically, the microcontroller will have to reproduce the PWM waveforms to the servo controllers.

The voltages are at 5V, so there's no voltage amplification/reduction needed from the microcontroller. I guess there just needs to be a drive circuit between the two so that I don't burn up the controller.

Any ideas? Thanks in advance!

-Mike
 
YOu are on the right track. If it is a remote control car, the motor drive rshould also respond in the same way to the radio receiver's signals which can also be reproduced by the 8051.

What kind of toy car is it? Like a REAL radio control car? Or a toy radio control car made for 5-year olds?
 
It's a "real RC car". Although it's not an overly expensive one.

I guess the main question I'm asking is what the heck am I gonna have to build between the microcontroller's output and the input to the motor/servo controllers? To make things clear: I am NOT driving the servo or the rear wheel directly. There are small control modules that are already in place.

If you guys need more information, just say the words. I'm trying to stay to the point and to avoid complicating my post with information that just isn't needed.
 
Last edited:
Well by definition an RC servo has the power electronics built into it already since the radio receiver obviously can't drive the DC motor inside the servo directly.

So by this (dare I say infallible?) logic, there must be a motor controller that responds to the same type of signals the servos do from the same radio receiver, otherwise how would everything work?

So, if this is the case, and it is a real RC car (with "real" swappable parts), then the radio receiver outputs PWM signals and the servo reads them and interprets them as a position and it's power electronics inside the box do the rest of the job to actually drive the motor. It is the same for the motor driver, except that it interprets the signal as a speed.

So the answer to your question is most likely NOTHING since you make it sound like the car came with servos, motors, motor drivers (ie. the modules) and was all ready to run. Just run a PWM line to each servo and motor driver (and provude them power from their non-logic power source of course). If it was not all ready to run though, you might need to get another one of the "modules", be it a servo or motor driver. You don't have to build it unless you want to control it in some other way (like if you didn't want the 8051 to simulate the signals of a radio receiver). But otherwise, just buy one- much cheaper and faster and easier.

Easy as apple pie.

EDIT: By real RC car vs toy RC car, I am asking if it is hobby grade or not.
 
Last edited:
It's a hobby grade car, although an entry level one. The kit with starter battery was like 150.

I took some measurements today, and found exactly what you said, dknguyen. Thanks!

To give a little more detail, here's what I found:
There are 3 wires running from the AM radio receiver to the steering servo controller, and also to the speed controller. One wire supplies a constant +5V and another Ground. The third is the control signal.

This control signal provides a roughly 4.7V square wave at 66.67Hz. (Plus some noise due to the radio receiver being AM. The servo (and speed control) modules respond by changing the duty cycle of the signal, but nothing else.

In my haste, I didn't grab the input impedance to each of the modules. What kind of output impedance does an 8051 have on its pins, and what kind of current can it supply?

Lastly, what's an easy way to program the controller to modify the duty cycle as such? Any ideas?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top