Wednesday, September 2, 2020

No-Sweat Biking

After realizing that skateboards are pretty damn dangerous (following my e-board build), I decided to try and make my own e-bike for the lowest amount of money possible. Although an electric skateboard may have a smaller footprint, I think that e-bikes are a lot more practical. For me, I can actually ride a bike around town without getting thrown off when the smallest of pebbles get lodged under the wheel. Additionally, the area behind the rider on a bike can be used for extra storage. 

There are a multitude of electric conversion kits for standalone bikes, but most overcharge for basic components that can be found off the shelf for lower prices. An e-bike is extremely simple. The whole system consists of a motor, battery, motor controller, and other input devices (throttle, brakes). My first decision was about which motor type I wanted to use. In general, the two main motor variants are front/rear hub and center drive. To minimize cost, I decided on a front hub motor. Although not the most powerful, a front hub is the easiest to integrate (no need to modify pedals or gears). After browsing around on eBay, Amazon, sketchy Chinese sites, Craigslist and Facebook Marketplace, I found someone selling a used e-bike kit for a lot lower than market value. The setup included a 36V 350W front hub motor, motor controller, and various accessories such as a twist throttle and e-brakes. In hindsight, I would've liked a slightly more powerful motor, but it still works well for cruising around town (for reference, 72V 1000W motors are essentially the high end of the motor spectrum in terms of power). 

Next, I started thinking of the battery setup. I knew that I needed a pack to suit the motor: supplying a nominal voltage of 36V and an amperage of around 9-10A (350W/36V). From experience building drones and model airplanes, my first choice was a lithium polymer battery. Although widely available, these batteries tend to get expensive when it comes to voltages as high as 36V (most drones run anywhere from 7 to 20ish volts). Also, LiPo batteries tend to wear quickly after many discharge/charge cycles. Because of these factors, I decided to use 18650 (18mm diameter, 65mm long, 0 for circular shape) lithium-ion batteries. These look like larger AA cells and can be found in most older laptops. Even Tesla uses li-ion batteries in their cars (although not 18650s specifically). Depending on the manufacturer, 18650 cells can last a long time and deliver a large capacity in a relatively small package. 

