Programmable Tesla Coil Interrupter and General Purpose Timer
6.05.11
While doing some x-ray experiments I suddenly found the
need for a remotely operated relay. That led to thinking of a way to
overengineer the problem, and I found I could solve several problems at
once by making a universal fiber optic system of sorts. The basic idea
I came up with is to have one module with all the needed hardware; LCD,
potentiometers, buttons and fiber optic output. This module could then
be programmed easily with different firmware depending on the needed
application. I've made three different firmware packages so far, a SSTC
interrupter, a DRSSTC interrupter and a timer for my x-ray experiments. I
imagine there are several other uses for such a module as well. The
USART TX pin has been connected to the fiber optic output, so using the
module to send serial commands over a fiber optic link should be a cake
walk.
A straight forward circuit with no frills, the real magic happens in the firmware.
For the ISP socket I used a 9-pin D-sub connector, this allows for
rapid reprogramming without even taking the back cover off. I built the
interrupter in a diecast aluminum project box, to prevent any possible issues with interference from Tesla coils.
5.07.22
I recently found myself in need of a fiber optic remote control and remembered this project. After reading up on it again, I realized having to flash different firmware based on the required function was pretty excessive, especially considering how much space the ATmega8a has. So I spent a few hours refactoring the code into a new C++ project, and created a system where different "programs" can be loaded at start-up, depending on the buttons held down during the first 2 seconds. In addition to the SSTC, DRSSTC, and general purpose timer, I added a new serial transmission mode. In this mode the unit will send it's current button and potentiometer state via a framed serial packet, at a constant interval.
When trying to program the AVR unit I sadly discovered my old STK500 + USB to serial combo no longer worked, giving a "Failed to set communication state while setting baudrate. Error 0x1f. stk500" error message. This seems to be a common problem, which I wasn't able to solve. However I had a USBasp lying around from 8 years ago, which I decided to try. Turns out it works! My new workflow for flashing AVRs is to use avrdude, combined with the USBasp. Once the command line arguments are set it's pretty easy to use.
I had to use zadig to set the USBasp driver to WinUSB, as it wasn't automatically recognized by Windows. My USBasp doesn't support custom SCK rates, which seems to be the case for most of the Chinese USBasp clones. This is only an issue if the target needs a lower SCK rate than 1MHz. Something to keep in mind.
The arguments I used for flashing and setting the fuse bits to low 0xED and high 0xD9:
I found the website AVR Fuse Calculator very useful for determining the fuse settings, or in my case decoding the existing fuse settings. Fuses can be read with:
The fiber optic modules I used are HFBR-14E4 and HFBR-24E6 which I was able
to acquire in a large quantity. They use regular SC-SC cable, at
pretty much any fiber diameter from what I gather, but thicker is
better. I use a 62.5um/125 fiber patch cord, multimode, simplex, which
only cost 7USD on eBay. So far I've tested these modules in two SSTCs.
The receiver worked just fine in my second PLL SSTC, but in my 4.096MHz
Class E coil there were problems with noise. The noise issues were
completely fixed by simply placing some tin foil over the receiver. So
if you use the receiver module in a diecast project box or similar,
noise will not be an issue.
Disclaimer:
I do not take responsibility for any injury, death, hurt ego, or other
forms of personal damage which may result from recreating these
experiments. Projects are merely presented as a source of inspiration,
and should only be conducted by responsible individuals, or under the
supervision of responsible individuals. It is your own life, so proceed
at your own risk! All projects are for noncommercial use only.