# PiCar-X help and suggestions

**URL:** <https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271>\
**Category:** Robotic kit for Raspberry Pi\
**Created:** [May 10, 2023, 12:13am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271 "2023-05-10T00:13:56Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffmorris1956](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jeffmorris1956](https://forum.sunfounder.com/u/jeffmorris1956)\
**Post date:** [May 10, 2023, 12:13am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/1 "2023-05-10T00:13:56Z")

</div>

I got the kit this morning. After assembling the car, I ran into problems trying to center the servos. I may have to write code that centers servos in Python. If the Raspberry Pi 4B board has heatsinks, the Robot Hat won’t go over the board fully seated. The board and hat need cooling fans because they get too warm. Is it possible to connect either different kinds of batteries or use plug-in power supply to the hat?

---

<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:** [May 10, 2023, 9:23am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/2 "2023-05-10T09:23:40Z")

</div>

It is normal for the Raspberry Pi to get hot after working with a robot hat. It will not affect your normal work.  
Regarding the type of battery, please follow the battery specifications provided in our tutorial to use the battery, all are OK:  
[https://docs.sunfounder.com/projects/picar-x/en/latest/appendix/battery.html](https://docs.sunfounder.com/projects/picar-x/en/latest/appendix/battery.html)  
The plug-in power supply can also be used, but the DC input voltage can not exceed 9V, it is recommended to be 6V-9V.  
It may not be good to find a power supply online. Or not compatible with the power supply interface of our robot hat.  
So we recommend you use battery power.  
Tip: If you want to try to plug in the power supply, there may be too much voltage, resulting in a short circuit, there is a risk that the robot hat will be burned or the Raspberry Pi will be burned.  
The consequences of this, you need to bear yourself.

---

<div class="post-metadata">

**Author:** ![jeffmorris1956](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jeffmorris1956](https://forum.sunfounder.com/u/jeffmorris1956)\
**Post date:** [May 12, 2023, 1:02am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/3 "2023-05-12T01:02:52Z")

</div>

The EzBlock Studio for Arduino tablets doesn’t match what’s in the documents. I think that EzBlock Studio in the documents are for Apple Ipad. There is no Navigation Bar on the left side. The Ezblock for Raspberry Pi image file doesn’t show the desktop. How can I fix the problems?

---

<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:** [May 12, 2023, 3:45am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/4 "2023-05-12T03:45:35Z")

</div>

1. the EzBlock Studio for android tablet does not match the content in the documentation?  
Not quite understand what you mean, we tutorial on the connection product steps, is the use of iPad to complete the screenshot steps tutorial, but the operation of android devices and ipad is the same.  
There is no navigation bar on the left side? Don’t understand, please describe the problem you encountered in detail and provide us with screenshots or videos of the problem, so that we can analyze and solve the problem easily.
2. The ezblock OS we specified is a system without desktop, if you  
want to make a system with desktop to install ezblock, install it by cloning the source code on github, some dependencies may be missing, you need to improve the dependencies according to the situation as follows  
cd ~  
git clone -b EzBlock3.1 [GitHub - ezblockcode/ezb-pi](https://github.com/ezblockcode/ezb-pi.git)  
cd ezb-pi  
sudo python3 install.py  
You also need to install opencv3 and its dependencies: cd ~ git clone -b EzBlock3.1  
[OpenCV: Install OpenCV-Python in Ubuntu](https://docs.opencv.org/4.x/d2/de6/tutorial_py_setup_in_ubuntu.html)  
Use  
sudo systemctl stop ezblock  
sudo ezblock-service  
to run the test  
Again, some dependencies may be missing and you will need to work them out yourself, so if you are not familiar with linux, it is not recommended to try it.

---

<div class="post-metadata">

**Author:** ![jeffmorris1956](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jeffmorris1956](https://forum.sunfounder.com/u/jeffmorris1956)\
**Post date:** [May 13, 2023, 10:39pm UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/5 "2023-05-13T22:39:01Z")

</div>

I bought the Raspberry Pi Starter Kit (Raphael) before buying the Raspberry Pi Ai Car Kit (PiCar-X). When I got the car kit, I followed the instructions for downloading and installing the Ezblock for Raspberry Pi image file. I wanted the desktop so I followed the instructions at how2electronics website for installing RaspiOS with desktop but I had problems trying to connect the car to the Internet. I followed the instructions at SunFounder Ulimate Raphael Kit for Raspberry Pi website for installing the image and then followed the instructions at how2electronics for installing **Installing Python Modules & Libraries** and I can connect the car to the Internet. Will there be new versions of software that’s compatible with Bullseye OS?

---

<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:** [May 15, 2023, 10:40am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/6 "2023-05-15T10:40:43Z")

</div>

I don’t quite understand the question you are asking, please describe the problem you are having in detail.  
The Raspberry Pi Starter Kit (Raphael) is also for the Raspberry Pi system.  
If you want to use python control on your picar-x, you need to install the required libraries on your Raspberry Pi system  
[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)  
Please follow our tutorial steps to install it.

---

<div class="post-metadata">

**Author:** ![jeffmorris1956](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jeffmorris1956](https://forum.sunfounder.com/u/jeffmorris1956)\
**Post date:** [May 19, 2023, 1:09am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/7 "2023-05-19T01:09:14Z")

</div>

I got a 5VDC fan with three wire that came from a Raspberry PI 4B case. The fan is connected:  
red wire - 5V  
black wire - ground  
blue wire - GPIO14  
How can I connect the fan to the Robot Hat?

---

<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:** [May 19, 2023, 2:37am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/8 "2023-05-19T02:37:56Z")

</div>

You can link D0-D3 on Robot hat, these 4 are Raspberry Pi IO ports, their correspondence is like this  
 ![51901](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/1X/b12fba2be914ece67a6af627e14ce34c0cf30da5.png)

---

<div class="post-metadata">

**Author:** ![jeffmorris1956](https://avatars.discourse-cdn.com/v4/letter/j/ebca7d/32.png) [@jeffmorris1956](https://forum.sunfounder.com/u/jeffmorris1956)\
**Post date:** [May 19, 2023, 11:35am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/9 "2023-05-19T11:35:22Z")

</div>

Is it possible to remove the speaker from bottom of the Robot Hat? The speaker interferes with the heatsink on the Raspberry Pi 4B and prevents the Robot Hat from going all the way down on the Raspberry Pi 4B.

---

<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:** [May 22, 2023, 3:50am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/10 "2023-05-22T03:50:20Z")

</div>

You can remove the speaker from the robot hat, but you can’t hear the sound when you execute the example about the sound.  
The speaker is attached to the robot hat, please be careful when you remove it, when you want to attach it back, you need to prepare the glue to attach it by yourself.  
So we still recommend that you do not remove the speaker.

---

<div class="post-metadata">

**Author:** ![PicarUser](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@PicarUser](https://forum.sunfounder.com/u/PicarUser)\
**Post date:** [June 18, 2023, 2:06pm UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/11 "2023-06-18T14:06:22Z")

</div>

Is there a way for the Raspberry Pi to query the Robot Hat for the battery charge state? The battery indicator LEDs on the Hat seem to know the batter charge, but I would like to automate a way to let the user know without having to look.  
Thanks.

---

<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 20, 2023, 2:36am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/12 "2023-06-20T02:36:24Z")

</div>

Sorry, currently the only way to determine the battery level is by looking at the battery indicator on the robot hat.  
About Raspberry Pi is there any way to check the battery charging status to Robot Hat?  
There is no way to solve it.

---

<div class="post-metadata">

**Author:** ![PicarUser](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@PicarUser](https://forum.sunfounder.com/u/PicarUser)\
**Post date:** [June 21, 2023, 3:45pm UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/13 "2023-06-21T15:45:25Z")

</div>

The robot hat has an ADC, couldn’t that be used?

Something like this: [Raspberry Pi Pico Battery Voltmeter in Python – Kitronik Ltd](https://kitronik.co.uk/blogs/resources/raspberry-pi-pico-battery-voltmeter-in-python) with some wiring between the batteries and the ADC on the robot hat.

---

<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 25, 2023, 10:32am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/14 "2023-06-25T10:32:03Z")

</div>

We do have a resistor set aside to divide the voltage of the battery to read. The battery voltage signal pin is A4  
The battery voltage can be read by Python using Robot Hat’s ADC library

```auto
from robot_hat import ADC

def get_battery_voltage():
  bt = ADC("A4")
  value = bt.read() # Get ADC pin value
  voltage = value * 3.3 / 4095 # Calculate ADC pin voltage
  voltage = voltage * 3 # Calculate battery voltage
  return voltage

def get_battery_level():
  voltage = get_battery_voltage() # Get battery voltage
  percent = ( voltage - 6.6 ) / ( 8.4 - 6.6 ) * 100 # Map voltage from 6.6V to 8.4V to percentage
  percent = max(0, min(100, percent)) # Constrain percentage from 0 to 100
  return percent

voltage = get_battery_voltage()
level = get_battery_level()
print(f"Battery state: {voltage}V, {level}%")

```

---

<div class="post-metadata">

**Author:** ![PicarUser](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@PicarUser](https://forum.sunfounder.com/u/PicarUser)\
**Post date:** [June 25, 2023, 4:27pm UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/15 "2023-06-25T16:27:39Z")

</div>

> [@SunFounder\_Moderator](#):
>
> We do have a resistor set aside to divide the voltage of the battery to read. The battery voltage signal pin is A4

Thank you.  
I see A0 - A3 on the robot hat. Where is A4?  
If I use A3, do I need my own resistor in series, if so what size?

---

<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 26, 2023, 9:15am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/16 "2023-06-26T09:15:22Z")

</div>

It is internal A4, no need to connect resistors in series with the robot hat, you connect the battery normally, start the robot and go to the Raspberry Pi system terminal and run the script.  
At this point you will see the battery voltage data printed out.

---

<div class="post-metadata">

**Author:** ![PicarUser](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@PicarUser](https://forum.sunfounder.com/u/PicarUser)\
**Post date:** [June 26, 2023, 1:54pm UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/17 "2023-06-26T13:54:03Z")

</div>

> [@SunFounder\_Moderator](#):
>
> ```auto
> from robot_hat import ADC
> 
> def get_battery_voltage():
> bt = ADC("A4")
> value = bt.read() # Get ADC pin value
> voltage = value * 3.3 / 4095 # Calculate ADC pin voltage
> voltage = voltage * 3 # Calculate battery voltage
> return voltage
> 
> def get_battery_level():
> voltage = get_battery_voltage() # Get battery voltage
> percent = ( voltage - 6.6 ) / ( 8.4 - 6.6 ) * 100 # Map voltage from 6.6V to 8.4V to percentage
> percent = max(0, min(100, percent)) # Constrain percentage from 0 to 100
> return percent
> 
> voltage = get_battery_voltage()
> level = get_battery_level()
> print(f"Battery state: {voltage}V, {level}%")
> 
> ```

Wow, that worked so easy. Thank you.

---

<div class="post-metadata">

**Author:** ![danfagerburg](https://avatars.discourse-cdn.com/v4/letter/d/a88e4f/32.png) [@danfagerburg](https://forum.sunfounder.com/u/danfagerburg)\
**Post date:** [March 16, 2025, 2:09am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/18 "2025-03-16T02:09:27Z")

</div>

Is this accurate? two posts down from the same handle is two functions using the A4 ADC to determine voltage and battery\_level…???

---

<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:** [March 17, 2025, 9:46am UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/19 "2025-03-17T09:46:33Z")

</div>

Correct. Please take a look at our adc.py code:

> <https://github.com/sunfounder/robot-hat/blob/v2.0/robot_hat/adc.py>

 ![image (8)](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/2X/f/f981321ea66b8d6693bab95990879add1b9b104d.png)

---

<div class="post-metadata">

**Author:** ![trebor](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@trebor](https://forum.sunfounder.com/u/trebor)\
**Post date:** [October 12, 2025, 4:58pm UTC](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271/20 "2025-10-12T16:58:41Z")

</div>

That works for PiDog as a charm. Thank you!

[Next page](https://forum.sunfounder.com/t/picar-x-help-and-suggestions/271.md?page=2)
