Laser Scanning Display Project - Electronics Forums

Author Topic: Laser Scanning Display Project  (Read 14350 times)

ElectroNick

  • The forum moderator
  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Karma: +3/-0
  • The soldering iron is ON!
    • View Profile
    • Electronics Blog
Laser Scanning Display Project
« on: April 13, 2013, 09:37:02 PM »
I'd like to start this new thread to share build notes and other materials for a not-yet-finished at the time of this writing project that started as a collaboration with another forum user Georg in another thread. Thank you Georg for the project idea!

The laser scanning display project is inspired by this YouTube video by user npaltmp
I could not find more info about the project other than the author's very nice presentation of its features and I wanted to make some changes, so I started my own from scratch.

The initial project requirements I am trying to adhere to were:
  • use 8 mirror faces
  • use mirror materials other than glass
  • use HDD spindle motor or similar BLDC for the rotating mirrors
  • use TTL controlled laser diode driver
  • have Arduino act as a USB-connected character display device with potential future integration with LCDProc

I've done several things on this project before starting this message, and the current state of the project is in the picture attached to this post.

I have decided to stick to Georg's suggestion of using pieces of split CDs for the first surface mirrors required in this project. Please note that the trick only worked for me on DVD-R blanks, not CD and not anything factory-made. Additionally, only one brand of DVD-R blanks could separate without tearing up the mirror surface (the aluminum layer that gets burned when the laser records the disk). I used Playo brand  single layer 8x blank DVD-R disks (previously recorded) . Nothing else worked. If you find another brand that splits well for this purpose, please post here. Playo disks split well and also cuts well just by scissors - very convenient. My issue here - it's an older brand, I don't have any more of them left and don't know who still sells them, so any data about alternatives is appreciated.

I have attempted to create the mirror base from sheet metal but that attempt had failed for I could not devise a way to carefully control the angle of each mirror. As a result of that attempt, I've decided to create a 3D part and have it printed by Shapeways. The part that I have created is available for download/order at Shapeways here: laser mirror holder. This link leads to the holders that has surfaces for holding mirrors at 0.25° angular difference. I am also trying a similar holder with surfaces at 1° difference.

I have already received the 1° holder and tried it with some encouraging result although they aren't perfect. I am observing a possible divergence from the required angle because the layer of super glue that holds the mirror pieces to the base could not have been applied evenly. So, be very careful with glue, especially with an even more precisely tuned 0.25° holder.

As for the HDD, I ended up using a scrap 2.5" (laptop) HDD for the motor - it appears to have the right size and torque.

The HDD motor is driven at this point (uncontrollably) by a spin up circuit from here. The circuit is very simple and works a treat but not without its downsides: first of all, it's not auto-starting (i.e. you need to give the rotor a not-so-slight push) and second, when it runs, it flies! I am seeing RPMs in excess of 3,000 for sure at 7.5V power and at higher voltages (9V+) well over 5,000RPM. This is not safe for any part of the device and the problem is exaggerated by the mirror holder not being a symmetrical shape (due to 8 mirror surfaces each at its own angle) is not well balanced and will probably break apart at high RPMs.

I have tried the laser diode output at high RPMs and it appears that the RPMs can be lowered without much problem for the functionality. I would like to keep it down to about 1,200RPM if the timing of the laser diode scanning allows.

This is it so far, haven't moved much further than that. This post was intended as a starter for a thread where I (and hopefully other people) will post notes and question about the Laser scanning display project

Electronics Forums

Laser Scanning Display Project
« on: April 13, 2013, 09:37:02 PM »

Georg

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
  • I have a soldering iron and I'm not afraid to use it!
    • View Profile
Re: Laser Scanning Display Project
« Reply #1 on: April 14, 2013, 02:07:07 PM »
Perfect new thread!

A remark to the mirror holder.
Probably it would be more weight balanced, if the mirror angle would change around the centerline of the mirror. In your part the mirror angle flip around the baseline of the mirror close to the buttom ring. (But the weight differences are most likely very small.)

