Blog Archive

Sunday, June 29, 2008

Tuning the tesla coil

I've completely constructed the tesla coil, and now I'm at the hardest stage of all, tuning it. To be honest, it's even harder than I thought. I succeeded in measuring the frequency of the primary and secondary coils. The primary seems to be around 700-800kHz, while the second around 1,1mHz. However, when I add a toroid-like dish or something to the secondary, it's frequency drops since I'm increasing the capacitance. The two frequencies almost match, but it still keeps giving me sparks of around 50kV, i.e. 5-6cm long. This is not how it's supposed to be... The coils are both very close to meet the same resonance, but there is still something that prevents the sparks from reaching long distances. One reason might be, that I'm using a fly-back transformer from an old TV. I'm using a 555 timer and power N-Mos transistor, to drive the transformer (there are more components, but they are irrelevant in this case, so I'm not going to mention them now). I also reduced the turns in the primary coil of the transformer and added a diode rectifier. So overall I get roughly 5kV, which is reasonable. Anyways, the spark gap is very well construced, I've made it, so that it can be easily adjusted with a screws. What I've noticed, is even if both of the 5nF, 6kV capacitors are connected in series, giving me a 2,5nF, 12kV capacitor, it still takes alot of time to fill up (judging from the slow frequency of the spark gap switching). I think thats also a reason, why my TC still gives me such weak sparks. One thing I might do, is increase the frequency of the flyback transformer, that will increase the current, therefore the capacitor will fill up more quickly. But then there's a chance that the transistor might blow (not that I didn't blow up 6-7 IRF730 transistors already, still wondering how this one is kept in one piece). Another reason for this awful appearence, might be that I'm using 28 gauge wire for the secondary coil (i.e. around 0.3mm). In the end I might be forced to rewind the secondary coil with thicker wire of around 27 gauge. Too many considerations, but I have alot of time, I'll do whatever is necessary for my TC to work. So, if you have any suggestions, share them with me, that may ease my work greatly :)

Monday, June 23, 2008

Back again

So I haven't posted anything for more than 3 months maybe, again because of the things I had to do at home, at school, etc. But now that I have finished this year of painful and boring studying in my ... well lets just say that my school is shitty, I'm free to start on my projects again. Really, the worst part was, that I couldn't concentrate alot on my projects, although I surely did some neat things, like a PC remote control (well not controlling anything yet tbh), some mind boggling game, I even made a primitive oscilloscope. I'm desperately trying to learn how the USB works, so I'll pretty much concentrate on that during the vacation. But just to get a nice "kickstart" on things, I decided to make something fun and not that useful or complex. A Tesla Coil - a device I always wanted to posses since I first started playing Red Alert 1. Classics never die ;) I'm still playing that shit. So I spent 2 days to find the proper materials. I found a nice plastic tube 12" high, 2" wide, just the right size of around 750-900 turns of 28 gauge copper wire for the secondary coil, and 15 gauge for the primary, 10-12 turns with 4" diameter. I also found 3 ceramic 5nF 6kV capacitors which I'll connect in series for a maximum of 18kV rating. I also found two 4kV microwave oven HV transformers. Now... all I need is to setup the coil, tune it and in the end I'll make myself a nice HV lightning show. Oooh can't wait, if you have any suggestions about the tuning, please post them here, would really appreciate it! ;)

Thursday, March 13, 2008

Having fun with PWM

In the passion to learn how to handle and use USB, so that my PIC tiny computer can communicate in a more modern way with laptops, PCs, etc, I decided to make one dedicated board for the PIC18F4550 just for that purpose. I had some problems with the board at the start, but at the end all went well. After all, this is just a strip board. Then, I started thinking, that it would be pretty boring to make a whole board, just for a PIC and a PC can "chat" together. So I decided to add it some peripherals, and I chose LEDs at the start. But I wanted to control their light intensity, and I thought that PWM is the best way to do it. Since I didn't want to create individual software PWM for each of the pins, I decided to use the built in CCP2 module of the PIC, to control a 4x4 LED matrix. Here's the schematic below. I don't have any specific code for this, since I was only experimenting, but I can tell you the configurations. I used a CPU clock of 48 Mhz (12Mhz crystal resonator input, divided by 3 and multiplied by PLL to get 96 Mhz , then divided by 2 so we can have 48 mhz for USB and the MCU). The PWM ran at ~11,7 kHz with maximum resolution of 10bits(PR2 is set to 0xff) and timer 2 has a 1/4 prescaler(T2CON is set to 0x5). The matrix is controlled by PORTD bits RD<0:3>(the rows) and the coloumns are controlled by the decoder, which is controlled by pins RC2,RC6 and RC7. RC2 is the multiplexed CCP1 output, i.e. the PWM signal is used to turn the decoder on/off, thus controlling the intensity of the entire LED matrix, while RC<6:7> are the decoded signals of the microcontroller. It's a pretty neat idea in my opinion and saves me time to develop software PWM which is both hard to make and inaccurate. So I messed up with this for a while, until I got bored and decided to make something different. Then I thought of motor control. The 18F4550 has built in another CCP module with enhanced PWM(CCP1). That is, it can control a full H-bridge, or a brushed DC motor in both directions in that matter... However I got tired of controlling just one motor, and since there is only one H-bridge controller in this pic, I decided to apply, another really neat trick of mine. Since I got one more decoder of the 74HC139 circuit, I added another bridge and controlled it with it. Here's the schematic. As you can see, the decoder controls the P-MOS transistors, so if we look at a truth table, while RD4 is low, motor 2 won't spin regardless of the signals applied to the gates of Q6 and Q8(the PWMs), since Q2 and Q4 are "closed", and vice versa, if RD4 is high. A closer look, shows that RD4 is not part of the built in enhanced CCP1 module, it's an option I added to select the motors. RD6 or P1C of the PWM circuit, is low when the module is in forward mode(bit 7 of CCP1CON is 0), or only Q1 or Q2(with respect to the state of RD4) are "open" thus allow current to flow through the motor and spin it(while RD7 or P1D is the "forward" PWM signal). Same thing happens, when the MSB of CCP1CON is 1(reverse mode), but then Q1 or Q2 are closed and Q3 or Q4 are open and RD5 or P1B is the active PWM signal. So, what we get is, that with RD4 select the motor, and with CCP1CON[7] we control the direction and with PWM we control the speed. This interface however lacks 2 things. First it's very hard to control both motors at once at different speeds (or even at the same speeds), the second thing is, that originally full bridge PWM uses 4 pins(RC1/P1A,RD<5:7>) and my design excludes RC1. And while the module functions, this pin is useless. If you want to learn more about the enhanced PWM, and bidirection motor control, read here.

Tuesday, February 26, 2008

Nano technology + electronics = nanotronics

First of all I wish to say hello to everyone! This is my first post here this 2008. I got some problems I needed to take care of(study, family, education), which restricted me from my freedom. But now it's all gone, and I would love to revive and refresh my beloved blog with this EXTRODINARY innovation from the NOKIA and Cambridge University collaboration. They presented one device named "Morph" which made my skin turn pale and my hair went white! You can watch and read about it here... http://www.allaboutsymbian.com/news/item/6840_Nokia_and_Cambridge_Univiversi.php
From what I understand, this device contains more transistors than a hall full of super computers, I mean seriously 10k transistors per a fly's hair, which is a lot smaller than a human hair! Pretending that a fly has 100(I may be inaccurate here, because I don't know anything about flies) hairs, that makes 100*10k transistors just for the hairs of the fly. Considering that the hairs are at least 2% (again, I don't know this exactly, I'm just using my imagination) of a fly's body , a whole fly can have 49*100*10k transistors. Now imagine that a today's processor in an everyday PC, can contain 20~30 flies. That makes 20~30*49*100*10k transistors! And not only that, these transistors are stretching and transparent... This made me think back into the past, when electronic engineers could only dream of such sizes and possibilities! The time of the radio lamp, which I'm sure are still used, I even keep some(gift from my grandfather). I hope this reminds everyone how fast technology grows, and how with every year, our world 'distorts' rapidly. I mean, what could be next, tiny little nanobots with advanced AI, capable of altering cells of humans and animals with rapid speed and preciseness, or that which can repair and regenerate these cells, granting humans the ability to live for a very long time? Or perhaps easy to use terminals and computers in every house, running with great speeds, and large memory storage sizes? So many possibilities and ideas! That's one hell of a journey, but are we prepared to take it? I say, let's fasten our seat belts and GO GO GO! The future awaits us!
**********************************************************
On a side note, I too make some innovations on my own, if you can even call them that! My tiny embedded computer starts to take shape. I replaced the controller from 18f452 to 18f4550. That means, that it can now support Full Speed USB(technically it doesn't yet have the ability to connect to the PC, I still need to learn how to make PC applications that can communicate with the PIC). This change increased the previous frequency of the computer from 40Mhz to 48Mhz. I also added a 32-bit SPI I/O expander (4xMCP23S08 cascaded together), switched to C (I believe the C compilers became intelligent enough to handle this type of microcontroller, although I'll still stick to assembly for certain subroutines, closely related to the "inner core" of the computer) and reshaped the strip board, which now is much smaller, and the wiring is not loosely positioned, with minimal risk of the wires touching each other near the pads, one knows what happens when it happens! ;) I plan to make a PCB for my computer, thus increasing possibilities (adding more ram, flash, I/O expanders, etc.). What I also would like to make my computer do, is use a PC application as a virtual color LCD. That will really easy my development of the PIC PC. As for the AT keyboard, I think I'll remove it and add a different type. I'll post some pictures later, to see my progress! Comments, would greatly be appreciated!

