PocketMagic

May 9, 2009

Ultraviolet Light

Filed under: Hardware, High Voltage, Optics — Tags: , , , , — radumotisan @ 8:51 pm

“Ultraviolet (UV) light is electromagnetic radiation with a wavelength shorter than that of visible light, but longer than x-rays, in the range 10 nm to 400 nm, and energies from 3 eV to 124 eV. It is so named because the spectrum consists of electromagnetic waves with frequencies higher than those that humans identify as the color violet.” Source.

There are several ways of subdividing the UV electromagnetic spectrum. Most common is:

Name Short Wavelength Photon energy
Ultraviolet A, long wave, or black light UVA 400 nm–320 nm 3.10–3.94 eV
Ultraviolet B or medium wave UVB 320 nm–280 nm 3.94–4.43 eV
Ultraviolet C, short wave, or germicidal UVC 280 nm–100 nm 4.43–12.4 eV

There are several ways of producing UV light, that include natural sources (Eg. the Sun) or artificial sources (UV bulbs, UV tubes, N2 Lasers, etc).

I have tested two UV Light tubes: a black light UV tube, and a germicidal UV tube. There two correspond to UVA and UVC spectrum.

UVA
The wavelength is in the range of 400 nm and 320 nm. I have a 6W “blacklight tube”. Looking at powered tube you barely see anything, but putting a piece of white paper shows powerful fluorescence. The second picture below shows this phenomenon:

The reason for this is that my UVA tube emits long wave UV radiation and very little visible light.
In the third picture, the glass ball is an uranium doped glass. It shows greenish fluorescence when exposed to UV. See an article on this topic, here.

This type of tube looks black when non energized, as the deep-bluish-purple glass called Wood’s glass, is a nickel-oxide–doped glass, which blocks almost all visible light above 400 nanometers.
Unlike the other UV subdivisions with shorter wavelength, the UVA emits lower energy radiation, that doesn’t cause sunburns or skin cancer. Instead, UVA is capable of causing damage to collagen fibers and destroying vitamin A in skin.

UVC
I got these tubes at a fair price on Ebay. They were manufactured to be used in germicidal applications. Most of the light they produce is in the 280 nm–100 nm spectrum. The sun is a natural source for UVC radiation. Some of the UVB and UVC radiation is responsible for the generation of the ozone layer. After running my UVC tubes for a while, ozone smell could be detected in the air surrounding the tube.

In this video you can see that if the magnetic field moves, the plasma moves in such a way that magnetic field lines cannot slide across the plasma.

UVC rays are the highest energy, most dangerous type of ultraviolet light. Unshielded exposure of the skin or eyes to UVC light sources is quite dangerous. It can produce DNA damage that leads to skin cancer, since it penetrates the skin, so protection is required.

Power source
Solution 1:
To power these tubes you need a high voltage source. A simple solution is to use an inverter. You can also build one, using a power transistor (2n3055) and a flyback transformer ferrite core:

The resistors need to be at least 5W, and the transistor can be a 2n3055.
The primary consists of 30 turns, for the feedback you’ll need 15turns and 250 turns of secondary, all concentric. You might need to be able to swap feedback (or primary) connections in case of wrong phase polarity.

Solution 2:
Another way of building the power source is without a feedback coil, but instead a 555 timer to trigger the power transistor. Here are the schematics:

Instead of the MPSA42 / MPSA92, you can use any other generic PNP/NPN pair of 0.5A minimum current.
The Mosftet (IRF540) will be needing a heatsink. You can use a different power mosfter or a power BJT transistor instead (eg. 2n2055).
The secondary can be winded manually or you can use a flyback secondary.
The advantage of this circuit is that you can adjust the frequency using the pot.

The next few days, I’ll be publishing an article on various high voltage sources, so we’ll see more on these later.

Radu Motisan

May 5, 2009

Homemade Flyback secondary

Filed under: Hardware, High Voltage — Tags: , , , — radumotisan @ 5:50 pm

While the Flyback transformers can be salvaged from old/damaged TVs, they prove to be rare components, and finding a quality Flyback secondary is often a great challenge.