There is another advantage: we can point the laser to the flipline of the mirror - at this line all mirrors have the same distance from the center of the HDD. That means the laser has the same distance to all mirrors.

In theory: when the laser sends pulses at the same time to every mirror outside the flipline the reflected point on the wall will not be one under the other - there will be a deviation to the side (because the distance of the reflections point on the mirror to the laser is different!).
I am trying to calculate it. The effect is smaller when the laser is more perpendicular to the mirror, but if we want to show a text line, there is always an angle. Assumption the reflection point is 5mm above the flipline - we have an angle of 0.25° for each of 8 mirrors, the maximum difference is 2°, - so the maximal mirror deviation is 2/360*10*3.14=0.17mm. If the laser points at 30° to the mirror, I can use cosinus 60° and come to 0.34mm deviation, if the projection field is in best case perpendicular. This will increase at the ends of the text line ...
So thats the theory ... in practise we will have much other influences !!
Finally I would say - don't care!! But if we need a new holder for any reason, I would change the holder!

I am still fighting with my HDD motor ....

ElectroNick

  • The forum moderator
  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Karma: +3/-0
  • The soldering iron is ON!
    • View Profile
    • Electronics Blog
Re: Laser Scanning Display Project
« Reply #2 on: April 14, 2013, 03:59:25 PM »
Probably it would be more weight balanced, if the mirror angle would change around the centerline of the mirror. In your part the mirror angle flip around the baseline of the mirror close to the bottom ring. (But the weight differences are most likely very small.)
Good point. Perhaps this is not a final design of the holder, we'll see. I am also hoping that the 0.25° holder will be much better balanced than 1° simply because the difference is so small. In fact, looking at the computer rendering of the 3D part, it's quite clear just by looking at it that it should be much more balanced.

I've ordered myself the 0.25° holder last night. It takes Shapeways about two weeks to get one sent here in US. You may be able to get it quicker given that Shapeways is a Dutch company. Not sure where they ship from but if it's the Netherlands, it sounds like you may be able to get it in days instead of weeks. In the meantime, there's much else to do so the lack of proper mirror holder is not even a limiting factor for me right now.

ElectroNick

  • The forum moderator
  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Karma: +3/-0
  • The soldering iron is ON!
    • View Profile
    • Electronics Blog
Re: Laser Scanning Display Project
« Reply #3 on: April 16, 2013, 01:15:05 AM »
Well, here are some notes for the work done today:

Spent some time hooking the photointerruptor sensor device up to an Arduino to measure the actual RPMs that the spin-up circuit provides.  Photointerruptor is basically a device with an IR LED that shines onto a phototransistor through a slot which can be, well, interrupted by placing something in between the IR LED and the phototransistor. If something blocks the line of sight between the diode and the transistor, its output is high. If the window is clear, the output is zero. In our case there's a slot  on the skirt of the mirror holder that opens the line of sight once per revolution.

I wrote a simple Arduino sketch that processes an interrupt every time the output of the sensor goes from HIGH to LOW which happens to be when the slot on the skirt comes in between the IR LED and the phototransistor. I include the text of the sketch below.

So, it turns out the spin-up does crazy RPMs. I clocked it at 4895 RPM using only 6V power supply. In fact, it hovers around 4000 RPM even at as low as +5V motor supply voltage. The spin-up circuit allows for PWM control, so that's my next step.

Also, had a nasty setback in the process of picking the right materials for the mirror holder. it turns out that the DVD mirrors warp, and pretty badly at that, only two days after I glued them onto the holder. The warping is pretty bad and my laser pointer on the wall is no longer a dot but a random shape. That's going to seriously mess up the output of the display.

