Here is a collection of some of the smaller projects I have hacked together over the last decade. Some projects are old, some are unfinished, some failed miserably, but I would like to share them anyway. Each of the projects by itself would be too small for a full article, so I have written a collection of short articles instead.
One day I was looking for a new bed. The old mattress was worn pretty thin, I didn't like the frame and the whole thing wasn't even mine to begin with. I quickly got hold of a decent but odd sized (190x120cm) mattress. Where do you find a frame of this size? I always like to build things but didn't want to spend too much money on my bed. Then I realized, when you can sit on an empty crate and stand on an empty crate, why wouldn't you be able to sleep on an empty crate? Why not build a bed out of empty crates? If you shuffle the 30x40cm crates correctly, you can fit them exactly under the mattress. And when you're done with it, you can even get your deposit back when you return the crates to the supermarket.
There were some pipes from the central heating in the corner of my room, so the bed couldn't be as close to the wall as I would have liked. This is resolved by cutting some bits from the corner crates. I might not get my deposit back, but at least the bed fits now. Another problem was that the crates tended to slide outwards when you get in and out of the bed, so I wrapped a tie down strap around the outer crates, holding the whole bunch together. I have used this crate bed for a little over 2 years and, while unique, it is not as comfortable as a real bed base. Also the plastic bottom of the crates, used to hold the mattress, really wear the mattress down.
Soldering workshop: UTP cable tester
Some of my friend are interested in electronics, but had never soldered before. Since I love to teach people things and tell about my hobbies, the idea for a soldering workshop was born. I had recently made a simple UTP cable tester myself and figured this would be an ideal workshop piece. It has a couple of parts, but not too many, it does something useful and it has blinkenlights. The idea was to bring a bin of electronic parts, some perfboard, soldering iron, schematic and let everyone figure it out themselves. Building my version took me about half an hour, so how hard could it be?
This was the very first workshop I hosted myself. I ordered parts for 20 kits, borrowed some soldering irons from friends, drew up some schematic diagrams and thought I was prepared. The first workshop really was a learning experience, mostly for me. Telling people how to read a schematic diagram, how to translate this to perfboard layout and how to solder was a bit too much for one workshop. Most people gave up after about 6 hours and very few kits were finished. However we all had a great time and I have plenty of parts on stock now if I ever need another 555, 4017 or a bunch of UTP connectors.
cost: 12Euro worth of parts per kit.
Bass guitar fuzz
There are a few songs that just have the best distorted bass guitar sound. For instance Apocalypse Please by Muse and One Angry Dwarf and 200 Solemn Faces by Ben Folds Five. After searching the internet, I discovered all those bass players used the same fuzz effect: the Electro-Harmonix Big Muff Pi. There are several different versions of this pedal made over the years with all different component values and a slightly different sound. The best one seemed to be the old, green Russian version. Off course now I had to have one myself.
General Guitar Gadgets offers a kit of the effects pedal. It is not particularly cheaper than a new BMP, but it uses high quality parts and comes with schematic and PCB layout. It's ideal when you want to modify it, and that's exactly what I planned to do. Originally the fuzz is a guitar effect, but a bass guitar, besides being tuned an octave lower, also has a higher output voltage. I made several modification to fix these problems and also tune the sound more to my liking. I can't really remember from the top of my head, so I'll have to reverse engineer my modifications to be able to document it. I'm still fine-tuning the sound and will continue this write-up some other time.
Serial USB stick
For my friend Gert's birthday I tried to make a appropriate present. We used to be partners in the tikkenteller company, so that would be a starting point. The tikkenteller used an I²C memory module, housed in a serial port plug. In my parts bin I still had a couple of the old prototypes. As a present I bought a USB stick flash drive of a whopping 1GB, the biggest one available at the time. I gutted the old serial memory module, keeping the shell, and stripped the USB flash drive from its housing, keeping the electronics. I epoxy glued the flash drive electronics into the old memory module shell. This resulted in the franken-stick pictured on the side.
On the flash drive itself I put some old pictures, video clips and other nostalgia. Gert enjoyed my home crafts and, last thing I heard, is still using the flash drive.
EvilCMS is the content management system that is used for this website. It consists of a combination of php and a shell scripts to generate the web pages. Editing a page is done in a normal text editor. When finished, static html is generated and then rsynced to the webserver. The CMS started out as a bit of a crude hack, hence the name, but it got the job done. Over the years it has been completely rewritten, some features were added, and it's starting to be a halfway decent CMS. However, the name has stayed.
Actually, there is a funny story to this EvilCMS. Some years ago I was looking for a CMS for my website. I tried several on opensourcecms.com and installed some of the more promising ones on my own webserver to give them a try. After fiddling with them for a bit, I moved on to some other project and forgot all about it. About a year later I remembered the CMS and tried to pick up where I left the last time. After trying again all the CMSes I installed on my webserver, there was one I liked most. It had no useless features, looked good and had a name right up my alley. This is the one I wanted to use for my website. After a couple of days of playing with the CMS I had the feeling there was something funny about it that I couldn't quite put my finger on. After some more days I realized I wrote the CMS myself when I couldn't find something suiting anywhere else and had completely forgotten it existed.
While recently googling EvilCMS I nociced there are a few other CMSs using this name. So far this hasn't been a problem and they all co-exist happily together.
Thanks to the Wayback Machine for archiving this old version of my website, made by the original EvilCMS, so I could take a screenshot. We sure have come a long way.
Gear leaver coat rack
Every once in a while you get one of those ideas. Hey, I could use $foo to do $bar, why didn't I think of this before? One of those ideas I had is: a coat rack has pins sticking out to put your coat on. Why not use gear leavers instead? I was able to liberate a few from cars that were to be demolished.
So far the project has stopped here. I still have a bunch of gear leavers that I might some day turn into a coat rack.
I run on solar power. It's true, in the winter when it's all dark outside I have very limited energy, but in the summer when everything is sunny and bright I really have a lot more energy. Waking up on those dark days is the worst. It's so demotivating when you open your eyes in the morning and it makes no difference at all, it's still pitch black. A couple of years ago Philips introduced the wake-up light; a bedside lamp alarm clock that simulates dawn just before the set alarm time. This looks like something I would like to try, but the lamps were quite expensive. Why spend 200 Euro on an upgraded alarm clock? It also had built-in bird sounds which I'm not a big fan of. How hard could it be to make something similar myself?
For the prototype I used an Ikea Lampan, the worlds cheapest table lamp. The light bulb socket is removed and replaced with a 3W RGB led, left over from a previous experiment. The led is driven by a FDP603AL logic level N-channel MOSFET, with red, green and blue wired in parallel. For now I will only simulate dawn brightness, not the colors. The fet is controlled by an Atmel AT90S2313 AVR (predecessor to the tiny2313) pwm output. The firmware handles the dawn simulation.
I didn't feel like designing an alarm clock with full week program. This would take too much time and I would like to start testing the lamp as soon as possible. So I used a programmable timer switch instead. The first couple of mornings I would wake up by myself, half an hour before the alarm time, so I could see the magic happen. Luckily, after a couple of early mornings, I would actually be woken up by the lamp.
It took a bit of experimenting to figure out how long the fade-in period should be. If the dawn simulation was set too fast it felt very abrupt. On the other hand, if it was too long I started to be very sensitive to changes in light intensity in the morning. This would cause me to wake up by any change in light intensity, such as the wind flapping the curtains. Also it is difficult to time this to the set alarm time. It turned out that a setting of 10-15 minutes worked best, so this value is hard-coded in the firmware.
The lamp made all the difference in waking up I hoped it would make. It really helps a lot to wake up in a brightly lit room instead of a dark one. After using this prototype for two years I decided to upgrade. The led was replaced with an even brighter 11W power led. Then I noticed that the lowest brightness setting was already quite bright, so I tweaked the firmware to make the brightness steps a lot smaller. Also sometimes the led flashed on full brightness, just before the fade-in started. This turned out to be caused by an initialization error in the firmware. Along with some other fixes the firmware started to mature some more. This mark II prototype has worked fine for another 3 years, until it was replaced by a led strip on the bedroom ceiling. The prototype moved to someone else's bedside table to give it a try.
Like I said before, The dawn simulation lamp is a huge step forward from the dark mornings. I would really recommend building something similar to everyone who has seasonal affective disorder or just likes to wake up in a nicely lit room instead of a loud beeping device right next to your head.
An attempt at reverse engineering Atmel debugWIRE
DebugWIRE is a proprietary debugging protocol by Atmel. It is used as poor mans JTAG for small AVR microprocessors. Since the protocol is proprietary it only works with Atmel AVR programmers, such as the AVRDragon. Being the open source nerd that I am, this annoyed me. Why keep such a handy protocol secret? Not that I've ever used debugWIRE, or needed it, or wanted it, but it's the thought that counts, right? Wouldn't the world be a better place if we were able to support this wonderful protocol on all open source programmers as well? I decided to reverse engineer this protocol, document is and make it available for use in all open source programmers.
Okay, now where do we start? First I needed a programmer that supported debugWIRE to be able to sniff the communications and decode the protocol. I have only ever used cheap open source programmers, so the price of the Atmel programmers came as a bit of a shock. Even the cheapest one was almost 80 Euro. I bit the bullet, bought the programmer and set to work. AVRDUDE has a set of commands to enable and disable debugWIRE. This seemed to be broken in the version I was running, but after a downgrade to the last stable version I got it working. Now I was able to put an AVR into debug mode and back. When I connected the oscilloscope to the debugWIRE bus I saw all kinds of pulses, so communications were working and visible.
With the Open Logic Sniffer logic analyzer hooked up, I saw a nice pulse train, but I couldn't make heads or tails from it. Which part is the programmer talking to the device and which part is the response? On the programmer were several big chips. I tried probing all those pins to see if there happened to be a pin which only held one direction of the information, without the other one. Unfortunately there was none. So, what else could we try? DebugWIRE is an open collector bus, with a pull-up resistor inside the the AVR. I figured I could add a series resistor between the AVR and the programmer and see which one pulls the bus low. With an opamp used as comparator I seemed to get random readings. Even with the bus idle, the data direction seemed to change all the time. Okay, this so this approach didn't work either. Maybe I should focus on the data instead of the direction.
There were so many pulses on the bus. Some long, some short, sometimes high frequency, sometimes low frequency. Since I didn't know which ones were the commands and which were the responses, I was stuck. Every couple of days I gave it another try, hopeful to see something I didn't see the last time, but after a while I gave up. This project cost me money and time and has only given me frustration. Stupid debugWIRE.
About a year after I gave up, I found out that a hacker named RikusW had managed to succeed where I had failed. 'I obtained many dumps of the protocol to try to decipher it, turns out it was easier than expected' he writes. Ouch, there goes my ego. However, I'm glad somebody managed to figure out how debugWIRE works. RikusW documented his findings on his website. The article is even linked on the Wikipedia page about debugWIRE. While reading this page there was something familiar. It took me a moment to remember, but as it turned out, I was the one that had started the Wikipedia page with the intend of releasing the debugWIRE specs there myself. It's great to see that other hackers add to Wikipedia as well.
As far as I know nobody has yes implemented debugWIRE in any of the open source programmers.
Drain pipe welding electrode container
Welding electrodes are hygroscopic, that is why you should keep them dry. Keeping something dry in our shed is a bit of a challenge. The welding electrodes are too long to fit in a normal household container, such as a spaghetti container or any other Tupperware box. Hmm, I wonder if I have anything waterproof in the shed... How about drain pipe?
The container is made of a length of 75mm diameter PVC drain pipe, left over from another project. I glued a cap on one end and a screw cap on the other end. The container can made any length, so this is perfect for the long welding electrodes. With this diameter pipe there is room for a lot of electrodes. The bunch I had hardly fills 1/10 of the available space. Just to be sure everything stays dry inside, I put some silica gel packets in the container, along with some bubble wrap to keep the electrodes from rattling around.
Building the thing was surprisingly easy. I wonder what other people do to keep their welding electrodes dry.
Sometimes you really need a symmetric power supply, but you only have a single ended one available. Don't you hate that? This is where the rail splitter comes in. A rail splitter is a device that makes a virtual ground at half the input voltage. In other words, when you put 30V in, you get +/- 15V out. This is exactly what you would otherwise need a symmetric power supply for. It even has a feature a symmetric power supply won't offer you. On a regular power supply, when you go into current limiting on one output, the voltage on that one output starts dropping, but the voltage on the other output is not affected at all. So your ground potential is no longer exactly in the middle between the two voltages. This might cause problems with the electronics hooked up to the power supply. For instance, not all audio amplifiers are designed to be able to handle asymmetric rails. Worst case it could apply DC to your speaker outputs and produce some magic smoke. This problem is completely solved with the rail splitter. The virtual ground stays, by design, exactly at half the input voltage, even when that input voltage is fluctuating.
How do you make a rail splitter, you ask? Just make a voltage divider and buffer it with a powerful opamp. I used the L165 power opamp which can deliver up to 3A of output current. In the ST datasheet there is a schematic for this specific virtual ground application on page 6. It is also published in Elektors 304 Schakelingen (Dutch, ISBN 90-5381-001-3) on page 324.
The reason I built this in a subd25 housing is that it was the smallest enclosure I had around that I could just squeeze everything in. Also the metal shell acts as heatsink.
Soldering workshop: USB blinkenlights
With the experience gained from the last soldering workshop, I decided to do it all again once more. At work we have a different workshop every month. Some workshops are work related, most are not. Soldering hasn't been covered by another workshop before and several colleagues liked the idea. Most of them had never soldered before and were willing to give it a try. A few already knew how to solder and that is exactly why they would like to join as well.
So I prepared for another soldering workshop. This time I designed a PCB to make building easier. No more figuring out the schematics or pining over perfboard layout. Along with the PCB I made an instruction sheet: Start with the smaller parts, work your way up to the bigger parts. An electrolytic capacitor is cylindrical, has both legs on one side and mind the polarity, etc.
The subject I choose is a classic: the astable multivibrator. No integrated circuits in this design, just two transistors and a bunch of passives. The unit has a USB connector for power and this nicely contrasts the old school circuit. Last, but not least, the unit has two clear red leds. They would blink alternatingly at about 1Hz. Where would we be without blinkenlights?
I managed to keep the costs lower than for the previous workshop. It worked out for under 5 Euro per kit. The boards were etched and cut by en electrical engineering student, offering a PCB etching service on his website. Parts came from my personal collection, so probably mostly from Ebay.
Even now, 3 years later, some colleagues still have the thing on their desk. Since then a couple new colleagues joined us, so maybe, one day, I might do a follow-up.
In EEVblog episode 102, Dave explained and built a programmable electronic load. This simple device is quite handy to have in your electronics lab. You apply a DC voltage on the input terminals, dial in the current you want, and the electronic load mimics the correct resistor to make this current happen. When the voltage changes, the resistance is changed accordingly, so the current remains on the set value.
Shortly after this episode, several people started building similar designs. There are various threads on the EEVblog forum about their builds. After a while I decided to join them and build an electronic load as well. It seemed useful to have one around, without being too much of a hassle to make one.
The design of my electronic load is almost identical to all the other electronics loads on the forum. The power section consists of an 1Ω shunt resistor and a N-channel fet. I settled for modest specs and used a single IRF620 power mosfet. This results in a maximum current of 2A, maximum voltage of 200V and maximum power dissipation of 50W. The fet is mounted to an old CPU heatsink that sits on top of the enclosure. This should be more than enough to dissipate the generated heat.
The control circuit consists of a 10-turn potmeter to set the current, an opamp to compare the set current with the measured current, an RC filter to stop oscillation from happening and a little power supply. On the front panel are input terminals for the load, a buffered output of the shunt voltage and the potmeter to set the current. As you can see on the picture there are another terminal and a switch on the front panel as well. The plan was to have a control voltage input, but I never connected this.
As it turns out, it is indeed handy to have an electronic load around. Especially when testing power supply designs. I have 2 multimeters permanently hooked up to the electronic load; one to measure input voltage and one to measure shunt voltage. The whole system is not ground referenced, so easy to hook up. There are plenty of ideas for improvements (higher voltage, higher current, higher power, dual channels to match a dual rail power supply, panel meters on the front, constant power mode, etc), but I'm glad I built this one.
SMD soldering is a really fiddly job. The smaller the objects, the bigger the challenge. To assist me in this I bought a microscope. It's an old, used, Carl Zeiss stereo microscope, fitted with a modern led ring light around the lens. The thing weights a ton, but is very stable. Soldering SMD under the microscope is so much easier than without it. Small IC leads are suddenly the size of DIL or even bigger. It's also much clearer to see if something is shorted out or not. The only problem now is, where do I store my new microscope when I'm not using it?
The microscope didn't come with a case. I tried for a while to store the microscope safely without a case and decided that I really did want a case for it. This looks like another woodworking project. Your typical wooden microscope case is nothing more than a simple box with a door on one side and a handle on top. This is pretty much what I made. The microscope is rather heavy so I made the case a bit more sturdy than I'd otherwise do. To prevent the microscope from moving around, I routed the exact shape of the stand in the bottom of the case. The door is mounted on a long piano hinge that I happened to have around. Everything is both glued and screwed.
I preferred to have a locking mechanism on the door with no parts sticking out and without a key. Parts sticking out will either scratch something else or snap off. Keys will be lost and that would lock the microscope out of my reach. This combination proved quite difficult to find. I tried every hardware store in the neighbourhood without success. Eventually, at a camping store, I found a replacement top cabinet lock for use in caravans. When closed the handle sits flush with the door. When you press the handle the door unlocks and the handle pops out. This is exactly what I was looking for and will remember it for my future builds.
With the case finished I can now safely store the microscope under my desk. Another problem solved!
10Mhz reference clock
When I bought a frequency counter, I expected its clock to match the function generator. It never occurred to me that there could be differences, until I started measuring. With the function generator set to output 10.000000MHz exactly, I got measurements on the frequency counter ranging from approximately 400Hz lower to 100Hz higher, varying with warm-up and over time. Now instead of only having one reference, I had two. Now which one is correct?
To resolve this problem, I decided I needed a stable, high precision reference clock. All devices would slave to this master clock and there would be no more doubt about which clock is correct. 10MHz seems to be the typical frequency for a reference clock.
So I went online and found an affordable 10MHz oven controlled crystal oscillator (OCXO) on Ebay. It's an used C-MAC STP2187 unit with double oven and sine wave output. There are all kinds of stability figures in the datasheet, but for me it is sufficient to know that it's way more stable than any of the other clocks around the lab.
After testing the thing for a bit, I built the clock in a small metal enclosure (also from Ebay). The power supply is a standard LM317 job, made from junk parts. The regulator is running hot when the oven is warming up, so it is mounted on the metal enclosure for heat dissipation. There are BNC outputs (also from Ebay) both on the front and the back. Those are driven from two jfet buffer amps, to reduce load on the oscillator. The whole thing works like a charm, but needs some time to warm up. Some day I would like a led indicator for when the temperature (and therefore the oscillator) is stable. Since there is no such output on the OCXO, I could detect the current drop when the oven is switched off by the internal thermostat.
The new reference clock agrees almost completely with the frequency counter. There is hardly any drift at all. Apparently the clock stability issues were mostly with the function generator. But this will all be solved soon, right?
Unfortunately it turned out the function generator doesn't have an input for a reference clock. It only has an input for phase lock and the input frequency needs to be the same as the output frequency. The frequency counter does have one, but without both the function generator and the frequency counter hooked up to the same reference, there is little use in using one. Maybe, some other time, the reference clock will be of some use.
RFID Shielded wallet
A while ago I received my new debit card with contactless payment. You don't need a pin number for this contactless payment, just be close to a payment terminal and the money is deducted from your account automatically. To me this looks like a security risk if you ever saw one. First the two-factor authentication (something you have: your debit card and something you know: your pin number) is downgraded to one-factor (only the card). This means anyone who happens to have your card can do a transaction. Second contactless means it works just as well through your wallet or your pocket. Some crooks have already been arrested for making contactless payments by tapping peoples pockets and purse with a portable payment terminal. The banks all know this and lower the risk by only allowing contactless payment for relatively small payments, but this does not fix the underlying problem.
Obviously I immediately disabled contactless payment on all my debit cards. But I have more NFC cards in my wallet. The public transport OV-Chipkaart for example. Their whole system is based on contactless communication so there is no way to disable this. There might even be other cards in my wallet that are NFC capable without me knowing it. The problem with these cards can be narrowed down to the cards being exposed all the time. Even when you are not actively using the card (which is most of the time) your card can still be read or manipulated by anyone close.
To protect all cards when not in use, I made a simple shielded wallet. On AliExpress I bought a square meter of RF shielding fabric. This is thin gray polyester with conductive material weaved in. Unfortunately there is no datasheet available and the specs on the website are very limited. I guess I'll just have to try and see if it works for my application. To test this I wrapped a (fully functional) NFC card in a single layer of shielding fabric and tried it on several card readers. None of the readers registered the card anymore. So the shielding seems to be sufficient for 13.5MHz NFC.
The shielding fabric felt very thin and flimsy so, for a bit more rugged result, I sandwiched the shielding fabric between two layers of bright red canvas. The resulting material both strong and shielding, not to mention Firetruck red. The fabric is then cut to size to fit around two small stacks of 3 credit cards each. The whole thing is then sewed up and you're done.
I tested my new wallet again with several card readers around the city and, just like my tests at home, no reader registered the cards in my wallet. Another advantage of my new wallet is that it's more compact than my previous wallet and does not take up too much of my jeans pocket space.
Recently our cat developed an annoying new habit. She's usually is asleep in the study when we go to bed. But in the middle of the night she wakes up and wants to go outside. Unfortunately the closed living room door is in her way, so the can't get out. She found a solution for this problem; start making noise in front of our bedroom door until someone comes out and opens the living room door for her.
After a week of getting our sleep interrupted every single night, I decided to cut a hole in the living room door. As you can see, the shape is inspired by her as well. It took some getting used to, both for us and for the cat, but we can finally sleep without interruption and the cat can go in and out whenever she pleases.
The last couple of weeks I spent working on the geekabit.nl website. Writing articles never was my strong point but I've given it another try and turned out to be more fun than I imagined. In conversation I can talk for hours on end, but when trying to write an article down or do a lecture I don't know where to start. So I'm practicing elaborating. There usually are some good reasons for what I did, choices I made, so I might as well write them down. I think I've written more words on my website in the last couple of weeks, than in all of my school assignments combined.
I also added bass tabs to the website. For years I have been writing down songs, but the transcriptions never made it outside my own computer. The bass tabs page started as a tool for me. A way to listen to the music and read the bass tab at the same time. But I noticed other people visiting the bass tabs page as well. People I didn't know. Some people are actually visiting my website! Apparently there are some songs on there that nobody else had posted online. So I invested some more energy in making sure the bass tabs are accurate and original before I started adding more. Maybe some day I might make a wish list system.
Another aspect is the design of the website. Making a good layout is not as easy as it might seem. I have tried several different layouts and it took quite some time, but I finally managed to make something that fits this website. This is the layout you're currently seeing. The new layout went live just a couple of days before writing this article.