On the other hand, a good Flyback secondary can get easily destroyed , it the voltage level inside gets too high (the insulation is punctured internally).

This is why I’ve decided to build one with proper insulation from scratch, since the whole thing is merely a multi-layer coil. Using 0.2mm CuEm wire and a PVC pipe for supporting the coil, I’ve created a 2500 turns flyback. The winding was deployed on multiple layer, insulated with PVC tape.

This video shows a test run with this flyback secondary. Bottom line, I encourage you to try making your own Flybacks, since it’s quite easy. More on the ZVS driver here.

Radu Motisan

April 2, 2009

Tesla Coil #3

Filed under: Hardware, High Voltage — Tags: , , , — radumotisan @ 12:07 pm

Since most of the things I build are modular, and often get disassembled to use parts in other projects, I decided to make an exception for my ZVS Tesla Coil and leave it in a form easy to plug and play.

I already had the ZVS module, a good flyback transformer with built in HV diode, and lots of HV cables. Time to put everything together in a final form.

A light bulb “powered” by my Tesla coil

To my previous design I’ve added a second deck, to contain the power source (ZVS+flyback), the capacitor bank and the spark gap.

The tesla transformer has a secondary of 1500 windings (Cu 0.2 mm on a PVC pipe diameter 5cm/length 30cm), and a primary with 16 windings (Cu 4mm on PVC pipe diameter 11 cm/ length 10cm):

The primary has several plugs, used to make the primary and the secondary resonant at the same frequency.

The rest of the setup:

Photo 1:The small PVC pipe contains the capacitor bank (9x10nF/6KV, connected for 10nF/18KV), and a small filter.
I’ve used a ceramic bulb socket to contain a static spark gap and limit the noise. It also has a lid, not shown in the photo
To the right you can see the ZVS module.
Photo 2: the ZVS Heatsink, and the power-in/ground connector. It might be a bad idea to have the ground so close to the low voltage connector. I’ll need to check that.
Photo 3: the flyback transformer, and the rewound primary (blue wire 4+4 windings). When powered by the ZVS driver at 30V the sparks start at 1.5cm and can be stretched to almost 4cm. Quite powerful.
Photo 4: front view, the flyback , a small filter connected on the ‘cold’ wire (black) and the capacitor bank again.

The complete schematics:

This setup needs further improvements, so I’ll update this post soon.

Radu Motisan

March 22, 2009

Robo Evolution – how to build a better robot

Filed under: Electronics, Hardware, Research, Software — Tags: , , — radumotisan @ 3:51 pm

This topic will try to sum up my work related to robotics, and provide as much pictures an videos as possible for those of you interested in this subject.

Perseus 1, 2005-06-29
General:I’ve worked on this one for about 2 months, with lots of interruptions and having only little continuous work time.
It was my university graduation project and major research work was on artificial vision.
Platform: modified RC truck, with servo controlled direction on front wheels, and geared (weak) motor on back wheels for propulsion.
Hardware: video camera, powered on 2 AA batteries, 2.6GHz video transceiver powered on 8xAA batteries, original car 35MHz RC control board connected to car’s motors running on 4xAA batteries, remote PC running custom image processing software, that I’ve created at that time.
Block Schematics:

Functionality:
The performance was very good, the robot being capable of recognizing and following a laser spot projected in front of it (in the camera’s view port).
Here are a few pictures of the robot vision itself:

Pictures

Resources:
Front cover of my license work: cover.pdf
Snapshot of desktop application:

Perseus 2, 2007-12-04
General: in an attempt of continuing the perseus 1 project, the first improvement I’ve tried was to eliminate the need for a remote computer
Platform:
modified RC truck, with servo controlled direction on front wheels, and geared (weak) motor on back wheels for propulsion.
Hardware:
Mini ITX D201GLY2 motherboard with 1.3GHz Celeron CPU, 512MB RAM, IDE2CF and CF2SDCard adaptors for a 2GB SDCard based DOC (disk on chip), M2-ATX DC-DC PC power supply 160W, 4×8 AA rechargeable batteries connected for 10.4V @ 10.4Ah .
Block Schematics:

