Arduino + LEDs + fan = POV "APPLAUSE" sign

 by duboisvb
FeaturedContest Winner
photo.JPG
 

I saw these POV(Persistence of Vision)  devices on other Instructables and thought I would like to make one and I have always wanted my own "APPLAUSE" sign.  Next improvement will be to make it go on whenever I enter the room.  :)  Maybe have it say, "And here's Charlie !" But that is for another time.

So I got a fan at a garage sale, did some reading , found some code and below is a video of my machine in action.

I started with nice code from an Instructable by Scott Mitchell - "Arduino Bike POV" but what I ended up with is his code greatly parred down.  I could not get it to work at first and so I keep changing the code .  Turned out my problem had nothing to do with the code. So I am going to go back to his code and try again as his is much more generic and would work more easily with different phrases.   But that is for later also.

The video below shows the POV in action. It does not seem as broken or disconnected in real life as it does on the video.




 
Remove these adsRemove these ads by Signing Up

Step 1: Get stuff

DSC00215.JPG

Items used in this project:
small fan - garage sale - 2.00
misc lumber - my basement - 0.00
a length of plastic  15 by 2.5 inches  - my basement - 0.00
an Arduino - I use a Ardweeny from SolarBotics - about 10.00
7 red LEDs -  already had -  1.00
7 - 330 ohm resistors - 3.00
Halls Sensor - I got from Adafruit - US5881LUA - 2.00
1 10k resistor to be used with the Halls sensor - 1.00
2 magnets from local hobby store - 1.00

also will need : wire, 9v battery , screws, Loctite 5 min epoxy, small PCB from Radio Shack

 

dudbarn says: Aug 13, 2012. 5:13 PM
I am trying to find a fan that will have some fairly strong wind generated when hooked to Arduino Uno. I bought a computer cooling fan, but it did not produce much wind. Need more powerful fan. Anyone have suggestions? The fan should be able to blow a sheet of paper off a table (for example). Thanks!
duboisvb (author) in reply to dudbarnAug 13, 2012. 6:15 PM
I have a project where I use an arduino and a motor controller shield along with a DC motor that has a propeller attached. the DC motor was gotten at a local hobby shop and it was originally meant to fly RC airplanes. It is pretty powerful and it blows a lot of wind. Perhaps that would work for you.
dudbarn says: Jul 19, 2012. 8:29 AM
I am trying to find help with the following error I receive when I attempt to load the program onto my Uno...

byte b = font[ch][i];    "font" nt declared in this scope

fanfk2.cpp: In function
'void printLetter(char)': fanfk2:103: error: 'font' was not declared in this scope
fanfk2.cpp: At global scope: font:32: error: redefinition of 'const unsigned char font [95][5]'


I appreciate any help to this "noobie" 
duboisvb (author) in reply to dudbarnJul 19, 2012. 1:15 PM
what I suspect may be wrong is the following:
Your arduino sketch should consists of 2 pieces each in its own tab

1. the arduino code from this instructable but only from the begining of the code to the the line "delayMicroseconds(51000);"

2. then thewre is a drop down menu which you access by clicking the little arrow on the upper right of the shetch (just under the serial monitor icon) . select "new tab" and name it font.h. then copy and paste the remainder of the code into that tab.

hard to explain but I hope that helps

dudbarn in reply to duboisvbJul 19, 2012. 8:18 PM
What would you code to hve the fan display other words?
e.g. it would say "applause" for 5 seconnds, then display "winner" 5 seconds and so on...

Thanks!
duboisvb (author) in reply to dudbarnJul 20, 2012. 6:57 AM
I did a POV which had 4 different phrases. Perhaps you can modify the code to your needs
http://www.instructables.com/id/Simple-POV-wArdweeny-Persistence-of-Vision/
dudbarn in reply to duboisvbJul 22, 2012. 7:35 AM
I have the program loaded and working, however, it seems the letters are too narrow. How does the width=5 command work? Is that the determining factor for the letter width?

Also, you said you didn't use a sensor. I don't have one either, but perhaps my fan runs at a different speed and my letters spin around in a circle. Where in the code can I make adjustments to play around with this?

Thanks,...again

Gary
duboisvb (author) in reply to dudbarnJul 23, 2012. 8:58 AM
hello,

the width = 5 refers to the font.h file.
when you look at the font.h file you see that each letter is a matrix of 5 unigue pieces. each piece will light the 7 leds in a pattern that when done quickly and in the proper sequence will produce the letter required.

worddelay will define the blank space between each word so you can play with that to get more or fewer words in the circle


delayMicroseconds(500); this effects the time between 2 columns of leds

delayMicroseconds(2800); this effects the time between 2 different letters

You will need to adjust the above 2 based on the rpms of your fan. just trial and error

hope that helps
dudbarn in reply to duboisvbJul 24, 2012. 6:16 AM
Thanks for the help. I have played with the numbers and just can't seem to get it right. Still moving too fast and the letters are not really clear.
I was curious if adjusting the variable here