I think I used way too much super glue to attach the mirrors to the sides of the holder and the glue had actually dissolved the material from which the holder was printed (ABS I think). This came after one mirror flew right off my previous holder and, hoping to avoid this experience again, I glued it too well this time. The mirrors are now absolutely, monumentally, affixed to the holder but, ironically, useless because of the warping.

Be extra careful gluing the mirrors. Avoid using too much glue and avoid glue that dissolves the material of the holder! I think I'm going to try to use epoxy next time. I know it won't dissolve the plastic but I'm not sure if I can apply a layer thin enough for it not to mess up the minute angular difference between the faces (I only have 0.25° to play with)   

Code: [Select]
/*
Laser Scanning Display Project
See http://elabz.com/ for more project details and instructions
 */


byte slotPin = 2;
byte pwmPin = 9;
byte ledPin = 13;
byte laserOnPin = 7;
int serialDelay = 2000; // print out RPM valule every 2 sec
unsigned long serialPeriodNow;
unsigned long rotationTime;
unsigned long lastInterrupt;
unsigned int rpm; // caclulated RPM value

void setup() {
  attachInterrupt(0, calcRPM, FALLING);
  Serial.begin(9600);
  //pinMode(slotPin, INPUT);
  pinMode(pwmPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  pinMode(laserOnPin, OUTPUT);

}

void loop() {
digitalWrite(pwmPin, HIGH); // enable the motor


if((millis() - serialPeriodNow) > serialDelay)
{
 rpm = 60000000/rotationTime; //rotationTime = duration of 1 rotation in microseconds.
 Serial.print("RPM: ");
 Serial.println(rpm);
 serialPeriodNow=millis();
}

}
void calcRPM(){
  rotationTime = micros()-lastInterrupt;
  lastInterrupt = micros();
}
« Last Edit: April 16, 2013, 01:19:29 AM by ElectroNick »

Georg

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
  • I have a soldering iron and I'm not afraid to use it!
    • View Profile
Re: Laser Scanning Display Project
« Reply #4 on: April 16, 2013, 10:17:00 AM »
I am still struggling with the HDD-motor issue. I got now another defect HDD (Samsung HD103SI). There is a power button on the controller. When I press it, the motor starts, runs for some seconds with full speed and then stops, probably in sleep-mode.
Do you have an idea, how to avoid the sleepmode and how to influence speed?
I read somewhere the recommendation to influence directly the original controller. But I have no glue where I can interfere the controller ....

Holder: I want to make it in aluminium and polish the areas. Or chrome it. But for the dimensions of the holderring, I first must solve the the motor issue...

ElectroNick

  • The forum moderator
  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Karma: +3/-0
  • The soldering iron is ON!
    • View Profile
    • Electronics Blog
Re: Laser Scanning Display Project
« Reply #5 on: April 16, 2013, 12:19:51 PM »
Dude, are you trying to break a 1TB HDD for the sake of this project?!  ;D I am seriously impressed!

I have an old HDD (18Gb) that I would donate for the purpose but I have a feeling the shipping cost is going to be a killer.

Anyway, if I got your idea correctly, you are trying to use the HDDs native BLDC controller? That's is a great idea except the more recent the HDD, the more complex its BLDC controller is. In fact, it's not even a BLDC controller anymore, it's a complex chip (and entire computer in and of itself) that takes care of pretty much every mechanical aspect of the HDD - platters, heads etc. Additionally, I could not find any datasheet on SH61258. But even without the datasheet I can tell you that it may not be so easy.

Older HDDs on the other hand, will have much simpler controllers  such as Phillips TDA5143 which may be easier to handle. There are other BLDC motor ICs, too.

I have to admit, I would love to work with a specialized controller IC at some point but perhaps on one of the next projects. For now it looks like this spin-up circuit works a treat, just need to devise a way to limit RPMs to less destructive 1000-2000RPM.

On a plus side: your new HDD has the 4 leads that you need for the simple spin-up circuit.

Holder: 3D parts printed in metal look a bit too porous to me but I've never seen one that's 3D printed, then polished. Perhaps it's the way to go. If you end up going this route, be sure to post some pictures - I'm very interested to see how it looks. And performs - I have a feeling my plastic mirrors/holders are not yet done giving me a hard time  :)

