EE-SX1140 troubleshooting

I’ve bought 2 EE-SX1140 and I’ve wired one of them like in the photo, but it’s not working. I’ve already tried to swap the sensor but they are either both broken or both fine: the output it gives me remains constant and close to 750, regardless of the presence of objects blocking the sensor. The code I’m using is the default AnalogInOutSerial you can find on the examples. What am I doing wrong?

EESX1140.png

Does it still emit some light? A current limiting resistor should be in series with the LED. 750 is almost equivalent to the 4V you supply. Did you check that the wiring of the EE-SX1140 is correctly? Except the little arrows on the top there seems to be no other mark to show the pin order on the casing.

Thanks for replying. I put a 100 ohm resistor in series with the LED then I checked with my phone's camera and it does not emit any light. The camera I used picks up IR light from a TV remote and if I remember correctly both TV remotes and the sensor have the same frequency, close to 850nm, so it should be able to pick up something. I believe the LED might be broken since I didn't put a resistor. I also double checked and the sensor is wired correctly, no problems there. "750 is almost equivalent to the 4V you supply." What do you mean?

I also double checked and the sensor is wired correctly, no problems there. "750 is almost equivalent to the 4V you supply." What do you mean?

The 5V from the Arduino divided to the 1023 (10bit) of the ADC times 750 (your reading) results in slightly under 4V. If your supply wasn't the full 4V and the Arduino got a bit more than 5V from the USB connector the reading might be plausible.

I set my supply at 4V and the Arduino was connected to my PC so I have no idea why 5/1023*750 is 3.6. Is this in any way a problem? Will the Arduino still read a 4V (3.6 in my situation) input? If no, should I increase the voltage of the sensor to 5V, and if yes, will that damage it?

I didn't want to point to a problem there just explain the value you got. Try to replace that part and use a resistor on both sides to try again.

Thank you very much! I will buy another one of those sensors but unfortunately it will take a while to ship. I'll post an update when I'll try again tho.

pylon: Try to replace that part and use a resistor on both sides to try again.

The new sensors arrived so I put in a 100 ohm resistor on both the LED and the sensor side but the Arduino still picks up a constant value close to 700

May I ask you to post a wiring diagram of the complete setup? Including how you power the Arduino (BTW, what type of Arduino are you using?).

I use an Arduino Uno with ethernet shield, both are manufactured by third parties. It's powered by my computer via USB cable since I monitor the sensor using the Serial Monitor. I attached the schematics with some photos of my setup. Sorry for the quality, I don't have a tool to draw diagrams so I just used MS Paint. Unfortunately the forum doesn't let me post for some reason. If the site is going to let me post this I will write another reply with the schematics.

Since the forum won't let me post the images I created a folder you can view with dropbox: https://www.dropbox.com/sh/08zdlb9nk1e8g9n/AADVmxfy681Zua8qNk4mn85Fa?dl=0

I'd say the EE-SX1140 datasheet leaves room for interpretation but for any of my interpretations you wired incorrectly.

My main interpretation of the pinout is (given looking top-down to the device, the arrows pointing left to right):

  • top-left is LED anode
  • bottom-left is LED cathode
  • top-right is emitter phototransistor
  • bottom-right is collector phototransistor

If I'm right, the LED is blocking in your setup and the transistor is the wrong way connected too.

In your wiring diagram the emitter is connected to 4V and collector is connected to GND. I'd say it should be the other way round because that's an NPN transistor.

I was just about to write that you didn’t understand my poor diagram when I decided to test things first and guess what: the LED was hooked backwards! I cannot express how grateful I am! Thank you very much for all your help! :slight_smile: :slight_smile: