Archives 2011

Monday 28th November 2011 - 08:44:21


Went on a fixing mission this weekend. Rehung doors, fixed broken kids stuff (new wood leg for their little chair), re-mounted sunken light switches and all sorts of stuff. I removed the Roman rings from the kids swing set and added a new swing – so the wood working gear got a workout – poor little router hasn't had a good run for months. I used some cable pull rope to hold up the swing with eye splices at each end – although I had to go and look up the eye splice again because I messed it up initially... On Friday I borrowed a bench top LCR meter to measure the resistance and inductance of the armature and field windings of the VW generator which is going to be converted to a traction motor. Only problem was I didn't go and get the generator! Here is a screen dump of the motor control circuit graph:

Monday, 21st November 2011

Agree to what?!

I came across a very interesting prompt while trying to scan a hard drive... I'm still not sure what it's asking me...

Monday, 7th November 2011 - 08:49:43

Fedora Logo

During the weekend I upgraded Fedora on my laptop from Fedora 13 to Fedora 15 using the preupgrade utility. This initially took a lot of messing around. The main problem of capacity in the /boot partition was self-inflicted. When I created the partition layout for the system, I only allowed 100MB. This meant that there wasn't enough room to install the upgrade installer boot files to that partition.

Resizing the /boot partition, which was ext3, took a number of steps.

First, it was necessary to convert to ext2. All the utilities required can be found on Hiren's Boot CD by booting into small linux, knoppix would also be a good choice. First, tune2fs is used to convert from ext3 to ext2 by removing the jounal (-O ^has_journal). Once that is done, some space must be made to expand the boot partition. In my layout I removed the swap partition which is directly after to /boot. The friendliest way to do non-straight forward manipulation (i.e. resizing) of the partition table is with gparted. Start gparted and delete the swap partition, then resize the /boot partition to 250 meg. The next thing to do is resize the actual file system to occupy all of the partition. resize2fs is used to expand and shrink ext2 filesystems.

The other important thing I should mention: remove all your custom repos where possible i.e. Adobe et al. Otherwise preupgrade will go hunting for preupgrade packages at those repos (and fail).

Once all that was sorted, preupgrade was left to run overnight downloading about 2.6 gig of rpms.

In the morning I was presented with a reboot button. Once rebooted, the real work starts. Updating 2000 odd packages. This ran for most of the morning but once complete, it worked well with no major problems yet.

Saturday 29th October 2011 - 23:48:13

Reverser Relay

I managed to make it out to the lab for a bit today.

I added a relay to the kids electric ride on Jeep replacing on/off with forward/reverse. They never turn the damn thing off anyway! I bypassed the on/off switch and cabled it separately. Originally the on/off and "go" buttons were in series. The on/off now energizes a relay for reverse, when unpowered the NC position on the relay is forward. I used a simple DPST reverser configuration where the power enters the NC terminals then crosses over to the NO terminals creating a polarity switch. The motor is fed from the centre common terminals.

Also on the list - a white noise generator. After messing around a few nights ago and not getting anywhere, I tried another circuit. This time using BC548s and a 12V supply. One BC548 is reverse biased and the E-B junctions zener effect is used as a noise source. The base of the reverse biased BC548 is then fed into the base of another BC548 to be amplified and then coupled with a 10uF cap to another BC548 for further amplification. At one point while I was messing around it was receiving radio - probably from the audio amp section. The whole thing is on a bread board, so its not that protected from interferance.

Monday 17th October 2011 - 07:38:30


Owner finally decided to fix the sewer properly after 3 months. Yaaay

Saturday 15/10/2011


Unproductive Saturday. Watched the plumber try to jet blast the sewer most of the day as well as trying to help him with some bugs in his jetblast system. He just replaced the water tank in his truck and hadn't drilled a breather yet. The high pressure pump tried to turn the plastic drum inside out - and nearly did... We had to reprime the pump too because it was full of air.

Spent the rest of the day on the veranda with a beer watching the kids play (and giving hugs to stem crying / breaking up their fights =P )

Monday 3rd October 2011 - 18:45:31


Today I messed around with the "f88 and got the code working to push updates to the three multiplexed displays in parallel. The controller, once completed, will be fitted to my dummy load. One A2D will read the voltage on the 1R shunt giving me current, the other will measure the input voltage. During the update process, the pic multiplies these two and gives a third readout in watts. These three figures are then pushed out to three shift registered with linked clocks and latches. Three four digit displays with just 5 IO.

Saturday 1st October 2011 - 18:51:01