Georg

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
  • I have a soldering iron and I'm not afraid to use it!
    • View Profile
Re: Laser Scanning Display Project
« Reply #6 on: April 17, 2013, 02:26:18 AM »
the 1TB HDD was donated by a colleague, who recognised strong smell coming out of the controller, so he lost trust in the HDD! Looking at the controller I found a capacitor melted away. I also couldn't find a datasheet! So I can only make a try and error experiment!
You are right now I have a 4 wire base!
I will ask a friend to make the holder with a milling machine. 3D parts will be too porous to make a good mirror! On the other hand the example in the video makes it with mirrors glued together. So if the centrifugal force is small enough (not too much rpm and small diameter) it should work as well. (maybe you must wear protection goggles and a helmet during the test  ;))

ElectroNick

  • The forum moderator
  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Karma: +3/-0
  • The soldering iron is ON!
    • View Profile
    • Electronics Blog
Re: Laser Scanning Display Project
« Reply #7 on: April 17, 2013, 12:34:31 PM »
the 1TB HDD was donated by a colleague, who recognised strong smell coming out of the controller, so he lost trust in the HDD! Looking at the controller I found a capacitor melted away. I also couldn't find a datasheet! So I can only make a try and error experiment!
You are right now I have a 4 wire base!
Save the controller! I think you can disconnect it from the HDD PCB, and it looks like a perfectly fine USB-IDE controller, perhaps you can use it with another HDD to make an external HDD out of an internal one? You can easily replace the capacitor and try it on another IDE HDD
But I digress...


Regarding our project: I implemented PWM speed control last night. No feedback yet, just open loop control. But the good news is that the spin-up circuit responds very well to PWM and I am able to have stable (enough) RPMs even without feedback. Since feedback it readily available - the photointerruptor we use for laser synchronization,  I will definitely add some closed loop RPM control later. Just wanted to get to the stage where I can see some meaningful output, then clean up loose ends such as the better RPM control.

So, this spin-up circuit is a keeper! It works very well from just +5V supply. I think I'm OK with having to spin it initially by hand - I'll see what to do about it later, but for now it's performing very well, can be easily controllable and even provides its own rotation speed feedback (which we may not need because we have a photointerruptor).

I keep referring to the circuit and I did post a link to the Parallax forum page where it came from but I feel like I need to have a reference here as well. So, I would like to repost the circuit schematics here (see attachment). Once again, the credit for the circuit goes to Beau Schwabe - an engineer  at Parallax.

I think you should get the parts for the spin-up circuit and build one since you can use it to test HDDs, balance the mirror holder and do other stuff before even building the project. I am guilty of using this circuit for pure entertainment, too - spin up a HDD to some insane RPMs (like 15,000+), stand back and just watch the HDD break the sound barrier :)  So, if you come here one day and there's no response from me, it's probably because I got killed by shrapnel from an HDD torn apart by centrifugal forces  :'(
 

I will ask a friend to make the holder with a milling machine. 3D parts will be too porous to make a good mirror! On the other hand the example in the video makes it with mirrors glued together. So if the centrifugal force is small enough (not too much rpm and small diameter) it should work as well. (maybe you must wear protection goggles and a helmet during the test  ;))
I have a feeling that a holder from solid metal may be a little too heavy for the purpose and its weight may make it harder to balance. The plastic 3D printed holder, terribly unbalanced as the 1° version is, is still light enough for the device to stand steady at 2000-2500 RPM (at 4,000 RPM it tries to vibrate itself right off the table!).

