BS2 laser control
bcook65
Posts: 12
Hello,
I am currently working on a BS2 project to flash LEDs at specific frequencies. Currently I am using the FREQOUT to accomplish this, but without a Oscope I cannot verify this. Otherwise it does seem to work. As I need to control frequencies from 1 to 1000Hz this also seems the easiest way to do this.
The next part of my project involves flashing a Laser diode at the same frequencies as mentioned above.. I am using a red· laser at 635nm with built in driver, and the same program. THe laser runs on from 3-5Vdc. The BS2 is powering the laser, however, very dimly. I am measuring approx 1.23Vdc across the Leds above. Obviously not enough to run the laser diode.
Is there a means of telling the BS2 to increase voltage out? Or do I need to build some sort of voltage amp?
I am assuming from memory that there will be some sort of voltage drop as the frequency increases, if so how do I negate this?
Any Ideas?
Any help would be greatly appreciated as this has taken me quite a while to get to this point from having had to learn some of the programming for the BS2 and other stamps.
When I am finished, ultimately the goal is to flash either an array of leds and or Laser diodes at specific·frequencies and durations.
Below is the code for one of the projects. pretty simple and straight forward.
Thanks
Bill
'{$STAMP BS2}
'{$PBASIC 2.5}
'debug "this section tests each led"
DEBUG "Program Abscess", CR
DEBUG "Total Run Time = 15 minutes", CR
PAUSE 3000
x VAR Byte
· HIGH 15
· PAUSE 2000
· LOW 15
· HIGH 14
· PAUSE 2000
· LOW 14
· HIGH 9
· PAUSE 2000
· LOW 9
· PAUSE 2000
· 'DEBUG "LED TEST", CR
· 'FOR x = 1 TO 5
· 'DEBUG ? x
· 'HIGH 9
· 'PAUSE 100
· 'LOW 9
· 'PAUSE 500
· 'NEXT
· 'DEBUG "LED TEST Complete", CR
· 'PAUSE 3000
· 'debug "this section displays sequence frequncies"
· DEBUG "Frequency Display", CR
· HIGH 15
· PAUSE 2000
· DEBUG "Abscess - 802 Hz", CR
· FREQOUT 9, 3000, 802
· DEBUG "Lymphatics - 42 Hz", CR
· FREQOUT 9, 3000, 42
· DEBUG "Thymus - 73 Hz", CR
· FREQOUT 9, 3000, 73
· DEBUG "Pancreas - 66 Hz", CR
· FREQOUT 9, 3000, 66
· DEBUG "Skin - 363 Hz", CR
· FREQOUT 9, 3000, 363
· PAUSE 3000
· DEBUG "Starting Sequence", CR
· HIGH 14
· 'DEBUG "Section 1"
· DEBUG "(Sequence 1 - Abscess and Lymphatics)60 Sec 802hz and 42Hz)", CR
· FREQOUT 9, 60000, 802, 42
· DEBUG "(Sequence 2 - Abscess and Lymphatics)30 Sec 802hz and 42Hz)", CR
· FREQOUT 9, 30000, 802, 42
· DEBUG "(Sequence 3 - Thymus and Pancreas)60 Sec 73hz and 66Hz)", CR
· FREQOUT 9, 60000, 73, 66
· DEBUG "(Sequence 4 - Thymus and Pancreas)60 Sec 73hz and 66Hz)", CR
· FREQOUT 9, 30000, 73, 66
· DEBUG "(Sequence 5 - Skin)60 Sec 363Hz)", CR
· FREQOUT 9, 60000, 363
· DEBUG "(Sequence 6 - Skin)30 Sec 363Hz)", CR
· FREQOUT 9, 30000, 363
· 'DEBUG "Section 2"
· DEBUG "(Sequence 1 - Abscess and Lymphatics)60 Sec 802hz and 42Hz)", CR
· FREQOUT 9, 60000, 802, 42
· DEBUG "(Sequence 2 - Abscess and Lymphatics)30 Sec 802hz and 42Hz)", CR
· FREQOUT 9, 30000, 802, 42
· DEBUG "(Sequence 3 - Thymus and Pancreas)60 Sec 73hz and 66Hz)", CR
· FREQOUT 9, 60000, 73, 66
· DEBUG "(Sequence 4 - Thymus and Pancreas)60 Sec 73hz and 66Hz)", CR
· FREQOUT 9, 30000, 73, 66
· DEBUG "(Sequence 5 - Skin)60 Sec 363Hz)", CR
· FREQOUT 9, 60000, 363
· DEBUG "(Sequence 6 - Skin)30 Sec 363Hz)", CR
· FREQOUT 9, 30000, 363
· 'DEBUG "Section 3"
· DEBUG "(Sequence 7 - Abscess)60 Sec 802Hz)", CR
· FREQOUT 9, 60000, 802
· DEBUG "(Sequence 8 - Lymphatic)60 Sec 42Hz)", CR
· FREQOUT 9, 60000, 42
· DEBUG "(Sequence 9 - Thymus)60 Sec 73Hz)", CR
· FREQOUT 9, 60000, 73
· DEBUG "(Sequence 10 - Pancreas)60 Sec 66Hz)", CR
· FREQOUT 9, 60000, 66
· DEBUG "(Sequence 11 - Skin)60 Sec 363Hz)", CR
· FREQOUT 9, 60000, 363
· LOW 14
· PAUSE 500
· LOW 15
DEBUG "END"
END
I am currently working on a BS2 project to flash LEDs at specific frequencies. Currently I am using the FREQOUT to accomplish this, but without a Oscope I cannot verify this. Otherwise it does seem to work. As I need to control frequencies from 1 to 1000Hz this also seems the easiest way to do this.
The next part of my project involves flashing a Laser diode at the same frequencies as mentioned above.. I am using a red· laser at 635nm with built in driver, and the same program. THe laser runs on from 3-5Vdc. The BS2 is powering the laser, however, very dimly. I am measuring approx 1.23Vdc across the Leds above. Obviously not enough to run the laser diode.
Is there a means of telling the BS2 to increase voltage out? Or do I need to build some sort of voltage amp?
I am assuming from memory that there will be some sort of voltage drop as the frequency increases, if so how do I negate this?
Any Ideas?
Any help would be greatly appreciated as this has taken me quite a while to get to this point from having had to learn some of the programming for the BS2 and other stamps.
When I am finished, ultimately the goal is to flash either an array of leds and or Laser diodes at specific·frequencies and durations.
Below is the code for one of the projects. pretty simple and straight forward.
Thanks
Bill
'{$STAMP BS2}
'{$PBASIC 2.5}
'debug "this section tests each led"
DEBUG "Program Abscess", CR
DEBUG "Total Run Time = 15 minutes", CR
PAUSE 3000
x VAR Byte
· HIGH 15
· PAUSE 2000
· LOW 15
· HIGH 14
· PAUSE 2000
· LOW 14
· HIGH 9
· PAUSE 2000
· LOW 9
· PAUSE 2000
· 'DEBUG "LED TEST", CR
· 'FOR x = 1 TO 5
· 'DEBUG ? x
· 'HIGH 9
· 'PAUSE 100
· 'LOW 9
· 'PAUSE 500
· 'NEXT
· 'DEBUG "LED TEST Complete", CR
· 'PAUSE 3000
· 'debug "this section displays sequence frequncies"
· DEBUG "Frequency Display", CR
· HIGH 15
· PAUSE 2000
· DEBUG "Abscess - 802 Hz", CR
· FREQOUT 9, 3000, 802
· DEBUG "Lymphatics - 42 Hz", CR
· FREQOUT 9, 3000, 42
· DEBUG "Thymus - 73 Hz", CR
· FREQOUT 9, 3000, 73
· DEBUG "Pancreas - 66 Hz", CR
· FREQOUT 9, 3000, 66
· DEBUG "Skin - 363 Hz", CR
· FREQOUT 9, 3000, 363
· PAUSE 3000
· DEBUG "Starting Sequence", CR
· HIGH 14
· 'DEBUG "Section 1"
· DEBUG "(Sequence 1 - Abscess and Lymphatics)60 Sec 802hz and 42Hz)", CR
· FREQOUT 9, 60000, 802, 42
· DEBUG "(Sequence 2 - Abscess and Lymphatics)30 Sec 802hz and 42Hz)", CR
· FREQOUT 9, 30000, 802, 42
· DEBUG "(Sequence 3 - Thymus and Pancreas)60 Sec 73hz and 66Hz)", CR
· FREQOUT 9, 60000, 73, 66
· DEBUG "(Sequence 4 - Thymus and Pancreas)60 Sec 73hz and 66Hz)", CR
· FREQOUT 9, 30000, 73, 66
· DEBUG "(Sequence 5 - Skin)60 Sec 363Hz)", CR
· FREQOUT 9, 60000, 363
· DEBUG "(Sequence 6 - Skin)30 Sec 363Hz)", CR
· FREQOUT 9, 30000, 363
· 'DEBUG "Section 2"
· DEBUG "(Sequence 1 - Abscess and Lymphatics)60 Sec 802hz and 42Hz)", CR
· FREQOUT 9, 60000, 802, 42
· DEBUG "(Sequence 2 - Abscess and Lymphatics)30 Sec 802hz and 42Hz)", CR
· FREQOUT 9, 30000, 802, 42
· DEBUG "(Sequence 3 - Thymus and Pancreas)60 Sec 73hz and 66Hz)", CR
· FREQOUT 9, 60000, 73, 66
· DEBUG "(Sequence 4 - Thymus and Pancreas)60 Sec 73hz and 66Hz)", CR
· FREQOUT 9, 30000, 73, 66
· DEBUG "(Sequence 5 - Skin)60 Sec 363Hz)", CR
· FREQOUT 9, 60000, 363
· DEBUG "(Sequence 6 - Skin)30 Sec 363Hz)", CR
· FREQOUT 9, 30000, 363
· 'DEBUG "Section 3"
· DEBUG "(Sequence 7 - Abscess)60 Sec 802Hz)", CR
· FREQOUT 9, 60000, 802
· DEBUG "(Sequence 8 - Lymphatic)60 Sec 42Hz)", CR
· FREQOUT 9, 60000, 42
· DEBUG "(Sequence 9 - Thymus)60 Sec 73Hz)", CR
· FREQOUT 9, 60000, 73
· DEBUG "(Sequence 10 - Pancreas)60 Sec 66Hz)", CR
· FREQOUT 9, 60000, 66
· DEBUG "(Sequence 11 - Skin)60 Sec 363Hz)", CR
· FREQOUT 9, 60000, 363
· LOW 14
· PAUSE 500
· LOW 15
DEBUG "END"
END
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
If you know the specs on your laser, find the proper series resistor to drive it off from 5V, which you can pull off Vdd on the HW board. I bet it's 25-30 mA at around 3V, if it's like a laser pointer. You can then add a transistor switch, like a 2N2222, which the HW board can drive through its built-in 220 ohm resistor. That transistor will drop (absorb) about 0.7 volts, so recalculate a new resistor based on using (5-0.7=) 4.3 volts.
If my numbers are close, you'll need a 68 ohm series resistor or thereabouts. Always check first!
BTW, FREQOUT sends a crazy sine-wave pulse, not a square wave, as you can see at https://ccrma.stanford.edu/~gary/controllers/ir.html
Might affect your results.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Yeah I was thinking the sinewave might affect things.. And I think I saw a simple oscope circuit for a pc that I might be able to utilize.
That was going to be something else I needed to look up and see if I can do the square wave and generate the frequencies on the BS2 without too much complication.. Ive been racking my brains for some time trying to learn all this stuff.. I wish all stamps had a standardized language, gets kind of confusing. And right now, the BS2 (PBasic) seems to be the easiest of the languages.
Thanks for the help.. I appreciate anything I can get on this. I have a somewhat vested personal interest in getting this done as soon as I can for personal therapy that I have to have. Started off using RC circuits with SSRelays, which worked ok but was rather limited in scope.. The Micrcontrollers seemed to offer a simpler approach (save the language) and much wider scope .
Thanks
Bill
Bill
Yes, Stamps are easy to work with, lots of help in these forums. Plenty of people here are much smarter than me; I always learn something prowling through here.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Is it Beer Yet?
http://www.philohome.com/sensors/lasersensor.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Sorry for the misinformation. It was still fruitful though. The end result will require a 20-50 High Output LED array or one or more lasers probably in the 15omw range..
**Sigh** must be early onset old age..[noparse]:)[/noparse]
Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Is it Beer Yet?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Is it Beer Yet?
The switching frequencies produced by FREQOUT can be over 100 kHz, and an LED with resistor can easily keep up with that, as can a laser diode with fast current controller.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
But I got to admit, that having a lil 150mw green laser that when focused is hot enough to cut/melt thin plastics is still pretty cool.
I think i saw in the completed projects section of this forum a simple PC Oscope project, that I may go back and lok for. It would be nice to actually be able to see/verify my output frequencies and waveforms
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Is it Beer Yet?
Is the Basic stamp the way to go with this or should I consider another chip? Propeller? Arduino? Others??
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Is it Beer Yet?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Is the programming language similar with the propeller? and does it come as a kit like thehomework board? As you can see in above in a few prevous post, the language/program, on the BS2 is really simple, At least if it is doing what it is suposed to be doing.. hehe. That said.. I just really need the quickest, easiest and most cost effective means of achieving my goal.
The program code i posted is just one set of frequencies. In total, I need to generate about 60 frequencies, and run them singly or in groups.
Teach me thy ways, Master!...[noparse]:)[/noparse]
hehe
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Is it Beer Yet?
I need a stamp that will read my mind and just know what I want it to do and just configure itself. Now that would be a stamp worth having..:P
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Is it Beer Yet?
Post Edited (bcook65) : 3/16/2010 10:09:41 PM GMT
1. which one of the kits below would be best? Or do you recommend something else?
They both appear to have usb, unless they posted a deceptive picture:
Propeller Education Kit – PropStick USB Version.. $99
Propeller Education Kit - 40 pin DIP Version ..$99
2. Can achieve my project goals more easily on these platforms? with minimal equipment?
3. The programming language, is it more difficult than the basic stamp or similar?
Someone had told me a couple months ago Arduino maybe a good way to go, but never having seen one or known anyone who has used one, I would not know..lol
Thanks
Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Is it Beer Yet?