Cool Cap Engineer

Engineering by an anime nerd


7 Comments

Projects: Face Tracking Turrent

facetracking_overview
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!


Leave a comment

Electronics: MAX619

One of things I remembered doing a lot last semester at RPI was building various analog circuits in my free time. One of my good friends who’s a lab technician for one of the labs at RPI, had reels of ICs that never been used. He even had 3 reels of Motorloa’s microprocessors that came out in the 1980s. However, one IC that I found extremely useful was the MAX619 IC. The Max619 IC accepts voltages between 2.7 and 3.6 volts, and converts it to 5 volts using charge pumping.

Max619 Pinout

To be honest, the pinout is really straight forward and I will not go into much detail.

datasheetpic

C1+ (Pin 1) and C1- (Pin 8): This is where you connect your .22uF capacitor to.
In (Pin 2): This is where you connect your input voltage to. As I stated before, the input voltage range from 2.7 to 3.6 volts.
Out (Pin 3): 5V output of Max619
C2+ (Pin 4) and C2- (Pin 5): This is where you connect your second .22uF capacitor to.
GND (Pin 6): Connect this pin to 0V of your power supply
SHDN (Pin 7): To make sure the IC is properly working, connect this pin to 0V. Otherwise, the chip will not turn on.

Circuit Diagram

MAX619

Although there’s an example schematic in the datasheet, I decided to create a quick schematic in Eagle Cad to show where you should connect your capacitors to. Please note: the IC will not work if you connect a capacitor from C1+ to C2+ and from C1- to C2-.

 

Increasing Output Current

540097_4228839031505_1432697520_n

Although the voltage will increase from 2.7-3.6 volts to 5v, the output current will be really low. When I first tested the IC, I got around 90ma. If you need to power more beefier devices, then you can connect two or more MAX619’s in parallel. In fact, the picture above shows me building a two level multi-level DC to DC converter using two MAX619 ICs. The output current of the converter was around 180ma. Since you’re increasing the output current of the device, you’ll also increase the input current the device needs. My advice is to use the chip with hi-current batteries such as Lithuim Ion batteries.

That’s all I have for you guys today. If you guys have any questions or concerns, feel free to post a comment!


Leave a comment

Projects: Pygames Controller Final Update

pygamescontroller

Well, I head back to RPI next Sunday. I finally can say I finally finished building the prototype of my Pygames Controller and successfully completed the “before I go back to RPI” requirement. The only thing I wished I could of adding for the project is a decoupling capacitor for each button. Otherwise, I am very proud of the prototype. The code for the project can be found at the following URL.  Feel free to post any problems or concerns you have about the code, and I will make sure I add it to the next version of the controller.Now I change the project status to complete on the projects page 😀 In fact, for now on, instead of placing code in these blog posts, I will upload code to Github. Anyway, I see you guys later!


Leave a comment

Projects: Pygames Controller Update #2

So I’ve been busy for the past couple of days for the Pygames Controller project. However, I would say that I’m 90% done with the Pygames controller project. Let me talk about what was been done thus far.

20130101_121929

After my last update, I finished writing the C file for the controller. For some reason, serial communication was not working at the time, so I had to test my code using LEDs. When I flick the left joystick to the left, it will turn on the smallest yellow LED on the board. When the right joystick is flicked up, then it will turn on the green LED. Finally, when I pressed down the yellow tactile switch, it will turn on the yellow LED next to the smallest yellow LED.From my LED tests, I had to modify a few things with the button press code, but the c file for the controller is fully functional.

406599_4456933653728_1151303803_n

As I said in my last post, I had to revise my original layout of the controller. Instead of having 2 joysticks, four tactile buttons, and two triggers, I had to reduce the parts of the controller to two analog sticks and two tactile buttons. Since I’m testing the controller on a breadboard, I wanted to select a layout that could fit onto the breadboard I current have.

debug_results

I did some final testing for the controller C code by seeing the states of the joysticks, and buttons using Arduino’s serial window.  Although testing the controller using the serial window severely slowed my computer down while I was watching the latest episode of JoJo’s Bizarre Adventure (which I highly recommend if you love 80’s anime like Fist of the North Star), I was fairly pleased by the results. However, when I work on a future version of the controller, which I’m 95% I will,decoupling capacitors will need to be added at the buttons terminals because when I pressed and release the button, it does not instantly go to an “off” state immediately.  This is a common, but simple, problem that exists when dealing with digital inputs for microcontrollers.

Right now, I’m writing the python class for the controller. I hope I can finish the python class by the end of this week. Afterwards, I will release the python class, c files, default schematic, and documentation on Google code.  One of my friends even agreed to help me test out my controller by creating a small python game designed exclusively for the controller.

Well, that’s all I have for you guys! Again, if you have any concerns or suggestions, feel free to post a comment.


2 Comments

Electronics: Serial Expansion Using 74HC4052