As I soon realized, 18650s aren't the cheapest batteries. That's when I made the decision to harvest old laptop batteries. While this can be dangerous (old cells typically aren't safest), you'd be surprised at how many perfect cells can be recovered. The only real downside with using these recycled batteries is the time it takes to check each cell. I also found it hard to get my hands on old laptop batteries as most people I knew had thrown their computers out (except my grandparents, where I got the majority of cells). After deciding on a battery layout consisting of 50 cells, a 10s5p setup, I began the long process of acquiring the cells. For the pack design, 10s5p means that there are 10 cells in series (3.6V nominal voltage of 18650s x 10 = 36V and 2000mAH capacity x 5 = 10AH - most smartphones are around 2-3AH). To test each cell, I used my drone battery charger to charge and discharge the batteries. I removed any cells that started to overheat during the process and also observed the cell voltages following charging after multiple days to make sure the batteries held their voltage. I also purchased a BMS (battery management system) that would allow me to charge the cells safely and make sure none of them burnt out. Most li-on packs are assembled using nickel strips and a spot welder to make connections. Without a spot welder and a large budget, however, I decided to use a pack assembly kit. The kit was made up of plastic battery holders with screw threads at the terminal ends so that cells could be connected by bridging these threads with nickel strips (and securing them with small bolts). Following a long process of building and checking connections (nearly ruining the whole setup by shorting two cells with a screwdriver), I wrapped the pack in several layers of foam and finished the whole thing off with some gigantic heat shrink tubing. 

Ironically, the bike was the last part of this build that I got. I managed to pick up a decent hybrid for free from a friend that was moving. After testing all the electronics, I started mounting them on the bike. I noticed how the provided e-brakes not only clamped down on the wheels when triggered but also sent a signal to the motor controller to stop the motor. Although the wires running along the frame gave it away, the front hub blended in perfectly. I rode the setup around my neighborhood and got up to 15-20 mph with minimal pedaling. Following some cable management and minor modifications, I started going on longer rides for range testing. I managed to go about 20 miles with not much physical exertion and still had about 25% battery left (voltage in this battery goes from 42V fully charged to 30V completely drained). So far, I've had no major problems with this build and it works perfectly to get around campus (surprisingly, I still have some in-person classes in the age of Zoom). The only real negatives come mostly with the bike itself. The caliper brakes aren't the best (looking to switch to disc later) and the gears don't change very fast. Other than that, the battery is a bit heavy but does provide significant range. 

In the future, I may swap in a more powerful motor, improve the braking situation, add more weatherproofing, and attach a key-start system. Not to mention, the cheap charger I bought doesn't really display charge percentage/rate so it's slightly inconvenient. Also, I had an idea to add a generator to the pedals so I could charge the battery when pedaling (although there might be too much resistance/weight). Overall, this project went a lot better than I expected and I'm genuinely satisfied with the final outcome. See pictures below. 

Motor Controller mounted below the seat

Integrated Motor in Wheel Hub

Fully sealed Custom Battery 



Sunday, March 29, 2020

A Smart Garage Door

Instead of acting like a normal person and just placing a spare key outside my house for the times that I get locked out, I decided to make my garage door "smart." By that, I mean integrating it with an Arduino-controlled motor relay hooked up to a server via WiFi. I had an old Arduino Uno sitting around and decided to put it to use. All I needed to link the Arduino and my garage door together was a motor relay. A relay basically acts as a switch that can open and close a circuit when instructed to by a microcontroller or some other device. I discovered a free Internet-of-Things service for these types of projects called Blynk. The service provides pre-written Arduino code and an ecosystem for controlling the whole thing with a smartphone app. After loading up some of the sample code and hooking the relay up, I followed the simple steps for setting up the Blynk app and attempted to test my over-engineered garage door opener. With my phone connected to a network, as soon as I pressed the button in the Blynk app, I could hear the clicking sound of the relay opening and closing. Next, I found an enclosure for the Arduino and relay while also running wires from my garage door motor. After doing some cable-management and putting the wires in their correct locations, I tried opening my garage door from the app. On the first try, the door opened, but as soon as I released the virtual button the door shut immediately. In the Blynk app, I changed the button to a switch, so it could remain open without constant pressure. This change worked and marked the end of this project. I also discovered later that Blynk has its own cloud server, meaning that you don't have to be connected to your home's network to open the garage door. Theoretically, I can open my garage door from across the world, assuming I have some sort of connection. Recently, I also found out (around 2am) that when power is cut to the Arduino, it closes the relay, triggering the garage door to open. That's really the only problem with this project so far. See pictures below. 
Control UX

Relay Connected to Arduino Board

Component Enclosure

Relay Wires Connected to Existing Opener

Friday, June 14, 2019

Laptop Surgery

Oftentimes when a piece of technology breaks, people throw it away or never use it again. I've done this before, especially with old smartphones. While cleaning my room, I found an old laptop that I used in middle school. At the time I used it, around 2015, it was new. It's an Asus Transformer Book T1000 with a detachable keyboard. Perfectly usable today, albeit slightly slow. The screen is cracked in the corner, but the actual LCD panel functions properly. I realized that I had stopped using this laptop because the power button broke. It couldn't be turned on. I decided to take apart the Transformer Book the find the root of the problem. After removing the back plastic cover on the tablet portion, I located the circuit board for the power button. The internal button had snapped off, leaving only a metal contact on the board. With the cover off, I used my screwdriver to short the contact, resulting in the normal boot-up sequence. The power button board simply had a few screws to secure it and a standard ribbon cable to connect it to the motherboard. I searched eBay for a replacement power button board and found one for around $10. Once it arrived, the repair procedure was basic. Everything worked like new. As technology has become more advanced, it has also become less repairable. Companies like Apple have long restricted consumers from taking apart their devices for repair. The idea of planned obsolescence (tech intentionally made to require a replacement) has only spread. The tech industry, with many parallels to the automotive industry, isn't favoring the true enthusiast anymore. For example, if my laptop was a newer MacBook, it would've been a lot harder to find a power button module on eBay. To achieve a sleeker form factor, companies have opted to solder components directly to the motherboard and adopt proprietary designs. This recent trend is not only detrimental to the wallets of consumers in the case of a repair, but also to the environment. The life cycle of technology is decreasing, resulting in more waste. It's probably too late now, but tech companies should begin to support the tinkerer. 

Tuesday, May 28, 2019

Mousetrap Powered Vehicle Challenge

In a recent project in my physics class, our teacher instructed us to build a mousetrap powered vehicle that can travel at least one meter off of a table. We were only allowed to use basic materials and all the vehicle's power had to come from a mousetrap. The hard part about this project was finding a design. Most high school mousetrap car projects focus on a simpler distance-based challenge, where students build vehicles that can travel for the most distance. There are plenty of these distance designs on the Internet, but not many for the table style challenge. Instead of building a traditional mousetrap car, I wanted to do something different. I felt that a regular car would either break on impact with the ground or have a hard time maintaining momentum after the drop from the table. In my design process, I attempted to come up with the simplest design I could that had the lowest amount of moving parts. In the end, I came up with the idea to attach a mousetrap to the bottom of a ball and basically just launch it off the edge of the table. The potential energy stored in the mousetrap would be used to make the ball jump off the table where it would roll on the ground. I settled on using a ball made of floral foam that I bought at Target. The foam was stiff but easy to cut with a knife. I first began carving out space for the mousetrap to sit in. The difficult part about this process was making sure that the mousetrap was fairly flush with the ball so that the roll wouldn't be affected too much. It took some sanding to get the perfect fit. Next, I used superglue to secure the mousetrap. I tested my contraption at school the next day. It worked pretty well, but on my last test run, the mousetrap fell out of the ball. I decided to add some hot glue along with applying more super glue. Additionally, I applied a lot of duct tape around the circumference of the ball to make sure the mousetrap never popped out again. I did some more testing and my revisions seemed to have been successful. On the actual day of the competition, my ball went about 2.5 meters (measured from the edge of the table to the closest side of the ball). Most people in my class were surprised to see a foam ball brought into class when they had all built traditional mousetrap cars. Click here for photos.




 

Sunday, January 13, 2019

A Look Back

Many years ago, when I was around 11 years old, I embarked on my first real DIY project. This was before any drones, 3D printing, or anything else. My cousin, two years older than me, had come to the U.S from India. It was the middle of summer and both of were extremely bored. After seeing a video from the Make Magazine Youtube channel about a compressed air rocket, we decided to try and build it (many other DIY Youtube channels have done this same project since). The design seemed simple enough - a PVC pipe air chamber with a bicycle tire valve using a sprinkler pipe electronic valve controller to release the air pressure and a small projectile. Using the video as a guide, my cousin and I took a trip to our local Home Depot and purchased everything we needed. Our PVC pipes weren't the same size as those in the video, but we figured that the whole thing would be fine. We also found some scrap wood to construct a structure around the PVC components to support the whole thing. Building the frame and installing the valve controller were the easy parts of the project, but adding the bicycle tire valve and actually switching the valve controller on and off were some of the challenges we encountered. I had an old bike tire that I used to get the valve. It took some time to find a proper adhesive to make the tire valve-PVC connection airtight. We settled on using JB Weld to secure the tire valve to the PVC pipe after drilling a hole. Next, we focused on controlling the sprinkler valve. There were no switches or anything else included in the box, so we had to improvise. After searching the garage for some time, we found an old light switch and decided to use it. To power the whole circuit, we used a 9V battery. Wiring the whole setup took a while, as I didn't have a soldering iron (and I didn't know how to solder) and I wasn't too familiar with electronics at the time. After making sure the PVC was airtight and the valve controller functioned correctly, my cousin and I worked on making a projectile. We carved a wooden dowel into a torpedo-like shape and sanded it a bit. Some duct tape was added to the mid-section to make sure that it fit snugly into the top of the PVC launching pipe. To fill the air chamber up, we simply hooked up a bike pump to the tire valve and pumped until the pressure was around 60 psi. Surprisingly, the first time we launched the projectile, everything went as planned. The wooden rocket shot up extremely fast, maybe to around 100-200 feet. This project really motivated me to try others and was essentially my introduction to the DIY space. I actually made a video about this compressed air rocket around the time I built it. Click here to watch it (keep in mind that it was filmed on an iPhone 4 and edited on iMovie by an 11 year old). 

Sunday, November 11, 2018

Drone Update

From previous posts, you may be aware that I started building my own quadcopter a while ago. Since then, I have made several improvements. For many years, I've always wanted my own DJI camera drone for taking videos and just general cinematography. However, these drones are incredibly expensive, unless you buy the new DJI Spark, which still starts at $500. The Spark is a good drone, but I feel that its capabilities are limited by its size and performance. Because of these reasons, I decided to build my own drone, centered around cinematography, basically my version of a DJI Phantom. I started with by upgrading the frame on my existing drone to a bigger 500mm frame with more room for camera equipment. It also has landing gears that are far more stable and stronger than those from my old frame. To improve the camera capabilities, I bought a 3-axis gimbal (same type on DJI Phantom) to replace my 2-axis one. This means that the camera I use will now be stabilized on the pitch, roll and yaw axes. Overall, it provides smoother video to get me closer to that DJI level. Another significant upgrade that I made was with my flight controller. When I started this drone, I was still a beginner builder, and I used the KK2 board to start. While this flight controller is fairly cheap and good for beginners, its technology is outdated and isn't very customizable. Because of these factors, I switched to the far more advanced Naze board. These boards are very popular nowadays, mainly being used on high-performance racing quads. Naze boards are compatible with a computer software called Betaflight, which allows for lots of customization regarding self-level, motor speeds, orientation, and many other things. It allows me to tune the self-leveling feature of the board so that my quad can still maintain a stable position in wind to improve the quality of the video recording. To make the drone easier to fly, I've also added an FPV (First Person View) system. This essentially allows me to see what the drone is seeing by wearing VR-like goggles. The camera on my quad both records and transmits video to my goggles. In the future, I hope to add things such as a GPS system, so that my drone can stay even more stable in the air and possibly do autonomous flights. I have attached pictures of my drone and some sample footage that I took with it here. 







Saturday, July 28, 2018

Embry-Riddle Drone Summer Camp

Flying drones for fun is great, but they have so much more potential than most people think. Instead of using drones as toys, there are many practical uses. Adding autonomy to drones can allow for new possibilities, such as land surveying or package delivery. Tasks that used to be otherwise strenuous or boring for regular drone pilots can now be accomplished with a lot more ease. Last week, I attended a drone summer camp at Embry-Riddle Aeronautical University. Embry-Riddle is one of the best aeronautical universities in the U.S and even the world. They offer a variety of degrees focused in aviation, engineering, and cyber-security. During this camp, the members in my camp group built and flew autonomous quadcopters along with some DJI Phantoms/Inspires and RC airplanes. We also spent some time in the classroom with the UAS (Unmanned Aerial Systems) professor. UAS focuses on the systems around and inside unmanned aerial vehicles. For the autonomous quadcopters, we used the f450 frame along with 1000kv motors + 30a ESCs and a 2200mah battery. To add autonomy, we used the Pixhawk Flight Controller running an open-source software known as Ardupilot with a GPS/Compass. The flight controller was able to be programmed using a software called Mission Planner. In this program, you can create a flight plan with waypoints, change the altitude/speed of the drone, disarm/arm, and do many other things. Besides a few friends and I, most of the other people in our group had little to no experience with building drones. We decided to split up and help the others build their quads. I felt that this particular experience was very beneficial, as it improved and refined my building skills through teaching. After the building was complete, we tested the motors and made sure everything was working correctly. We went out to the RC field and programmed a flight plan to all of our drones. I was surprised to see that all the drones followed their routes without any problems and flew well. At this point in the camp, we still had a few more days left to fly, as our professors had underestimated the time it would take for us to build the drones. We spent the rest of the camp flying RC planes and DJI drones. I didn't have much experience with flying RC planes prior to going to this camp, but I was able to learn and improve my RC plane flying skills a lot. On the last day of camp, most people in our group flew DJI Phantom 4s at the same time in formation and patterns while my friend and I flew/controlled the camera on a DJI Inspire to get some video of the other drones flying. The Inspire requires two pilots: one to fly the drone, and one to operate the camera gimbal. Although the actual building and flying of the quadcopters in this summer camp was a bit too simple for my skill level, I still enjoyed it. I did learn some new things about autonomous quads, UAS, and flying RC airplanes. See photos and videos here.