CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Laser level receiver project?
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Wed Jan 04, 2023 11:51 am     Reply with quote

It may well be using the detection of the motor speed as it's modulation.
Key to understand is that the further you want to detect, the harder it is
to get the detector reliable. I use systems with UV and IR reflecting
off river surfaces to detect things like oil on the surface, and working through
rain, mist, waves/ripples on the surface, at distances of often hundreds of feet
across the water, you have to design a really sensitive detector that can
ignore light from any other sources. We measure the difference in beam angle
for the two light frequencies.
Sam_40



Joined: 07 Jan 2015
Posts: 127

View user's profile Send private message

PostPosted: Wed Jan 04, 2023 12:09 pm     Reply with quote

Ttelmah,
I just want to duplicate the original receiver and make mine has more vertical sensing/display. The original sensing hardware only about 5 CM or 2 inches.
When testing the original receiver these are the parameters that I noticed.
It has less than half a second to respond if the laser beam hit any of the sensing area vertically.
If I move it away, it has latency before it stop showing high/level/low. I would say about 1/2 a second.
If you shine flash light directly on it, and the laser hit it, it will stop showing high/level/low. It basically sense other sources of 630 is interfering.
The receiver is designed to be held vertically. Sunlight will not effect it as it will be angled on the display, if the sun was shining in the direction of the sensing unit or receiver.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Wed Jan 04, 2023 3:54 pm     Reply with quote

Quote:
I disassembled the original receiver.
The only hardware that I see are:
Something rectangle looks like LDR to capture the light. It has about 20 pins for power and outputs.


LDR with 20 pins, sound like a digital image sensor, not as a single component.
Could you give us more details of the sensor pls?
_________________
Humberto
Sam_40



Joined: 07 Jan 2015
Posts: 127

View user's profile Send private message

PostPosted: Wed Jan 04, 2023 5:59 pm     Reply with quote

I disassembled the unit one more time. I looked at the components with high power magnifier. The sensor maybe just an array of 19 phototransistors or 19 photodiodes. They look like they have flat head. they made some type of cut look identical to how the LDR looks. I think it's just to prevent the light that comes at vertical angle from interfering with the sensors. the shape of it looks like this text in the code text box:
Code:

 __________
 __________|
|__________
 __________|
|__________
 __________|
|__________
 __________|
|__________
 __________|
|__________
 __________|
|__________
 __________|
|__________
 __________|
|__________
 __________|
|__________



The sensors are in the middle. the horizontal groves about 12mm wide, about 2mm high and about 2-3mm deep. The spacing between the groves about 2mm.
I am not sure, but I believe one pin is comm and the other 19 are the signal from the sensing devices.

I also checked the flashlight that I was able to activate the receiver with on flash mode. It has about 25mS ON and about 25mS OFF.

I also noticed, the processor of the receiver has condition statements, even with the flashlight hitting wider area than the laser. The display shows the sensor is active where about the middle of the flashing light is. As I am moving the flashing light above or below the sensing area, it continue to sense until the flashing light leaves the sensing area. I also noticed the laser may hit two sensors while in the receiver sensing area.

I don't want to damage the original receiver to better inspect the hardware as it is very expensive.

If you think it is not doable, I will stop wasting your time and mine.

If you guys can help me code this project, especially if I have the inputs sense the timing of the laser ON\OFF. I may have better receiver Smile


Thank you
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Thu Jan 05, 2023 12:05 am     Reply with quote

Yes, a linear array sensor. Just like I posted the link to right near the
start of the thread.
Sam_40



Joined: 07 Jan 2015
Posts: 127

View user's profile Send private message

PostPosted: Thu Jan 05, 2023 6:47 am     Reply with quote

Last night, I soldered 8 phototransistors to a board. I also soldered 10k resistors for pullups. I made a shield around each phototransistor so only straight light go through and allow horizontal light. I tapped the red optical shield on top. I am going to experiment with my homemade 😀 phototransistor array today in daylight and see what kind of results I get.
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Jan 05, 2023 7:53 am     Reply with quote

Providing you get them all physically aligned (equal vertical and horizontal spacing), and calibrated ( same voltage output on each ) it will work.

The proof will be to shine the LASER light at sensor #5.
#5 will have maximum voltage
#4 and #6 ,less BUT equal
#3 and #7, less but equal from #4 and 6
#2 and #8, less but equal from #3 and 7
#1 , less than #2 and 8

Ideally you'll power them from a well regulated, well filtered 'precision voltage reference' and NOT from the VDD ( PIC power pin.....)

I prefer putting the load resistor on the emitter of the phototransistor, a 'common emitter' configuration. That way the output indicates 'signal strength'. The higher the output voltage, the brighter the beam. If your phototransistors have the base lead, you'll probably have to adjust that resistor(s) to calibrate all 8 sensors to have the same linear response.

this makes for a great rainy day project !!
Sam_40



Joined: 07 Jan 2015
Posts: 127

View user's profile Send private message

PostPosted: Thu Jan 05, 2023 6:02 pm     Reply with quote

The phototransistors that I used have no base lead.
My testing went well.
The array worked as temtronic describe. I tested the array using 6 volts battery. The shield between the phototransistor is important, otherwise the phototransistor will activate each other. The red optical lens is also important, otherwise the sunlight will effect the phototransistors.
When the laser hit one phototransistor, the two phototransistors next to it, will output less (when connected to the processor, these the only three that activate the inputs). The array preform exactly as the original receiver. The only difference is, the original receiver only respond to the fast flashing light.
I also tested some LED and photodiodes, for this setup the phototransistors that have a peck wavelength of 630nm and narrow field is the best option.
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 06, 2023 6:45 am     Reply with quote

My previous post...
http://www.ccsinfo.com/forum/viewtopic.php?t=59934&postdays=0&postorder=asc&start=15
I gave a basic description on how to 'see' ONLY the LASER signal.
Another way would be to have PIC coded as a 'tachometer', where the PIC determines the 'on' time of each LASER pulse.
In one of your posts you said it's high 280us, then low for 100ms.Use those values to cut code to 'read' the beam, if you get a high pulse width time of 250-290us, consider that to be a 'valid pulse', and update a variable
Sam_40



Joined: 07 Jan 2015
Posts: 127

View user's profile Send private message

PostPosted: Fri Jan 06, 2023 7:23 am     Reply with quote

I tried to code something similar to what you suggested in your previous post. I tried to set variables to store the ON time and the OFF time. Subtract the low from the high. If it's 99mS then it's valid signal. I also tried to duplicate the original receiver responding to the flashing flash light 25mS ON and 25mS OFF. I wasn't successful.
As you know I need to monitor 16 inputs and display on 16 outputs (of course I have to have a time delay of at least 100mS to keep the outputs from flickering or flashing.
Would you please provide sample code or pseudo code in C that I can build on correctly. I would appreciate that.
Thank you
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 06, 2023 7:41 am     Reply with quote

Have a look in the examples folder or search here for 'tachometer'. Maybe google 'CCS C tachometer' ? There has to be 100s if not 1,000s of 'tachometer' programs on the net.
You'll need an interrupt /timer based program and a crystal based clock for accurate timing.
Sam_40



Joined: 07 Jan 2015
Posts: 127

View user's profile Send private message

PostPosted: Fri Jan 06, 2023 7:48 am     Reply with quote

I built a project in the past for DRO using encoder and port B and display on LCD.
How can I use the principal to other inputs ports?
What crystal power you suggest for this project?
Thank you
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 06, 2023 9:42 am     Reply with quote

Initially for test purposes , you could use the internal osc set at 32MHz
though I'd use an 8MHz xtal/2 caps and set the PLL to on.8 x 4 = 32 MHz clock.
I have a lot of 8MHz xtals here but you could use a 10MHz an dget full speed of 40 MHz.
Sam_40



Joined: 07 Jan 2015
Posts: 127

View user's profile Send private message

PostPosted: Fri Jan 06, 2023 10:47 am     Reply with quote

Thank you, I appreciate your input. I have some 8 and 10 MHZ crystals. I will start with the 8mhz.

How can I use other ports of inputs to act like port B. In the past (it has been long time ago) I used port B to read the optical encoder. My understanding from reading the datasheet and few posts on this forum. Port B has special feature to read fast inputs (I may not understood that correctly).
Thank you
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Jan 06, 2023 10:57 am     Reply with quote

Honestly, you need to concentrate 100% of your time to 'seeing/ reading' the LASER beam FIRST.
Nothing, absolutely nothing else matters until you can receive and decode the beam.
You need to think of the 'beam' as a repeating , very narrow pulse sent at a 10Hz rate.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group