OBJECT TRACKING DEVICE
My main project is an object tracking robot which uses computer vision. First, I plan to calibrate it so that it can recognize a ball. Afterwards, I will try to make it recognize, track, and potentially retrieve multiple objects.
Area of Interest
Computer Vision, Electronics, Physics
College Prep School, Oakland
For my first milestone, I can successfully spin two DC motors upon running a command. So far, I have worked with many hardware components: an L298N motor driver (a type of H-bridge), DC motors, wheels, a portable USB power supply, an Arduino micro-USB breakout board, a temporary breadboard, the GPIO pins in a Raspberry Pi Model 3B, some re-soldered jumper wires, and an Ethernet cable. Additionally, I used a separate HDMI monitor, microSD card, keyboard, and mouse to configure that software that allowed me to actually code.
First, I had to set up my software and ensure its reliability. Since the Raspberry Pi is an independent computer, it runs on its own operating system: Raspbian, which is a derivative of the Linux OS. However, I have a Macintosh computer running on the Mac OS, which is incompatible with Raspbian. Therefore, I established a secure shell network (SSH), which allowed me to remotely control the command line interface of the Raspberry Pi, through my Mac computer. That way, I could create Python files through a text editor that I accessed through the remote Raspbian command line. In order to establish SSH, I attached several components to the Raspberry Pi: an HDMI monitor, keyboard, and mouse. Separately, I reformatted my microSD card into the FAT (MS-DOS) format, installed a Raspbian OS image into it, and connected it to the Raspberry Pi, as well. The initial boot of the Raspberry Pi took a long time but was ultimately successful. Using the desktop displayed on the HDMI monitor, I enabled SSH connection through the preferences menu, and used the Ethernet IP address. I then attached the Ethernet cable from my Mac to the Raspberry Pi, inputted the relevant command and finally made the connection.
The SSH connection was the most challenging portion of my main project thus far, as I ran into multiple troubleshooting errors and ran several erroneous commands. My lack of familiarity with the Linux command line further compounded these issues. In fact, I initially wanted to connect the devices using Wi-Fi, which would eliminate the need for an Ethernet cable. Unfortunately, when I attempted to connect using the wLAN IP address, the local firewalls continuously blocked Port 22. I had to settle with an Ethernet connection temporarily. The first time I managed to succeed in creating an SSH connection, I had unknowingly damaged the text editor capabilities, as well as my sudo (super user) privileges, which were essential. I was forced to use another microSD card I had lying around in my home and repeat the entire process, this time successfully retaining all the SSH functionalities. In the future, I might establish a VNC (Virtual Network Computing) connection, which would grant access to the entire desktop of the Raspberry Pi, rather than the command line alone. Also, I could use my personal hotspot in my phone as a Wi-Fi connection, although there may be potential complications.
After I properly configured the software, I could finally set up the hardware and get the motors to actually spin. First and foremost, the Raspberry Pi Model 3B itself is the independent computer than runs everything. On the Pi, there is a series of 40 GPIO pins (General Purpose Input Output). This section of the Pi is very versatile and can interact with nearly any electrical component. They are designed for input, output, ground, or more specialized functions. In this case, I set the pins that I used to output, since they need to supply voltage. They connect to the L298N motor driver, which is a type of H-bridge. The H-bridge allows for current to be sent in both directions, removing the need to rewire every time. In addition, it supplies extra power to the motors that the Raspberry Pi is incapable of giving. The motor driver in turn is connected to the DC motors and wheels. I connected all of these parts with jumper wires. However, I did not have the correct wires, so I decided to cut certain parts of wires, solder them together, then insulate them with heat shrink with a heat gun. Finally, I dealt with the power supply, which independently powers the Raspberry Pi and the motor driver. Although the Raspberry Pi connection was simple, the connection to the motor driver seemed impossible, since the micro-USB cable did not fit with the pins in the motor driver. That’s why I used an Arduino micro-USB breakout board to facilitate the conversion on a breadboard, which allowed the power source to connect to the motor driver.
There were several complications that occurred. Most infuriatingly, the left motor starts spinning spontaneously upon the first boot, and does not work properly at times. Additionally, the configuration of the motor drivers confused me at first. In the future, I think I will be able to build a chassis for the robot, for stabilization and so that I can code more easily without having the spread it out. Also, I will work on the camera capabilities, possibly drawing from the Open CV libraries.
Schematic for Basic Motor Movement
For my starter project, I decided to create a mini charger with the battery packs that could fit inside a mint can. This device is a boost converter, which amplifies voltage from input to output. When the circuit closes, the inductor builds up voltage, and when the circuit opens, that voltage is transferred to the capacitors. There are several intricate parts soldered in the PCB (Printed Circuit Board). The IC (Integrated Chip) is essentially the control center for the device. The power inductor is a coil of wire that produces a magnetic field, which in turn amps up the voltage. The bypass capacitors regulate the input voltage, and the electrolytic capacitors regulates input and output voltage. The resistors provide resistance by decreasing the flow of current. The diodes permit the current to flow in only one direction. Together, these parts form the device. My main problem was removing the existing solder, when the anode was accidentally detached from the charger. Also, I struggled to put the device in the mint can, because I inadvertently pushed back many of the parts while soldering. Overall, however, this project has been very informative. Although soldering has been very laborious, it gave me an appreciation for the sheer intricacy of electrical engineering. This is a link to the schematic and parts I used while doing the project: https://learn.adafruit.com/minty-boost/parts-list