Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Relflection Sensor

I have the 4WD Robot and have hooked up the reflection sensors. It did not works so i I used MyRobotDebug and the data I get looks odd..

Below is the data with average output. I tested this on both the left and right sensor and the results where similar.

The results go up on all three sensors even though I only plug in one sensor.
If I put black in front of it--- about 1/4" -- the results only move a little --

Any ideas?

1 2 3 4 5
Nothing Hooked up NHU 449 448 439 10 0
Black
Sensor pluged in the #0 position 880 855 831 49 0
Sensor plugged in the #1 position 831 812 878 -48 0

White
#1 875 845 823 52 0
#2 815 797 874 -59 0
G
1 person has
this question
+1
Reply
  • Brian Jepson (Editor, Maker Media, Inc.) August 01, 2013 19:16
    Hi Bill,

    Sorry you're having trouble. Could you post a photo of the object you're putting in front of the sensor as well as an "action shot" of the object placed in front of the robot? The closer you can get to the actual lighting you're using, the better. Can you also take a photo of how it's all wired up?

    Thanks,

    Brian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Here are some images... It is a piece of white paper about 1/2 inch from the sensor. For the black i have used a brim of a black baseball cap.



  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Brian Jepson (Editor, Maker Media, Inc.) August 02, 2013 14:38
    Thanks, Bill. Have you tried any other materials for the black? I found that the black was the trickiest; a black piece of paper (matte rather than glossy) worked well for me.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • I just tried matt black plastic... not much difference.. here is the data.
    There is only one sensor plugged in and Data 1,2 and 3 go up... when I plug in the one.. BTW - I only have the power on from USB... but turning on the robot power does not seem to change any of the data.

    White
    Data,1,824,
    Data,2,804,
    Data,3,878,
    Data,4,-54,
    Data,5,0,

    Black
    Data,1,833,
    Data,2,813,
    Data,3,881,
    Data,4,-48,
    Data,5,0,

    No Connect - unplugged the cable
    Data,1,447,
    Data,2,440,
    Data,3,433,

    White paper further away... 1.5” with bright light on it.
    Data,1,815,
    Data,2,795,
    Data,3,872,
    Data,4,-57,
    Data,5,0,
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Brian Jepson (Editor, Maker Media, Inc.) August 02, 2013 17:51
    Thanks, Bill. I'll ask the author to take a look at your photos and numbers and see if he can suggest some solutions.

    Best,

    Brian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Hmm... So I moved on and tried the Ping sensor.. It seems to work - Flashing green light on the sensor and the sever work.. but I get "No front sensor"... the one thing i did when i built the Shield was that I accidentally swapped the two chips -- the one in back and center and powered it up.. I have swapped them back.. any chance I did some long term damage?

    The other odd thing I have noticed is when I unplug the USB the Ardrino light goes off and if the motors are running they stop. I would think that the robot batteries keep the Ardrino powered and the LED should stay on..

    Thanks for the help. This is not working out how I was hoping.. :(
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • Brian Jepson (Editor, Maker Media, Inc.) August 03, 2013 22:50
    Hi Bill,

    When you swapped the chips, did you need to desolder them before you could swap them, or were they socketed? Desoldering is messy business, and it's possible to damage the chips when you do this.

    This is the Adafruit motor shield, right? I'd suggest that you check with their support team to see if it's possible to damage something (either the Arduino or the chips) when you connect things the way you did.

    Also, you may want to disconnect your Arduino from the shield, and run some test sketches on it that use the various pins that are used; you could start with the Arduino's built in examples for digitalWrite and analogRead. That way you could determine whether any of the Arduino's pins are fried.

    - Brian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly

  • I got lucky and had use the sockets.. so the swap was easy.

    I tested the digitalWrite and analogRead... they both gave me back results.. not sure what the number should be but it it did reply with a number.

    I did check with the Adafruit and they did not help other than to say my board should be ok, "Even if it were possible to cause damage to the Arduino with a misplaced chip, that damage would be directed to the Arduino IO pin it was connected to. Since the motors are all working, that means that all the pins connected to the shield are working. viewtopic.php?f=31&t=13173

    Since the shield does not use any of the analog pins, I do not believe it is possible it to cause them damage without sending the whole processor up in smoke."

    Any more ideas?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • Brian Jepson (Editor, Maker Media, Inc.) August 05, 2013 18:38
    Thanks, Bill. One more thing to try: can you connect the IR sensors directly to their assigned Arduino pins and test the reflectance that way? You'll bypass the motor shield and be able to eliminate the possibility that the motor shield has a problem. You may need to use jumper wires to make the connections (signal, power, ground).

    Also, if you can get some construction paper to test with for the dark object, that may be helpful.

    I checked with the author, and he didn't have anything to add, other than that we're essentially on the right track with our research here!

    - Brian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited