[SOLVED] FEZ Mini with Existing Car motor


Recevied a few weeks ago the FEZ Mini Robot Kit. Awesome!

Question; I have an existing electric running remote-controlled car.
I have managed to get the servo working on the FEZ mini without any problems.
But, instead of the dc motors in the kit i want to use the motor of the remote-controlled car, cause they are powerfull.
But, they don’t have the correct connectors to connect with the FEZ Mini.

Does anyone have any experience with other motors for the FEZ Mini?

Do I need another component or shield to control the motor?
Forgive me if i am wrong, but i think the motor i’ve got from the existing car is something like this:


and another one like this one:


Second question. I want to add a GPS. I want the car to drive itself :wink: Sound awesome. Want to build an autonomous car.
Which GPS should i use and do i need a shield of some kind of connector for this too?

Can someone help me with this?

Thanks in advance.

Best regards,

So you want to use the RC car and leave the motors in it?

I would think the simpliest approach is replace the receiver with the Fez. A servo shield (or board) should be all you need I would think. Keep your ESC and connect to a servo port on the shield. Then your not changing much and swap back to RC if needed. Other people here should have more to offer. I would get your fez-car running and programming tweaked. Then look to add GPS.

William, thanks for your reply.

That is what i was thinking, i’ve tried connecting ESC to FEZ, but without any succes. Where do i connect ESC on my FEZ to?

On the ESC are several component and connectors, like, Battery pack, on/off switch and cables to connector motor.
Do i still have to connect the battery pack?
And the FST connector, on what port should i connect it on my FEZ?

Anyone any ideas?

Thanks and good evening!

You should look for information on how your rc car operates. They all has a common scheme:

motor → motor controller → receiver

What a motor does I hope You undrstand :smiley:

Motor controller. This part controls how much “energy” goes form a batery to motor. If there is more energy - motor spins faster. So to answer to your questions:
ESC needs to conect to batery (probably with a switch You mentioned), and it must conect to the motor.
The conection left is for conection to receiver.
Since You trying to replace the receiver this must go to Your FEZ.

How to connect:
there is diferent color codes, but all connections use the same scheme - signal, “+”, “-”. You need only signal and “-”. [url]http://fatlion.com/sailplanes/servos.html[/url]
Do not connect “+” anywhere for now. Later it is possible to power FEZ from it, but You need to messure how much V you get from it (it can be 5-6V).
“-” goes to Your FEZ GND pin.
And signal to any digital pin.

Now, to drive your motor You need to generate signal (servo pulse) on pin You puted signal on. There is couple of libraries writen on http://code.tinyclr.com type “servo” in search.

Hope it helps You.

And like William said, first try to run a car, then we will help You with GPS.

@ Rimvis, thanks!

Managed to get the motor running via PWM.Di6 and Digital.Di9.
But, the motor only running forward (e.g. byte 50) but always the same speed, even i change the byte to 1 or 100.
And also when i change the byte to negative, e.g. -1 or -50, the motor will do nothing.

I have connected the ESC component to Motor B on the RBX Controller board beneath the FEZ Mini (i’ve got the FEZ Mini Robot Kit)…

Anyone any ideas?

Ps; At the moment, GPS is step 2, get the car running well is step number 1.

Thanks for replies!

MotorB is highV out to power a motor not electronics. Luckly it is probably only 5Vout or you could have fried your ESC. Much depends on your ESC type (fubata, etc). Here is something that may help.

Pictures and name/model would help.

So i need to connect the ESC to a Servo Port ( number 7 or 8 )?

The ESC is a Hitec SP-560 (see attachment).

You control the esc ~like a servo. From what I read, esc has a center position you need to find and maybe a start marker like low speed for some period. But need to find specific info or use logic probe to know for sure. Others here have more experience in this area that should be able to help more.

Here are some refs I found.


And from our own King Chris. May have to tweak for your specific ESC if it setup different.

Look for information and drivers here related to King Chris’ project “RWAR”.

William, Brett, will look into it. Thanks for oyur help.
Will let you know when i found out more.

To be continued.

FWIW. Here is a bare-bones version that may help you reason about it and get started.


I have used the code you supplied. I have added the class to my project and add the following code in the Main function:

FEZ_Components.SpeedController ESC = new FEZ_Components.SpeedController(PWM.Pin.PWM6);
ESC.Speed = 25;

Didn’t try this code yet, i have a question first.
In this code, and other code snippets i have to select a PWM pin. But how do i know which PWM pin is the connector on the board?

Attached to this post, a picture i just made of the board i’ve got.
Can someone tell me where to connect the ESC controller to?


On top you have 2 3-pin headers, connect the ESC to one of those.

Okay, on a servo port. Checked both, servo ports 7 and 8, without any succes.

I used PWM.Pin.PWM6 to control it.

Motor is connected to ESC, ESC has external power, ESC is connected to Servo Port 7 (or 8).

How do i know which PWM pin i need to call?
I have tried different PWM pins, but sometimes it gives me a Hardware Exception.

The mini has hardware PWM on di3, 5, 6, 9, 10. Servo ports are di7-di8. You have to use software (i.e. OutputCompare or manually) pwm I think. You can use sw pwm, but code will change. If you want to solder, you can solder a header onto mini to get access to di3 pwm pin. You can also pull the mini off the robot board. You then have access to pin on underside. I think at this point, the other stuff is getting in the way. Then use jumper wire to connect servo wire to di3 or di5. Other two servo wires to 5v and gnd.

If want sw pwm, OutputCompare sample usage for sw pwm:

Also, I updated my code a tad, so may want to grab again.

Found out something with OutputCompare;

oc = new OutputCompare((Cpu.Pin)pin, true, 5);

uint forward = 100 * 15;
uint reverse = 100 * 10;

timings[0] = direction;

// 100 * 1000 = Slower speed
//  50 * 1000 = Higher speed

timings[1] = 50 * 1000;
oc.Set(true, timings, 0, 2, true);

Now i need to find what it’s stop signal to stop the motor running.

William thanks!

To be continued.

Yes! Managed to get the code running. I do need some tweaks here and there, but it is running!

See the following blog post for the code.


More testing and tweaking tomorrow.

See yah and thanks for your help guys!

@ William, I have add your blog (i asume it’s yours) to my favorites. http://staceyw1.wordpress.com/

Coolness. Glad it is working!
Could you write up what you discovered on your esc. What was timings to make your esc work (i.e. direction, forward, reverse, stop). A video and code at Code (fezzer) section is good for all. :slight_smile:

BTW - I really like your blog engine. Which is it? What client editor are you using to format code blocks and text? nice.

Hey William, i will look in to the fezzer code thing when i am done programming with the ESC.
I just have to found out the right timings/signal to stop the motor, cause it’s still little buggy :wink:

Will let you know asap.

Blog engine :wink: Just what you said, “Blog Engine.NET” is the engine. You can download (or create by yourself) a lot of Extentions and stuff, Syntax Highlighter is one of it.

Wanted to let you know the basic assambly is done. I have a picture attached.

Now I have to tweak the source code to run the engine. Will do some more tests in the afternoon.