Functionality:
This design was a failure. The heavy batteries overloaded the motors, and the original H Bridge circuit transistors vaporized. The platform is too weak for the robot’s mass.
Additional problems: motherboard resets when motors are triggered since there is only one common power source. Some high capacitors or separate power sources would have solved this.
project was abandoned – seeking for a better platform.
Pictures

TwinMotion 1, 2009-03-01
General: Since I needed a stronger platform, but didn’t want to spend 300-400$ on commercial offers, I’ve built my own, strong, customizable robot platform FROM SCRATCH!
Platform: Big 28 cm diameter light wooden wheels, two geared (30rpm) strong motors , some metal pieces and screws. To fix the wheels on the motor-heads, I’ve created a custom bearing, out of some tick small diameter metal pipe.

Hardware: Robot “brain” under development, currently I’ve used it with my AtMega8 H-Bridged board, available here.
Block Schematics: Not yet available.
Functionality: Not yet available.
Pictures and videos




This video shows the platform in action, controlled by a simple ATMega8 microcontroller brain, that was only giving simple movement commands : forward x cm, turn left, move backwards x cm, turn left/right, etc.

TwinMotion update #1, 2009-03-22
General: Wheels needed better adjustment on motor axis, and I’ve decided to add a third wheel for stability, since running on two wheel can make the fixed-body turn upside down – and would create problems when using various environment sensors.
Platform:
A third wheel has been added.
Hardware: Currently the experimental setup is running on the same Atmega8 board.
Pictures and videos
Here’s a demo showing this platform, you can easily see how powerful it is, considering the complete setup is ~2 Kg weight.

To be continued…
Radu Motisan

A simple H-Bridge design

Filed under: Electronics, Hardware — Tags: , , — radumotisan @ 1:23 pm

Normally I wouldn’t a topic about such a simple device, but since there are many sites offering wrong information (for eg. this one short circuits your power source), I had to do it.

An H-bridge is an electronic circuit which enables a voltage to be applied across a load in either direction. If you need to learn more, read here.

Now, assuming you know what a hbridge is, let’s choose a topology for our implementation. You already know we’ll be needing transistors or mosfets (if not, please read the docs above), what you might not know is that these transistors will have to handle a high enough currents, especially when the motors they control are overloaded.

Some time ago, I’ve build a robot on a RC-truck, the load was so high because of the heavy batteries, that when the motors got the command to move forward they overheated and died.

So it’s important to use heat sinks, to dissipate the heat. So, for a h-bridge we will be needing 4 transistors, working in pairs at a time. If we use 2xPNPs and 2xNPNs we can have common collectors, and so, using a single heatsink per pair. For the topology this is the only requirement I will impose, and here is one possibility:

You will need to place the left side MJE2955 and MJE3055 on the same heatsink since they have common collectors. A separate heat sink for the right size transistors must be used.

These components support up to 10A current, so they will work well for small to medium motors.
Remember, a H-Bridge only controls 1 motor. So if you’ll need to driver the servo motor and also one main, propulsion motor you will need two separate h-bridges.

Here are some of the h-bridges I’ve created. On a board I usually create 2, since I mostly use 2 motored robots.

And here is a nice board having an ATMega8, a MAX232 for serial communication with a PC, and two h-bridges for controlling two big gear motors. Again I’ve used MJE2955/3055 pairs, but feel free to use any transistors/mosfets you have.

It runs well and it doesn’t heat up much. In case anyone needs further details on how this works, or other things like why we need the D1-D4 diodes, feel free to ask.

Also the R3,R4 resistors can be adjusted to suit your needs. For me, they are used to limit even further the current given by the microcontroller on the output control pins. Not really required in my case.

Radu Motisan

March 1, 2009

ATMega8 and DS18B20 (digital temperature sensor)

Filed under: Electronics, Hardware — Tags: , , , , , — radumotisan @ 1:29 pm

