Thursday, 6 September 2018

Inductance Meter

Quick Inductance Meter


I needed an inductance meter and had already spent my months spending money so I couldn't simply buy one.  I built one instead.

Luckily I had all the bits I would need to build the meter in the junk box.

Inductance Meter Circuit

The circuit is very simple.  Just an LC oscillator with a known tank capacitor.  The micro counts the oscillator frequency and works out the connected inductance.

The formulae for the resonant frequency of the parallel LC tank is..

f = 1 / (2 * Pi * sqrt( L * C )) 

Rearranged for L is...

L = 1 / (4 * Pi * Pi) * C * ( f * f )

The circuit was cobbled together on a bit of board...

Inductance Meter Circuit

And a window, for the display, CNC'd into a plastic box.




Whoops, n00b, lol.
Clamp, clamp.
Then Clamp some more...


Fixed, nice label :)











I was stressing about powering the thing off a 1.5V battery, but I had a 9V battery and the case takes a 9V battery so I used an XC6202 3V linear regulator to power it.

I added a power button which briefly powers up the device, does a reading and then switches its self off after 10 seconds.

The circuit as built looks like this...

Schematic

Source code and hex file are available here
The meter measures from 1uH to 10mH.

And a quick video showing the operation.



Making that video put me over the budget for this quick project, I had to buy a holder for my camera.


Friday, 13 July 2018

Pressure activated speed controll

Controlling drill speed with pressure

I have a small hand held drill similar to a Dremel.


I need a way of controlling the speed of the drill while I am using it.

I thought some sort of pressure sensor mounted on the drill would allow me to vary the drill speed without needing an external speed controller.

To achieve this I used a piece of silicone pipe mounted on the drill which leads back to a pressure sensor, connected to a PWM power controller.

The pressure reading is taken by the PIC10F320 and converted to a PWM signal, which is connected to a MOSFET, which drives the drill.



Component choice is down to what I had to hand at the time.
Schematic



Wednesday, 28 March 2018

Wired Home Automation

After mucking around with the idea of wireless nodes around the house controlling various things, I dumped the idea and instead ran an RS485 network around the house.

So far I have two temperature and humidity nodes...


The hardware and software are really simple compared to any wireless solution.  These two nodes are polled every now and then and the average temperature in the house is calculated.  This will eventually switch the central heating on and off.

The 'controller' is simply a PC connected to the RS485 network via a bit of hardware.  The hardware does the automatic switching of the RS485 transceiver between Rx & Tx.  There is also a current limited regulator to provide 8V at 200mA.  All this is piped round the house through CAT5 cable.

The PC software is written in JavaScript and executed with node.js.  The user interface is via a browser on any capable device on the IP network.

The two temperature / humidity nodes were installed quickly and I soon required more nodes.  Hand building prototypes is fine but when more units were needed I did a PCB using EasyEDA and ordered them from JLCPCB.  Two weeks later, PCB's arrived.


Nice.  The PCB's were good quality and its not really worth etching boards at home anymore unless you need a PCB within the next few hours!

The PCB contains the RS485 comms stuff and a 5V regulator.  'Functionality' such as the temperature sensors can be added in the 'prototype' area.

The boiler and front house lights require a relay switch to operate them.  Rather than having a relay eating into the power budget of the system I used relays with a coil rated at 12V and ran them at 8V.  The circuit below was used to boost the voltage to the coil at switch on, reducing the coil voltage once it had switched.

Voltage boost relay driver

This circuit provides a voltage pulse of just under twice its supply voltage to the coil.  It also provides a turn off delay, determined by the charging of C1.


Friday, 23 March 2018

Stepper motor speed controller (Tesla coil winder)

I have been wanting to build a tesla coil forever, winding the coil has always put me off.  I think its about time I built one.

I was going to build the coil winder using a drill powered by a 300W, 0 - 40V variable voltage supply.  I built the supply using a variac and large torroid transformer.  The supply worked and is nearly indestructable, then I remembered I had some huge stepper motors...

...so I used those instead.

At least I now have another power supply :)

The stepper motor is driven by a microcontroller (ATtiny2313) with coils driven by mosfet's (BUK9840).  The speed and direction of rotation is varied using a rotary encoder.  The micro spits out information on speed / direction / revolutions on its UART.  The UART connects to an LCD.
The motor coils are rated for 3 volts.  To trade off some torque for speed the motor coils are driven from a 12V supply via some resistors.  These get quite warm in use, the only ones I had with a large enough power dissipation were 25W aluminium resistors, so no trouble there.



I was going to use a shift register to drive the LCD from a couple of pins, but didn't have any.  I have lots of ATtiny2313's so I stuck one on a board with the LCD and used the UART to shift data to the display.  The LCD microcontroller has a 32 character buffer into which any characters received on the UART are stored.  Characters below an ASCII space reset the buffer index to zero.


Very simple, now I've written the code for that it will be useful for other stuff.

To turn the piece of pipe which will be the secondary's former, I made two 'centers' out of the only stuff I had, concrete.  I used two plastic funnels for a mold, which also held the aluminium shaft central while the concrete went off.


Here, the bottom funnel is full of concrete and its stuffed into a bucket of sand while it sets.

The finished winder with first coil secondary.  The two blue concrete 'centres' are holding the piece of plastic pipe.


This only took about 15 minutes to wind, I was expecting to spend at least an hour on it.

Monday, 24 October 2016

USB STK500 AVR Programmer

So, I had one of these AVRISPMk2's for programming AVR's

AVRISPMk2

