PDF with instructions open/download here
Program in Wedo 2.0 software for automatically stopping before obstacle: