DIY hub dynamo usb charger

June 10th, 2010 by Arend 12 comments »

This is a step by step guide on creating your own USB compatible charger using your bicycle’s hub-dynamo as the power source.
It’s a work in progress and I will update this post along the way.
All images link to full resolution originals.

Requirements:

Tools:

  • Soldering iron + tin
  • (optional) Multimeter
  • (optional) Soldering clamp
  • (optional) wire stripper

Parts:

Note that these prices are ex FAT and I ordered them in larger volumes, ymmv.

components overview

Poor man’s (ms-paint) diagram

Step 1: saw a piece out of the veroboard, approximately 17 x 40 mm (the board below is too long, approx 65 in length)
Veroboard

Step 2: Solder the two tantalum bead capacitors on the voltage regulator. Be careful to not overheat the components, polarity is essential. Long leg is positive.
Place the 22uF Capacitor on the right,  the .47 uF on the left. Negative polarity combined in the middle.

Step 3: prepare capacitor C1 with the heat-shrink tubing, bend the pins (long leg = positive) as seen in the photo. Keep the legs as long as possible for flexible placement of this component inside the ABS case.
capacitor
Step 4: place the components on the veroboard:
Looking at the first picture below; the middle three parallel stripes on the board serve as the main electrical paths for the components. The stripe on the left corresponds with the positive side on the diagram.
- C1: the long leg (+) should be placed on the left of the three middle stripes. The short leg should go in the middle. (in reference to picture 1)
Picture 1:
step 4 picture 1

The bridge rectifier output legs should be placed as follows: The + (as indicated on the component) should go on the left of the three middle strips.
The – (negative) output should go in the middle. The AC input legs can be placed on the outer stripes of the board. (left and right in reference to picture 1)

step 4 picture 2

step 4 picture 3

And finally solder the voltage regulator as well.

step 4 picture 4

Before going any further, check to see if it’s working properly.
Prepare the cable that runs to the dynamo, and connect it on the input legs of the bridge rectifier. Polarity is of course of no concern as we are dealing with an alternating current. Connect the dynamo to this kit, swing the wheel and measure the output voltage on the + (Vout) and – leg of the output regulator.

test output 2

We should measure around 5 Volts

Test output

If it doesn’t work, carefully check the polarity of the capacitors and other components.

We can now safely cut the remaining component legs form the veroboard, and bend C1 to fit inside the ABS case.

I connected the heat-sink using a blind rivet this is ideal as it does not need any additional space (especially height).

Before connecting the cables, drill a small hole for the Cable Gland Locknut, connect the Cable Gland Locknut and route the wires through it.

Next, connect the USB A receptacle or if you like a mini or micro USB cable directly to the voltage regulator output legs. Connect the dynamo cable to the bridge rectifier.

In order for this whole package to fit inside the box, I had to saw one of the corners from the veroboard.

When using the same ABS case as listed in the requirements section, be sure to cut the two screw holes at the bottom of the case for more room.

That’s pretty much it. I will seal the case of with a polymer resin, to make it water proof. Be sure to only do this after you are absolutely sure everything works.

Revision 2 with grommets

That’s it! Let me know if you take on the challenge to build one yourself, or if I need to explain anything in more detail.

Bicycle USB charger using a hub dynamo (update)

June 1st, 2010 by Arend 6 comments »

This is an update on my previous post about a hub-dynamo driven (USB) charger.
A step by step guide is posted here: (still a work in progress)

The latest incarnation is a stripped down version of the original. I left out the input tuning C2, C3, R1 (see original post for the diagram) and replaced the 4 Schottky diodes with an integrated bridge rectifier. The Schottky diodes  are more efficient due to the lower forward voltage drop, but require more soldering and space.  This version now fits into a small ABS case. I hope to replace the fixed USB cable with a USB A receptacle (if it fits).

usb dynamo case

usb dynamo case layout

Flash AS3 Opennap / Napster Client using the binary Socket class

May 31st, 2010 by Arend No comments »

As a way to get more familiar with the Socket class in Flash, I decided to write a simple Opennap chat client.

Have a look at http://www.arenddeboer.com/flashnap/ ViewSource is enabled for a peak inside.

You can use any username / password combo as long as it doesn’t exist yet.

update:
Due to a take-down notice from the BPI connecting with this client is currently not possible.

Update:
Server back online with filesharing disabled.

screenshot FlashNap

Cheap Code Signing Certificate for $75,-

May 20th, 2010 by Arend 9 comments »

lockFor an Adobe AIR program I wanted an official code signing certificate to get rid of the big fat “publisher: UNKNOWN” warning clients face while installing my software.

Visiting verisign.com you will see a one year Code Signing Certificate will set you back  US $ 499,-

According to Adobe’s Flash Builder documentation only Certificates from the big four CA’s are trusted:

A developer can use any class-3, high-assurance certificate provided by any CA to sign an Adobe AIR application. However, only ChosenSecurity, GlobalSign, Thwarte, and VeriSign come pre-installed on most end user’s machines (Mac OS X or Windows) and are trusted by the operating systems.

These companies ask an amazing amount of money for a certificate, luckily there are better alternatives. The one I got was available for $75,- a year. This of course raises the question whether this certificate will be accepted, but I did found a couple of blog posts that reassured me this shouldn’t be a problem.

Hop over to author.tucows.com, register for an account and you will be able to purchase a Comodo Certificate through tucows.
The process will take some time. You will have to email documents to proof  your business/person identity and they probably call you as well. After receiving the certificate and signing the AIR package I was able to install my signed software successfully on:

  • Windows 7
  • Windows Vista
  • Windows XP
  • Mac OS X (10.6).

Unfortunately Ubuntu Linux 10.04 fails to recognize/trust the certificate out of the box (thanks to Jaap for testing this)

Before:
unknown publisher

After:

Trusted Publisher

Restore spanned raid volume after a droppped member

March 14th, 2010 by Arend 1 comment »

This post is the second part from my “note to self” on recovering my PC.

The problem

I have a 4 drive spanned RAID (raid0) volume where one of the drives mysteriously dropped from the volume, becoming a so called non-RAID member.  I was pretty sure I had not messed around with this now non-raid drive. Neither had I performed any write operations to this disk. This led me to the conclusion that somehow the software raid manager (Intel Storage Matrix) had decided the drive was no longer part of the volume, but the data must still be intact. Apparently the meta-data for each member used by the (software) RAID BIOS is located on each member drive. So if this meta-data could be restored, the entire volume could be restored. Armed with this knowledge I booted into the RAID BIOS, and removed the other 3 drives from the volume. This will give you an intimidating warning about losing all data, but at least with Intel RAID this only wipes the RAID meta-data from the drive. After  removing all drives, I recreated the exact same volume, in the exact same order (order is critical!)  Now after booting into Windows I was able to recover the partition with the excellent tool TestDisk which you can find here: http://www.cgsecurity.org.

Be sure to follow the manual. In my case the partition didn’t show up using the quick-search, but after the more thorough  “Deeper Search”.

Many thanks go to Christophe GRENIER, the developer of TestDrive and the post from  “adamsap” on forums.extremeoverclocking.com

Windows 7 system recovery

March 14th, 2010 by Arend 3 comments »

I wrote this down here as a reminder / “note to self”, and hopefully as a guide for people with similar problems.

Situation

My PC has 6 drives in it, two 1TB drives as a mirrored RAID (raid1) which hold two separate installations of Windows 7 and 4 500 GB drives running as striped RAID (raid0). I somehow lost the ability to boot into my second installation of Windows 7 which I use for gaming. In an effort to fix this I planned on removing the 200 MB system reserved partition, converting this partition to a Linux ext2 filesystem to install the GRUB bootloader. I assumed this partition was used only for the Recovery Environment. Boy was I wrong…

After converting this partition, on the next boot I was greeted with the infamous “BOOTMGR is missing, Press Ctrl+Alt+Del to restart” message

Thinking this could easily be solved with the Windows Recovery Disc, I booted the original Windows 7 DVD, selected “Repair your computer” and was surprised to see the error:

“This version of System Recovery Options is not compatible with the version of Windows you are trying to repair. Try using a recovery disc that is compatible with this version of Windows”

If you see this error, chances are you try to use the 32 bit version of Vista / Windows 7 Recovery Options on a 64 bit Windows installation, or the other way around. This wasn’t the case with my setup. I knew I had Windows 7 x64 and I was sure I had the right Recovery DVD. After wasting many hours I finally found the reason of this misleading error. As mentioned earlier, the Windows installation that needed recovery was located on a RAID1 (mirror). Temporary disabling  RAID1 in the BIOS allowed me to get past this error and continue the path to recovery. In my case this was done by setting the “SATA RAID / AHCI mode” from RAID to AHCI.