It was very good.. I was using Atmel Studio 6.  For some reason I upgraded to Studio 7.  I then wasted an entire day messing with various drivers trying to get it working again.  I eventually got everything going again and connected the project I was working on to a 24V power supply, blowing the programmer completely.

I have a working PICkit3 and some PIC16F1455's, so I built a replacement programmer using these parts.  It pops up in windows as a com port and emulates an STK500.  No driver issues there.
The code is based upon a project found here AVR Programmer which I ported over to the PIC and added the necessary code to drive the USB.  As you can see from the below schematic, there isn't much in there.


I have done a PCB and ordered a few in EasyEDA.  The sourcecode can be downloaded here...
https://drive.google.com/open?id=0B0Dxv1kRlKo8MVJwU2tuczJkYmM


Picture of pcb

I can now program my AVR's again :) and if I blow the programmer up, its cheap enough to replace.

Wednesday, 6 July 2016

OWON PDS5022S fixin'

Found one of these.....

thrown out.  It was dead and is a basic scope, but it has a battery power option and would be good to have as a "disposable" 'scope.

Opening it up and checking the supply voltages around the PCB revealed nothing surprising.  Everything looked OK.  The processor on the main PCB is a BGA packaged part.  Taking a well educated guess I repowered the 'scope while pressing down on the processor, it worked :) so after applying foil around the chip and heating it with a hot air gun I had a working 'scope.

When I found the thing it was wet through which hadn't done the LiPo battery any good and it looked a bit 'puffy'.  I have plenty of NiMh cells lying around so I thought I would make up a battery pack from these to replace the LiPo battery.  First I checked the PSU to see what kind of provision had been made for charging the batteries....

The output stage of the PSU looks like this...


The battery is just connected across the output via the main switch.

The 'scope draws...
360mA, 8.4V, LCD Backlight.
380mA, 8.4V, Main board.
80mA, -8.4V, Main board.

After trying out a NiMh pack and realising it was stupid, I decided to dump the entire power supply and have the thing powered externally by a ready made 19 volt or so ( old laptop psu ) brick.  Clearing out the power supply left lots of space.  I can get lead acid batteries for free and there is room for a small one plus its charging psu plus all the other power stuff I am going to need.

While I'm modding this thing I might as well swap out that LCD backlight for an LED one, that will save 200mA !!!


This was easy to do :)

The replacement power supply is fed with 19V and provides 13.8V for charging the lead acid battery, this stage is followed by a further regulator which outputs +/-8.4V.
The backlight is powered from the 8.4V via two 47R paralleled resistors which gives it 20 to 30mA, which is plenty bright enough.

Oscilloscope PSU

Metal Forge / Induction heater

YouTube suggested I watch this video.. Grant Thompspn - "The King of Random"

Ooo, thats good I thought. I'll make one.  So I purchased some of the stuff to make this small charcoal fired forge, then remembered I was an electronics engineer and thought why am I not making an electric one?  I pondered this for a while and then thought why am I not building an induction heated forge.  So thats what I have started doing....

Induction heating involves inducing eddy currents in the work piece.  These currents are big, so the work piece heats up.

Wikipedia has the explanation here https://en.wikipedia.org/wiki/Induction_heating

The output stage of this heater will probably connect to rectified mains so I would like all the control electronics isolated from this.  I started with what I had 'in the drawer' to construct an oscillator and gate drive transformer driver.  The IR2153 is a self oscillating half bridge driver, so sounded ideal for what I was trying out.

IR2153 Half Bridge
The board is supplied with 24V for the half bridge, regulated down to 12V for the IR2153.  This provides a +/-12V square wave output to drive a gate drive transformer.

Out of curiosity I connected this...

...to the output of the driver via a 1uF Cap.  Using a 'scope I could tune the IR2153 to get the coil resonating.  This was able to heat my screwdriver up to above 100°C, I know this because my finger sizzled when I touched it.

From initial measurements on the above coil of wire I could tell the final coil would be conducting 100's of amps, so water cooling would be a good idea.  I got some 8mm copper tubing and found a paint tin to wrap it around.  I couldn't just wrap the tube around the tin, it would buckle at the first bend, so I perused the WWW and plenty of people suggested filling the tube with salt.  This I did and the tube bent very nicely...

...Getting that salt out was difficult and took ages, tap tap tap, rotate, tap tap tap, rotate, Zzzzz
I tried buzzing it out with a sander and all sorts.

I needed a smaller coil.  I wasn't going to use the salt method again.  Water doesn't compress, so I capped one end of tube with a compression fit stop end, filled the tube with water and capped the remaining end.  The tube requires a slight tweak to take up any air that got in, but after that the tube wrapped up into a coil nicely.  Getting the water out was easy, just release the compression fittings and empty the water out.  Using the compression fittings 'wastes' a couple of olives and some tube but saves a lot of time.

The coil gets hot without cooling, so I purchased a water CPU cooler from ebay.  It was 'untested', but after cleaning it out, removing pipework and re-piping it to the coil, it pumped water round no problem.

The pump and cooling fan required an extra 12V supply, the pump at 200mA and the fan at 1.5A.  I decided to under run the pump and fan at 10V and constructed a 2A buck regulator from a TL494 and associated components.

The heater as it was built was getting hard to work on so I put the lot into a metal enclosure..


I am planning on adding a 'wall' down the middle of the box to separate the electronics from the half that has water pumping round it, just in case :)

To test a theory about using Litz wire for the work coil I obtained some of these...

Polypropylene capacitor
1uF, 1500V Polypropylene capacitors.  Manufactured by ICW Ltd. I bolted three together to make 3uF...
Very nice.