Cool Cap Engineer

Engineering by an anime nerd

Leave a comment

Projects: Arduino 24V Brushed DC Motor Controller Shield Update #4

wpid-20131228_181153.jpgWell, this is a first. This is kind of an embarassing first, but a first nevertheless. In my two years blogging on Cool Cap Engineer, I could never get past a third update for any of my projects. A lot of the times, I cancelled a project due to the huge time commitment for a project, or the lack of knowledge on the project’s topic. With that said: here’s the 4th update for the 24V Brushed DC Motor Controller Shield project.

In my last post, I mentioned that the original 24V Brushed Motor Controller circuit needed some improving. One of the crucial improvements I mentioned was adding overvoltage and undervoltage protection circuitry. Because of the power supply protection circuitry additions, I decided to look into the LM2574: a 12V/.5A Buck Regulator IC. By using the LM2574, not only will I be able to add the protection circuitry by manipulating the on/off pin of the regulator, but its surprisingly more efficient than the 7815 linear regulator I was using.I could not emphasize how efficient this regulator is. No matter how much I loaded the regulator, it still delivered 11.92V  to the load. Even when I loaded the regulator with a 24 ohm resistor, it still maintained 11.92V. Of course, the performance will change depending on huge temperature variations, but I’m assuming the final shield will be used at room temperature.


Just for the sake of curiosity, I wanted to see how the regulator performed when I loaded it with an Arduino, which typically draws 30-40ma. To my surprise I regulator delivered 11.97V to the Arduino. So I think I will use the LM2517 in the final design.

wpid-20131229_145616.jpgThe final thing I was thinking doing for the project was implementing the MC33035 brushless motor controller on the shield. The MC33035 can not only control DC motors, but it comes with a current limit. If I have time this week, I will implement the undervoltage and overvoltage protection circuitry with the 12V Buck regulator circuit and start working on the PCB for the shield, which will control 1 motor. Once I test the shield, I will modify the shield to control 2 motors.

Well, that’s it for me this week. Feel free to post a question, comment, or concern and I will do my best to respond back to you. See you guys next week and Happy New Years!

Leave a comment

Projects: Arduino 24V Brushed DC Motor Controller Shield Update #1

So let’s rewind 7 months ago, when I was still in senior year of college. One of my final projects I was working on for my club was a drink dispensing robot. We were close to finishing the robot, but I could not get the motor drive working for it. No matter how much I tried, the circuitry for the motor controller kept burning out. I felt so ashamed because I could not figure out what was wrong with the circuit. Fast forward to today and I wanted to try to correct the mistakes I made for that project by working on a similar one. So, one of my new projects is a 24V brushed motor controller using Arduino.

So, I want the final version to be implemented as an Arduino Uno shield. The shield will allow the user to control two 24V DC motors and limit the current 10 amps (5 amps per motor). If one of the motors draw more than 5 amps, then the shield will shut off power to both motors. The shield should also provide some level of isolation between the Arduino and the motor controller. By providing some isolation between the Arduino and the motor controller,  the Arduino will not get damaged during overcurrent condition. To control the direction of both motors, I will be making a homebuilt Hbridge using a combination of pchannel and nchannel mosfets. For my pchannels mosfets, I used Fairchild’s FQP27P06. As for nchannel mosfets, I used FQP20N06.

Normally, I would talk about the theory behind the brushed motor controller shield and talk about testing later, but I drew a lot of the schematics by hand and will need to be either re-scanned or converted to an Eagle Cad schematic. I will mention that for driving the pchannels and nchannels, I used IR’s IR4427 dual low side gate driver.


Arduino motor controller implemented on a breadboard

The figure above shows my first implementation of the motor control circuit. This motor control circuit should allow me to change the direction the motor is rotating. For testing the circuit, I used a 24V scooter motor I brought from Ebay. Despite the fact the motor is a 120W motor, the motor will not be loaded. By not loading the motor, the motor draws a couple of milli-amps (200-300ma) when I connected 24V to it using my 32V/5A DC power supply.  Because of this, I thought it would be unnecessary to heatsink some of the parts of the circuit.After building the circuit, I was able to safely power the motor from 12V-19V, but then one of the motor control transistors burned out. “Why?” you ask? Because by the time I put 18V into the circuit/motor, it was drawing 2.5A.

One of the pchannel mosfets was damaged around 18V.

One of the pchannel mosfets was damaged around 18V.

How could this be? If I provided a heatsink to each of the transistors as I should of, I could of pump 24V into the motor easily. To fix this situation, I was going to have to either grab a couple of heatsinks, or grab a piece of metal to act like a giant heatsink and attach the transistors to the piece of metal with sol-pads on the back. I also going to need to buy some more p channel mosfets T_T. However, I could not wait a couple weeks to solve the issue. I wanted it fixed now.


A homemade heatsink for power mosfets.

Luckily, I had several pieces of pre-drilled metal and sol pads already available. After attaching each transistor to the piece of metal and using every available alligator clip at my disposal to connect each transistor to the circuit I built on the breadboard, I tested the circuit again. Again, I was still having problems as the circuit was still drawing a high amount of current (around 4.89A). I later found out that the way I was driving my pchannels was completely wrong. For  pchannel mosfets to be fully off, the gate voltage must be equal to the source voltage. Because of my inproper way of controlling the pchannel mosfets, this caused a short in my Hbridge. So now I have to completely revise my previous hbridge control circuit in favor of a new one.