“The DS18B20 Digital Thermometer provides 9 to 12–bit centigrade temperature measurements and has an alarm function with nonvolatile user-programmable upper and lower trigger points. The DS18B20 communicates over a 1-Wire bus that by definition requires only one data line (and gound) for communication with a central microprocessor. It has an operating temperature range of –55°C to +125°C and is accurate to +-0.5°C over the range of –10°C to +85°C. In addition, the DS18B20 can derive power directly from the data line (“parasite power”), eliminating the need for an external power supply.” Read more about this sensor, here.

Since I had two DS18B20 sitting among my other electronic components, I’ve decided to hook one up to my ATMega8 test board and see if I manage to get some temperature readings. One wire to a microcontroller’s pin, and two other wires for 5V power.

Now we’re ready to go… well not quite, this is a digital sensor and first we need to understand the way it communicates.

I’ve also found some good resources online here. If the link doesn’t work for you, see the attached PDF.

Here’s my source code, to get you started right away:
atmega8_lcd_temp.zip

Bottom line, this sensor offer some impressive results, and works very well. It is a good addition to any microcontroller board for gathering some extra environment parameters, and all at the expense of a single PIN on the microchip.

Radu Motisan

February 13, 2009

ATmega8 and 2×16 HD44780 LCD

Filed under: Electronics, Hardware, Uncategorized — Tags: , , , — radumotisan @ 4:43 pm

Following my first article on the initial findings and results of my tests on the ATMega8, this article will show basic steps on how to connect a 2×16 characters LCD to the micro chip.

The reason for this is to have a way of debugging the microchip functionality, to output the results, the data and various other stuff. I can tell you this is a must have.

To use a minimum of I/O pins, I’ve decided to build a 4bit interface with the LCD. The hard part was to write the code, but finally after fixing several bugs and reading a lot of HD44780 documentation, I can say that I’ve completed a nice flexible code – meaning that you can easily configure the LCD pin connection.

The wiring diagram is below:

The code interface is also attached, not much to say about it here, since it’s full of technical details and bit-wise operations, but if anyone has questions feel free to use the comments form at the bottom.
To edit some parameters like frequency or PIN connections (you can change the I/O pins used by the LCD on the ATMega), have a look in lcd.h . Zip attached:
atmega8-lcd

Function lcd_string2 is very useful for outputting text, since it supports variable parameters similar to printf. So you can use it for outputting misc content: lcd_string2(“Hello World! %d\npocketmagic.net”,i);

Here are some pictures with my LCD running:

Next thing to do is to start connecting various sensors.

Radu Motisan

February 11, 2009

First steps with micro controllers (ATMega8)

Filed under: Electronics, Hardware — Tags: , , — radumotisan @ 5:33 pm
Purpose of this article:
1) to learn how to connect the Micro controller in a simple circuit and how to power it
2) to see how to create a simple programmer (a device to connect the micro controller to a PC for uploading software)
3) to present a simple software program in C that controls a series of LEDS
4) to show everything in action
Note: its my first time when I’m working with micro controllers. The info presented here might be inexact, but not incorrect, since I will stick to my findings and to the easy path for a beginner.
All that is presented below was the result of one day of reading, soldering, testing – a good score I would say.

Short Intro and Motivation
Since I’m a C++ developer for Embedded Devices, small processing units were always a strong point of interest for me. Furthermore, building a robot for my bachelor degree, a few years ago, required getting over serious hardware limitations related to power consumption and weight. So I’m still looking for a way to perfect my robot, and to extend its functionality, and the microcontrollers look like a very interesting approach, to say the least.

For a start, I had two micro controllers at hand: the popular ATMega8-16PU and the not-so-popular PIC24FJ64GA002. The first one I’ve bought on Ebay from a very good seller in Thailand:

For this article I will be targeting the ATMega8, since it gave me excellent results, thanks to available documentation. Can’t say the same about the PIC.

So let’s start:

Our first ATMega8 circuit
The ATMega8 is an excellent micro controller:

28 PINS (23 for Input/Output !!!)
8-Kbyte self-programming Flash Program Memory
1-Kbyte SRAM
512 Byte EEPROM
6 or 8 Channel 10-bit A/D-converter
Up to 16 MIPS throughput at 16 Mhz
2.7 – 5.5 Volt operation
Its datasheet is available here

