As a part of my ECE Discovery Studio course, I was tasked with creating something to build ECE skills for myself. So, after considering my need for quick transportation in the future, I decided to build myself an electric scooter. Below is documentation of my progress throughout the engineering process, and the steps that I took to pull off this custom e-scooter.
The first part of this project was of course to determine what components I would be using for the scooter. I dug around and found some other people that had attempted a similar thing, including Saral Tayal's Electric Skateboard Project, PracticalProject's Electric Skateboard Project, and Matthew Daniel's Electric Scooter Project. These guides would prove extremely useful when determining what components I would need for the project. After looking through each of the guides, it was clear that I would need the following things at a bare minimum: a motor, a motor controller, a battery, a throttle control, and of course the frame and body of a scooter. Realizing that creation of each of these parts from scratch could in and of itself be individual projects, I elected to purchase most of the components.
First, considering the motor, which by and large would determine the rest of the specs for the scooter, I had to determine both what type of motor I wanted and how powerful of a motor I wanted. So, I looked around at various electric scooter manufacturers to see what motors they use, which mainly consisted of Segway's Ninebot line of electric Kickscooters. From this, I learned that they all generally used 24-48V brushless DC hub motors. With only a little more looking I was able to determine that this was probably going to be the way to go due to the ease of installation of a hub motor, and the relatively low cost of a brushless DC motor. Determining the specific voltage was a little bit more difficult, though, as I had to consider the supply voltage as well. This meant finding a battery.
After only about an hour of looking around, I had found the battery that I wanted to use. While there were many options out there, only a few were available to be shipped to Georgia Tech, a key detail. I eventually ended up purchasing a 7800mAh 36V battery that is a replacement for a Xiaomi electric scooter. This I know would provide me with the capacity necessary as well as the form factor that I needed for an electric scooter.
So, once I had settled on my battery, I went back and determined that I needed to purchase a 36V motor. From there, it was really up to me to choose what size of tire I wanted on the hub motor. I elected to go with a 10" tire, as it was the best deal and it would give me enough flexibility when I would design the frame later.
Moving on to the motor controller, I had received a recommendation from my friend to go with a Flipsky VESC (Vedder Electronic Speed Controller), as he had used it for a project of his in the past and had a good experience with it. So, looking into Flipsky's offerings, I quickly realized that they had some products that far exceeded the performance that I needed for my scooter, so I ended up going with one of their more basic models, the FSESC6.7. This had voltage and current limits above that which my motor would draw, so there would be no problems using it to power my scooter. Also, it comes compatible with the VESC software, making the programming process easier.
To complete the backbone of my scooter, I needed to be able to control the throttle somehow. A fairly standard way of doing this is a simple thumb throttle, which is widely used across many consumer models. So, I purchased a basic one and had it shipped to me here at school.
Now that I had all of the necessary components, I thought through some other functionality that I would want my scooter to have, and I concluded that the only other thing that I needed was a way to monitor the charge remaining in the battery. I decided to use a circuit of LEDs and a ELEGOO Uno microcontroller to do this. After this point, it was just a matter of waiting for the components to arrive. In the meantime, I got to work designing the circuitry of the electric system, which is detailed in the next section.
While waiting for my components to arrive, I laid out the general circuitry that would be required for the scooter to function. This can be seen in the schematic below.
Included in this circuit is blocks representing the motor, electronic speed controller (ESC), throttle, and battery level indicator circuit. Although this was just a basic idea, it was helpful to determine just how many connections I needed to account for within the scooter. This will also help me later when I have to determine where everything is going to go in the frame of the scooter. Of course, I cannot just buy a battery level indicator and have it work in the way that I would like, so I also needed to work further until my components came in to design a working design for this circuit. Included below is my first idea as to how to make the battery level indicator.
This schematic details the inner workings of the battery level indicator circuit using an array of 5 LEDs and a signal from the batter. For the LEDs, I had not decided what type or color that I would use, and therefore could not determine the resistor values that I would need for them. Also, I knew that I needed to step down the voltage of the battery, as the ELEGOO Uno can only read voltages in the range 0-5V. So, to accomplish this step-down I decided to put in a basic voltage divider that divides the voltage by 10. This means that the range of voltages for my battery from no charge to a full charge would be 3.0-4.2V. To read the signal, I planned to use the onboard analog to digital converter (ADC). Looking into the documentation for the microcontroller, I was able to determine that I could associate a specific value with a certain voltage input. Using this, I created 5 thresholds, one for each of the LEDs, with the basic idea being that I would illuminate a certain number of LEDs corresponding to the charge remaining in the battery. The finer details of this I would explore later, and are detailed in the Programming the ELEGOO Uno section below.
Something that I did not consider, and would later come across is the way that I would power the Uno, as in the above design, the battery is not powering the microcontroller, it is only providing a signal. This is something that I still am considering, and will have to design for in the future. However, as of right now, I expect to have to split the voltage from my battery another way to provide power for the microcontroller. I think that in the end this will be the most elegant design, and what makes most sense. At this point, though, all of my components had arrived, so I needed to get to work with what I had designed so far.
Once my parts arrived, I realized that I needed to adapt just about every connector, as none of them were the same. To do this I took my first visits to the Interdisciplinary Design Commons (or HIVE) makerspace, and got to work soldering connectors and wires. The first picture to the right depicts the first connection that I had to adapt, which was between my VESC and the battery. Coming off the battery, there is an XT30 connector, so I figured that keeping that connection would be fine, and adapting all of the other wires to it would be the best way to go.
The second picture shows the default connectors for the motor's 3-phase power, and what I needed to adapt the VESC to be compatible with. Fortunately for me, the VESC did not come with any connectors on the 3-phase power wires, so I was able to just add female bullet connectors.
The third picture depicts the moment that the connections became a bit more complicated. For the connection between the motor's hall sensors and the VESC's onboard connection, there were three different connectors in use from factory. So, what I ended up doing, and what is depicted in the image, is cut off the factory connector coming off the motor and the end connector from the VESC's included adapter. Then, I soldered the wires of the motor directly to the adapter wire to have a more seamless connection between the two components.
Once I had all of the components adapted to the VESC's connections, I turned to the battery and the connections I needed to make there. Depicted to the right in the first picture of the second carousel, is the first splitter wire that I soldered to allow me to create the parallel circuits between the battery and the VESC and the battery and the battery level indicator circuit. Depicted in the second picture, is the other power wire of the splitter, as it used XT30 connectors to allow easy connection between the components.
Shown in the third image to the right is the finished splitter for the battery that I will end up using to bring power to both the motor through the VESC, and the battery level indicator circuit through the ELEGOO Uno.
For the battery level indicator circuit, I once again got to work at the HIVE. I surveyed the options for LEDs that I had, and I ended up deciding to go with an array of one red, one yellow, and three green LEDs. I figured that having some color to easily determine if the battery is getting low on charge would be good, so that is what I decided to go with.
Now that I had the LEDs that I was going to use, I had to figure out the resistors that I needed for each of the LEDs. There was no forward voltage information for the LEDs, so I tried out 120 Ohms for all of the LEDs. This resulted in the green LEDs being far too bright, the yellow LED was just right, and the red LED was too dim. So, I tested other larger values for the green LEDs and smaller values for the red LED. I eventually arrived at final values of 250 Ohms for the green LEDs and 82 Ohms for the red LEDs.
With these resistors selected, I set up the array of LEDs in parallel with each one of them connected to a different output pin of the Uno. Further explanation of the programming process and result is included in the Programming the ELEGOO Uno section below. The end result, though, was a simple sequential blinking of the LEDs and then turning them on constantly.
For the rest of the battery level indicator circuit, I of course needed the signal from the battery. While I was not able to get to this point just yet, I was able to figure out and use the digital multimeter that was at the bench I was working at in the HIVE. This device is pictured to the right booting up. Using this, I was able to determine the current charge of my battery, and in the future, I will be able to test the battery level indicator circuit to determine whether or not it actually reflects the current charge of the battery.
Once I had the circuit for the battery level indicator set up, it was time to program the microcontroller to do what I wanted it to. First, I had to declare the pins that I would use for the LEDs. While I could have just used the pin numbers in the rest of the code, doing it this way allowed me to easily determine which LED was being controlled in each line.
The first behavior that I wanted this circuit to have was a quick sequential blink from each of the LEDs to ensure that each of them was indeed working each time I turned on the scooter. This will enable me to quickly determine when one or more of them break or burn out in the future, without having to charge the battery to do so. So, to achieve this, I first set each pin to be an output pin. Then, I would turn on each LED by using the included digital write method, and turning the output to HIGH. Following a delay of 250 ms, I then turned the LED off by switching the output signal to LOW. This was all done inside of a for loop to consolidate the code, as the same behavior was done for each of the LEDs, and I wanted them to be sequential.
The second behavior is reflecting the current charge of the battery. I was not able to fully test this, but I was able to simulate this functionality using an online resource I found called Wokwi. Shown in the second picture to the right is the code for this simulation, which used a signal from a potentiometer to mimic the signal that would be sent from the battery.
The same setup code was included from above, but this time within the loop function I included the polling of the battery's signal and the resulting behavior of the LEDs. Above the code included in the screenshot are the definitions of the different battery percentage thresholds. They are values I calculated from the board's ADC that will be read when the battery has the respective level of charge left. Using these values, I set up a simple if-else ladder with the thresholds, and would turn on and off the LEDs in the array depending on the charge left in the battery. So, for example, if the battery it at 60% capacity the red, yellow, and two of the green LEDs will be lit as seen in the first else if statement in the code snippet to the right. At the bottom of the loop function, I used a delay statement to determine the polling rate of this circuit, as it is unnecessary for the charge to be checked continuously. The full code for this project can be viewed on my GitHub repository, and will be updated as I make further progress.
Even though I am not finished my electric scooter, and realistically not close to finishing either, I have learned a lot already. Before starting with this project, I have had very limited electronics experience, and I effectively threw myself into the deep end of sorts. But, being able to work through and learn in the process is the main goal that I have. Some of the things that I have learned so far are detailed below.
Designing of electric circuits and schematics
Soldering and working with physical electronics
Programming and implementation of microcontrollers in electric circuits
Included with these topics are more fundamental skills, but at a high-level these are the things that I have learned. Of course, as I navigate the rest of this project, I will learn far more, but I believe that this is a good start!
While this project is yet to be finished, there are a few things that I know that I can already improve upon in my design. These ideas are detailed below and while I do not necessarily have a timeline for how I will implement these ideas, I want to make sure that I will be able to at some point in the future. Also, included below are the aspects of this project that I still have to work through and construct in order to have a fully functional electric scooter.
Design and manufacture the frame of the scooter
Add a mechanical braking system
Include road safety features like headlights and taillights
Improve the wiring of the components and their connections.
Add a screen to the scooter to include more information and telemetry
Personalize the aesthetics of the scooter with things like additional LED lighting
If any of these future ideas sound interesting or cool to you, be sure to check back some time to see what progress I am making with them! Also, feel free to contact me with any questions you may have or if you would just like to chat about this project! My contact information can be found below, and on the bottom of every other page as well.