Saturday, July 4, 2015

LED POV Fan Update

I first posted on how to reprogram a "Programmable Message Fan: Model 45 Series" POV fan a few years ago, and the code I posted no longer works with the current versions of the Octave and Arduino software.  The original post still describes how the fan works and how I went about figuring it out, and this is just an update to the software to reprogram it.


I'm taking the same general approach, where a script run on a computer writes an Arduino sketch that can be compiled and uploaded via the Arduino IDE.  The Arduino sketch isn't elegant, but it works.  The only real change that broke the generated Arduino code is that they changed the "send" method to "write" in the newer versions of the I2C "Wire" library.  I am using Arduino software version 1.6.5 with a clone of the Arduino UNO board.

On the scripting side, though, things have changed a bit more.  I used Octave back in 2011 because I was using Matlab a lot at work for data processing and analysis, and Octave was pretty similar.  Since then, I've moved on to Python and haven't looked back, so my update here is written in Python rather than trying to update to whatever the current version of Octave is.  I have a pretty simple module called "pov.py", and a demo file called "demo_pov.py" that shows how to use it.  It does some simple checking on the inputs and will filter out invalid screens, then create the .ino file for programming the Arduino.  I tested the Python script with both Python 2.7.5 and 3.4.3.  I'm not using anything beyond the standard library here, but if you're interested in Python, I highly recommend the Anaconda distribution.

I've also switched where I'm hosting my source code files.  In the past, I would just upload a .zip file of source code to SourceForge.  Since then, I've learned a lot about version control and come to really appreciate the benefits of using a version control system.  My personal favorite is Git, and I'm using GitHub to host my projects right now.  Here's the link to the new files.

6 comments:

  1. I have one of these fans, and have tried to 're-program it with my Arduino Mega 256.. I've traced the pins out to the socket (mine only has four pins). I wire it up, but all I manage to do is corrupt the LED sequence for a couple of power cycles, then I'm back to the original text.

    ReplyDelete
  2. Hi Zach - Thanks so much for all your hard work!

    I got 2 of the newer blue fans at a conference, 1 for each of my kids :)

    I have read everything on your older post and this post, and have connected my Arduino UNO to the fan card and I have uploaded your sample to the fan - It all works / runs GREAT!!!

    My problem is that I don't know Python - I downloaded the Anaconda version you linked to - What do I do to run your script? I'm sooooo close - please help!

    ReplyDelete
  3. Never mind - I figured it out Zach!

    I was not adding the .py at the end of my command line, expecting Python to have known file types.

    As soon as I typed "python demo_pov.py" instead of "python demo_pov" it all worked - I knew it would be something simple!!!

    ReplyDelete
  4. Heh, yeah, I have one of these fans too albeit with Shenzen's finest L24C04-SI instead, and with what looks like a mini-usb port to connect (upgrades, perhaps?)... Ooh I'm glad I dug this fan up :)

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete
  6. I’m still trying to figure out the hardware. Nothing is labeled! I don’t know what I’m doing. I’m flying blind here. Help!

    ReplyDelete