I did some test runs of my software, too - with no good results, unfortunately. I've only gotten enough code to print the word "TEST" but even then, I can only see two or three random dots on the wall instead.   I don't know if it makes sense to post unproven software (let me know and I'll post it) but I  have a feeling it's not the software but rather laser diode driver that is not fast enough. I am using the TTL-controlled laser diode driver of my own design. It has a rather large capacitor in the output circuit which I think is messing up my timing.  I'll make myself another laser diode driver tonight (and just omit the capacitor C1 and its drain resistor R5), will post results later.

Georg

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
  • I have a soldering iron and I'm not afraid to use it!
    • View Profile
Re: Laser Scanning Display Project
« Reply #8 on: April 18, 2013, 05:06:32 PM »
I want to try it with the spin-up circuit and your code from April 16. Two silly questions:
- Goes the PWM to ENABLE?
- Is the 4.wire from the motor on ground?
I tried it with a laser from a laser pointer. My impression was that it was fast enough. 

ElectroNick

  • The forum moderator
  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Karma: +3/-0
  • The soldering iron is ON!
    • View Profile
    • Electronics Blog
Re: Laser Scanning Display Project
« Reply #9 on: April 18, 2013, 05:30:29 PM »
- Goes the PWM to ENABLE?
Yes, the PWM output from Arduino (I used digital pin 9) goes on ENABLE
- Is the 4.wire from the motor on ground?
No, the 4th (common) wire goes to the positive supply rail, in my case 5V but on the schematics it's marked as 12V. At 12V my little laptop HDD motor would be doing 20,000 RPM or will just break apart. Perhaps the 3.5" HDD that you have needs a bit more juice, so be ready to play with the supply voltage, which, again, comes in on the 4th (common) wire to the motor.

I tried it with a laser from a laser pointer. My impression was that it was fast enough.
Well, I have re-done the driver and I can now pulse is sufficiently quickly. But (and that's a big one :) )  if I try to pulse the extremely bright 150mW red laser from a DVD burner drive (about 30 times brighter than a typical laser pointer) at 10 microseconds per pulse, which is about all time we have for one dot, all I see is a very faint spec of light, and not even on a wall a few feet away (about 2m)  but on a sheet of paper I hold right in front of the mirrors. This is very alarming - it means that we either need to slow the mirrors down significantly or increase the power output of the laser even more (and at 150mW that's already a very powerful and dangerous laser). Perhaps there's something terribly wrong with my mirrors (also a distinct possibility). As soon as my new holder comes, I will try again.

Also, if you are working with the code, try this code below (yet unproven as far as text output but motor control works). You will need to hook up a potentiometer (5-10K) with one leg on the +5V of Arduino, opposite leg on the Ground and the brush (middle contact) on A0 input (potPin in the code) - this is the manual PWM control. Let me know how it works!

The laser control is digital  Pin 8 (laserOnPin), the photointerruptor input is Pin 2  (slotPin) and the PWM is Pin 9 (pwmPin).

if you don't have a laser hooked up yet, all you really need is  these two lines of code in the loop():
Code: [Select]
pwm = analogRead(potPin)/4;
analogWrite(pwmPin,pwm);

The full code as it stands now is below. It is supposed to print the word "TEST" but all I see at this point is some specs of light (see above)

Code: [Select]
/*
Laser Scanning Display Project
See http://elabz.com/ for more project details and instructions
 */
#include <avr/pgmspace.h>

byte slotPin = 2;
byte pwmPin = 9;
byte ledPin = 13;
byte laserOnPin = 8;
byte potPin = 0;
int pwm;
int serialDelay = 2000; // print out RPM valule every 2 sec
unsigned long serialPeriodNow;
unsigned long rotationTime;
unsigned long lastInterrupt;
unsigned int rpm; // caclulated RPM value
byte currentRow = 0;
byte charsInLine = 4;
byte timePixel = 20; // this is in microseconds
int timeDelay = 20; // in microseconds - delay until the first pixel of the first column is shown
byte image[4][8]  = {
{B11111111,B10011001,B00011000,B00011000,B00011000,B00011000,B00011000,B00011000},
{B11111111,B11000001,B11000000,B11111000,B11111000,B11000000,B11000001,B11111111},
{B01111111,B11000001,B11000000,B01111100,B00111110,B00000011,B10000011,B11111110},
{B11111111,B10011001,B00011000,B00011000,B00011000,B00011000,B00011000,B00011000}
};
/*
PROGMEM byte image[4][8]  = {
{B11111111,B10011001,B00011000,B00011000,B00011000,B00011000,B00011000,B00011000},
{B11111111,B11000001,B11000000,B11111000,B11111000,B11000000,B11000001,B11111111},
{B01111111,B11000001,B11000000,B01111100,B00111110,B00000011,B10000011,B11111110},
{B11111111,B10011001,B00011000,B00011000,B00011000,B00011000,B00011000,B00011000}
};
*/
/*
byte alphabets[][8] =
{  {0,0,0,0,0},
  {0,56,125,56,0},//!
  {80,96,0,80,96},//"
  {20,127,20,127,20},//#
  {18,42,127,42,36},//$
  {98,100,8,19,35},//%
  {54,73,85,34,5},//&
  {0,80,96,0,0},//'(7)
  {0,28,34,65,0},//(
  {0,65,34,28,0},//)
  {20,8,62,8,20},//*
  {8,8,62,8,8},//+
  {0,5,6,0,0},//,(12)
  {8,8,8,8,8},//-
  {0,3,3,0,0},//.(14)
  {2,4,8,16,32},///
  {62,69,73,81,62},//0
  {17,33,127,1,1},//1
  {33,67,69,73,49},//2
  {34,65,73,73,54},//3
  {12,20,36,127,4},//4
  {114,81,81,81,78},//5
  {62,73,73,73,38},//6
  {64,71,72,80,96},//7
  {54,73,73,73,54},//8
  {50,73,73,73,62},//9
  {0,54,54,0,0},//:(26)
  {0,53,54,0,0},//;(27)
  {8,20,34,65,0},//<
  {20,20,20,20,20},//=
  {0,65,34,20,8},//>
  {32,64,69,72,48},//?
  {62,73,87,85,62},//@
  {31, 36, 68, 36, 31},//A
  {127, 73, 73, 73, 54},//B
  {62, 65, 65, 65, 34},//C
  {127, 65, 65, 34, 28},//D
  {127, 73, 73, 65, 65},//E
  {127, 72, 72, 72, 64},//F
  {62, 65, 65, 69, 38},//G
  {127, 8, 8, 8, 127},//H
  {65, 65, 127, 65, 65},//I
  {2, 1, 1, 1, 126},//J
  {127, 8, 20, 34, 65},//K
  {127, 1, 1, 1, 1},//L
  {127, 32, 16, 32, 127},//M
  {127, 16, 8, 4, 127},//N
  {62, 65, 65, 65, 62},//O
  {127, 72, 72, 72, 48},//P
  {62, 65, 69, 66, 61},//Q
  {127, 72, 76, 74, 49},//R
  {50, 73, 73, 73, 38},//S
  {64, 64, 127, 64, 64},//T
  {126, 1, 1, 1, 126},//U
  {124, 2, 1, 2, 124},//V
  {126, 1, 6, 1, 126},//W
  {99, 20, 8, 20, 99},//X
  {96, 16, 15, 16, 96},//Y
  {67, 69, 73, 81, 97},//Z
  {0,127,65,65,0},//[
  {32,16,8,4,2},//
  {0,65,65,127,0},
  {16,32,64,32,16},//^
  {1,1,1,1,1},//_
  {0,64,32,16,0},//`
  {2,21,21,14,1},//a
  {64,126,9,17,14},//b
  {14,17,17,17,10},//c
  {14,17,74,127,1},//d
  {14,21,21,21,9},//e
  {1,9,63,72,32},//f
  {9,21,21,21,30},//g
  {127,8,8,8,7},//h
  {0,0,46,1,1},//i
  {2,1,1,1,94},//j
  {1,127,4,10,17},//k
  {0,65,127,1,0},//l
  {31,16,14,16,31},//m
  {31,8,16,16,15},//n
  {14,17,17,17,14},//o
  {127,20,20,20,8},//p
  {8,20,20,31,1},//q
  {31,8,16,16,8},//r
  {9,21,21,21,18},//s
  {16,16,126,17,18},//t
  {30,1,1,30,1},//u
  {28,2,1,2,28},//v
  {30,1,6,1,30},//w
  {17,10,4,10,17},//x
  {16,9,6,8,16},//y
  {17,19,21,25,17},//z
  {8,54,65,65,0},//{
  {0,0,127,0,0},//|(92)
  {0,65,65,54,8},//}
  {32,64,32,16,32},//~

 
 
};
*/
void setup() {
  attachInterrupt(0, calcRPM, FALLING);
  //Serial.begin(9600);
  //pinMode(slotPin, INPUT);
  pinMode(pwmPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  pinMode(laserOnPin, OUTPUT);

}

void loop() {

pwm = analogRead(potPin)/4;
analogWrite(pwmPin,pwm);
/*
if((millis() - serialPeriodNow) > serialDelay)
{
 rpm = 60000000/rotationTime; //rotationTime = duration of 1 rotation in microseconds.
 Serial.print("RPM: ");
 Serial.print(rpm);
 Serial.print(" | PWM: ");
 Serial.println(pwm);
 serialPeriodNow=millis();
}
*/
}
void calcRPM(){
  rotationTime = micros()-lastInterrupt;
  lastInterrupt = micros();
  byte currentCharRowByte;
  byte actualRow; // since the slot photointerruptor is on the side opposite to the laser, it's always 4 mirrors ahead
  actualRow = currentRow+4;
  if(actualRow > 7) actualRow=actualRow-8;
  int timeOneMirror = rotationTime/8;
  //delayMicroseconds(timeDelay); // small delay to align the laser with desired position on the wall (higher - string starts more to the left)
  delayMicroseconds(timeOneMirror*actualRow); // wait until the proper mirror for that row is positioned for the laser
  for(int x=0; x<charsInLine; x++){
    //currentCharRowByte = pgm_read_byte(&(image[x][currentRow]));
    currentCharRowByte =image[x][currentRow];
    for(int y=1; y<9; y++){
    if (currentCharRowByte & (1<<y)) {
        digitalWrite(laserOnPin, HIGH );
    }
      else {
        digitalWrite(laserOnPin, LOW );
    }
    delayMicroseconds(timePixel);
    digitalWrite(laserOnPin, LOW);
    } 
 
  }

  currentRow++; // prep the row counter for the next interrupt
  if(currentRow > 7) currentRow = 0;
}



Georg

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
  • I have a soldering iron and I'm not afraid to use it!
    • View Profile
Re: Laser Scanning Display Project
« Reply #10 on: April 18, 2013, 05:52:09 PM »
Thanks for the info. I have to order the amplifier LM741 to build up the circuit ... (I am a mechanical engineer, so so no stock of parts!)

ElectroNick

  • The forum moderator
  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Karma: +3/-0
  • The soldering iron is ON!
    • View Profile
    • Electronics Blog
Re: Laser Scanning Display Project
« Reply #11 on: April 18, 2013, 06:12:55 PM »
LM741 has a ton of suitable replacements (but LM741 is probably one of the most common OPs anyway). Just look for Low Power, Single Supply Operational Amplifiers

MC33171
LT1006
LT1637
LM308
LM709
... and many more


Additionally, take a look at almost any discarded PCB - that HDD PCB for example. There may very well be an Op Amp on it just like the one you need. They normally have 8-16 legs and they are usually surface-mounted but it would be almost trivial to remove a 8 pin SOIC from an old board. They are also very common in telephones, faxes, you can find two or three in a CD (the older the better), floppy drive etc. Almost ANY electronic device that needs to measure or amplify something uses op amps these  days. 
 
« Last Edit: April 18, 2013, 06:59:43 PM by ElectroNick »

Georg

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
  • I have a soldering iron and I'm not afraid to use it!
    • View Profile
Re: Laser Scanning Display Project
« Reply #12 on: April 19, 2013, 08:48:54 AM »
IR-LED and phototransistor? what do you use here?
The laserdiode of the CD board is on my CD-boards glued into a header. Do you know a trick to get out?
(I had to buy the amplifier .. I could not find one in my PCBs..)

ElectroNick

  • The forum moderator
  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Karma: +3/-0
  • The soldering iron is ON!
    • View Profile
    • Electronics Blog
Re: Laser Scanning Display Project
« Reply #13 on: April 19, 2013, 06:23:29 PM »
IR-LED and phototransistor? what do you use here?
I'm using an old OPB 9357 photo interrupter (photo attached below) removed from some CNC equipment years ago. I could not find any online references for the part but, fortunately, I saved the wiring diagram on a piece of paper. It's a very easy one anyway and I presume the same for most of these devices. This is by no means a rare type device - every electronics parts house has them. Sparkfun sells such devices and so do most if not all of the distributors: https://www.sparkfun.com/products/9299

The laserdiode of the CD board is on my CD-boards glued into a header. Do you know a trick to get out?
If you are talking about removing the high power red laser diode from a DVD-RW drive (a CD drive has an IR laser diode, pretty much useless for this visual project)  and by header you mean the carriage (a.k.a. sled) that moves the laser with optics back and forth on linear rails, then removing it is very easy. It is usually glued in with a very brittle optical epoxy. You just grab it carefully but firmly with needle nose pliers and give it a slight twist - the epoxy layer normally just crumbles apart easily. The real trick is what to do with it after you pulled it out :)   Do you have one of those laser diode housings? Can be seen on the videos here and on that page I also describe where I get mine (hint: eBay :) ). You have to have the housing with internal size matching your laser diode. Oh, and by the way, some laser diodes cannot really have a standard housing
because of the weird body shape. Check this laser diode and that's not even the worst!

