It's very similar to the flyback circuit I posted about before but on a much smaller and lower power scale. The transistor basically turns on and off as fast as it can and energy is passed into the primary winding of the RF transformer. The magnetic field in the primary winding is coupled into the secondary winding and this causes a very large voltage to be induced. This voltage can be used to cause compact fluorescent light bulbs to glow - it's quite visually impressive. The amount of RF field this circuit gives off will be high so don't use it near any sensitive equipment. It may well affect LCD monitors causing them to flicker.

I did try and perform a simulation of the circuit but it didn't work as well as I would like so I'm not going to discuss it. Getting simulators to model magnetic coupling well is difficult!

The transformer is actually a fancy pair of windings on a straight ferrite rod. The ferrite rods are available from old FM radio receivers and switch-mode power supplies. The original article shows how to find them and wind them.

Because it's me and I couldn't find any strip board, I made a small PCB. Here is the layout:

MicroTesla PCB Top layer with Components

MicroTesla PCB Bottom Layer

Here are some renders of the populated PCB...just showing off the 3D capabilities of the EagleUP ULP!

Isographic image of populated PCB

Top view of populated PCB

The hardest part of realising this circuit is winding the transformer. Wrapping 270 turns or more around ferrite core can be very tedious and hard to achieve. To make it easier for me I designed a 3D printed stand! Here is a render of the print from Sketchup:

MicroTesla Stand

Winding the coil is difficult and tedious...there is no real short cut or quick method unless you have a coil winder. I didn't....What I did was cover the ferrite rod in insulating tape and then apply double sided tape on top of the insulating tape. I then started winding...and winding....and winding until most of the ferrite rod was covered. I got the ferrite from an old FM radio and the really thin wire from an old relay coil that I had lying about - Raid the junk pile!

The components required are:

1x 22k 1/4W resistor

1x BC548C NPN transistor

1x 5mm LED (any colour)