New motor control circuit. Surprisingly used less parts than the last circuit.

After testing the new circuit, I still saw a high current draw (again, around 4.89A). It was later revealed that my arduino was turning on both pchannels of my Hbridge, even though I specify in my code that only one pchannel should be on at a time.  In other words, this caused yet another  short in my Hbridge.When I looked at the voltage Arduino’s onboard 5v regulator was outputing, I found it that instead of outputting close to 5V, it was outputting 3.5V. Long story short, I need to replace my Arduino.


To see if my Hbridge was still working, I provided the input voltages using an 7815 voltage regulator. Now my circuit was drawing the correct amount of current!


Correct current draw. The circuit/motor was drawing 280ma and not 2.80 amps.

Well, that’s it for me today. Not only will I post the parts I used and the theory of the motor controller circuit soon, but I will keep you guys updated on the progress on this project. If you have any questions, comments, or concerns, feel free to leave a comment!

Leave a comment

Projects: Face Tracking Turret Update #2

Hey guys! I finally have some time to update the blog. So, I figure today’s blog post will be an update on my face tracking turret project. In my last post, I mentioned I ran into some difficulty with figuring out a way to implement the image tracking in Matlab.  However, I ran into an article that will jump start this project.


In an article posted by Sparkfun, they implemented a face tracker using Processing, an open source programming language developed by the folks who worked on the Arduino. The interesting thing is that there is an Open CV library, in Processing. For those who do not know, Open CV is an open source computer vision library that can be implemented in C++, Java, Python, and even Android. I’m 100% certain I will be utilizing the Open CV library for this project.

As for the decision to go with the USB missile launcher or the water pump, I decided that the only way to decide is by buying the USB missile turret and reverse engineer it. In other words, I will take it apart and learn how to control it using the Arduino. If it is possible to control it using the Arduino, then I will use the USB missile turret. If not, then I will use a water pump instead. I will buy the missile turret sometime next week. I will let you guys know what I found from USB missile turret breakdown and a way to control it manually from your Arduino.

Leave a comment

Projects: Face Tracking Turret Update #1

Hey guys! Long time no chat. Sorry for my lack of updates lately, but I’m not only swapped with school work, but I have a ton of research work as well. A couple weeks ago, I mentioned to you guys about my new project, the face tracking turret. Well, it turns it might be more difficult than I imagined. Not only because I never did image tracking before, but because my original idea on how to do the face tracking is probably not going to work.
My original idea for the face tracker is to connect the camera to Matlab 2012b, use its image processing library and computer vision library. I knew for a fact that Matlab can do image processing without any problems. The problem? Well…the computer vision library costs an arm and leg. That’s no problem, right? My school’s Matlab license should cover it? Nope. The library is so expensive, that even my school refused to add it to our Matlab 2012b installation. I will try to see if the computer vision library is in the Matlab 2012a installation but I doubt it. However, there is another option. I looked into OpenCV, an image processing library for not only Android phones, but Python as well! So project is far from over.
Another important issue I started to think about was the turret’s defense mechanism. Originally I thought about using USB missile launchers, but there’s no documentation on how to take these things apart. I have two options: take the usb missile launcher apart myself and post the documentation online, or have the turret shoot water at its victims. I’m still thinking about it.
In the past, I always used PIC microcontrollers in a heartbeat. However, I think I will stick with the Arduino this time. Most specifically, the Arduino Mega 2560. You know the best part? I got it for free from my Mechatronics research. Another reason why I might use the Arduino Mega is the fact Simulink, Matlab’s graphical GUI interface program, fully supports Arduino. So, if I find a way to do image processing using the Matlab, then I can easily create Arduino system blocks in Simulink to create the turret. I am kinda of disappointed that I do not have any tangible results for you guys, but I am still planning for this project. Stay tuned for more details.


Projects: Face Tracking Turrent

Hey guys! School is going okay-ish. I have fewer classes to take this semester, but I have a part- well contractual- time job, a lab assistant position, and a private tutor positions this semester. Not to mention an undergraduate research project to do. Speaking of which, I figured out my next project!

So the research I mentioned before is a mechatronics research. My friend and I are responsible for testing the new Mechtronics kits this semester. What’s cool about these kits is the fact that they use primarily Arduino, a Lego NXT motor and Matlab. Although I primarily use PIC microcontrollers, my experience with Arduino is much stronger than my experience with PIC microcontrollers. Lately, I came across a lot of tutorials which people are able to track their face using Matlab. Then I saw this beauty.

To make a long story short, I WANT TO CREATE THAT! I want to create a face tracking turret. Although my default choice is to use a PIC microcontroller, I might open the project to Arduino. One of the reasons I want to work on this project is not only the fact it’s wicked, but I have a final project to do for my Mechatronics class. You read that right. I’m doing Mechatronics research and taking a Mechatronics class at the same time. Ironic isn’t it (if not cheating according to my multiple friends)?

Keep in mind; I have no experience with image processing. In other words, I need to learn how to use the image processing library in Matlab. I already know how to communicate microcontrollers yo Matlab using serial communication, so I can just skip that step. What I need to figure out is whether I want my device to shoot out water, or to shoot nerf darts. This is going to be a fun project! I’ll see you guys later!