You don't open it, it opens itself. You don't check it, it checks itself
This trash can use ultrasonic sensor to get data how filled it is. Then this data is transmited using IR diode and then to Processing.