# Picar-X motors run in opposite directions when using EzBlock

**URL:** <https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688>\
**Category:** Robotic kit for Raspberry Pi\
**Created:** [December 10, 2023, 4:17pm UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688 "2023-12-10T16:17:20Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![schuemie](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@schuemie](https://forum.sunfounder.com/u/schuemie)\
**Post date:** [December 10, 2023, 4:17pm UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/1 "2023-12-10T16:17:20Z")

</div>

I followed the [instructions](https://docs.sunfounder.com/projects/ezblock3/en/latest/quick_guide_3.2/install_ezblock_os.html#install-ezblock-os-latest) using the custom image for EzBlock, and can connect to the Picar-X just fine using EzBlock Studio. in EzBlock Studio I can calibrate the camera tilt and pan, and the steering servo. However, when I try to move the car forward with any of the example scripts, the right motor is spinning the wrong way.

I’m running EzBlock Studio v3.2.145. The Picar-X says it is running 1.2.4.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [December 11, 2023, 9:50am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/2 "2023-12-11T09:50:56Z")

</div>

We recommend that you prepare a new SD card, install the Raspberry Pi system, and install our Python code base on the Raspberry Pi system terminal:  
[https://docs.sunfounder.com/projects/picar-x/en/latest/python/python\_start/install\_all\_modules.html](https://docs.sunfounder.com/projects/picar-x/en/latest/python/python_start/install_all_modules.html)  
Then go ahead and execute the calibration.py code to calibrate the direction of the motor:  
[https://docs.sunfounder.com/projects/picar-x/en/latest/python/python\_calibrate.html](https://docs.sunfounder.com/projects/picar-x/en/latest/python/python_calibrate.html)  
See if that solves the problem. If there is something you don’t understand, please describe it in detail, and provide us a video of the problem if you can, so that we can easily analyze and solve the problem.

---

<div class="post-metadata">

**Author:** ![schuemie](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@schuemie](https://forum.sunfounder.com/u/schuemie)\
**Post date:** [December 11, 2023, 11:28am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/3 "2023-12-11T11:28:59Z")

</div>

Thanks for the quick response!

I actually already did that (I started with Python, but then discovered EzBlock Studio doesn’t work on the image used to play with Python, so I switched to the EzBlock OS image).

When using Python, I was able to calibrate the direction of the motor, and all was well. However, I then switched to the EzBlock OS image, and it had forgotten the calibration. There is no option to calibrate the motor direction in the EzBlock Studio app, and I really want to use that app to play with the robot with my daughter.

Could you help me understand how the motor direction calibration can be ported from the Python image to the EzBlock image? Is there maybe a file I can edit on the EzBlock image?

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [December 12, 2023, 8:37am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/4 "2023-12-12T08:37:09Z")

</div>

Under normal circumstances, after you calibrate the motor direction in Python control, when you switch ezblock APP control, the direction of the motor is also confirmed.  
If the direction of motor movement between your Python control and ezblock control is not consistent, please provide a video of the problem to us, so that we can analyze and solve the problem.  
You can replace the motor interface to try, and then go to run the move example to see how it works. (ezblock)

---

<div class="post-metadata">

**Author:** ![schuemie](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@schuemie](https://forum.sunfounder.com/u/schuemie)\
**Post date:** [December 14, 2023, 9:06am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/5 "2023-12-14T09:06:42Z")

</div>

I got a second SD card, and now have both images readily available. I created [this video](https://youtu.be/lPAUbpPRuOo?si=RPDdGzzKq3lg81Pv) that demonstrates that, if I fix the motor direction on the Python image, it is still a problem on the EzBlock image.

Not shown in the video is that, when I go back to the Python image, it does remember the calibration, and the car runs fine. To me it seems the motor direction calibration is stored on the image, not anywhere else.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [December 14, 2023, 9:35am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/6 "2023-12-14T09:35:23Z")

</div>

This is an issue we need some time to test to reproduce and will update you with the results.

---

<div class="post-metadata">

**Author:** ![schuemie](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@schuemie](https://forum.sunfounder.com/u/schuemie)\
**Post date:** [December 18, 2023, 10:06am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/7 "2023-12-18T10:06:25Z")

</div>

Thanks!

After looking back at my own video, I noticed that the red and black wires were really switched on the two motors, so I switched them on the right motor with my soldering iron. Now I don’t need the calibration anymore.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [December 18, 2023, 10:13am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/8 "2023-12-18T10:13:53Z")

</div>

After you switch the red and black wires of the motor, does the motor work correctly in python control.  
Is the motor working fine in ezblock control?

---

<div class="post-metadata">

**Author:** ![schuemie](https://avatars.discourse-cdn.com/v4/letter/s/a3d4f5/32.png) [@schuemie](https://forum.sunfounder.com/u/schuemie)\
**Post date:** [December 19, 2023, 11:53am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/9 "2023-12-19T11:53:05Z")

</div>

Yes, after switching the wires everything works fine both through Python and EZBlock.

---

<div class="post-metadata">

**Author:** ![sunfounder.iwyaj](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sunfounder.iwyaj](https://forum.sunfounder.com/u/sunfounder.iwyaj)\
**Post date:** [June 23, 2024, 5:55pm UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/10 "2024-06-23T17:55:09Z")

</div>

Hi there, I’m having the exact same issue with my Picar-X and similar to schuemie it looks like the wires are reversed on one of my motors. I’m also using EZBlock. Is there any way to correct this without reflashing my SD card to Python? Is there a config file I can edit? Unfortunately I don’t have a soldering gun to fix this.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [June 24, 2024, 10:33am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/11 "2024-06-24T10:33:39Z")

</div>

You don’t need to solder anything. You can simply swap the positions of the wires on the motor’s connector.  
Please refer to the video： [https://1drv.ms/v/s!As4abzxu6AMwg0o5wjnatPAkVwNT?e=TYMITp](https://1drv.ms/v/s!As4abzxu6AMwg0o5wjnatPAkVwNT?e=TYMITp)

---

<div class="post-metadata">

**Author:** ![JaseUltra](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.sunfounder.com/jaseultra/32/2143_2.png) [@JaseUltra](https://forum.sunfounder.com/u/JaseUltra)\
**Post date:** [December 27, 2025, 11:34am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/12 "2025-12-27T11:34:52Z")

</div>

Hey can you please repost that. Got the same issue here.

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [December 29, 2025, 6:23am UTC](https://forum.sunfounder.com/t/picar-x-motors-run-in-opposite-directions-when-using-ezblock/688/13 "2025-12-29T06:23:35Z")

</div>

Please swap the black and red wires of the motor connector, then reconnect it to the robot hat and observe the working result.