3x 5mm Screw terminal connectors (optional

1x SPST or DPST slide switch

For the RF transformer

1x old relay (for the really thin enamel coated wire)

1x Ferrite rod (old FM radio or similar)

Double sided tape

Patience!

Here are some photos of the construction of the PCB:

Cleaned single side PCB ready for ironing on the design

layout reasonable successfully transferred!

Into the etch tank!

The etched and drilled PCB

Once I had the ferrite and secondary winding complete I connected the end of the secondary to a pin so that it could easily be inserted into the screw terminals - the relay wire is very thin and breaks easily, be careful.

Here is a short video of the circuit in operation.

The circuit works...I didn't really get it to light a compact fluorescent light bulb but it works fine on the LED with a coil of ten turns. It caused a CFL lightbulb to glow in one corner. It isn't a circuit with practical uses apart from low power inductive charging and is similar to those used for mobile telephones. It is difficult to transfer energy wirelessly. The BC548 transistor gets incredible hot to the touch! I had fun building this circuit and playing with it but I doubt I'll make another!

Sunday, 21 December 2014

Just in time for Christmas I got a present from Numato Labs! They have sent me a Mimas V2 FPGA development board! *Really Huge Grin*

I thought the first thing I should do would be to write up a tutorial on how to get started using it. Here is a short video of me unboxing it!

For those who are not aware the Mimas V2 is an FPGA development board. It's basically a simple to use tool for people who would like to learn how to use an FPGA (Field Programmable Gate Array) device to complete complex engineering and programming tasks. FPGA devices are quite complex and the learning curve can be quite steep. A simple to use and program development board takes some of the load off.

The key points to note from the above list is that we don't need an expensive external programmer or complicated power supply, the board has lots of memory and plenty of ways to interface with the FPGA device!

In order to use the development board we will need to download a few bits and pieces from the Numato Website:

We will also need to download Xilinx Webpack ISE 14.7 and a licence file....and in order to that you will need to register with the Xilinx Website and then download the files as required. It isn't difficult but it might be confusing:

Once the software has downloaded you will need to install it. Extract it to a suitable folder on your hard disk and then navigate to the install file xsetup.exe. You will need to execute the setup and then let the software install. The installation program will prompt you to respond to where you would like to install the software and which features you require. Choose the default features (Webpack ISE) and continue. At the end of the installation you will be prompted to obtain a licence file - make sure that you enter a suitable email address to receive the licence file. You can't program the Mimas V2 without it!

Once the software is installed run the Xilinx ISE 14.7 project Navigator (choose 32 bit or 64 bit as appropriate to your operating system)

Once the Xilinx project navigator software has loaded we need to start a new project - Exciting times!

After that a new window will appear prompting you to select where on your hard disk you wish to store the project files and what you would like to name the project. Choose somewhere suitable to store the files and call the project something appropriate. Make sure you select HDL as the top level source - this means we will be typing in code to program the project, not drawing a schematic. Click 'Next' when ready:

The next screen prompts you to enter the specifications of the FPGA - Make sure your select the same settings as shown below, if you don't your project may not compile and may not work!

Click 'Next' to continue onto the project summary screen. Its a text file which confirms all of the information we just selected. Click 'Finish' to close the window and return to the main Xilinx project screen:

Don't be put off by all the menu items and toolbars. You will learn how to use them in time! What we need to do now is create a new source file. Right click on the box with the text 'Empty view' and add new source:

A new window will appear - select VHDL module and provide an appropriate file name:

Click 'Next' when you are ready to continue. For this tutorial we are going to keep things simple! Lets turn an LED on when we push an associated button. I've chosen to have two inputs and two outputs and given them appropriate names:

Click 'Next' when you are ready to continue. A summary screen giving the details we just selected will be provided.

Click 'Finish' and the source code template will be displayed in the main project window:

Any line which is in green and preceded by '--' is a comment. Any word in dark blue is a 'keyword' and any text in purple relates to a library or method. The Xilinx software has added a few comments relating to the source file. I tend to delete them as they aren't strictly necessary. Cut out the comments (optional) and paste in the code below:

The first three lines are comments about what the source code does. Lines 5 and 6 tell the Xilinx compiler to use the standard library and notation. Lines 8 to 13 tell the Xilinx compiler what inputs and outputs we want to use - two dip switches and two onboard LEDS. The actual function (behaviour) the dip switches and LEDS perform is set by lines 19 and and 20. LED1 is equal to the state that DIP switch 1 is at and the same for LED 2 and switch 2.

Now we need to tell the Xilinx compiler which pins are connected to what. To do that we need to create an implementation constraints file. Right click on the 'Hierachy box' and add a new source file.

Click 'Next' when you are ready to continue and a summary window will be displayed:

Click 'Finish' to return to the main project window where the ICF file will be open and blank! What we need to do is fill it. To that we need to know how the Mimas V2 board is connected up - How are the DIP switches and LEDS and for that matter any peripheral devices connected to the FPGA? The way to find out is to consult the manual and the schematic diagram. The schematic diagram of interest is on page 29 of the manual. The diagram is quite complex but if we look carefully we can see the bus connections of the DIP switches and LEDS:

We can choose to use any LED or any DIP switch we like. I'm going to use LED1 and LED8 for the outputs and DIP switch 1 and DIP switch 2 for the inputs just to be different! LED1 is connected to pin 'P15' and LED 8 is connected to pin 'T17'. The DIP switches are on pins 'C17' and 'C18'. From this information we can write the implementation constraints file. Numato labs have helpfully provided a sample one. All we need to do is modify it to suit our purposes. Here is the sample file:

Anything preceded by a # is a comment in an implementation constraints file and is ignored by the Xilinx Compiler.

The line NET "DPSwitch[0]" LOC = C17 | IOSTANDARD = LVCMOS33 | DRIVE = 8 | SLEW = FAST | PULLUP; means there is a dipswitch connected between pin C17 and 3.3V, The pin uses a fast slew rate and the internal pullup resistor is enabled. It's the same thing for DPSwitch[1]The line NET "LED[0]" LOC = P15 | IOSTANDARD = LVCMOS33 | DRIVE = 8 | SLEW = FAST ; means there is an LED connected between pin P15 and 3.3V, the pin uses a fast slew rate. It is the same for LED[7] What we need to do is change the 'NET' names to reflect the VHDL code we have already written. Copy and paste the code below into the Xilinx ICF code editor:

Once you are ready its time to save our work and to implement the top level - Click on the arrow on the left side of the screen:

If everything went as planned there should be green arrows present in the bottom left corner. Now it is time to generate the bit stream file. This is the binary file that is sent via the programming software to the FPGA to 'program' it. Right click on the 'Generate Programming File' option in the bottom left part of the screen and then select 'Process Properties':

A new window will appear. 'Check' Create Binary Configuration File and then click 'OK'

Now its time to actually generate the 'bit stream file'....right click on the Generate Programming File' option and select 'Run'...

Once that is complete we can close down Xilinx 14.7 and load up the Mimas V2 programming software. Navigate to where you downloaded the Mimas V2 files earlier - we are looking for the MimasV2Config.exe application. For ease of use I made a shortcut and 'pinned it' to the start menu:

Next we need to connect the MimasV2 development board to a suitable USB port and install the USB driver. I've done this already, if you haven't when you plug in the development board you will be prompted by windows to locate the driver file. It's in the numatoCDC folder. Once that's sorted we need to find out the COM port for the Mimas V2 board. Click on 'Devices and printers' from the start menu. If the driver and board have been correctly loaded it should be present in the unspecified section:

Double click on the ICON highlighted and a window will appear showing the COM Port number:

Make a note of the COM port number as we will need it to program the development board. Load up the MimasV2Config software and select the COM port:

Now click on the 'Open File' button and navigate to the project folder which contains the bit stream file we just created. It should have a .BIN extension:

Click the 'Open' button and then click the 'Program' button - Exciting times!

Once programming has completed (it took a good 30 seconds) all of the LEDS should be OFF except LED1 and LED8. When you change the state of DIP switches 1 and 2, LED1 and LED8 should go 'OFF'!

And when we change DIP1 and DIP2....nothing happens! I found that it was DIP7 and DIP 8 which cause the LEDS to go OFF.

This suggests there is something incorrect with the implementation constraints file and the schematic diagram! I suspect the connections have been reversed and DIP1 and DIP2 are connected to pins F17 and F18. I also noticed that the seven segment display is 'Ghosting' - it is slightly on when it should be....Lets fix that by modifying the VHDL code and lets modify the implementation constraints file to use the correct switches. Lets also reverse the logic so that when the switches are 'Off' the LEDS are 'Off' and when the switches are 'ON' the LEDS are 'ON'.

Here is the new VHDL code which needs pasting into the VHDL source file:

About Me

I'm an electronics engineer and uber geek from the UK. I live in the North West of England in Manchester. I mostly spend my time working in electronics and developing custom electronic solutions to problems as well as a few fun projects. I do a lot of development using microcontrollers - particularly using the arduino