Friday, December 14, 2007

Great ideas can sometimes get you really bored

Yeah, for these 16 years that I've been living, I entirely came to the conclusion that projects like "A Multifunctional Calculator" can get more and more boring, the deeper you dig into them. So in order not to give up on this, I decided to give my calculator idea a little break. Just until my muse visits me again. I took the liberty to redesign my calculator though. I removed the square root function, because the algorithm I used was not in it's "fully optimized" state and could only calculate integer values. I also added a better string support and LCD control. It still uses a similar design like the one Myke Predko suggested, with the only difference that it now can be "auto-cleared", as you'll see in the code and schematic I supplied here for you. Anyways, I decided to begin working on my notebook/tablet thingy (The Pic Based Computer). It looks really gorgeous now that it has a PC/AT keyboard connected to it, external ram and rs232 and all fully functional on a PIC18F452. Now I can concentrate on making the inner core of the notebook. But first... I've been reading so much stuff about LED matrices, so I couldn't resist to make one on my own. Just a little fun before going for "Da Big Stuff". The fun will consist of a Win32 GUI program telling the PIC which LEDs to light up and even send entire patterns, which will be stored in a EEPROM (4k), so when the PIC receives a "start" command from the PC(or a button is pushed), it'll start following this pattern to light up the LEDs. This can also be considered a training exercise since:
1. Will be writing/read from an EEPROM (I2C fun)
2. RS232... just training
3. Visual C++ coding and stuff
4. I'll control the matrix using the same 74HC164 serial register I used in the new design of the calculator.
Well, I'll be waisting no more time, gotta get to work :D Oh, and here's the code (http://docs.google.com/View?docID=ddhwppvg_19cvhqhtff&revision=_latest) and the schematic of the calculator so far.

Monday, November 19, 2007

A friend of mine got an iPhone

Yeah, it came like lightning in clear sky. Not that I'm jealous or something. No, I'm not! Especially when I saw the size of that thing! I mean seriously, this can NOT be called an "iPhone". Sure it's thin, surely it has a nice color touch screen and surely he's taking the eye of the whole crowd! I mean come on, it's not that big deal! He's had it for 4 days, and the touch screen already turned in one smudgy, dirty, covered with fat, piece of ugly art. Of course I cannot ignore that fact that hes incompetent, but I'm pretty sure that if I had one of these, the LCD would turn into the same thing, 20 days after I acquire it (20 because most of the times it'll remain in my pocket, unlike the other school mates who always play their silly games or listen to crappy music on their cell phones, which I'm forced to listen to). Still, I was talking about the size, it covers his hole ear and is 2/5 of his head size. That's unacceptable. They talk of simplicity and comfort. I don't see any comfort in that, do you? It's all about this stupid touch screen, that's the big deal, everything else is the same old technology used on every other newer digital phone! Well let me tell you, that touchscreen technology is now on my granny's computer! So it's NOT something that's discovered just now. It's all about controlling the LCD and giving it the ability to use powerful software, which Apple clearly have mastered, for that I give them my applause. Everything other than that, is already old. So it's not that hell of an invention. I'm sure they can do something better than that. Everything else is nothing... air... Share your thoughts with me.
P.S. Here's a video of a dude, who made a touch screen control system with a PIC18F452 microcontroller, to prove that even you can make yourself a touchscreen application.

Sunday, November 4, 2007

Happiest Week I Ever Had



This week was, as the title states, the best week I ever had since turning 16. Here are the key things that made it so:

1. I finished my first board which is from tomorrow going to get manufactured. It's a board designed for a device I made 2 months ago... It's a safe protection system and simply sends a signal when any "destructive" force is applied to a safe. I use a microphone to detect such interferences and calculate the frequency using a pic12f629 microcontroller and a lm324 op. amplifier. I ran a lot of tests on this thing, but my mentor encouraged me to try it out on real safes and so I decided to make the board.
2. I finished the outline of my new "Notebook" Pic Based Computer (PBC). It now has a keyboard connected to it, rs232 protocol interface(mainly for testing) and 2 32k*8 rams. And now I can continue with my work on the calculator. By the way, I got the pictures I so promised for both the calculator and the Notebook as you can see here on the left(the first one is the calculator, the second one is the PC).
3. I found a dusty old computer. It didn't work but there are parts in it that seemingly remained unharmed. The processor (IBM 6x86 MX 166 PR), the hard drive, 2 Ram sticks and a Trio64V2/DX video card. After I got consulted at Aaron's Homepage, I decided to keep the ram sticks, the hard drive and the card for spare, while the processor - just as a lucky charm! I'm so excited, what about you?