I suggest you download the ATMega8 image to the left and print it, since you will need it often to consult the PIN layout when doing your circuit.

The Input/Output pins are important when it comes to how many devices you want to connect/control/use. To control a simple LED you will need to use 1 PIN (for output). To control a temperature sensor, you will need another PIN (for input).

To do a simple circuit and power the micro controller, first thing you need to know is that you need a stable 5V power source. The best way to achieve this is to use a regulator like the 7905/7805. This component has constant output regardless of the input current – in regards to some given boundaries, of course.
Here is the circuit. I suggest you use sockets for the ATMega8, to easily change your chip on your board.

By implementing the schematics above, you’ll have the microchip powered. But you’ll need to program it in order to have a useful result.

A parallel programmer for the ATMega 8
A programmer is a hardware interface that connects the micro controller to a PC.
On the PC you create a software program, that you can then upload to the ATMega8 using the programmer. It’s quite simple.

To make things easier, I’ll describe how you can create a parallel programmer, but this will work for you only if your computer has a parallel port since that’s where you need to connect it. If it doesn’t, you can purchase an USB2Parallel adapter or build an USB Programmer directly (you can use this)

For the parallel programmer you’ll need a LPT 25pin connector and 4×470 Ohm resistors. This is the way you need to make the connections for the BSD type parallel programmer:

Here’s how I’ve managed to set it up:

Writing the software
Let’s try something simple – like controlling a LED on/off.
For this, we need to attach the led to any of the ATMega8′s available I/O pins.
I’ll use Pin 28 named PC5. This pin is part of the PORTC set of 7 pins PC0 – PC6. Notice there are other sets of pins like PORTB (PB0-PB7) and PORTD (PD0-PD7).

So the wiring is like this:

Next you’ll need a C compiler for the ATMega8 and a software programmer that will upload the compiled code to the micro controller.
For the compiler I’ve used AVR Studio from ATmel. Download the 3 files below and install them in the given order (the avr studio itself and 2 additional service packs):
1 AVR Studio, version 4.13, build 528 (73.8mb)
2 AVR Studio 4.13 SP1 (build 557) (37mb)
3 AVR Studio 4.13 SP2 (build 571) (45mb)

For the uploader I’ve used AVRDude that comes with the WinAVR package:
WinAVR

As soon as you’ve installed everything, start AVR Studio. You’ll get a page like this:

Click on “New Project”, and select AVR GCC, then add a project name “TestLED” and select a location to store the new project’s files:

Click Next, and in this new page you can select “AVR Simulator” and to the right under Device, select ATMega8 as show below:

Simply press Finish, and you can start writing code:

First things we need to know:
#include
Will include this library in our project so we can access basic Input/Output functions and macros.

int main() is the entry point of our program, here is where the program execution starts.

So, first thing to do is to set the PORTC as output. For this we’ll use a special register named DDRC:
DDRC = 0×20;

why 0×20? Let’s have a look in binary:

PC6 PC5 PC4 PC3 PC2 PC1 PC0
0 1 0 0 0 0 0

Basically we set a value of 1 to the position associated with our target pin.
To set all pins to output, the value would have been:
DDRC = 0x7F (in binary: 1111111)

To control other ports (B or D) you can use DDRB or DDRD in a similar way. At this point you should consult the micro controller’s datasheet available here.

Next thing to do is to turn the led on and off by code. We want this in an infinite loop, so here’s the approach:
DDRC = 0×20; //PC5 set to output
while (1) //forever
{
PORTC = 0×20; //set PC5 on . again computed in binary
delay_cycles(1000); //a short delay to keep led on
PORTC = 0; //all C Pins off
delay_cycles(1000); //a short delay to keep led off
}

An even better approach that doesn’t interfere with other PORTC pin’s settings would be:
DDRC |= 0×20;
while(1)
{
PORTC |= 0×20; //set 1 on first position, or simpler: PORTC = 0×20;
waitd();
PORTC &= 0x5F; //remove position 5 value, or simpler: PORTC = 0×0;
waitd();
}

