Simple POV W/Ardweeny - Persistence of Vision
by duboisvb in Circuits > Arduino
15988 Views, 27 Favorites, 0 Comments
Simple POV W/Ardweeny - Persistence of Vision
This is basically a remake of a previous POV project but I scaled it down a bit
The original is from this instructable https://www.instructables.com/id/Arduino-LEDs-fan-POV-APPLAUSE-sign/
This particular one will be given to a relative who has decided she is a Honey Badger . Her inspiration is from a popular YouTube video about Honey Badgers. But the phrase that is produced is easily changed in the code so this is a project that others could use for other reasons.
The original is from this instructable https://www.instructables.com/id/Arduino-LEDs-fan-POV-APPLAUSE-sign/
This particular one will be given to a relative who has decided she is a Honey Badger . Her inspiration is from a popular YouTube video about Honey Badgers. But the phrase that is produced is easily changed in the code so this is a project that others could use for other reasons.
Supplies
Items used in this project:
At a flea market , I had purchased 5 computer fans for a dollar each so I used one for this project. I was not sure if it would be strong enough to turn with the battery and the attached PCB but it does turn easily.
misc lumber - my basement - 0.00
a length of plastic 9 by 1.25 inches - my basement - 0.00
an Arduino - I use a Ardweeny from SolarBotics - about 10.00
7 red LEDs - already had - 1.00
7 - 470 ohm resistors - 3.00
1 - 7805 voltage regulator - 1.00
1 - 12 volt wall wart - already had - 0.00
2 - small SPST switches - had in my supplies - 0.00
1 - old record - 0.00
also will need : wire, 9v battery , screws, Loctite 5 min epoxy, small PCB from Radio Shack
At a flea market , I had purchased 5 computer fans for a dollar each so I used one for this project. I was not sure if it would be strong enough to turn with the battery and the attached PCB but it does turn easily.
misc lumber - my basement - 0.00
a length of plastic 9 by 1.25 inches - my basement - 0.00
an Arduino - I use a Ardweeny from SolarBotics - about 10.00
7 red LEDs - already had - 1.00
7 - 470 ohm resistors - 3.00
1 - 7805 voltage regulator - 1.00
1 - 12 volt wall wart - already had - 0.00
2 - small SPST switches - had in my supplies - 0.00
1 - old record - 0.00
also will need : wire, 9v battery , screws, Loctite 5 min epoxy, small PCB from Radio Shack
Begin Assembly
1. Cut a small - 2 by 2 - piece of 1/4 inch plywood and epoxied to the fan hub . Right now the epoxy is the only thing holding the LED assembly to the fan. I have had good luck with the Loctite but it could be the weak link in this setup. Time will tell.
2. I cut a 9 by 1.25 inch piece of plastic from some stock I had. Sheets of plastic can be had at Home Depot. I just guessed at the size and it turned out to be pretty good.
3. Drill 7 holes in one end about 3/8 of an inch apart for the LEDs. I found a drill size that allows the LEDs to be pressed into the holes quite tightly.
4. Insert the 7 LEDs into the holes.
2. I cut a 9 by 1.25 inch piece of plastic from some stock I had. Sheets of plastic can be had at Home Depot. I just guessed at the size and it turned out to be pretty good.
3. Drill 7 holes in one end about 3/8 of an inch apart for the LEDs. I found a drill size that allows the LEDs to be pressed into the holes quite tightly.
4. Insert the 7 LEDs into the holes.
Wiring the Leds and Attaching to the Ardweeny
The Ardweeny from Solarbotics comes in a kit and it requires about 30 minutes to solder the pieces together. It is intended to be used on a breadboard. After I have bread boarded the circuit, I solder it to a small piece of PCB board which I can in turn attach to the plywood . The Ardweeny will spin along with the LEDs.
After the Ardweeny is constructed, it is time to wire up the LEDs. I used a bare copper wire as a common ground wire. Each of the short wires from the LEDs is soldered to the copper wire and then the copper wire is connected to a ground on the Ardweeny. From the longer, positive leg, of the LED attach a wire to the Ardweeny and include a 470 ohm resistor in the circuit.
I connected the LEDs to pins 1,2,3,4,5,6,7 with the inner most LED being connected to pin 1.
A voltage regulator is also needed and I added a small SPST switch so I can control the power to the Ardweeny.
I find using the short lengths of wire with female/male ends already attached in combination with some headers soldered to the PCB will make the build easier and reuse for possible without a lot of desoldering.
After all connections are made, attach the Ardweeny to the plastic with small bolts thru a short length of plastic tubing, which is used as a stand off for the PCB.
After the Ardweeny is constructed, it is time to wire up the LEDs. I used a bare copper wire as a common ground wire. Each of the short wires from the LEDs is soldered to the copper wire and then the copper wire is connected to a ground on the Ardweeny. From the longer, positive leg, of the LED attach a wire to the Ardweeny and include a 470 ohm resistor in the circuit.
I connected the LEDs to pins 1,2,3,4,5,6,7 with the inner most LED being connected to pin 1.
A voltage regulator is also needed and I added a small SPST switch so I can control the power to the Ardweeny.
I find using the short lengths of wire with female/male ends already attached in combination with some headers soldered to the PCB will make the build easier and reuse for possible without a lot of desoldering.
After all connections are made, attach the Ardweeny to the plastic with small bolts thru a short length of plastic tubing, which is used as a stand off for the PCB.
Hall Sensor
This time , I did not use a sensor to trigger the LEDs. I was able to get it pretty good in the code.
Finish the Construction
The remaining steps were:
- attach the plastic arm to the wood hub with small wood screws.
- attach the 9 volt battery to the plastic arm . As the battery may need to be replaced, I wire tied it to the arm but that turned out to be not enough of a tie down. As the arm spins , the battery will try to be flung from the arm so I glued in a small piece of wood to keep it from dislodging. Also the more balanced you can get the arm, the less vibration it will do .
- I then built a stand from scrap wood, painted it black
- I attached the fan (which has the arm attached ) to an old LP record . The record inturn is attached to the stand .
- I used a wire tie to make a tension relief for the wire and added a SPST switch so I can turn the power on/off to the fan.
- The AC adapter is a 12volt 200 milli amp that I had around.
- attach the plastic arm to the wood hub with small wood screws.
- attach the 9 volt battery to the plastic arm . As the battery may need to be replaced, I wire tied it to the arm but that turned out to be not enough of a tie down. As the arm spins , the battery will try to be flung from the arm so I glued in a small piece of wood to keep it from dislodging. Also the more balanced you can get the arm, the less vibration it will do .
- I then built a stand from scrap wood, painted it black
- I attached the fan (which has the arm attached ) to an old LP record . The record inturn is attached to the stand .
- I used a wire tie to make a tension relief for the wire and added a SPST switch so I can turn the power on/off to the fan.
- The AC adapter is a 12volt 200 milli amp that I had around.
The Code
/ Code for the Arduino Bike POV project
The original code is from an internet find which is noted in the comments
I have modified it greatly
Some issues:
without a hall sensor, one will have to play with the time between words to get a reasonably stable image
// Arduino Bike POV
//
// by Scott Mitchell
// www.openobject.org
// Open Source Urbanism
//
// Copyright (C) 2008 Scott Mitchell 12-10-2008
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//============================================================
// 6/2011 heavily modified by c. Dubois for my POV project
// Hall sensor is a switch so I used different code for it
// also used a font.h that I found
// ------------------------------------------------------------
// defining the alphabet
#include "font.h"
// define the Arduino LED pins in use
const int LEDpins[] = {
1,2,3,4,5,6,7};
// number of LEDs
const int charHeight = sizeof(LEDpins);
const int charWidth = 5;
int var = 0;
int worddelay = 50000;
// sensor setup
const int sensorPIN = 0; // define the Arduino sensor pin
// boolean sensorFlag = false; // stores sensor state
int sensVal; // variable to store the value coming from the sensor
const char textString[] = "CLAIRE";
const char textString2[] =" is a ";
const char textString3[] ="HONEY ";
const char textString4[] ="BADGER";
void setup()
{
pinMode(13, OUTPUT);
pinMode(1 , OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
// Serial.begin(9600);
}
void loop()
{
// turn on Led for a circle in middle and proof that arduino is powered
digitalWrite(13, HIGH); // set the LED on
// sensVal = analogRead(sensorPIN); // read the Hall Effect Sensor
// Serial.println(sensVal);
// delay(500 );
// if (sensVal != 1023 ) {
// Turn on the leds to test that they work and create circles
digitalWrite(1 , HIGH); // set the LED on
delay(500);
digitalWrite(2 , HIGH); // set the LED on
delay(500);
digitalWrite(3 , HIGH); // set the LED on
delay(500);
digitalWrite(4 , HIGH); // set the LED on
delay(500);
digitalWrite(5 ,HIGH); // set the LED on
delay(500);
digitalWrite(6 ,HIGH); // set the LED on
delay(500);
digitalWrite(7 ,HIGH); // set the LED on
// delay to let the fan get to speed
delay (3000);
// printing every letter of the textString
// then clear and print textstring2
var = 0;
while(var < 200){
// do something repetitive 150 times
for (int k=0; k<sizeof(textString); k++){
printLetter(textString[k]);
}
var++;
// space between words
delayMicroseconds(worddelay);
}
//clear the LEDs
digitalWrite(1 , LOW); // set the LED off
digitalWrite(2 , LOW); // set the LED off
digitalWrite(3 , LOW); // set the LED off
digitalWrite(4 , LOW); // set the LED off
digitalWrite(5 ,LOW); // set the LED off
digitalWrite(6 , LOW); // set the LED off
digitalWrite(7 , LOW); // set the LED off
// delay between phrases
delay (500);
// ------------------------------
// -- now do second phrase ----
var = 0;
while(var < 100){
// do something repetitive 75 times
for (int k=0; k<sizeof(textString2); k++){
printLetter(textString2[k]);
}
var++;
// space between words
delayMicroseconds(worddelay);
}
//clear the LEDs
digitalWrite(1 , LOW); // set the LED off
digitalWrite(2 , LOW); // set the LED off
digitalWrite(3 , LOW); // set the LED off
digitalWrite(4 , LOW); // set the LED off
digitalWrite(5 ,LOW); // set the LED off
digitalWrite(6 , LOW); // set the LED off
digitalWrite(7 , LOW); // set the LED off
// delay between phrases
delay (500);
// -- now do third phrase ----
var = 0;
while(var < 100){
// do something repetitive 200 times
for (int k=0; k<sizeof(textString3); k++){
printLetter(textString3[k]);
}
var++;
// space between words
delayMicroseconds(worddelay);
}
//clear the LEDs
digitalWrite(1 , LOW); // set the LED off
digitalWrite(2 , LOW); // set the LED off
digitalWrite(3 , LOW); // set the LED off
digitalWrite(4 , LOW); // set the LED off
digitalWrite(5 ,LOW); // set the LED off
digitalWrite(6 , LOW); // set the LED off
digitalWrite(7 , LOW); // set the LED off
// delay between phrases
delay (250);
// -- now do fourth phrase ----
var = 0;
while(var < 175){
// do something repetitive 200 times
for (int k=0; k<sizeof(textString4); k++){
printLetter(textString4[k]);
}
var++;
// space between words
delayMicroseconds(worddelay);
}
}
// }
// ------------------- Functions _________________
void printLetter(char ch)
{
// make sure the character is within the alphabet bounds (defined by the font.h file)
// if it's not, make it a blank character
if (ch < 32 || ch > 126){
ch = 32;
}
// subtract the space character (converts the ASCII number to the font index number)
ch -= 32;
// step through each byte of the character array
for (int i=0; i<charWidth; i++) {
byte b = font[ch][i];
// bit shift through the byte and output it to the pin
for (int j=0; j<charHeight; j++) {
digitalWrite(LEDpins[j], !!(b & (1 << j)));
}
// space between columns
delayMicroseconds(425);
}
//clear the LEDs
digitalWrite(1 , LOW); // set the LED on
digitalWrite(2 , LOW); // set the LED on
digitalWrite(3 , LOW); // set the LED on
digitalWrite(4 , LOW); // set the LED on
digitalWrite(5 ,LOW); // set the LED on
digitalWrite(6 , LOW); // set the LED on
digitalWrite(7 , LOW); // set the LED on
// space between letters
delayMicroseconds(2600);
}
The original code is from an internet find which is noted in the comments
I have modified it greatly
Some issues:
without a hall sensor, one will have to play with the time between words to get a reasonably stable image
// Arduino Bike POV
//
// by Scott Mitchell
// www.openobject.org
// Open Source Urbanism
//
// Copyright (C) 2008 Scott Mitchell 12-10-2008
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//============================================================
// 6/2011 heavily modified by c. Dubois for my POV project
// Hall sensor is a switch so I used different code for it
// also used a font.h that I found
// ------------------------------------------------------------
// defining the alphabet
#include "font.h"
// define the Arduino LED pins in use
const int LEDpins[] = {
1,2,3,4,5,6,7};
// number of LEDs
const int charHeight = sizeof(LEDpins);
const int charWidth = 5;
int var = 0;
int worddelay = 50000;
// sensor setup
const int sensorPIN = 0; // define the Arduino sensor pin
// boolean sensorFlag = false; // stores sensor state
int sensVal; // variable to store the value coming from the sensor
const char textString[] = "CLAIRE";
const char textString2[] =" is a ";
const char textString3[] ="HONEY ";
const char textString4[] ="BADGER";
void setup()
{
pinMode(13, OUTPUT);
pinMode(1 , OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
// Serial.begin(9600);
}
void loop()
{
// turn on Led for a circle in middle and proof that arduino is powered
digitalWrite(13, HIGH); // set the LED on
// sensVal = analogRead(sensorPIN); // read the Hall Effect Sensor
// Serial.println(sensVal);
// delay(500 );
// if (sensVal != 1023 ) {
// Turn on the leds to test that they work and create circles
digitalWrite(1 , HIGH); // set the LED on
delay(500);
digitalWrite(2 , HIGH); // set the LED on
delay(500);
digitalWrite(3 , HIGH); // set the LED on
delay(500);
digitalWrite(4 , HIGH); // set the LED on
delay(500);
digitalWrite(5 ,HIGH); // set the LED on
delay(500);
digitalWrite(6 ,HIGH); // set the LED on
delay(500);
digitalWrite(7 ,HIGH); // set the LED on
// delay to let the fan get to speed
delay (3000);
// printing every letter of the textString
// then clear and print textstring2
var = 0;
while(var < 200){
// do something repetitive 150 times
for (int k=0; k<sizeof(textString); k++){
printLetter(textString[k]);
}
var++;
// space between words
delayMicroseconds(worddelay);
}
//clear the LEDs
digitalWrite(1 , LOW); // set the LED off
digitalWrite(2 , LOW); // set the LED off
digitalWrite(3 , LOW); // set the LED off
digitalWrite(4 , LOW); // set the LED off
digitalWrite(5 ,LOW); // set the LED off
digitalWrite(6 , LOW); // set the LED off
digitalWrite(7 , LOW); // set the LED off
// delay between phrases
delay (500);
// ------------------------------
// -- now do second phrase ----
var = 0;
while(var < 100){
// do something repetitive 75 times
for (int k=0; k<sizeof(textString2); k++){
printLetter(textString2[k]);
}
var++;
// space between words
delayMicroseconds(worddelay);
}
//clear the LEDs
digitalWrite(1 , LOW); // set the LED off
digitalWrite(2 , LOW); // set the LED off
digitalWrite(3 , LOW); // set the LED off
digitalWrite(4 , LOW); // set the LED off
digitalWrite(5 ,LOW); // set the LED off
digitalWrite(6 , LOW); // set the LED off
digitalWrite(7 , LOW); // set the LED off
// delay between phrases
delay (500);
// -- now do third phrase ----
var = 0;
while(var < 100){
// do something repetitive 200 times
for (int k=0; k<sizeof(textString3); k++){
printLetter(textString3[k]);
}
var++;
// space between words
delayMicroseconds(worddelay);
}
//clear the LEDs
digitalWrite(1 , LOW); // set the LED off
digitalWrite(2 , LOW); // set the LED off
digitalWrite(3 , LOW); // set the LED off
digitalWrite(4 , LOW); // set the LED off
digitalWrite(5 ,LOW); // set the LED off
digitalWrite(6 , LOW); // set the LED off
digitalWrite(7 , LOW); // set the LED off
// delay between phrases
delay (250);
// -- now do fourth phrase ----
var = 0;
while(var < 175){
// do something repetitive 200 times
for (int k=0; k<sizeof(textString4); k++){
printLetter(textString4[k]);
}
var++;
// space between words
delayMicroseconds(worddelay);
}
}
// }
// ------------------- Functions _________________
void printLetter(char ch)
{
// make sure the character is within the alphabet bounds (defined by the font.h file)
// if it's not, make it a blank character
if (ch < 32 || ch > 126){
ch = 32;
}
// subtract the space character (converts the ASCII number to the font index number)
ch -= 32;
// step through each byte of the character array
for (int i=0; i<charWidth; i++) {
byte b = font[ch][i];
// bit shift through the byte and output it to the pin
for (int j=0; j<charHeight; j++) {
digitalWrite(LEDpins[j], !!(b & (1 << j)));
}
// space between columns
delayMicroseconds(425);
}
//clear the LEDs
digitalWrite(1 , LOW); // set the LED on
digitalWrite(2 , LOW); // set the LED on
digitalWrite(3 , LOW); // set the LED on
digitalWrite(4 , LOW); // set the LED on
digitalWrite(5 ,LOW); // set the LED on
digitalWrite(6 , LOW); // set the LED on
digitalWrite(7 , LOW); // set the LED on
// space between letters
delayMicroseconds(2600);
}