<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ram Sabavat on Medium]]></title>
        <description><![CDATA[Stories by Ram Sabavat on Medium]]></description>
        <link>https://medium.com/@ramsabavat2012?source=rss-a75aa2c6882b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Pv6z6b9lQQ2B_zOM</url>
            <title>Stories by Ram Sabavat on Medium</title>
            <link>https://medium.com/@ramsabavat2012?source=rss-a75aa2c6882b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:23:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ramsabavat2012/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I Built My Own Toy EV Car at 13 — With Raspberry Pi, Code, and an Xbox Controller]]></title>
            <link>https://medium.com/@ramsabavat2012/i-built-my-own-toy-ev-car-at-13-with-raspberry-pi-code-and-an-xbox-controller-d52dd164f7d4?source=rss-a75aa2c6882b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d52dd164f7d4</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[lidar]]></category>
            <category><![CDATA[raspberry-pi-5]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[ev-cars]]></category>
            <dc:creator><![CDATA[Ram Sabavat]]></dc:creator>
            <pubDate>Sun, 03 Aug 2025 06:59:53 GMT</pubDate>
            <atom:updated>2025-08-03T20:10:18.194Z</atom:updated>
            <content:encoded><![CDATA[<h3>I Built My Own Toy EV Car at 13 — With Raspberry Pi, Code, and an Xbox Controller</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HFiPoXs0YJenqE1VClOdfQ.jpeg" /></figure><h3>Hi, I’m Ram Sabavat — and I Built a Toy EV Car That I Can Drive with an Xbox Controller 🎮 🚗</h3><p>Hey! I’m Ram Sabavat. I’ve been coding since 3rd grade and have loved it ever since. Back then, I was especially into building websites and creating JavaScript games. In 5th grade, I joined an FLL team called Jarvis C0ders, and we actually made it to nationals! I stuck with FLL through 6th grade, and then moved on to FTC in 7th, where I became the head coder for Team 17595 Beta Bionix. Outside of coding, I’m into robotics, Autonomous EV Cars, and — of course — gaming.</p><p>In February, I got hooked onto Brawl Stars and my grades slipped, so my phone was taken away. Bored, I wandered into my dad’s office and found a microcontroller that caught my interest. Even with lots of homework, I got back into coding and made a small project with a Raspberry Pi Pico. Wanting a bigger challenge, I upgraded to a Raspberry Pi 5 and started chatting with AIs for project ideas. I have tested all code on my MacBook Pro. Eventually, I found my old RC car in the closet — and that sparked the idea for a partly-autonomous toy EV car.</p><p>What started as boredom turned into an exciting journey of building my own toy EV car — powered by code, curiosity, and a Raspberry Pi.</p><p>The complete working code for my EV car is available on my GitHub repository: <a href="https://github.com/RamCodesBetter/RC-CAR-CODE">https://github.com/RamCodesBetter/RC-CAR-CODE</a></p><h4>Driving the car with an Xbox controller on the street:</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FnKXE3lvHMBc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DnKXE3lvHMBc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FnKXE3lvHMBc%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fd65d92648a4fba22746d1600cac892/href">https://medium.com/media/3fd65d92648a4fba22746d1600cac892/href</a></iframe><h3>What I Used to Build My EV Car 🧰</h3><blockquote>“You don’t need a huge team — just some parts, tools, and curiosity!”</blockquote><ul><li><a href="https://amzn.to/3IVzaZb">My MacBook Pro M3 Pro Laptop</a></li><li><a href="https://amzn.to/41p9rym">CanaKit Raspberry Pi 5 Starter Kit PRO — Turbine Black (128GB Edition) (8GB RAM)</a>: The brain of the EV Car.</li><li><a href="https://amzn.to/3UFf9IO">Xbox Wireless Gaming Controller</a>: Has enough buttons and joysticks to make the EV Car do almost anything.</li><li><a href="https://amzn.to/4fjO3R9">Adeept’s 40 Pin Male to Female GPIO Ribbon Cable</a>: The board to distribute and provide easier access to the GPIO pins.</li><li><a href="https://amzn.to/45aGE3f">Yahboom’s Ackerman Chassis</a>: A chassis to hold all the components, motors and servos (the motors and the steering servo come with the chassis)</li><li><a href="https://amzn.to/44XUtBU">Yahboom’s AT8236 Dual Motor Controller</a>: The best compatible motor controller for my chassis.</li><li><a href="https://amzn.to/4mo3H03">youyeetoo’s FHL-LD19 LiDAR Sensor</a>: This LiDAR sensor was small and powerful. It still works even in the bright sun, and It has a huge range of 12 meters.</li><li><a href="https://amzn.to/4okhTcd">Logitech BRIO 4K Webcam</a>: This camera lets the EV Car take videos for long periods of time at 1080p@60fps and can take 4K photos. The camera also comes with a microphone, providing audio to the videos.</li><li><a href="https://amzn.to/4lksoK4">HiLetGo’s MAX7219 32x8 Dot Matrix</a>: The matrix display on the car shows lots of information like current speed (MPH), direction to drive and the current gear (PRND).</li><li><a href="https://amzn.to/40MGNHt">Breadboard Kit</a>: This kit provides two 830 pin breadboards and two 400 pin breadboards. I used one 400 pin breadboard in the front of the car and one 830 pin breadboard on the middle to the back of the car.</li><li><a href="https://amzn.to/40M3MlT">Joyfar’s 10000mAh Battery</a>: This power bank powers on the Raspberry Pi 5 at 5V/3A.</li><li><a href="https://amzn.to/3IXXhX9">OVONIC’s 2S 7.4V 2200mAh 35C LiPo Battery</a>: This LiPo battery powers on the motor controller.</li><li><a href="https://amzn.to/4onTT8g">OVONIC’s D15 Dual LiPo Battery Charger</a>: This battery charger can charge the OVONIC LiPo batteries.</li><li><a href="https://amzn.to/4lfWBtz">EZlifego’s Double Sided Tape</a>: This double sided tape is strong enough to not let anything fall off of the EV car if the car flips over (or falls off my desk).</li><li><a href="https://amzn.to/3HiDocL">BN-880 GPS Module</a>: This GPS Module is going to be used in the future when I start making my EV Car autonomously drive next to a curb to a set location. Since the car is following a curb to get to the location, I call this “curb-following.”</li><li><a href="https://amzn.to/4lYwZ5F">100pcs 220 Ohm Resistors</a>: These resistors are typically used for LEDs to make sure they do not burn out. I had a lot of LEDs in my car, so having lots of these was a good idea.</li></ul><h3>Putting It All Together 🔧</h3><blockquote>“I started with a messy desk and ended with a working car!”</blockquote><h4>Preparing the Raspberry Pi 5</h4><p>When you open your CanaKit kit, start by taking the Raspberry Pi 5 and placing it onto the base of the case provided. Next, plug the fan into the port labeled <strong>FAN</strong>, then snap the fan and the lid of the case together. Place the black heatsink over the main components on the Raspberry Pi board. After the heatsink is in place, attach the walls of the case onto the base.</p><p>Next, take the 40-pin GPIO cable and plug the rectangular end into the GPIO pins on the Raspberry Pi 5. Place the lid on top and press firmly until you hear a click. There should be a gap between the lid and the walls — this is where the ribbon cable can fit through. Once the case is securely assembled, you’re ready to move on.</p><h4>Setting Up SSH on the Operating System</h4><p>Insert the microSD card into the USB adapter that came with your CanaKit kit, and then plug the adapter into your Mac. On your Mac, download the <strong>Raspberry Pi Imager</strong> from the official Raspberry Pi website.</p><p>Open the Imager, and in the <strong>Device</strong> box, select <strong>Raspberry Pi 5</strong>. In the <strong>Operating System</strong> box, choose <strong>Raspberry Pi OS (64-Bit)</strong>, which offers a user-friendly desktop environment. When you click on the <strong>Storage</strong> box, select your USB adapter (it should appear as <strong>bootfs</strong>). Click <strong>Next</strong>, then click <strong>Edit Settings</strong>. To set up your user profile, navigate to the <strong>General </strong>page, set the <strong>Hostname </strong>to <strong>raspberrypi5.local</strong>, set the <strong>Username </strong>to your first name (for me <strong>Ram)</strong>, and finally set the <strong>Password </strong>to a strong password of your choice.</p><p>In order to connect to a WiFi, set the <strong>SSID </strong>to the name of your WiFi (you can use 5G networks), set the <strong>Password </strong>to the password of your WiFi, and then set the <strong>Wireless LAN Network </strong>to the country you are currently in. Checkmark the <strong>Set locale settings </strong>box and set your <strong>Time zone </strong>and <strong>Keyboard layout </strong>to your time zone and your preferred keyboard layout, respectively.</p><p>Navigate to the <strong>Services </strong>tab and if not already, checkmark the <strong>Enable SSH </strong>box. After enabling SSH, click <strong>Save </strong>then <strong>Yes </strong>(to save the changes). Since you are using the microSD Card provided by the Canakit Kit, you can select <strong>Yes </strong>to erase the card. After waiting for the installation of the Operating System, you can eject the microSD card and place it into your Raspberry Pi 5. Finally, plug in the 45W power supply into the Raspberry Pi 5.</p><h4>Setting Up a Headless Display</h4><p>After a minute of the green light being displayed (it should be blinking irregularly) on the Raspberry Pi 5, you can run this command in your terminal:</p><pre>~ ssh &lt;Username&gt;@raspberrypi5.local</pre><p>You should see a result that prints “Are you sure you want to continue connecting (yes/no)?” Type yes and then hit enter. You should then see a line that says “&lt;Username&gt;@raspberrypi5.local’s password:.” Enter your user password and hit enter. You should see something like (Ram is the username):</p><pre>Ram@raspberrypi5:~ $</pre><p>Run:</p><pre>Ram@raspberrypi5:~ $ sudo raspi-config</pre><p>and press enter. You should see a window open with a blue background and an options menu. Use the arrow keys to go down and select<strong> 3 Interface Options.</strong> Choose<strong> VNC</strong> and use the left arrow to select<strong> Yes</strong>. Select<strong> SPI</strong> and select<strong> Yes</strong> then<strong> No</strong>. Select<strong> I2C</strong> and select<strong> Yes</strong> then<strong> No</strong>. Select<strong> Back</strong> then<strong> Finish</strong>. If a pop-up shows up asking you to reboot, choose<strong> Yes</strong>. If not, then run:</p><pre>Ram@raspberrypi5:~ $ sudo reboot</pre><p>Download RealVNC Viewer from their website on your Mac, and open the application after the installation. Once opened, locate the search bar at the top of the app and type in <strong>raspberrypi5.local</strong>. Enter the <strong>password </strong>of your Raspberry Pi user profile and click Enter. After a couple of seconds, you should be at the desktop of the Raspberry Pi 5.</p><h4>Plugging in the Components</h4><p>On the<strong> Yahboom Ackerman Chassis</strong>, connect the <strong>Left Motor Wire </strong>to<strong> Motor B </strong>on the <strong>Yahboom AT8236</strong>. Connect the <strong>Right Motor Wire</strong> to <strong>Motor A</strong>.</p><p>Connect the <strong>Logitech BRIO </strong>to the <strong>Top USB 2.0 (Gray) Port </strong>on the <strong>Raspberry Pi 5. </strong>Connect the <strong>LiDAR </strong>to the <strong>USB </strong>adapter, and connect the <strong>USB </strong>adapter to the <strong>Bottom USB 2.0 Port </strong>on the <strong>Raspberry Pi 5</strong>.</p><p>Connect the <strong>OVONIC LiPo Battery</strong> to the <strong>AT8236; </strong>turn the switch to the <strong>ON </strong>side. Connect the <strong>Joyfar 10000mAh Power Bank </strong>to the Raspberry Pi 5. Using power banks and LiPo batteries help with portability, which lets the car drive on the road.</p><p>Here is some wiring pictures from my EV car:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eQGdWFlP8yaT94YaewsXKg.png" /></figure><h3>The Fun Part: Making It Move with Code 👨‍💻</h3><blockquote>“Once I got the motors spinning, it felt like magic!”</blockquote><p>Here is an example code from my ev car:</p><pre>elif event.type == pygame.JOYBUTTONDOWN:<br>    if event.button == 0: # A: Horn<br>        state[&quot;horn&quot;] = True<br>    elif event.button == 1: # B: Night Time (Moved from D-Pad Down)<br>        state[&quot;night_mode&quot;] = not state[&quot;night_mode&quot;]<br>        print(f&quot;Night mode: {&#39;ON&#39; if state[&#39;night_mode&#39;] else &#39;OFF&#39;}&quot;)<br>    elif event.button == 3: # X: Hazard (Moved from D-Pad Up)<br>        state[&quot;hazard&quot;] = not state[&quot;hazard&quot;]<br>        print(f&quot;Hazard lights: {&#39;ON&#39; if state[&#39;hazard&#39;] else &#39;OFF&#39;}&quot;)</pre><p>You can see that if a button is being pressed, pygame.JOYBUTTONDOWN returns true. The code will then have to find what button is being pressed. Every button has a number “mapped” to it. On a Xbox Series X controller, pygame detects A as 0 and B as 1. So for my car, when A (button 0) is pressed, the horn sounds on the car.</p><pre>if event.type == pygame.JOYAXISMOTION:<br>    if event.axis == 0: # LS X: Steer<br>        raw_steer_val = event.value<br>        if abs(raw_steer_val) &lt; 0.1:<br>            state[&quot;steer&quot;] = 0.0<br>        else:<br>            state[&quot;steer&quot;] = raw_steer_val<br>    elif event.axis == 4: # RT: Gas<br>        state[&quot;throttle&quot;] = (event.value + 1.0) / 2.0<br>        if state[&quot;throttle&quot;] &gt; 0.05 and state[&quot;cc_active&quot;]:<br>            state[&quot;cc_active&quot;] = False<br>            # Reset PID when user manually applies throttle<br>            g_pid_integral_error = 0.0<br>            g_pid_previous_error = 0.0<br>            g_pid_output = 0.0<br>    elif event.axis == 5: # LT: Brake<br>        state[&quot;brake&quot;] = event.value &gt; -0.9 </pre><p>In this snippet you can notice that the code block is similar to the last snippet. The code checks if the controller event was an axis (joystick) movement. If true, the code checks if the axis moved was for steer, throttle, or brake. If RT (Right Trigger) was pressed, then the amount that RT was pressed downwards equals to the amount of throttle the motors receive.</p><p>When you physically place motors on a chassis, one of the motors may be flipped, so throttle values given to the motor will have to be flipped. For example, to make a car go forward, you have to give 1.0 to the right motor, but -1.0 to the left motor. Vice versa to make the car go backwards. In the code snippet below, I use the forward right motor pin and the backward left motor pin. I don’t use the forward pin for the left motor since the motor is physically flipped.</p><pre>if state[&quot;current_motor_pwm&quot;] &gt; 0.001: # Forward<br>    motor_right_fwd.value = pwm_val<br>    motor_left_bwd.value = pwm_val # Left motor might be inverted<br>elif state[&quot;current_motor_pwm&quot;] &lt; -0.001: # Reverse<br>    motor_right_bwd.value = pwm_val<br>    motor_left_fwd.value = pwm_val # Left motor might be inverted</pre><h3>Driving It Around: What Worked (and What Didn’t 😅)</h3><blockquote>“Here’s how the first drive went…”</blockquote><p>When I started my first drive, the LEDs — like the indicators, night lights, and brake lights — were all lighting up perfectly, and the servo was steering just how I wanted. So far, so good. But then I hit full throttle… and that’s when chaos broke loose.</p><p>The car suddenly spun around like a maniac and flew straight off my desk, knocking over everything in its path. I had no clue what was going on. I thought something was broken, but after calming down and doing a bit of digging, I realized the issue: one of the motors was flipped on the chassis.</p><p>That meant while one motor was going forward, the other was going in reverse. So instead of driving straight, it just spun in place like a Beyblade. I went back into the code and reversed the direction for that one motor. After that fix, it finally started driving like a normal car again. Well…mostly.</p><h4>This is a video recorded by the car’s own camera:</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FhujERAxT0NI%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DhujERAxT0NI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FhujERAxT0NI%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7e1ff3bba57df24b3facfe12ce8ba75/href">https://medium.com/media/b7e1ff3bba57df24b3facfe12ce8ba75/href</a></iframe><h3>Want to Try It Too? Here’s My Advice 👇</h3><blockquote>“If I can build this at 13, others definitely can too.”</blockquote><p>If you dream of building huge projects — like your own EV car — you <em>must</em> start small. Skip the fundamentals, and everything will fall apart. The big stuff only works because of hundreds of tiny things done right. Want to build something that actually works? Learn the little things first. Build the boring stuff. Wire the circuits. Write the simple code. Test. Fail. Fix it. Do it again. That’s how you earn the big idea.</p><p>Try to do something small like making a LED turn on and off or making a motor move. After you get some components working, try to plan your project and take your time on it. Don’t worry if it doesn’t work at first — that’s normal! Watch videos, read forums (this helped me a lot), experiment with electronics and never give up. Ask questions and stay curious when coding.</p><h3>What’s Next for the EV Car? 🚀</h3><p>Next up: autonomous driving. I’ll start by using an ultrasonic sensor to keep the car a fixed distance from a curb. Then I’ll train a camera to spot the curb or the white line along a bike lane. With both working together, the car should be able to drive straight on its own.</p><p>I also added a GPS module. If I can figure out navigation, I’ll map a controller button to send the car to a set location — like my friend’s house — by following the curb. Eventually, I want to add motion detection so the car knows when it’s safe to cross streets.</p><p>And finally, I’m planning to upgrade to a 3S LiPo battery (11.1V) to give the motors more power. It’ll make the car way faster — and way more fun.</p><p>Want to see where this goes? Follow along or drop your ideas in the comments!</p><p><strong>What should I build next?</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d52dd164f7d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>