You can download my code here:
testled.zip

After the code is ready, press Build in the menu. It will produce a .hex file, in this case testled.hex
Go to WinAVR folder, and enter the BIN subfolder. Copy testled.hex here and make sure your parallel programmer is connected.
Type in this command:
avrdude -p atmega8 -c bsd -U flash:w:testled.hex:i
If everything goes right, you will see a progress bar indicating the code upload to the micro controller:

As soon as the software is uploaded, the code will be automatically executed.
Sometimes you might need to disconnect your parallel programmer after the code has been uploaded!

Here’s my ATMega8 micro controller and several leds connected to multiple I/O pins:


Hope you find this useful. Thanks go to:
elforum.ro and the good people there
Society of Robots tutorials
CrazyTB’s blog

I’ve already built a very stable and flexible 4bit HD44780 LCD interface for the ATMega8, so stay tuned for the next article.

Radu Motisan

January 23, 2009

Tesla Coil #2

Filed under: Hardware, High Voltage, Uncategorized — Tags: , , — radumotisan @ 2:42 pm
My first results in building a Tesla Coil were encouraging, but running the whole system on a battery pack with a 555 driven flyback transformer was not the best I could get.
Still those of you interested in seeing my first steps in the Tesla Coils realm can have a look here

My second attempt and the subject of this article, came with a change in the power source.
As advised by Teslina I tried to use a ZVS driven flyback with builtin rectifier to power the tesla coil.

So I’ve built a new ZVS driver soldering the components above a heatsink. I’ve used 2xIRFP460 mosfets, 2xBYV26E as fast diodes, 2 15V Zenners and a 50coil iron-core inductor.

For the flyback, first I’ve tried a twin setup, by using two monitor flybacks, both with built-in rectifiers.
The primary must be shared, and the two secondaries connected in series for summed voltage output:

Luckily I’ve found a better flyback that did the job of the two, so I dropped the design above. Still it’s useful when you want to get a bit more voltage and you only have small monitor flybacks.

I’ve used the half wave rectified output to charge a bank of capacitors, summing 6nF 18KV. Here’s the simple Tesla Coil schematics for rectified current:

And here are a few pics and vids showing the Tesla Coil in action:

Radu Motisan

January 22, 2009

My first TEA Nitrogen laser

Filed under: Hardware, High Voltage, Uncategorized — Tags: , , , — radumotisan @ 3:30 pm
Well known for high voltage enthusiasts is the nitrogen laser, that uses a high voltage source and the nitrogen in the air.

What’s more difficult about it, is to arrange two electrodes to be perfectly parallel for an homogeneous discharge between then. Luckily while building my own, I came up with an idea that most of you will find useful.

First I need to say that I won’t be using aluminum foils, but real capacitors.
So let’s assume the electrodes are 2 ruler shaped metal pieces.
You can drill 4 holes, that would form an imaginary rectangle, two holes in each of the metal plates.
Using a non-conductive material, you can create two bridges between the two electrodes. This way you will have a rectangle shape, were the electrodes are parallel:

The good thing is that you can always loose the screws, so the rectangle shape can be easily shifted to the right, to a parallelogram shape.
This way the electrodes will always stay parallel, but the distance between then can be adjusted.
You will need to put some metallic spacers between the wooden bridges and the electrodes or else you’ll have arcs in that spot, that will burn the wood. It happened to me (see the marks left of the wooden bridges).
So one electrode can be free to shift left/right, and the other can be fixed to a holding plate.
Here’s my setup:

For the power supply I’ve used my ZVS driven flyback with built-in half wave rectifier, and a few hv ceramic capacitors (2x 18KV 3nF). Some designs use homemade plate shaped capacitors made of aluminum foil, but I don’t recommend it.

Here’s the laser firing, but apparently not working correctly:

The spark gap makes a lot of noise, and very bright discharges, so it’s very important to wear safety UV glasses.
A few videos:

For those of you willing to try this, you might need this as well:

Hope you enjoyed this,
Radu Motisan

Older Posts »

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.