The recovery environment scanned my drives and welcomed me with the message that problems where found and could be fixed, needing a reboot after the fix.

Failed to save startup options

Unfortunately this fix failed with “Failed to save startup options“. This can happen if the filesystem is corrupted so I dropped into the recovery command prompt and performed a disk scan using “chkdsk c: /f” no problems where  found. Finally after much trial and error, and searching online I was able to boot my system. I do unfortunately not remember the exact sequence of the below commands, so you might have to play with this a bit.
Still in the recovery command prompt go to the boot directory with the command: “cd boot”.

  • Restore the bootloader with: “bcdboot c:\windows /s c:”
  • Repair the mbr with: “bootrec /mbr”
  • Repair the bootsector with: “bootrec /fixboot”
  • Repopulate the bootloader with : “bootrec /RebuildBcd”
  • Update master boot code on all partitions with BOOTMGR code: “bootsect.exe /nt60 ALL /force /mbr”

The next reboot no longer gave me the “Missing BOOTMGR” but halfway down the boot sequence a blue screen flashed shortly and the pc rebooted. This I solved by reactivating the RAID mirror by switching back from AHCI to RAID in the BIOS.

Finally the system booted, unfortunately yet another problem surfaced: The striped RAID setup of 4 drives failed due to one of the drives had dropped out of the array, now being labeled “non-RAID member”. Even though the 4 drives where disconnected during the above endeavor. I will describe my solution to this problem in my next post.

MCE Remote with VLC

January 26th, 2010 by Arend 138 comments »

(update July 18, 2010)

!  There is a known issue when running MCE (7), and mceRemote2VLC in the background.
In this scenario, the remote does not correctly communicate wit MCE. I hope to have a fix ready in August.

philips-mce-remote

philips-mce-remote

Background:

At home I use Windows Media Center available on Windows 7. It’s a great program but it doesn’t play all the video codecs and file types that I have in my library. Even advanced codec packs like sharks “Windows 7 codecs” do not always solve this problem. To the rescue comes VLC . A media player that can handle almost any media file you throw at it. When using VLC however, I’m no longer able to use my Media Center Remote Control.

Say hello to mceRemote2vlc:

I decided to try and build an application to handle this, without incorporating this functionality into VLC, but using VLC’s excellent RC interface. In short it allows you to control a running VLC instance by communicating with VLC’s built-in TCP-server.
If you want to give it a try be sure to:

  • Go to Tools-Preferences.
    Select Show All settings (bottom left corner)
    Click on Interface->Main interfaces
    Check “Remote control interface”
    Click on Interface->Main interfaces->RC
    Enter in the field “TCP command input”: 127.0.0.1:8765
    Check “Do not open a DOS command box interface”

vlc configuration page 1

vlc configuration page 2

  • Install the .NET Framework 3.5 (if not already available)
  • Windows XP, Windows Vista, Windows 7
  • A Windows MCE Remote , the following eHome compatible remote devices should be supported:
    • Microsoft/Philips 2005
    • Microsoft/Philips 2004
    • HP
    • FIC Spectra/Mycom Mediacenter
    • Toshiba/Hauppauge SMK MCE remote
    • Hauppauge OEM MCE remote
    • Mitsumi MCE remote
    • Fujitsu Scaleo-E
    • Pinnacle PCTV Remote
    • Shuttle MCE Remote
    • Centarea Master Remote II

Supported buttons and default mappings:

button vlc_command Description
None none
Power1 none
Left menu left navigate menu
Right menu right navigate menu
Pause pause pause
Power2 quit exit vlc
PowerTV none
Stop stop stop playback
Record record ?
Rewind key key-jump-short go 10 seconds back
Play play play
Forward key key-jump+short skip 10 seconds
Replay previous previous playlist item
Skip next next playlist item
Back previous previous playlist item
Up menu up navigate menu
Info key key-intf-show toggle display interface in fullscreen mode
Ok menu select menu select
VolumeUp key key-vol-up volume up
VolumeDown key key-vol-down volume down
Start none
ChannelUp chapter_n next chapter
ChannelDown chapter_p previous chapter
Mute key key-vol-mute mute sound
RecordedTV f toggle fullscreen
Guide none
LiveTV none
DVDMenu key key-disc-menu show dvd disc menu
NumPad1 none
NumPad2 none
NumPad3 none
NumPad4 none
NumPad5 none
NumPad6 none
NumPad7 none
NumPad8 none
NumPad9 none
NumPad0 none
Oem8 none
OemGate none
Clear none
Enter none
Teletext key key-aspect-ratio toggle aspect ratio
Red key key-aspect-ratio toggle aspect ratio
Green key key-deinterlace deinterlace
Yellow key key-subtitle-track toggle through all subtitles
Blue key key-audio-track toggle through all audio tracks
AspectRatio key key-aspect-ratio toggle aspect ratio
Print none
Down menu down navigate menu

Download:
Stable 1.0
www.arenddeboer.com/wordpress/wp-content/uploads/2010/01/Setupv1.0.10.zip

Beta

New version:
- Users can change the ip and port number
- More accurate device (ir remote) status
- SQLite db is stored in “users\AppData\mceRemote2VLC\” instead of the “Program Files\mceRemote2VLC”

This new version will not import your old custom mappings.

If you don’t need user defined ip/port settings, you probably don’t need to update.

http://www.arenddeboer.com/Setup.msi

A big “thank you” goes to the team of MediaPortal as most of the functionality is coming right out of this project

navigate menu

PDA / GPS bike mounted USB charger

December 27th, 2008 by Arend 16 comments »

An update on this post is found here and a step by step guide is posted here: (still a work in progress)

I love to go on holiday by bike. And as a tech nerd I can’t be bothered by plain paper-maps!
Having a GPS-mapping application like OziExplorer on your bike makes navigation very easy.

The problem however is with the rapid draining of the battery-powered GPS / PDA.
Especially mobile phones / PDA’s have a very short (battery) lifespan, often no more then a couple of hours when the display is always on and a GPS-application running. Normally I just dragged a lot of AA aka penlite batteries with me and powered the phone with a simple battery holder like this one:
4_aa_battery_holder1

Of course this isn’t the best solution and I was looking for better alternatives.
Then I stumbled upon this genius, hub-dynamo driven “Bike mounted USB Charger” on an English bicycle forum.
The idea is quite simple. You take a HUB-Dynamo (Shimano DH-3R30) (I ordered one from ebay for less then 40 euro).
The hub-dynamo generates an alternating current that needs to be rectified and the voltage output should be regulated to 5 volts for USB powered devices.

The hub-dynamo:
dscf2834

These are the parts you need, available at any electronic (parts) store.
D1 – D4     1N5818
C1             2200uF   16v
C2, C3       470uF     63v   Low ESR
C4             .47uF      Tantalum bead
C5             22uF       Tantalum bead
R1             47K         .25W

Solder the parts according to this schematic:
dynamo1sbp

And there you go, you have the best energy- efficient charger, all done with green energy!

This is my effort. It still needs some good housing and connectors but it works perfectly:
dscf28291

For more detailed information visit the bike forum at http://yacf.co.uk/forum/index.php
Many thanks go to Simon Galgut for providing the electronic schematic.

Google maps API for Flash

December 27th, 2008 by Arend No comments »

The nice folks at google have made a Flash library-api for google maps.
I have made a sample application which displays my “current” position on the map.

How it works:

Mobile phone
On the Mobile Phone,  a Windows Mobile 6.1 ( HTC Touch Diamond) runs a .NET CF 3.5 application that sends the current GPS-location to the server. This is done every second, or on a chosen interval.

Live tracking application

Live tracking application

The server
On the server there is a simple php script that stores the GPS-location and device-id, send by the phone, in a database.

The web-application
The web-application is build in Adobe Flex Builder 3  and fetches the last known GPS-location from the server.
It then  draws a marker on the map and starts updating again.

To get an idea of how it works without me being on the run (and running the gps mobile application) use the simulation mode.
I have recorded two sample tracks, a walking track and a track by car.

Things to do:
Smooth map movement
Select mobile device(s) to show, and zoom map to show all selected mobile devices.
Show (last known) direction, speed, distance, top speed..

(this is partly implemented in the html/javascript version on http://www.arenddeboer.com/liveTracking/)