An optical sensor is used that can determine plastic glass a

An optical sensor is used that can determine plastic, glass and aluminium by way of variable voltage. I would like to have the sensor use two pins on the pi for all three possibilities.

Create a shematic using comparators and logic gates to accomplish the following:

10 => glass

01 => plastic

11 => aluminium

The voltage ranges are (in mV):

-infinity < 79 => 10

79 < 95 => 01

95 < infinity => 11

Solution

[-inf, 79] => 00, (79, 95) => 10 and [95, +inf] => 11. You\'d just need 2 comparators, for the voltage > 79mv and one for voltage >= 95mv.

If you use comparators with a open collector output , which will make interfacing it to what ever you are using easier (see below) you could even wire-and the outputs together (i.e. the output is high only if both inputs are high) to allow you to get the \'nothing\' state as well.

You\'d need one comparator to go high when voltage > 79mw and then 2 with the outputs together where one is configured to go high when voltage >= 55mv and one to go high when voltage < 95mv. This would give [-inf, 55) => 00, [55, 79] => 01, (79, 95) => 11 and [95, +inf] => 10.

Be careful with input voltages to whatever you are using. It sounds like you are trying to interface to a Raspberry PI whose inputs (as far as I remember) are 3.3v and NOT 5v tolerant. If you use a comparator with open collector / drain outputs you should then be able to connect this directly to the input with a pull up resistor to whatever is the correct voltage or use the Pi\'s internal pull ups.

Note:i have already answered this in Reddit!!!!!!!

An optical sensor is used that can determine plastic, glass and aluminium by way of variable voltage. I would like to have the sensor use two pins on the pi for

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site