Monday, December 1, 2008

USB Logger using a Vdrive2

I built a simple Data logger using a Vinculum Vdrive2. The logger records two sources of voltages within 0 to 5 volts. An 8 bit entry every second is recorded in a USB stick as a .csv file, suitable for use in Excel.

When I first got my Vdrive2 module, I built an RS232 interface to allow sending commands and viewing the responses with Hyperterm. My schematic of the interface can be found here.

You can update the flash ROM on the module by going to FTDI's website and downloading a FTD file to the memory stick. By changing the name to ftrfb.ftd, the Vdrive2 will detect the file and upgrade itself when powered up. Once this is done, remove the file from the stick before starting again. Otherwise it will try re-flashing the ROM again. When I got the module, it had a pretty old version in it, version 2.08.

Each entry into the USB stick is as follows:

A time stamped number of YYMMDDHHMM,ADC value1,ADC value 2,cr

2 hours worth or 7200 entries are placed in a file with the following date stamp.


How the logger works.

A debug port from the logger allows one to follow the operation in realtime with a PC running Hyperterminal.

The logger uses a DS1307 real time clock for date information. To set the date, a small file is placed on the USB stick. You can use notepad to make this little file. Name it "date.txt"

Using notepad, format the date as follows:


As an example, the time is 2008 on November 24th at 2 pm. 24 hour mode is used. The sequence would be:


When starting up, the little file is read and the date is set. Then the file is renamed to "ndate.txt" to prevent changing the time again. To reset the time, change the file to a new date and rename back to "date.txt". This makes setting the RTC easy.

To prevent loss of data while a file is open, a backup supply is turned on. An opto coupler is used to detect when to start and stop logging. Power to the opto comes from the main source of power. When the power drops off, the file is first closed and backup power is disconnected when done.

My first prototype was built on perfboard with plans to make PC boards in the future (if enough interest is generated). The pic microcontroller is a 16F688 and programmed using Pic Pro Basic. I used Microcode Studio as an IDE and programmed the Pic using the PICkit 1. To do ICSP, I made a little adaptor to bring out the connections from the PICkit 1 to the project. USB stick used with this project was a Kingston Data Traveler DTI/256.

I'm not the best in writing clean programs, but it works. Any suggestion on improvement is welcomed. One idea for improvement is to start getting it to delete the oldest files when the stick gets full. That would require making the memory into a circular buffer. Just haven't figured the file management scheme yet.

Schematic: Vdrive2 Project

Code (8 bit version):
Program "1_PerSec.bas"



Typical file "08120117.csv"

10 bit version


hex file

Tuesday, April 29, 2008

Joule Thief Artbots


A popular circuit for electronic hobbyists called a "Joule Thief" has been making the rounds on the Internet.
When your batteries go dead, there is still energy or "joules" still left in that battery. Instead of simply tossing it out to get recycled, why not squeeze out the remaning joules of life to do something useful.

With the Joule Thief circuit you can light a white led till the battery is down to .2 volts. Use it for a night light, it will run for days. Then, when it is good and dead, give it to the trash collector to get recycled.

2/10 volt and the led is still on!

The circuit consists of a ferrite core with a double winding, a transistor, resistor, led and the "dead" battery for power. Thats all there is. Sure you can put the parts on a perf board and make it work. I wanted more, so I built some artbots with the parts.


Ferrite uses a vintage germanium transistor to be able to run at very low voltages. Like all the way down to .2 volts.


Germanium also uses a vintage (1966) germanium transistor. This one is from General Electric. "Ge" is also the elemental name of germanium on the Periodic Table of Elements!

Here is a good modification you can do. Change the 1k resistor to something around 2.2k to 10k and place a CDS light sensitive resistor between the transistor base and emitter (or use a trimmer). This mod will make the circuit light sensitive and cause the circuit to shut down during the day. When its dark , the white led will light. Now how about that for a proper night light!

So go ahead and google "joule thief" and see what you can find, then make your own artbot.

Windsonics Album

I have received a lot of great response to my windharp music. I put together a group of my latest work at Soundclicks. Just go to

You can download my "songs" or just listen to relaxing sounds created by the wind.

Saturday, March 22, 2008

Wind Harp for Maker Faire 08

I completed my second Wind Harp. This one will be shown at Maker Faire in San Mateo California (Bill's Artbots, thats me!). Strings for the instrument are standard guitar strings, very much adjustable using guitar tuner machines. I wound my own humbucking pickup which is connected to a special preamp I designed using a LT1167 Instrumentation amplifier IC. The pickup is electrically balanced enough not to pick up surrounding AC hum, which was a problem with my other 8 foot contraption on my shed. The quality of sound is impressive.

Information on its construction is at my Maker Faire wind harp page. You can hear my Windsonics album, my best work yet with more to come.