Congratulations Rich, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Parallax Hb 250 Motor Controller And Ez-b V4 Microcontroller

Assistance Requested

Help Ellis with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

Ellis claims to have checked these sources:

I am trying to run two Parallax HB 25 motor controllers and Parallax Motor Mount and Wheel Kit 28962 with an EZ-B v4 micro-controller. The HB 25 data sheet says that the motor controller needs a standard pwm servo signal to operate. I am using a regulated 7.2 vdc for EZ-B and 12 vdc for motors. When I hook it up to a Standard Servo it works and when I hook it up to the motor controllers it doesn't. I have tried everything I can think of to get it EZ-Bo work to no avail. Help

Also the Motor Mount and Wheel Kit comes with a encoder to establish position. Can the EZ-B use this information. If yes what do I need to do.

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.

Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


Have a read of this topic.

Use the Modified Servo control and it should work once you set up the required "positions" in the config, there may be some trial and error in setting up the correct values but it shouldn't take long to work it out.


I am using the Modified Servo control and have played with the values which have not made it work. I wonder is the timing is the problem with the pulse. Their data says to set it at 1000, 1500 and 2000 in timing and I see no way to increase ez-b values more than 180 and 1. Am I missing something. There data sheet also says to bring the signal down low to start. I am assuming that means voltage or in their case 1500. Thanks for trying to help. Can you think of anything else.


Attached you will find the data sheet for the Parallax Motor Controller. I think the problem I am having has something to do with being brought low (whatever that means) and delay timing. I hope this helps. I have tried all the things I think would help to no avail. I am not a programmer yet but realize I may have to get back into it to make this system work. ThanksHB-25-Motor-Controller-Guide-v1.3.pdf
PDF Web Link


There are a fair few topics for the HB-25 in the forum so far, from what I have read in those topics the method in the first topic I linked to has worked i.e. the HB-25 works like a Modified Servo.

Use the forum search for more topics covering this. Also check you have it wired correctly, batteries charged etc. etc.


I have read all the post I can find and these do not answer my questions. I need to know how to change the pulse distances apart at startup.


The control for Modified Servo does this for you. The values entered are essentially PWM values, i.e. the pulse width.

Servos expect to see a pulse every 20ms. The length of the pulse determines the servo position, or in the case of a Modified Servo, the speed and direction at which it's moving.

The pulse distances are the pulse width, which are the values in the config for the Modified Servo control or the PWM control.

The userguide for the controller confirms that servo PWMs are accepted.


Mode 1 Communication
In this mode, a single pulse value sent to the HB-25 can control the HB-25; no “refreshing” is necessary, as is the case with a servo. For compatibility however, you may send the HB-25 pulses every 20 ms just like a servo and it will function the same.

If no values are working then you need to check your wiring, batteries etc.


I have done some more research. I talked to Parallax Robotics concerning the HB-25. The problem I seem to be having is initiation of the Parallax controller. The controller requires the microprocessor to check the signal pin for condition of Hi or Low condition. The condition will be high initially on the motor controller signal pin. If the microprocessor finds that it is high it must turn it to low then on the next pulse turn it back to high. What code and where do I need to write it to get it to do this.

This is their initiation code:

' -----[ Initialization ]--------------------------------------------------
IF HB25 = 0 THEN Startup ' Wait For HB-25 Power Up
LET DIRS = %00000001 ' Set PIN0 To Output
PAUSE 5 ' Wait For HB-25 To Initialize
PULSOUT HB25, 150 ' Stop Motor
PAUSE 20 ' Wait 20 mS

They told me to attach a servo to the microprocessor and turn the servo on then unplug it from the servo and plug it into the motor controller and then turn the motor controller on the wheels will start up. They did, so it seems like I need to write an initiation code for the EZ-B v4 microprocessor.

If I use the modified control panel and push forward both wheels go forward. If I push left left motor will stop and right motor will run forward. Right works the same only reverse wheels. If I push stop nothing happens the selected motors continue to run. if I push reverse the both motors stop. They will start again if I push forward, right or left. Neither motor will run in reverse. I am happy to see the motors finally running but want them to run without plugging a Modified Servo in each time and I want them to run in reverse. I do not know why this is happening but it must be a communications problem between the microprocessor and the parallax motor controller. Most likely it will require some code modification.


Hi @Ellis,

It seems like you'll have to adjust the servo values in the Modified Servo panel please see this thread for some details on how to adjust those values.

For the initialization code I can try and give you an untested sample. Here's an ez-script equivalent:


$x = getDigital(D0)
if ($x = 0)
sleep(5) # wait for 5mS for HB25 to initialize
servo(d0, 90) # HB25 connected to D0 set for stop value
sleep(20) # wait for 20mS

This example will do a single sample on D0 to see if it is low, then if it is it will proceed to send a servo stop value to D0. In the case of the HB25 it seems like the stop value might be lower, maybe in the value of 50 or lower range.


Darn it @Jeremie beat me to it while I was driving to work!..

However, I'd like to know how many motor controllers you are using and how they have been wired up. Can you post a photo or a quick schematic?