DIP16

I never thought I would say this, but there will be situations which you need to connect several serial devices using one microcontroller.  There are two options to increase the number of serial devices a microcontroller can handle. The default option is to get a microcontroller which has more than one USART port. The second option is to use 74HC4052, a multiplexer/de-multiplexer specifically designed to handle serial communications. In fact, it was the same chip I used in last Wednesday’s mini project post.

What is a multiplexer/demultiplexer?

51183

Let’s start off by talking about what’s a multiplexer. A multiplexer is a sequential circuit designed to accept  multiple inputs, but output the data from one of those inputs based on the input selected. This type of sequential circuit is used all of the time in building the underlying architecture for processors.  A demultiplexer is the opposite of a multiplexer. A demultiplexer is designed to take in one input, and output it to one of the several output pins based on the output selected.  As you can tell by now, the 74HC4052 is a special type of IC that can act as a multiplexer or a demultiplexer depending on the inputs and outputs.

Pinout Explanation

pinout

1Z( Pin 13) / 2Z (Pin 3): These pins are the input/output pins of the chip. These are the pins which you’ll want to connect TX or RX of the microcontroller you want to use.
Enable (Pin 6): This is responsible for turning on or off the chip. To turn on the chip, simply connect this pin to ground (0V) and to connect VCC to your positive supply, and GND to 0V.
S0 (Pin 10)/ S1 (Pin 9): These pins are responsible for choosing the input/output pin you wish to use. I’ll explain the purpose of these pins later on.
1Y0(Pin 12)/1Y1(Pin 14)/1Y2 ( Pin 15)/1Y3 (Pin 13): These are the input/output pins to be connected to the 1Z pin. For example, if I connected my microcontroller’s TX pin to 1Z, then I need to connect the RX of my serial device(s) to either one of my 1Yn pins.
2Y0(Pin 1)/2Y1(Pin 5)/2Y2 ( Pin 2)/2Y3 (Pin 4): Same thing as the 1Yn pins, except for the 2Z pin. For example, if I connected my microcontroller’s RX pin to 2Z, then I need to connect the TX of my serial device(s) to either one of my 2Yn pins.
VCC (Pin 16): This is the positive power for the chip.
GND ( Pin 8):  This is where you plugged in 0V.

Method of Operation

So how do you use the device?  The 1Z can be connected to 1Y0, 1Y1, 1Y2, and 1Y3 pins and 2Z can be connected to 2Y0, 2Y1, 2Y2, and 2Y3. The S0, and S1 pins specify which Y pin is connected to its respective Z pin. For example, if we want to connect 1Y0 to 1Z, we connect S0 and S1 to ground.  However, S0 and S1 cannot specify which Z pin is used.  In other words, if we connect S0 and S1 to ground, not only will 1Y0 is connected to 1Z, but 2Y0 will be connected to 2Z. I included the truth table from the 74HC4052 datasheet to show how S0 and S1 affect which port is connected.

truth_table

Default Wiring Diagram

Default Circuit

The figure above shows an example schematic of the 74HC4052.

If you guys have anymore concerns, or suggestions, please feel free to post a comment!


Leave a comment

Mini Projects: XBees Wireless Module and 74HC4052

20121229_130303
First off, I would like to say Happy New Year everyone! Apparently we all survived after all. Anyway, for the past couple of weeks, I started to mess around with X-Bees wireless modules. First off, what are X-Bees? X-Bees are a special type of chip that allows you communicate microcontrollers and computers together using serial communication.
Xbeeresults
There was a great deal of frustration when using these chips. First off, I soldered the X-Bees to the wrong side of the breakout board. It took me quite some time for me to realize the soldering mistake. Then I tried running the modules at an 115200 baudrate, which proved to be too much for the wireless module. Finally I got the modules communicating with each other when I programmed the PIC18F4553 to send “Hello World” to the computer. Although I managed to transmit the message wirelessly, the propagation distance was terrible. In fact, I could only get a transmission distance of a 1 foot. I began to wonder why the propagation distance was so low. Then I realized that the X-Bees I brought did not include the necessary antenna needed. After realizing this fluke, I quickly went to Sparkfun and brought the necessary antennas, which will not come in until next week.
20121229_171905
The final object I brought was a 74HC4052. What’s so amazing about this chip? It’s actually a multiplexer/de-multiplexer chip designed especially for analog and serial devices. In other words, you can connect up to 8 serial/analog devices using one microcontroller. I did an initial test which I connected my serial LCD to one pin, and the serial port of the computer to the other serial port. It took me some time make the right connections and debugged the hardware, but it worked marvelously afterwards. Overall, I think this chip is amazing! Previously, I was trying to think of a way to connect three of my serial devices using one microcontroller. However, after using chip, this will become a default option for me. In fact, you guys can expect a tutorial on how to use the chip this Friday.