Shift registers and Voltage display

I’ve been having great fun with the Arduino Uno microcontroller board.  Here I’ve got the Arduino using a shift register to light up a 7-segment display output.

20130706_143236

This device is reading the output voltage of the solar panel out to a 2-digit, 7-segment display.  So basically it’s a light meter!  The real fun of this little project has been writing the driver in C++ Arduino-code to run the shift register.  Magic!

Posted in Electronics, Solar | Leave a comment

Cars.com Data Miner

I’ve been working on a simple internet data miner using the .NET WebBrowser form.  Getting raw html into a .NET program is as easy – just navigate the WebBrowser to an internet address and you can click around and browse as usual, all while

page1 tab   page2 tab

You just have to get through a little bit of this mess:

<div class="col20 vehicle-info">
 <h4 class="secondary">
 <a name="&lid=md-ymmt" rel="nofollow" href="/go/search/detail.jsp?tracktype=usedcc&amp;csDlId=&amp;csDgId=&amp;listingId=132207735&amp;listingRecNum=2&amp;criteria=feedSegId%3D28705%26rpp%3D50%26isDealerGrouping%3Dfalse%26sf2Nm%3Dmiles%26sf1Nm%3Dprice%26sf2Dir%3DASC%26stkTypId%3D28881%26PMmt%3D1-1-0%26rn%3D0%26zc%3D95008%26rd%3D20%26crSrtFlds%3DstkTypId-feedSegId-mkId-mdId%26mdId%3D21758%26stkTyp%3DU%26mkId%3D20089%26sf1Dir%3DDESC&amp;aff=gogsemc&amp;listType=4">

 <span class="modelYearSort">2012</span>
 <span class="mmtSort">Volkswagen Passat SEL</span>
 </a>

 </h4>

but how hard can that be?  The only problem will be if Cars.com changes its html search results code, but after a little fine tuning I was able to download data on about 2600 cars from the website.  A little .NET is a small price to pay for car-buying confidence.

Posted in Software | 1 Comment

Mustang for Sale

The end of an era!  My 1991 Ford Mustang just sold.

1991mustang listing

That car and I went through a lot together – trips from FL to NY, FL to CA, and 13 years of daily driving.  It was time to let go, though, I just don’t have the time, money or room for a project car.

The Mustang ended things on a lucky note, though.  Right after I got the heater core bypass finished, I took the car down for a smog check so that I could legally sell it in California.  The damn thing passed just one PPM shy of the maximum hydrocarbon level in the exhaust.  Talk about close call!  So with the mechanical squared away, I took the car for a Delta Queen car wash then a photoshoot and I stuck her straight on Cars.com for sale.

Posted in Cars | Leave a comment

Side by side automobiles

I just bought a new car.  It’s a 2012 Volkswagen Passat, and for a few brief months I will be the legal owner of two automobiles.  I thought I would snap a picture while I actually owned two clean automobiles….

car 1 and car 2

Now it’s time to get selling that Mustang.  I will be glad to not deal with car that fails to hot start, leaks power steering fluid aggressively, and is missing a heater core.

Posted in Cars | Leave a comment

Heater Core Bypass

Now there are a few problems with my 1991 Ford Mustang, but assessing car problems is a good time to seperate needs into MUSTs and WANTs.  Starting from a list of about 8 items, it turned out that there were only two MUST-DO items.  The first was pass a smog check for the Mustang because you need that to transfer ownership of a vehicle in California.  The second was bypass the heater core because the Mustang was spraying so much coolant around that it was in no shape for a smog test or even much driving.

20140128_170251

20140206_180139

Posted in Cars | Leave a comment

So many cars!

Being in the market for a new car is overwhelming!  A car is a big purchase, and if you’re like me this is a decision that you only make once every decade or two.  There are thousands of cars available so how can you know you made the right choice?

Well, this time I decided to do some data mining on Cars.com to help me figure out what is going on with new and used cars in the area.  A little html parsing magic later, I was able to survey all of the new and used cars available in my target class: midsize sedans.

global data

Looking out from new cars to 20 yr-old cars in the class I was expecting some sort of exponential decay in price versus the age of the car.  Instead I think the data shows three distinct regions, where depreciation values are stated as a function of the original selling price:

  1. fast initial depreciation at about 18%/yr over the first two years
  2. depreciation at about 6%/yr over the next ten years
  3. stabilization at selling price of $5000

