The "sensor" is clearly not a simple phototransistor, it is presumably a "photo-logic" device but I can see no reference so far in the various eBay and Aliexpress listings as to its identity. It is not a 38 kHz sensor.
When the couple I am in the process of ordering from another (much cheaper) Aliexpress listing arrives in three weeks, I suspect I will be none the wiser as I doubt it has identification markings.
Your sensor is a DS18B20 LASER sensor not to be confused with the temperature sensor of the same name.
The pinout is labeled in the attached image. Additionally one side, the one facing us in the image, you can feel a tiny dot which is the sensor, the reverse or back side is sort of opaque and flat.
I don't believe there is more than one DS18B20.
It is available in a metal probe but never seen
it in a package like that. There's no reason
you couldn't use a temp sensor to detect a
laser if you had a lens to focus the photons
(possibly the raised bubble on the clear
plastic . The fact that the output is a voltage
rules out the DS18B20 which is Onewire.
Until I see a datasheet for that clear plastic
sensor I will not believe it shares the same
part number as a Onewire temp sensor.
Post a datasheet for that unless it IS a temp sensor and not photon detector.
Believe as you wish. I merely pointed out that DS18B20 is what is on the board and if we Google "18B20 LASER sensor" we come up with both. I am not going to play a childish game of I need to submit proof to be credible.OK, maybe the actual sensor less the board is not a DS18B20 part number. What does it matter? I at least provided the pin out so it can be installed correctly in the board. I see no reason for a rant over my post. Take a chill pill and get over my mistake. I really see nothing constructive you contributed to this thread.
It's not a game.
The vendors don't care if the part number is correct
because they knowmost of tgeir customers be lieve everything they read.
If you believe it , produce the datasheet for
the sensor. If it shows the clear plastic part and
has the sane part number I'll be surprisedbut I'll believe it.
I happen to believe there is only one DS18B20 and it's a Onewire temp sensor.
Don't you think it's strange that even Google
can only find one DS18B20 andi it's the Onewire
temp sensor ?
Look I already confessed, that was the number on the board. Now do you have anything constructive to add to the actual thread topic or are you just going to critique my post? I am not going to waste someone else's thread having an argument with you. Thank you and have a lovely day.
As far as the post is concerned, we still need a datasheet fir that clear plastic sensor. All
semiconductor devices have one. This post is not about the transmitter. It's about the receiver
and the specs are still unknown. If we write off
the damaged one, the OP still needs specs for the
receiver.
Last night I did a quick Google search on "DS18B20" combined with "laser sensor" (keeping the words a bit apart to prevent Google indexing this post as one) and got a few hits in between the temperature sensor hits, but most of those were "laser/temperature sensor" or something like that. Very confusing. It seems to me that a manufacturer decided to make their sensors more "discoverable" by marking them with the name of a common, popular, but very different sensor.
One or two of summaries mentioned it's for "unmodulated" light sources, which suggests it's not much more than a phototransistor.
I didn't dig deeper - to find a pinout, or even a data sheet, of how the thing is supposed to work. It indeed wouldn't surprise me if it's indeed just a phototransistor combined with laser source, where the phototransistor is designed to be fairly insensitive as to filter out ambient light.
Try OPL531 Inverted version datasheet
Look at the pinout in the photo in Reply#22
Note: The reason why it is the INVERTED version is that you can see from the schematic on page 3 of the datasheet, the OUT pin is the collector of the output transistor. When the transistor is ON, the OUT
will be low. The Non-Inverting OPL550 turns ON the transistor when light is detected. The OPL331 Inverting version has the transistor ON with NO light detected and OFF with light detected, causing the OUT pin
to be pulled up by the 10k pullup resistor, resulting in a HIGH.
Not to muddy the water, but the bottom line is that to end up with POSITIVE logic (high when light detected), you need the INVERTING version of the sensor (OPL331).
This was the original posted code: // (c) Michael Schoeffler 2014, http://www.mschoeffler.de
const int pinLaser = 2; // output signal pin of laser module/laser pointer
const int pinReceiver = 3; // input signal pin of receiver/detector (the used module does only return a digital state)
void setup() {
pinMode(pinLaser, OUTPUT); // set the laser pin to output mode
pinMode(pinReceiver, INPUT); // set the laser pin to output mode
digitalWrite(pinLaser, HIGH); // emit red laser
Serial.begin(9600); // Setup serial connection for print out to console
}
void loop() {
int value = digitalRead(pinReceiver); // receiver/detector send either LOW or HIGH (no analog values!)
Serial.println(value); // send value to console
delay(1000); // wait for 1000ms
}
Now as to the receiver module. They work and they work fine and will last a long time. What else could we possibly need or want to know? I posted a marked up picture of the sensor. When plugged into the board which is labeled DS18B20 and orientated correctly the board has three male header pins clearly labeled GND (Ground/Common) OUT which is signal out and VCC which is 5.0 volts. When 5.0 volts is applied the red LED on the board illuminates Telling a user the board is powered. I read somewhere the sensor was sensitive to 650 nm red light and that seems to be the case as ambient levels don't seem to bother it. When hit with red LASER light the OUT goes high.
Back to the original post what I don't quite understand is the LASER source is tied to digital IO pin 2 which is set as an output and set to high. OK and that Pin 2 is used to drive the LASER transmitter module. Like most stuff off the boat en mass details are sketchy, like data sheets but on several I have this is the read:
Max Light Power: 5mW
Operating Voltage: 5V DC
Max Operating Current: 40mA
Laser Wavelength: 650nm
Now at this point since in the code it seems we are just using a DIO pin as a 5.0 volt power source which I don't see as a good idea, especially since some of these 5 mW modules can draw 40 mA which I do not see as healthy for the Arduino which I believe is rated for maximum 40 mA on a DIO pin. Since we aren't doing anything like turning the LASER On/Off and if we were I would shove a transistor in there just to act as a switch. If all we want is On then just tie it to the 5.0 volt out on the Arduino board.
So anyway as to the receiver module VCC = %.0 Volts, GND + GROUND or COMMON and OUT = a 5.0 volt logic swing with high when the sensor senses red LASER light and about 0.0 volt when no LASER light is striking it. I had one in my junk stuff box from an old project. I think all of this pretty much covers it.
Ron_Blain:
I merely pointed out that DS18B20 is what is on the board and if we Google "18B20 LASER sensor" we come up with both.
It's not uncommon for Arduino sensor vendors to use the same printed circuit board for different sensors. My concern here is that they have repurposed a board that has some extraneous circuitry that causes problems in some configuration.
Assuming the sensor is a phototransistor of some sort the board should work if the collector is connected to the out pin (and pulled up to Vcc through 10k Ohm), the emitter is connected to Gnd, and the pin to Vcc is a no connection in the transistor package (some are no connect, some have a connection to base even though it is rarely used.) If the pin on Vcc is base, then smoke would ensue.
The hypotheses is that the designer repurposed a board for transistors that have a no-connect to the transistor base, and the board was shipped with a transistor that does have that connection. The Ohm meter procedure in post #11 would diagnose this. If this is the issue then disconnecting the transistor pin on Vcc would fix the issue.
Except for the 'unconfirmed' fact that the sensor
is much more than a photo transistor (see previous post with link to OPL331 datasheet). It's the
inverted version of the OPL550, which has an
integrated amplifier. That version is open-collector and needs a pullup resistor. Do I 'know' that's what it is ? No, but it certainly appears to be. That's
my best guess since obviously the vendor doesn't know or doesn't care because it obviously is NOT a DS18B20 Onewire temp sensor regardless of the
what the vendor page says. I think Wvmarle called
it right that the vendor did that to get better
search results . The real reason is unknown.
If it's not a DS18B20!then WHAT is it?
It is a variant of this one with the same - correct - configuration and looks rather nicer.
It appears that some clever vendor has paired it with an unidentified open-collector "photo-logic" device, realising that the board of which they found a dump, is perfectly suited. So while the other board is being sold with the DS18B20s, this vendor is selling it as a "Laser Detector Sensor".
Note the direction the photo-sensor is correctly mounted.
That makes sense, if it's that device, then the sensor device orientation as per post #18 would be correct. Turning the device around would apply reversed power to the outside pins which generally doesn't end well.
wvmarle:
It seems to me that a manufacturer decided to make their sensors more "discoverable" by marking them with the name of a common, popular, but very different sensor.
I think they just reused an existing circuit board (complete with markings) for a different application. The pinout of a DS18B20 temperature sensor would work on that board.
The real problem is that the device, like most all of the cheap eBay/alibaba stuff, comes with no documentation.
Have to agree it looks like a OPL530, OPL531, OPL535, OPL536, OPL550, OPL551, OPL560, OPL561, OPL562, OPL563 Series Photologic sensor. So here is what I diod since I have one laying here. I used the original posted code adding a curly bracket at the end and removing a few lines of code. I still think it is unwise to power the transmitter from a DIO. Anyway the board has two 10 K resistors. One of which is just a current limit for the LED they used and all it does is illuminate when the board is powered up.
Using an Arduino Uno I went ahead and set things up. The receiver module powered with 5.0 volts from the Arduino. I used a LASER pointer and when light strikes the sensor the card out goes from 0.0 volts to about 3.2 volts and the serial monitor changes from 0 to 1 as we would expect.So they work just fine. I may have a few more in a box somewhere.
As to the original problem and smoke. I believe we can all pretty much agree something has to draw excessive current and get hot enough and we see smoke. Now short of connecting the receiver module incorrectly which is unlikely the only other possible error I see is one already mentioned a few times. That being the actual sensor plugged into the board backwards. That would reverse VCC and Ground into the sensor and the LED would be reverse biased. So what would smoke whatever smoked?
That's where a thermal imaging viewer comes in handy if you can view
the board immediately after seeing the smoke you can narrow it down.
The other way is touch everything with your finger but that doesn't
usually end well.
I just want to make it clear that I understood it was a "re-purposed" PCB on my first reply. There is only one reason I can see that would make it "burn". (reversed insertion)
pwillard:
I just want to make it clear that I understood it was a "re-purposed" PCB on my first reply. There is only one reason I can see that would make it "burn". (reversed insertion)
I buy dat! About all I can think of. I guess I could just flip the sensor around on the one I have and power it using an external 5 volts and see what happens. While hardly expensive I am just a little reluctant to see if I can fry and smoke a perfectly good little module.