2009-02-02

Humidifier Reloaded (Hacked)

Pedro had a problem with his Venta Humidifier, although it has a nice "discrete" design it lacks one important feature: an external water level indicator. Pedro drafted a small specification of what he wanted, two indicators, one for "almost empty" and another for "empty", if possible when empty stop the motor i.e. cut the power.
I checked the price of a new one (just in case I ruined it beyond recognition) and after taking note of the 114€ price (and they weren't able to add a simple level indicator... shame on you product designers), I went to work.
My first idea was to use a buoy and a lever to externally indicate the level, but it appeared to be too fragile to store and to align the top of the Humidifier, then I though of building a buoy with a magnet and placing Reed switches on the outside of the case.
Having a small tube glued inside was very easy, I had to use hot glue as special PVC glue (in the picture) did not work with the case (clearly not PVC!!).


My original magnet was too heavy, it weighted about 7g and for that I needed about 7cm² of foam supporting it, too much!Then I tried 3 and 4 smaller magnets, about 1g each. Here is a picture of the magnet with the floater and the REED switch on top.

After having the level system I went out to design the electrical system. Initially I planed on using a normally closed reed switch for the power but a switch capable of cutting 230V 0.35A inductive load is impossible to find.
So I had to resort to an additional battery and a relay to invert the signal, the use of the battery made me use an extra power switch to turn off the detection circuit when the Humidifier is stored away.
Two normally open switches, one lighting a green LED when the level is almost at the bottom and a red LED lighting when the level of water is at the bottom and cutting the motor when this happens. The Relay contact is normally closed so that if the battery runs out or Pedro doesn't want it to operate just remove the battery and let it work as previous.

Here's is the finished "product", with the boxed closed and the LED visible.

Here's another picture, just to show the chaos during the creative process... :-)

2009-01-26

Linux on Compact Flash

Recently I bought an used odd Thinkpad X40 in Ebay, it has a French keyboard (ugh!) and a DIY touchscreen, Bluetooth but no WLAN. Since its hard disk was starting to fail I decided to try out and insert a Compact Flash as hard disk. I ordered a 8GB super fast x133 online, but this weekend I could not wait and since 4GB SanDisk's Ultra II were at 24€, I decided to try it now!
I already had a 1.8 inch IDE to compact flash adapter (bought earlier here), in hardware terms it is really plug and play! The BIOS and the computer think that they have a normal (although not hitachi) 4GB hard drive.


I managed to install Suse 10.3 and perform all the updates, it had to be a small install to fit in 4GB but enough to run the familiar KDE and OpenOffice. The installation goes slower than with the normal hard drive, but once you get to the Network update speed is about the same.
Then I edited the file /etc/fstab as according to this page.
Here's what I did:

su
vi /etc/fstab

Then edited the line with the line

xxxdisk-idxxxxx / ext3 relatime,errors=remount-ro 0 1

adding the noatime option. Normally every time you read a file, the time is written back to the drive. The noatime option disables this.

xxxdisk-idxxxxx / ext3 relatime,errors=remount-ro 0 1

Then added the following lines. They move most temporary files to a ram disk.

tmpfs /tmp tmpfs defaults,noatime 0 0
tmpfs /var/run tmpfs defaults,noatime 0 0
tmpfs /var/log tmpfs defaults,noatime 0 0
tmpfs /var/lock tmpfs defaults,noatime 0 0
tmpfs /var/tmp tmpfs defaults,noatime 0 0
tmpfs /var/lib/dhcp3 tmpfs defaults,noatime 0 0


I did not write the line for Mozilla Firefox because I am not sure if Novell/Suse whatever have changed the temporary directory. Another site that looks like having good information is this one.
After the installation and configuration I tested the hard drives for read speed, and the Compact Flash does not come very far behind! But the big test is endurance rather than speed. Here are the screenshots, the top one reports on the current X40 (with magnetic hard drive), the bottom one the test on the compact flash and the listing of the /etc/fstab.

As SU you must run the command:
# hdparm -t /dev/sda1

/dev/sda1:
Timing buffered disk reads: 56 MB in 3.08 seconds = 18.21 MB/sec
The CF disk reported 14 MB/s, which is 22% less... I still think it is not a big gap as with a bigger investment €€€ one could get better transfer rates (there are 8GB cards on the market advertising 30MB/s and more).

I think a good idea would be to have a mixed system on the same card, a compact flash on one side and a 1Gb dram on the other (for temp files, var, log, etc). One of the adapters that I found has a second connector on the back of the card, maybe it could be used with a small microcontroller, FPGA or CPLD to connect to a cheap SDRAM and provide a second volatile disk for all the changing data.

S620 fan "repair"

Some years ago (2004) I bought my second computer, at the time I wanted a very small desktop computer with parallel and serial port (for my electronics projects), a reasonable number of USB ports (3), audio line in/out and phones/mic, DVD-CDRW, good amount of RAM 768MB and a Celeron D.

I found the S620, it was small computer with acceptable performance, just what I wanted! The computer is now Ana's computer, she uses it to browse the web, store and edit her photos, update her blog and working from home. The computer has two shortcomings, one is that I have to reboot after a save to BIOS (the computer locks), the other is the fan noise. The really noticeable problem of the computer is the fan noise, maybe if I could fit a bit more RAM and a slower processor this could be solved. After a full day of work one could really feel that casing was warm and the Fan working hard.


When we came back from our Christmas holidays I noticed that the computer's Fan stopped working. Ana reported that the computer would start (very silently) but would never completely boot Windows. I tried booting linux and then the over temperature event was sent to the console and the computer stopped booting, after this "hint" I placed my hand on the Fan exit and noticed that no air was flowing! Surely it is a fan fault!! or so I thought... I rushed to buy one only and waited... After placing the new fan the system still did not work!!

I removed the Fan and examined it, and tried it with an external power supply... it worked!! Tried the old fan and it also worked! Then I measured the fan's output pins on the Motherboard, and the power pin had a voltage increase as temperature of the processor was increasing (checked using the BIOS monitor). When the fan was connected this voltage would drop and the fan would not start.
I suspected that "somehow" the output driver to the fan entered shutdown thinking it had a heavy load.
I decided to create a NPN(BDX33) emitter follower (a.k.a voltage follower), using the hard drive's power supply to supply more current and about the same voltage to the fan. The transistor was "fused" to the fan case using the soldering iron going through the case and the hole in the transistors plate.

2009-01-25

Kronan lighting

My Kronan is a simple bike with simple "extras", the headlamp is a filament bulb powered a dynamo, a simple LED tail light and a Kronan bycicle bell.

Since I installed the front cargo fork I had to reroute the power from the dynamo to the alternative location of the headlamp (on the other fork arm).


I noticed that there is a light sensor and when I leave the bike in a shed or I stop the tail light turns off after some time. But my current problem is that sometimes during a long route the light turns permanently off. I had to open the box and see!!

Apparently there's a transistor, a light sensor (top, back of the PCB), a red LED (transparent), a capacitor (bottom, back of the PCB) and an embedded IC. The IC has a blob of plastic (next to the capacitor) over it so no chance of knowing what it is. My current possible culprits are:
the battery connection that has oxidized or the light sensor is not correctly placed and the sensor is influenced by the LED.
Currently I just opened the box, cleaned the contacts and straightened the sensor but I doubt that was the last time I had this problem.

I also had some time so I decided to check if I had any noticeable chain stretch, I folded a new one over the current one while breaking and checked for any big difference after 10 links... so far, everything looks similar (i.e. no noticeable stretch).
I found more sites (here, here, and even in Wikipedia) giving instructions on how to check for chain stretch.