Introduction: 1 Meter POV With IOT Enabled

Picture of 1 Meter POV With IOT Enabled

Before starting explanation about this project I would like to apologized for low quality image and video , but honestly it is really hard to took a sharp and clear image from running POV with normal camera like my mobile camera. It need very fast diaphragm optical lens to capture true motion, But I will upload the better video when I finally could buy my CANON camera


What is the POV

POV stand for Persistence Of Vision Globe which is related to phenomenon of human vision. Light stimulus lingers as an aftereffect on the retina for about 1/10 of a second. When light stimuli are sequenced in rapid succession, they merge into one continuous image. In fact it’s the basis for film and television devices, . POV make such illusion (deceive us) and create the image by rotation the array of LED lights around a single point or axis

What is project innovation

Off course POV is not new idea and plenty of projects already exist in Instructables or in other sites, however those project mostly use preset static temple or image which is mostly read from MCU memory or SD card , but in this project we use deploy beautiful features of IOT enabled chip like ESP8266 in this matter.

With this IOT features we

  1. could easily can upload new images to the memory wirelessly
  2. create the desired scenario of image show with any sequence or any duration
  3. there is no need to reprogram the chip or unplug the memory card and re plug it for new animation
  4. user friendly IOT webhost make it easy for every one to mange POV with mobile or tablet even remotely
  5. very low cost hardware implementation with capacity of more than 30 different images

How POV works

POV displays, a linear (1-dimensional) array of LED lights rotates around a single point, like a bike wheel. By measuring their rotation rate and controlling their flashes with millisecond precision, we can create the illusion of a 2or 3-dimensional image lingering in thin air. Let’s Consider the single frame of any effect (image , text,…), each frame consist of many pixel and hence many lines in plane or spherical area, POV display this imagewith single line of image which is position changed along with its rotation to fill that image , so the problem is how to precisely control LED pixel color in manner of time and space so it could create whole image POV are categorized base on axis of rotation, type of effect can display and how much color can create.

By different axis of rotation, can produce planar, cylindrical and spherical POV display

many POV project use simple single-color LED or high speed smart pixels like WS2812 or APA104 and in this project we use the fast LED chip refresher APA102 with practically around 16 MHz refresh rate. this LED chip has 2 line to control ( Ground , Data, Clock , +5v)

Step 1: How to Build POV

Picture of How to Build POV

At first I need the structure to mount POV hub, making the metal or non metal structure is depend on what you have in hands. You can make it with any available material to install it on a wall or add legs to make stand . My friend makes the simple tripod and mounts the timing belt mechanism to reduce DC motor RPM around 500.

Small mathematics

For having clear and coherence image, we need frame refreshment around 20 fps , it's mean to have clear image we need to repeatedly display it about 20 times per second , As my POV consist 1 diagonal LED strip, hence each frame completed with half or rotation, in another word we need the Ideal hub RPM around 600 and with this RPM each revolution took about 100 ms. following equation demonstrate that concept

RPM=(fps/Nb)*60
which Nb equal to Number of branch, and in this case we have
RPM=(20/2)*60=600

my POV rotate around 430 rpm thus my fps is around 15 fsp which is fairly good on this matter .
Building the mechanical part

In the next step I used piece of PVC cylinder Milled to hold the LED bar. To connect the hub with pulley shaft one M10 bolt has been bolted to back of PCV part Two Cupper ring installed on pulley shaft to transmission 5 volts DC to the board and LED strip, then as per following pictures, this part mounted on the simple pulley time transmission system which is connected to 12v DC motor
each part has its own power supply and enclosed in white box attached to legs

Step 2: Software Implementation Part 1

Picture of Software Implementation Part 1

In order to demonstrate the given image in LED strip , each image should be pixelized then uploaded to MCU memory and then fed to LED strip line by line , to do that I made to software for two different platform , one is base on java runtime Processing and other in C++ for MCU

Processing pixelized program
this program wrote in Processing IDE and it simply open image file , then rotate it in steps to extract pixelized lines of image .
I choose 200 line for displaying a any image , so I rotate image abut (360/200=1.8 degree) 200 times to extract 200 line. As my LED strip consist of 144 LED with embedded APA102 chip thus a whole image have 200*144=28800 pixel . As each color in APA102 chip display with 4 byte (W,RGB) hence each image size is exactly 200*144*4=115200 or 112.5KB
following Processing code demonstrate sequence of image pixelization , and result will be a bin extension file which can be uploaded to MCU memory

<p>PImage img,black_b,image_load;<br>PrintWriter output;
 