Today I worked on the door counter project. I was inspired by Dave Jones' EEVBlog #204 and decided to do some of the math (which I'm really not great at and should practice!) instead of just throwing a pot in and then measuring it after.

Because of the overhead in the encoder/decoder arrangement and wireless, a pulse of at least 250ms is required before the other end reacts. This took some messing around with the scope and poking with a bit of wire to work out. When the relay on the door laser clicks, the pulse is very short, maybe 20-30ms.

To stretch out the pulse I used the 555 timer in monostable mode. Pin 2 of the 555 is pulled high by a 10k resistor. The output (pin 3 of the 555) is tied via a resistor to the base of a transistor. The transistor, an NPN BC548, is sitting across the pushbutton on the transmitter with its collector on the +5v side. When a falling edge (high to low transition) is detected on pin 2 of the 555, pin3 goes high for a fixed length pulse (unless pin 2 is maintained low for longer than the pulse time). The pulse length can be calculated using t (time) = 1.1RC.

With a desired pulse time of 250ms we can work out the resistor and capacitor required. I chose 10uF to start with and worked out R from there.

Here is a scope grab. It worked out pretty close.

Saturday 1st October 2011 - 09:14:38


Grass! It's like the day of the Triffids here. I couldn't mow last weekend because it rained. I've been thinking more and more about a project to use servos. I think a small lawnmower engine PID with throttle on a servo would be cool which regulated the revs. Later, a full RC mower.

I've got to finish off the door counter (which I mentioned as finished in an earlier blog). The counter hardware it's self is finished, but I need to write software for the linux box and I also need to make TX/RX arrangement to send the door clicks to the counter. The original plan was to have the whole unit next to the door and run a long serial cable. I've sinced decided that we're going to use some 315MHz TX and RX modules from work which means I need to make an monostable oscillator to extend the pulses long enough to make it through the RX and TX modules - if they are too short, they don't register at all. I am thinking at least 100ms.

Sunday 11th September 2011 - 23:26:32


I have finished off the door counter for work. We will see how helpful it is. I might put in the serial link today so that I can link it into the server.

Now to write a python daemon to monitor the clicks on the serial port!

Sunday 28th August 2011 - 19:07:43


A weekend of plumbing and painting. Fun times.

Friday 26th August 2011 - 08:51:39


I am currently working on a door counter. I have based it on the 16f84A (I bought a tube of them years ago before I worked out they weren't really that great). In keeping with the ancient PIC, I found ancient schmitt trigger to debounce. The TP4304. Its stamped '78. I scored a bunch of old CMOS from a closing electronics store.

Sunday 21st August 2011 - 18:22:09


Got lots of work done on my 4 digit multiplexed display. The prototype is up and running with an ADC demo on the pic. It's running 100hz refresh rate with 5hz data refresh rate.

Tuesday 9th August 2011 - 18:02:42

Lots of TG Watchdogs ready to go!

I have had a request to prepare a TG watchdog for installation inside a PC. To do this I am using the router to supply it power (as normal) and I have prepared a ribbon cable to go straight into the mainboards COM IDC header - rather than piggybacking ouside to a D9 socket and back in.

I also had the idea to use the TG watchdog as a means of powering down the box it lives in. Because it is powered externally to the server it lives it, it could reset or power down the system. I have some stuff I bought from mouser - 2 way inline SIL sockets and plugs. I'll have to post photos and part numbers. You could make a wedge cable to short the power or reset pins on the mainboard while leaving the button function intact.

Wednesday 27th July 2011 - 07:52:47


I now have Hi-Tech C running under piklab. I'm glad that I tried it now.

After messing around for an evening or two with a stupid problem where bitwise OR assignments "|=" on PORTA and reading the value on PORTA fails, I decided that maybe SDCC was bugged. The OR would appear to work, but on closer inspection they actally zeroed the byte I was working on and only set the single bit that I was specifying. I installed MPLAB 8.73 with the Hi-Tech C compiler for 10/12/14/16 MCUs. There was trouble initially with wine as the picc.exe executable lived under "Program Files", So I moved the folder down to the home directory. This brought me a step closer as piklab verified the files exist - when it came to compile time piklab still tried to execute the linux executable rather than the .exe. I symlinked sdcc.exe to sdcc and libr.exe to libr and it now works fine.

Straight away I tried a compile (which failed) and then started the port from sdcc to picc. Once I had finished, the project built ok and I burned the hex to the pic (an 'f88). Lo and behold the same error occurred!

The code I used was originally an experiment with the adc which I wrote previously to try out SDCC. After combing the net I found a FAQ on the Hi-Tech website which described exactly my fault! I had a read of the FAQ and then checked out my code. Doh! I had remmed out the ANSEL declaration rather than implicitly setting it to 0. Facepalm.

Saturday 23rd July 2011 - 20:15:43


Last night I decided to try SDCC again. It works much nicer than the last time I tried it. It also managed to make it work correctly with Piklab.

I have the USART and basic stuff running on a breadboarded TG watchdog.

Thursday 7th July 2011 - 20:38:20


I am learning LTSpice and have finally worked out how to sweep a resistor value over time in an LTSpice simulation. I tried all sorts of stuff to make it work, but didn't think of this novel way of doing it. Drive the resistance by multiplying the total resistance by a 0-1v sweep (and add say 0.001 so LTSpice doesn't cry). Unfortunately I can't take credit for this idea myself - it came after lots of googling and forum trolling. I've incorporated this sweep into my new constant current load simulation. This sweep starts after a delay of 2s.

The first part of the simulation (first 2s) concentrates on the low battery indicator. The vbattery voltage sweeps from 12v up to 24v over 2s so that we can see the battery voltage cross the low battery set threshold and the vlowled indicator fall.

In the top plot area you can see the traces for the battery after the resistor divider (vlowsens), the low battery threshold voltage set with a zener diode (vlowset), the output from the opamp to drive the low battery LED (vlowled) and the +15v output from the LT1121.

In the middle plot we can see the amount of current being sourced and by multiplying the voltage on the high side of R1 by the current on R1, we can see the power in watts.

The bottom plot area shows the linear response of the pot simulating the rotation of the dial for its full range over 10 seconds. It crosses over in the middle where the wiper is at exactly 50%.

There are also a few more notes and photos in the gallery.

Friday 17th June 2011 - 13:08:01


Off sick today.

Watching some Red Dwarf on DVD. Best quote ever: at 7:25

KRYTEN: Computing time to impact... calculations coming through - here they come.

LISTER: How long have we got?

KRYTEN: About the time it takes to read a stop sign, sir.

Sunday 19th June 2011 - 14:36:23


I have just finished removing the old clothes line which the tree loppers destroyed. Unfortunately it was an original hills hoist. The centre aluminium casting is smashed. The clothes line is incredibly over-engineered. 50mm main tube, 5mm wall thickness! The stringers that hold the arms up are 1/4" solid steel bar. The concrete block the base is set in presented a big problem. The slab is approx 400mm wide and 500mm deep. I actually bent the box trolley transporting the thing.

To get the slab out I had to use a combination of leverage (framing pine - I bent a star picket using that), back-filling and a really big hammer.

First I dug around the edges about 200mm (one shovel width) on two sides after realising how huge the slab was. I dug under one corner and then sheared the corner off with a few solid hits of the hammer. The slab was unaffected by the hammer when it was encased in earth. Next I had to tip the slab over into the hole because there was no hope of moving it until I got rid of the "suction" effect the wet ground had on the slab. To raise it out of the ground I used leverage and back-filling. Once near ground level I was able to push it up and over the edge using two pieces of framing pine as levers.

Suprisingly the new clothes line only has a plastic insert to set into the slab. The insert is just 340mm deep!

Sunday 12th June 2011 - 21:07:51


I have successfully revived the new laptop. Unfortunately, the spare lid and panel I received (for a different model) has a different mounting system, a straight panel/inverter swap was out of the question. Where the original panel is more inset to the lid with the mounting tabs on the glass side with standoffs extending from the back of the lid, the the new panel is flat on the rear of the lid with mounting tabs on the backlight side.

After assessment and a bit of testing I decided to fit the whole spare back lid to the laptop. Some modification was required. I had to modify the hinge mounting plates to fit the hole arrangement in the laptop and remove some of the plastic molding in places.

The machine was left running with a small stick of RAM running memtest with the screen on. Later in the day I returned and found it had passed successfully several times. I then removed the harddrive and RAM from my old laptop and fitted it to the new laptop.

If I had been running Windows on the original laptop, this probably would have posed a problem, thankfully I have Fedora 13 on it. The old laptop is intel based, the new AMD based. All that was required initially was to switch xorg over to the VESA driver temporarily until the machine came up on the new laptop and had the propriety ATI binary drivers installed. It "just works". Nice.

Sunday 12th June 2011 - 08:29:10


I scored a laptop with a dead screen just in time for my laptop to fail. Although my laptop didn't fail entirely - just the backlight. I took it apart last night and repaired the backlight. The bundle of tiny tiny tiny wires which traverses the hinge to drive the screen had one broken wire. It took a lot of peeling to get to the wires. The bundle is wrapped in a metallic/cloth weave with glue backing on one side. Once open I was able to solder the wire. I used a piece of silicone wire sheath from a halogen down light (since it needs to be really flexible) rather than heat shrink to protect the joint.

The laptop I scored appeared to have a dead screen. It was given to me with a spare screen. After about 40 screws I separated the top and bottom plastic molded section from the cast aluminium inner frame and gave everything a clean and a bit of an eyeball. I then ran the system up to see what was going on. The screen was entirely dead. I left the screen in place and plugged in the spare screen. It fired up nicely but the plug didn't quite seat correctly. There were bent pins in the socket. Out with the maggie lamp and the pointy tweezers! I straightened the pins and plugged in the original screen. Voila! The screen fired up, but it looked like it was toast anyway. There was a red band across the bottom. I don't know how the replacement screen fired up without those pins - but the original does not... Perhaps the plug, cabling or controller is damaged as well.

Today I will be swapping out the original LCD panel and hopefully, although the plugs are the same, hopefully the mounting system is the same. If it is - I've got a working laptop.

Wednesday 1st June 2011 - 19:40:53


I've just watched the Beowulf trailer after looking at some random videos in YouTube. Near the middle of the trailer they play "In the House - In a Heartbeat" which is the theme for 28 Days / 28 Weeks Later. Makes me want to break out Left for Dead II and fwap some zombies! I haven't played that in aaages.

Wednesday 1st June 2011 - 12:02:53


Got a few bits on clearance from Rockby. Large 7 segment LED modules and some SMD 5V relays. Cool.

Saturday 14th May 2011 - 18:39:34


I've started building my DSE signal generator kit. I bought the thing literally years ago, when I still worked there - before Woolworths destroyed the staff discount.

It will be built into a nice sloped console box and will include the DSE frequency counter kit.

Friday 27th May 2011 - 07:11:18


Finally, my 10 turn pot has arrived from Element 14, I can complete my EEVBlog based active load! It was out of stock and had to be shipped from the US. Last week I got the rest of my stuff from Element 14 including a 0.1R 25W aluminium clad resistor, an LM3302 comparator to fix Dad's strobe tacho, some CMOS 4000 series to play with - 40106 (hex schmitt inverter), 4030 (quad xor), 4027 (dual J/K flipflop), 4081 (quad and).

Saturday 7th May 2011 - 16:51:41


Added photos to gallery:

Wednesday 4th May 2011 - 11:50:53


I have uploaded some photos of the LED Downlight Display circuit.

Saturday 4th December 2010 - 22:59:33


I've started on a big project involving a LAN design and implementation. I'm going to be busy for a bit! This is the first project of this size that I have taken on. I'm sure it's going to last a month or two. The electrician team (yes there are about 8 of them, this is a big install) F%@king hates me because there are over 250 outlets and 3 45U racks of gear. The project is actually for a gaming arcade, so the layout needs to be flexible and cover the floor space. I will be designing the LAN, speccing the outlet requirements and once the sparkies are done - I will be installing and configuring the 2 servers, 6 POS systems and Elastix (Linux Based) phone system.

I will also have the opportunity to use a few TG watchdogs for environmental monitoring. They will be tied to nagios running on the Elastix box, which will also be monitoring the LANs.

Today I've been setting up the racks from scratch. The cement floor isn't sealed, which may kill some gear with dust - they seem aware of this and want to push the deadline. It took a lot of time (more than I expected) to unpack all of the switches! I'm putting in 9 24 port switches. The reason for this is that all 250 ports will never be patched at the same time, there is just a huge amount of them to cover the floor area.

The other minor (hah!) problem I have is that there is no f&*^%king power. Minor details. It looks like there won't be for some time.

Monday 2nd May 2011 - 22:54:43


Lots of work on my site today. Cleaned up a lot of old PHP crap, primarily deprecated functions.

I found earlier today that I could not log into my sites admin page. This is because it displays an event log when you log in - which should be fine right? The problem was, not having logged in for ages, that there was a substantial (15,880,000+, 3.8GB) of database table that the poor admin page had to join the user table against! Oops. All of these messages were about PHP deprecation. I must have been crawled by google or something, most of the problems were in my galley. There are over 2000 images in there, each image and gallery generating multiple warnings. So, after lots of careful ereg() and eregi() and split() replacements it's all good.

Sunday 20th June 2010 - 18:34:54


I have managed to get my 16f877 working with an LCD at last. The ICD2 definitely had a hand in getting it to work...

Saturday 1st May 2010 - 22:31:39


May Already?!

Kel had lot to do today so I looked after the Kids. If only I could get them to dig in their sand pit and not in the dirt.

I showed Liam an episode of The Mysterious Cities Of Gold, both he Emily were GLUED to it. The Mysterious Cities of Gold is a cartoon that was on when I was little in the late 80s. I used to like it alot. Liam even said that he likes it better than BEN 10!

I had some time today to build an ICSP attachment for programming 18 pin pics. My JDM serial programmer doesn't seem to cut it any more. I designed the link cable from the ICD2 so that it fits the headers on the attachments for the JDM so I can now do 18, 28 and 40 pin pics. The JDM has become unreliable for some reason, I have trouble verifying the code once it's written - and it takes aaages to write. The ICD2 takes only a few seconds.

I built up another MAX232CPE serial prototype circuit on the breadboard for my next round of tinkering with the 16f88. Although, tonight I did manage to get the UBW firmware D (USB CDC) to compile after lots and lots of messing around on and off over the past few weeks. If I can get that built and the bootloader then I can go direct to USB rather than serial. I have a Sparkfun UBW with the 18f4550 on it and also two 18f2550s for breadboard work.

The workflow using the ICD 2 is going to be different. I am used to pulling the chip out of circuit to program it. The next target is to test the ICD functionality - I've never tried it before.

I added mod_python to apache on my server at home so I can play with Django. I went through the first two parts of the tutorial and it was pretty cool (using the dev server). Under mod_python the paths are screwy - I must have misconfigured it. Will go back to it later! Oh - the built in dynamic admin functionality is just awesome. It takes so much crap work out of putting up the back end of a site - forms, fields, validation etc etc (all the tedious stuff)

Tuesday 5th April 2011 - 21:36:22


I've got myself a freshly imported Rigol DS1052E! It's got a Chinese manual, but meh. There is a PDF version of the manual in English if I really want it. I guess watching Dave play with all his scopes over at EEVBlog convinced me to get one.

The thing is awesome! I love it. DSO is entirely new to me. I've currently got a Dick Smith 60MHz CRO. I think my favorite thing so far is the single shot triggering and the timebase zoom it has, where you can show a magnified (by time) view of the triggered waveform below the normal display.

Thursday 4th November 2010 - 21:41:15


I have just put my first order into Mouser. Most of the TG board is based around what I can get from Electus and Mouser. I also got a few extra bits to play with.

I am building a dummy load based on Dave Jones' design from EEVBlog, so I need a 10 turn 50K linear pot.

Other goodies:

  • 20 and 24 meg crystals for my new pic 18f2550
  • A few SMD USB mini-B connectors to evaluate
  • 0.1R 25W aluminium clad resistor

Friday 30th July 2010 - 21:54:21


I've just sent the gerbers into BatchPCB for my first run of TG Watchdog boards!

Sunday 10th October 2010 - 11:53:47


I found an awesome project for the kids. On there is a mood lamp by Pete Griffiths.

On the last trip to Shenzhen, I asked my boss to get me a few handfulls of 10mm LEDs in colours. They will work great for this.

I've built it up on vero and programmed the chip with Pete's code. It works great! Even managed to get the ICSP to play nice.

Sunday 10th April 2011 - 14:34:46


I've finally found a use for these DPDT switches which I've had stashed for aaaaaaaages. They are DPDT, but one side is momentary. So they are ON, Centre OFF, MOMENTARY. I will incorporate one into the LED downlight display. I will also add a 40106 to the selection to help de-bounce for me. I tried a plain RC de-bounce, but I can never get them to work properly.

The customer will be able to switch the 'cycling' of the lamps from up 'Auto', to centre 'Stop' and also multiple presses on the momentary side they can manually select the lit lamp.

I am considering whether it's worth it putting an ammeter and volt meter on there.

Should be pretty cool.

Monday 7th April 2011 - 21:26:35


The new CRO (er, DSO) is great! I am using it while I design a circuit to help promote our range of 12V hallogen replacement LED downlights. They look damn boring in white boxes. My idea is to have a strip of aluminium angle with 10 MR16 porcelain sockets fitted to it. Each lamp will have it's own transistor to turn it on, mounted next to the socket on the strip. The circuit will serve as a test bed for new lamps that we get. It will have a PWM based dimmer and a voltage control. Each down light will be lit for a second or two (adjustable) and then the one after, down the line.

This should add some interactivity for customers, as well as some animation to catch the eye. I think having all of them lit at once would not only be blinding, but just as boring as white boxes.

So far my design is going to incorporate two 555s, an LM350 and a handfull of 8A transistors in TO220s. To do the stepping between globes I am going to use a 4017 decade counter.

Monthly archives