It could be the pins are wrong, The IR is on GPIO9 and the red on gpio10.