int SQL;
float led_t;
byte[] pov_data; 
int line_num=200;
String _OUTPUT="";</p><p>void settings()
{
selectInput( "Select an image", "imageChosen" );
noLoop();
wait(); 
}</p><p>void setup()
{
output = createWriter(_OUTPUT); 
black_b= createImage(SQL, SQL, RGB);
black_b.loadPixels();
for (int i = 0; i < black_b.pixels.length; i++) {  black_b.pixels[i] = color(0, 0, 0); }
black_b.updatePixels(); 
background(black_b);
}
int l=0;
void draw() 
{
  if(l>=line_num) {noLoop();output.flush();output.close();}
  background(black_b);
  pushMatrix();
             imageMode(CENTER);  
             translate(SQL/2, SQL/2);
              rotate(radians(l*360/line_num));
              image(img, 0, 0);
  popMatrix();
  pushMatrix();
       for(int i=0;i<144;i++)
       {
         color c = get(int(i*led_t+led_t/2), int(SQL/2));
         output.print((char)red(c)+""+(char)green(c)+""+(char)blue(c));     
        // print((char)red(c)+""+(char)green(c)+""+(char)blue(c)+";");
          fill(c);
          rect(i*led_t, (SQL/2)-(led_t/2),led_t,led_t);
      }
    //  println();
   popMatrix();
  // delay(500);
  l++; 
}</p><p>void keyPressed() 
{
  output.flush();  // Writes the remaining data to the file
  output.close();  // Finishes the file
  exit();  // Stops the program
}</p><p>void imageChosen( File f )
{
  if (f == null) { println("Window was closed or the user hit cancel.");exit();  } 
  else 
  {
  if( f.exists() )     img = loadImage( f.getAbsolutePath() ); 
  String s=f.getAbsolutePath();
  String[] list = split(s, '\\');
  int n=list.length;
  String[] fle=split(list[n-1], '.');
  println("Open file:"+fle[0]);
  _OUTPUT=fle[0]+".bin";
 // img = loadImage("test.jpg");
  int w = img.width;
  int h = img.height;
  SQL=max(w,h);
  size(SQL, SQL);
  led_t=SQL/144.0;
   println("h="+h+" w="+w+" max="+SQL+" size led="+led_t);
  }
}
void mousePressed(){  loop();}</p><p>void mydata()
{
 byte b[] = loadBytes("something.dat");  
// Print each value, from 0 to 255 
for (int i = 0; i < b.length; i++) 
{ 
  // Every tenth number, start a new line 
  if ((i % 10) == 0)   println(); 
  // bytes are from -128 to 127, this converts to 0 to 255 
  int a = b[i] & 0xff; 
  print(a + " "); 
} 
println();  // Print a blank line at the end 
saveBytes("numbers.dat", b);
}
void wait() 
{
  while (img == null) { delay(200); }
  loop();
}</p>

Step 3: Software Implementation Part 2

Picture of Software Implementation Part 2

MCU display program

high performance ESP8266 chip has been selected for couple of reasons ,first it has well develop open SDK tools for take advantage of WiFi features alongside it memory to hosting a web-server for user. With this capabilities, user friendly web-server designed for upload the pixelized image to the MCU memory and create user define scenario for show. With 4 Mb ESP-12E series we can use 1 Mb for program and 3 Mb for images which with size of 112.5KB for pixelized image we could roughly 25 image uploaded on MCU and could make any sequence or any display period for uploaded image I use Arduino code base implementation for making the webserver. code has three main function in its loop as per following

<p>void loop() {<br> if(!SHOW && !TEST) server.handleClient();   
  if(SHOW)
		  {
			if( (millis()- OpenlastTime) >DURATION[image_index]*1000)	{      
						 if(image_index>=IMAGE_NUM) image_index=0; 
						 _memory_pointer=start_address_of_imagefile[image_index];
						 Serial.printf("File number=%u name:%s address:%u duration:%u\n",
						 image_index,IMAGES[image_index].c_str(),start_address_of_imagefile[image_index],DURATION[image_index]);
						 Current_imageLine=0;     
						 image_index++; 
						 OpenlastTime=millis();
						}
			 if((micros()-lastLineShow)> lineInterval)
													 {  
													  lastLineShow=micros();
														  ESP.flashRead(_memory_pointer,(uint32_t *)leds    ,NUM_LEDS*3 );  
														  FastLED.show();
														   _memory_pointer+=(NUM_LEDS*3);
															Current_imageLine++;
														   delay(LineIntervalDelay);   
													  }
			if(Current_imageLine>=IMAGES_LINES)	{
												Current_imageLine=0;
												 _memory_pointer=start_address_of_imagefile[image_index-1]; 
												}
				 
		} 
optimistic_yield(1000);   
}</p>

Server Handler
the server.handleClient(); responsible to process any client request on webhost , this website could be design arbitrary to upload data, change show setting of any state report. My webhost consist of three tab as following images
in the first tab we could check current scenario of show with sequence and duration for each image , also network information as well as POV rpm shown

in upload image tab we could upload a pixelized image to the MCU memory or delete specific image

in network tab we could change network setting such as wifi mode , static ip , network name & pass , ..

Image Up-loader

this function server client request by Ajax to upload pixelized image to the MCU memory , then write the file in memory in raw format so reading the file be quick as possible. Memory start and end location store in table for displaying in LED strip

Display function

I used the FastLED lib to show pixel in LED strip , this library is one the most successful and well developed for LED show on AVR and ESP platform. It is just need to send FastLED function, the location of stored LED pixel. we read line by line pixels from memory and show it in LED strip and wait for new rotation flag come true. we repeated this sequence until 200 lines of each image been read

the whole code located in my git repository here

following is the video of POV in action which is recorded by mobile camera and as I explained , the video quality is not good due to slow diaphragm speed of unprofessional camera

Comments

Swansong (author)2018-01-11

That looks really nice! You should enter it in the First Time Authors contest :)

Hamids (author)Swansong2018-01-11

Thanks @swansong , but I don't know how to enter "First Time Authors contest"

About This Instructable

561views

12favorites

License:

More by Hamids:1 Meter POV With IOT Enabled
Add instructable to: