Laser receiver issue

(deleted)

Well, there is a lot of information missing from your description there!

Particularly what actual code you are using to say "detected". :roll_eyes: You need to read the instructions for posting questions and post your actual code properly.

The correct link for the BangGood listing is https://www.banggood.com/Laser-Sensor-Module-Board-Non-modulator-Tube-For-Arduino-Laser-Receiver-Transmitter-p-1359947.html


As I recall, I purchased a few some time back as someone was having trouble with them (possibly inserting the sensor the wrong way round!) but have not tried them out, but that sensor does not discriminate modulated light as some do and certainly cannot distinguish between laser and ambient light, so it will need to be shielded. If however, it is saying "detected" when completely covered, either the sensor is defective (or installed wrongly) or the code is wrong.

We await further information!



But the wait was indeed futile. :roll_eyes:

As noted in this memo, @system appears to have been pretty much a vandal/ troll, deleting the original post.

Though its actual history as recorded is very much unclear, implying that it was possibly a moderator while the account began in 2021 yet posting as far back as 2014.
:confounded:



Ok, noted the clarification regarding the "@system" account which makes sense.

It does appear however, that the original poster, "dominic9043" did indeed manage to vandalise this thread by removing the original post.

And in addition that this use of the @system account, actually continues to the present. :face_with_raised_eyebrow:

Hi,
Welcome to the forum.

Please read http://forum.arduino.cc/index.php/topic,148850.0.html.
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Thanks.. Tom... :slight_smile:

Hi,
Do you have a DMM?
If you remove the laser and just connect pin3 to gnd and then to 5V, what reading do you get on the monitor?

Try this code;

const int pinLaser = 2;
const int pinReceiver = 3;
bool inputValue;
void setup() 
{
  pinMode(pinLaser, OUTPUT);
  pinMode(pinReceiver, INPUT);
  Serial.begin(9600); //
}

void loop() 
{
  inputValue = digitalRead(pinReceiver);
  Serial.println(inputValue);
  digitalWrite(pinLaser,inputValue);
  delay (1000);
}

Can you post a copy of your circuit please?

Thanks.. Tom... :slight_smile:

Hi,
With the SENSOR module removed...

If you connect pin3 to gnd and then to 5V, what do you see on the monitor.

Remember connect Pin3 to gnd for more than a second, likewise when you connect Pin3 to 5V.

Can you post a circuit diagram or at least a picture of your project so we can see your component layout?

Thanks.. Tom.. :slight_smile:

Hi,
Disconnect the laser as well, I don't think the output pin of the Arduino has enough current to drive the laser.

Where did you get the laser, post link to seller/specs and or data please.

With pin3 continuously connected to gnd you should get ALL 0 0 0 0 0 0 0 0
With pin3 continuously connected to 5V you should get ALL 1 1 1 1 1 1 1 1

Use this code instead.

const int pinLaser = 2;
const int pinReceiver = 3;
bool inputValue;
void setup()
{
  pinMode(pinLaser, OUTPUT);
  pinMode(pinReceiver, INPUT);
  Serial.begin(9600); //
}

void loop()
{
  inputValue = digitalRead(pinReceiver);
  Serial.println(inputValue);
  delay (1000);
}

Tom... :slight_smile:

Hi,
What are the specs on the laser please.
You have posted the detector/sensor specs, now the laser please.

Thanks.. Tom... :slight_smile:

Laser Transmitter Circuit

TomGeorge:
Disconnect the laser as well, I don't think the output pin of the Arduino has enough current to drive the laser.

It does - just!


The resistor is "910" - 91 Ohms. Given 2V for the diode, 3 V across the resistor that would be 33 mA however the effective internal resistance of the ATMega output driver adds an extra 40 or so Ohms so the current is more like 24 mA as measured in practice.

dominic9043:
Any ideas on why the sensor is always displaying "detected" ?

What code?
Can you please post a picture of your project?
Thanks.. Tom.. :slight_smile:

As mentioned, it may be responding to room light.

dominic9043:
On all the codes mentioned... I'm sure I've posted a picture ?

Just a Fritzy picture, we would like to see a real picture of your project, not a diagram please.
Thanks.. Tom.. :slight_smile:

In order to migrate the forum from the SMF forum framework to Discourse, it was necessary to assign ownership of all the posts that had been created by users whose accounts had later been deleted (whether according to the user's own wishes or due to malicious behavior such as spamming). The people performing the migration chose to assign all those posts to the automated @system account, which is otherwise used by the Discourse to perform various maintenance operations.

So the standard posts you see in the @system account's history were created by many different people. This distinction is important because if we assume that all posts owned by @system were created by the same person then we will be unfairly associating the bad behavior of some of those deleted users with other users who behaved responsibly and made valuable contributions to the forum, but simply decided they no longer wanted to be a forum member.

The system of assigning posts to the @system user was specific to the migration that happened in spring of 2021. Once the switch was made to using the Discourse forum framework, it was no longer necessary to combine this type of post under a single user account. So going forward there will not be cause for this type of confusion but unfortunately we are stuck with this situation for all the pre-2021 posts.