1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Need help with robot project / color sensor

Discussion in 'Robotics & Mechatronics' started by Indecent, Jun 22, 2017.

  1. Indecent

    Indecent New Member

    Joined:
    Jun 22, 2017
    Messages:
    3
    Likes:
    0
    Hello, I am a student and my friends are doing a project, I want to help them.

    My friend told me that his problem is that he can't set up his color sensor to detect three separate colours using logic gates, he can only do either black or white, but he wants to differentiate between black, white and any other colour using logic gates, how can he do that ? with this color sensor logic gate thingy with 1's and 0's
     
  2. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,978
    Likes:
    510
    Location:
    Cleveland, OH, USA
    You could try a comparator with an adjustment on its threshold (the voltage to which the sensed voltage is compared) to account for the reduced light getting through the color filters that is neither bright nor dark, but in between.

    John
     
  3. Indecent

    Indecent New Member

    Joined:
    Jun 22, 2017
    Messages:
    3
    Likes:
    0
    My friend told me that method won't work and he could only use logic gates, any ideas?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,978
    Likes:
    510
    Location:
    Cleveland, OH, USA

    Maybe your friend should post his plan? If "red" is a logic state, then how will your friend determine what is "true?"

    John
     
  6. Indecent

    Indecent New Member

    Joined:
    Jun 22, 2017
    Messages:
    3
    Likes:
    0
    That's exactly the problem, our professor / instructor told us to do the project using logic gates like that. I am confused.

    Edit: We would like to make it like, if it's white or black then it is true, if it is anything else it is false. Something like that.
     
  7. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    5,978
    Likes:
    510
    Location:
    Cleveland, OH, USA
    You haven't said what family of logic you are using. Let's assume it is CMOS at 5V. The switch points are 1/3 and 2/3 of the supply voltage. Now, let's further assume that you can manipulate your color filter so its output is exactly half of what no filter gives. Darkness (not color, not light) is set to give less than 1/3 the supply voltage.

    Then arrange your logic so color is "not light" and "not dark" (inverting the dark might help). Here's one approach. There are many.

    Capture.PNG


    While there are many solutions, the key is that color will not be light and will not be dark.

    John
     
  8. ci139

    ci139 Active Member

    Joined:
    Apr 12, 2012
    Messages:
    469
    Likes:
    37

Share This Page