For any given make/model/year/trim category, there is still a pretty wide spread in dealer list prices.  My strategy was to watch this data for several weeks and look for outliers – cars that were selling at the tail of the distribution but with clean histories and low mileage.   A little data mining is a small price to pay for confidence in car-buying decisions!

Posted in Cars, Data | 1 Comment

Samurai II

Ok, so maybe I got a little too excited when I was talking about my first Samurai game.

I’ve been working on resurrecting the idea, except using some respectable 3D graphics, better user input and more realistic physics.  Samurai II is in the works.

samurai2

I’ve decided to work in DirectX11 and it is truly amazing how powerful modern 3D engines can be.  For this project I owe a great debt to RasterTek, without whose tutorials I would not have gotten this far.  The current build has working 3D collision physics between sword and swordfighters, where green-to-red shading shows a damage level.  The character models were split into limb sections using Blender (the best free 3D modeling tool?).  The terrain has some random hills and the texture is based on a picture of some grass from Tallahassee, FL.

Next steps include adding gravity and reworking the footwork and swordplay to make the character feel agile and precise.  Wish me luck!

Posted in Software | Leave a comment

Samurai!

If you know me fairly well and if you also happen to be into computer games, I’ve probably told you about my game, Samurai!.  The game was a project for me in 2004 using some very poor graphics library in C++ but despite its technical shortcomings… IT WAS AMAZING!!!

samurai1_arena

I’ve always felt that computer games don’t really capture sword-fighting very well.  In the late 90s, I was inspired by Die by the Sword because it was the first game to allow free sword movement instead of preset “attack” animations.  Taking Ryse as an example, stuffing pre-rendered animations into fighting mechanics has gotten much worse over the years.  The only problem I had with Die by the Sword was that the swordplay was too clunky for me to really get into it.  

So of course, the only reasonable thing to do was to write up a new game and “3D” engine from scratch so that I could get everything just the way I wanted.  SAMURAI!

You can play too!  Rename “Samurai.key” to “Samurai.exe”

Posted in Software | Leave a comment

Rock candy

For Halloween this year, I was inspired to transform myself into Walter White, the protagonist from the Breaking Bad television series.

In my mind, the most important part of the costume would be the blue crystals.  As a trained chemist, I knew that I would not willingly purchase a costume prop that I could make myself.  So I embarked on a quest to grow blue-tinted rock candy crystals.

The first step is to prepare a saturated solution of sugar in water.  I was surprised to discover that about 2 cups of white sugar dissolve into 1 cup of water.  Don’t forget the blue food coloring!

The second step is to cool the solution very slowly back to room temperature.  I recommend performing the cooling step over 2-3 hours.  I used nested pots to control the temperature: the larger pot contains water and the smaller pot contains the saturated solution.

20131025_231042

The third step is to remove the crystals from the saturated solution and wash off the syrup to yield the dry, brittle final product.  It took me a hammer and a few screwdrivers to get the biggest crystals out, and then an overnight air drying before the rock candy was ready to go.

20131025_231228

Boom!  Instant meth!

photo

Posted in Home projects | Leave a comment

Introducing Abella

Sound and light!

abella1

http://www.youtube.com/watch?v=ccJRsY-8vOs

Here is some footage from early hardware development of “Abella,” my Arduino-powered electronic instrument. Yes, it is in a shoebox, and yes, the control knobs are popped through the cardboard.

There is a control for pitch and one for volume. The box turns a different color for each of the twelve semi-tones so you can select a note before playing it.

This is a project inspired by the theremin, perhaps the most challenging and mysterious musical instrument.  In 2005, I followed some guide to make a Radioshack theremin, but without any knowledge of electronics I couldn’t take the project as far as I had wanted.  I ended up with half of an octave in range and I was able to create some strange sounds, but that was about it.

Fast forward 8 years and now we’ve got microcontrollers like Arduino Uno on the market that are fast enough to do some decent direct digital synthesis of audible waveforms.  I’ve got to thank Martin Nawrath for providing the programming code and circuit suggestions for a starter Arduino music box.

The version I’m playing here has a potentiometer working from 0-5V to set the pitch, and the input is binned to 15 notes spanning two octaves of A major centered at 440 Hz.  I’ve taken the basic sine waveform and added some harmonics to thicken the sound a bit, pushed the digital PWM output through an RC filter, and divided the output over a second potentiometer to control the volume.

I’ll have some more to say about the lights and the vibrato in a bit.  Catch you later!

Posted in Electronics, Music | Leave a comment