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.

Tuesday, July 10, 2018

Bluetooth Battery Monitor Using WICED Board

My electric skateboard so far has been great. The performance and battery life is better than I originally expected. However, there is one issue that bothers me: checking the battery voltage quickly. Right now, I have to take out a multimeter, open the enclosure on the bottom of the board, and measure the voltage. To solve this problem, I thought of making a Bluetooth-based battery monitor. I recently got an internship at a company in Silicon Valley called Cypress Semiconductors. One of their specialties is in WiFi and Bluetooth chips for devices such as game consoles, phones, smart home appliances and much more. They make Raspberry Pi-like boards aimed to help developers that can be programmed using a custom SDK. The particular board that I used is part of their WICED line of devices, and is called the BCM94343W_AVN. This product line focuses on connectivity, mainly Wi-Fi and Bluetooth. My particular board includes both Bluetooth Low Energy and WiFi, and is normally used for IOT (Internet of Things) applications. As the first main project for my internship, I decided to use this board to make a Bluetooth voltage monitor for my skateboard. I envisioned somehow measuring the skateboard battery voltage and sending that data to app on my phone so I could easily monitor the voltage. First, I focused on measuring the voltage. After some research, I found a feature built into the board that was called ADC, which allows any power source up to 3.3V to be connected to the board via the GPIO pins and measured. I found some code for the ADC online that worked with an Arduino board, so I changed the code a bit to work with my board and tested it with a AA battery (max of 1.5V). The problem was that the battery in the skateboard has a much higher voltage, around 12.5V fully charged. So I did some research and found out that there was something that could solve my problem known as a voltage divider circuit. Basically, two resistors, one higher impedance than the other, are used to bring down the voltage of a source to a manageable level. Then, you do some calculations to find out how much the voltage was divided by the resistors and use that data in your code to find the actual voltage of the source. I used a voltage divider calculator online to do my calculations. My skateboard is made up of two 3s batteries, each having a max voltage of around 12.5V when fully charged, and I only wanted to measure one of the batteries. In the voltage divider calculator, I used 13V as my input voltage to be on the safe side, and 3.3V as my output voltage, as that is what the max ADC voltage of the board was. There are no specific values to the impedance of the resistors that you need to use in a voltage divider circuit, but I settled on an 18K and 4.7K resistor, as that is what I could find in the company workshop. Next, I wrote some code to factor in the voltage divider circuit and everything worked properly. Finally, I had to find a way to send this voltage to my phone. Fortunately for me, Cypress makes an app that is designed for testing these Bluetooth boards. They also provide starter code that is compatible with this app. Once I modified their starter code a bit by adding my voltage measurer code and doing some small fixes, I was able to receive the battery voltage on my phone through the Cypress-made app. I put the board into the enclosure on the skateboard and did some soldering and tidying up with all the wires. The board, which needs 5V 2A for power, is powered by the skateboard batteries through a LiPo to USB converter that I bought online. However, there are still a few issues. For some reason, I couldn't get the Cypress app to display the voltage in a decimal format, so for example, 12.5 volts shows up as 125. Secondly, the voltage doesn't update as you ride unless you restart the whole system. In the end, it probably would've been easier to use an Arduino, but this project helped me get familiar with the WICED system and SDK. Click this to see my the voltage measuring code.