So, when you get your diode out, post a picture of it, I'll try to help you locate the proper housing. Alternatively, you can always go back to a laser pointer at the cost of brightness of your display. There are also people online that sell ready-made high power laser diodes, such as what you would remove from a DVD-RW drive, already mounted in a proper housing. If removal of a diode gives you hard time, you can always buy a complete device.

Back to the project: I was pretty unhappy last night when I glued more pieces of CDs right over those warped mirrors with epoxy (which seems to be the way to go - no longer any warping!) only to realize that the 3D model of the 1° holder  and the 8th mirror is at a wrong angle! Rats!
So, at this moment I am anxiously waiting for the 0.25° holder to come in so I can continue with the optical part of the project.

Cheers!

Georg

  • Jr. Member
  • **
  • Posts: 58
  • Karma: +0/-0
  • I have a soldering iron and I'm not afraid to use it!
    • View Profile
Re: Laser Scanning Display Project
« Reply #14 on: April 25, 2013, 08:01:07 AM »
no news... I am still missing parts for the circuit. The ESC was defect and did not work!

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
5713 Views
Last post December 08, 2012, 02:05:19 PM
by smeezekitty
0 Replies
3186 Views
Last post November 02, 2011, 11:49:06 PM
by ElectroNick
0 Replies
5840 Views
Last post May 19, 2012, 09:04:54 PM
by ElectroNick
2 Replies
6236 Views
Last post December 14, 2012, 04:14:52 PM
by ElectroNick
14 Replies
5354 Views
Last post February 25, 2013, 12:24:16 PM
by ElectroNick