How can you tell if the EE-SY310 photo reflective sensor is working?

Started by dom67911, March 01, 2014, 07:54:34 PM

dom67911

I just connected it to Moteino, loaded the WaterMote sketch to it and no data gets picked up.
So, I did connect GND to GND, "+" to VIN (as indicated in the article) and OUT on the sensor to DP3 on the Moteino. Yes, I also updated the WaterMote sketch to have INPUTPIN as 3.

The way I can tell nothing is being "sensed" is because the same 'odd' values appear in the Serial Console with AND without the sensor connected. Then, since I suspected a 'power' problem, I connected the sensor from VIN to 3.3 OUT PIN on the Moteino, also without success (probably as expected).

So, how can I tell if there's something wrong with the sensor?
"The setup"? Meaning, should I be connecting them to some other pins on the Moteino?
The soldering of the headers look fine to me. I inspected them ~3 times just to make sure.

Any ideas would be helpful.

BTW, I do know the Moteino's are working since the data is being sent and received just fine.
Its the sensor I'm questioning.

Thanks

Felix


dom67911

Using the "yellow LED" test in the products page (link below) shows that it's sensing changes between light and dark.

--Edited--
But still the pulseCount is not getting updated, and of course neither are GAL, etc.
This means, while the yellow LED is telling me that a change in light happened, the sketch did not get that notification. I'm not sure how to proceed.

This is how I connected the wires. Uses PIN2 since i had to change INPUTPIN in the sketch to 2 otherwise Arduino IDE would not connect to Serial Console.

Any pointers?




Products page
Mote's pin readout

Felix


dom67911

Ok, I have started over, including reconnecting the cables and re-checked out the WaterMote source from GitHub. What I'm finding is the LED does not light up when connected to INT1 - this is not expected since the article shows that it's lighting up when there's nothing in front of the sensor.

Images below show that when connecting the sensor's OUT to INT1 (Digital PIN3) it's not lit with nothing in front of it. This is concerning and unexpected since the article shows the LED is ON when nothing's in front of it. I *think* the connections are solid and continuous, so I attempted to prove that with the pictures below.

Anyone have an idea why the LED would not be ON when it's OUT is connected to INT1 and nothing in front of it? This is a clean checkout of WaterMote sketch and I've confirmed INPUTPIN is set to 1, as expected.

Any help or guidance would be greatly appreciated. I really want to get this working since I see so many cool projects possible.

Picture showing that the LED is not lit up when connected to INT1, but it should be.  :(


Picture showing that LED IS lit up when connected to Digital pin 9.
I understand the attachInterrupt is not going to work here since PIN 9 is not an interrupt pin.
BUT, what I *think* it does show is the connections are there - GND, Power - therefore, the cables *should* not have a problem.


Continuation from second picture - showing that LED turns off when the WaterMote is sending data to the Gateway. So, when its not transmitting, the LED is ON, but when transmitting the LED is OFF. I don't know what that means, but the answer is irrelevant. What I'm trying to show here is that the connections *should* be ok, meaning no breaks.

Felix

The LED is not supposed to be ON when nothing is in front of it. That's because nothing reflects the IR.
Take a sticky note or white paper and cover a portion with black Sharpie or marker. Put it close to the sensor, when the black portion is over (or nothing in front) it should be OFF/low, and when the white portion is over (or something reflective to reflect the IR back into the sensor) it should be ON/high. That's it.

dom67911

Even with a blacked out square on plain white paper, no light comes on. Toggling between the dark/light spot does not make a difference. Strange. I don't know what else to try.


Felix

I don't see a resistor on that LED, you should be using one to limit the current that the sensor will drive, otherwise you might damage it (if not already).
Try connecting the + of the sensor to VIN.
Can you verify the sensor still works without the OUT connected to anything? Put a white piece of paper in front of it, the LED should come ON.

dom67911

The LED works (is able to be powered on) when connected to 3.3V PIN without the resistor - controversial I know. Since I'm very new (obviously) to electronics and circuit diagrams I did not know how to connect all 3 together without burning something (the LED, resistor + Moteino).

So, simply removing connections to sensor's OUT *DID* show that the interrupt was being called.
Unfortunately, this resulted in an unexpected infinite loop of the interrupt being called.
What I did then was to try an reduce the number of moving pieces (connections) and the sensor still did not 'trigger'.

I've created another order purchasing additional sensors and Moteino's to test, just in case there's something I f'd up on my only current sensor.

Showing the sensor, without LED, over black square and "GPM: 0.0" being read. The PulseCounter being 3000+ comes from the unexpected infinite loop I talked about earlier.


For completeness, same setup, just over the light area, showing nothing being registered as shown by "GPM: 0.0"


A broad view of the full setup.
Attempts were done by connecting to both VIN and 3.3V PINs, without success.
sensor's OUT was connected to INT1 which, as you know, is Digital PIN 3.
And Ground to GND (for completeness).


I will wait for the next batch to see if maybe I messed up something with the current electronics I have.
After all, this is my first everything - soldering, sketch uploads, etc. So, I'm not going to rule out "user error". I will post an update once they arrive and I've made attempt #2. Thanks so much for your time and patience!

Felix

The code I released for RFM69 works just fine, verified again just now on a regular Moteino, I am using a low power LED with attached resistor to visually observe the change in OUT from the sensor. R4USB should behave the same.

Loaded with this sketch (with my own RFM settings): https://github.com/LowPowerLab/WaterMote/blob/master/WaterMote_RFM69.ino
Here's how I connected it, shown with WHITE/light paper over, red LED is ON:



And here are outputs from a receiver Moteino(top) and the sensor Moteino (bottom):

dom67911

SOLVED! I just received the latest batch of photo sensors (2) and confirmed they are working. The interrupt is now getting called, thus registering number of gallons consumed.

Therefore there was something wrong with the original sensor I was using.
Likely something I did during the wiring. The above pictures may be useful to others.

Thanks Felix from your time, patience and prompt delivery!

Felix