Communication error

I didn't see in the photo, which cable is connected to which sensor pin. What is the green wire and why it doesn't connect to anywhere?

According to output in Serial monitor, your board has restarted during the read the sensor. It could be a bad connections...