var = 0;
while(var < 95){
// do something repetitive 120 times

would make a difference.

Gary
duboisvb (author) in reply to dudbarnJul 25, 2012. 10:41 AM
the var adjusts how long an individula phrase will be shown before going to the next phrase. I do not think that variable will have much effect on the spacing of the letters and words.

I am surprised the other 2 lines did not make drastic differences. Do not be afraid to change the 500 to say 2000 and the 2800 to say 10000. Try very big numbers to get something to happen and then scale it back if needed
dudbarn in reply to duboisvbJul 20, 2012. 6:33 PM
Thanks! I'll give it a try. I appreciate your willingness to share!
dudbarn in reply to duboisvbJul 19, 2012. 7:14 PM
I had already done that because I read all the previous comments. My problem was I had 2 tabs, font and font.h that were interfering. I got it working!

Thanks for the quick response and help. I love it!!!

Gary
dchurch24 says: Nov 14, 2011. 3:29 AM
Hi, does the hall effect sensor have to be at the other end (opposite the LEDs)? I have designed a PCB with the hall sensor just in front of the 1st LED. Would I need to change the code (the delay part) for this to work?
duboisvb (author) in reply to dchurch24Nov 14, 2011. 1:23 PM
I have not worked with the hall sensor much but what I found was that it acts like a switch and so i have one sensor 180 degrees from the other because I just wanted the word to appear at the top of the circle. With just one sensor it would turn on the first time around and then off the second time around , etc. You could produce images all the way around the circle. You would have to play with the delay time to get good spacing . hope that helps.
dchurch24 in reply to duboisvbNov 16, 2011. 12:17 AM
Are both of your sensors plugged into the same Arduino pin? Reading through the code it seems like that might be the case.
duboisvb (author) in reply to dchurch24Nov 17, 2011. 1:59 PM
There is only one Halls sensor. It is attached to the part that spins. As it reaches the first magnet, it will be turned on and the software will detect that and then start the LED's . When it reaches the second it is turned off ( the lower half of the cycle)
dchurch24 in reply to duboisvbNov 18, 2011. 4:15 AM
Thank you. That makes much more sense now. For some reason I thought you were using two sensors!
dchurch24 in reply to duboisvbNov 15, 2011. 2:43 PM
Excellent, thank you for the reply. I have ordered 10 sensors (I couldn't find anywhere that only sold singles, but I have no complaints ;-) ).

I've just made a small home-printed PCB (following instructions from here and elsewhere) with 7 LEDs on and the holes ready for the hall sensors.

I'll keep you posted on my progress. Keep up the good work. Thanks for an easy to understand Instructable (it's actually the first that I've tried to put into practice).
dchurch24 in reply to dchurch24Nov 20, 2011. 2:18 AM
Hi, well, I'm still waiting for my hall effect sensors from China - so I went ahead and made it anyway. I changed the code and guessed at the rotation speed instead of using the sensors (I will change it back when they arrive). However, it only bloody works! The text spins sightly, especially as the motor battery discharges, but there is text spinning and is readable!

My kids love it! So, thanks once again for making an easy to understand 'able.
duboisvb (author) in reply to dchurch24Nov 22, 2011. 10:07 AM
thanks. I am glad it is working for you.
bears0 says: Sep 1, 2011. 5:45 AM
what about hacking one of those little handheld fans that are pre-made POV's. i wanna learn how they make those.
Blackice504 says: Aug 16, 2011. 6:17 AM
hi mate i copyed the code into my arduino software and it comes up with this error

sketch_aug16a.cpp:28:19: error: font.h: No such file or directory
sketch_aug16a.cpp: In function 'void printLetter(char)':
sketch_aug16a:103: error: 'font' was not declared in this scope
sketch_aug16a.cpp: At global scope:
sketch_aug16a:129: error: expected unqualified-id before '--' token

i am very new to programing with microcontrollers so i not sure how to fix this any ideas?
duboisvb (author) in reply to Blackice504Aug 16, 2011. 6:22 PM
Hello,
I think this may be the problem:
I did not spell it out in the instructable and that is my fault but ....

In the instructable the code is actually 2 files. I get the same error if I copy and paste the whole code listing into an Arduino sketch but if you do the following it does verify:
copy and paste from the top of the file to the point where font.h is started ie the last 2 lines of the copy will be :
delayMicroseconds(2500);

}

Then in the arduino sketch you need to click on the arrow that is in the box on the right near the top and select "new tab" , name this font.h , copy and paste the font.h code from the Instructable into this sketch.

I just tried this again and it worked but after doing the copying and pasteing, I did need to go back and delete a couple of lines that were not commented out properly eg
------------------------------------- this line
and

*/ this line


So in summary:
you need the font.h to be a seperate file (or tab)


Hope that helps
Blackice504 in reply to duboisvbAug 16, 2011. 7:08 PM
i shall try this.
thank you for pointing this out.
Blackice504 says: Aug 16, 2011. 6:20 AM
oh yeah i was thinking of using a PC fan and the sensor wire i think i can find the code for that from the examples from the arduino website but i think that should work.
nmvb says: Jun 20, 2011. 7:06 PM
What is a Halls Sensor?
godofal in reply to nmvbJun 20, 2011. 9:09 PM
a hall effect sensor if a chip that detect magnetic forces and electric current :)
here its used to know when a certain point is reached on the circle, so the arduino knows when to start blinking the LED's
duboisvb (author) in reply to nmvbJun 20, 2011. 9:06 PM
It is a electronic component that senses the presence of a magnet field. There are different types but the one I used changes states when near the north pole of a magnet and then changes back when near the south pole. This change of state can be "read" by the arduino and used as a signal to do something.

The following URL is to the Adafruit item that was used and a more detailed explanation can be found there.

http://www.adafruit.com/products/158
nmvb in reply to duboisvbJun 21, 2011. 5:38 AM
oh, thanks :D
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!