I want to make a program that on and offs a 5v single channel relay through a raspberry Pi zero w.(setmode is bcm) I connected 5v pin (pin number 2), gnd (pin number 6) and gpio 17(pin number 11) to the VCC, GND and IN pins respectively. The code uses GPIO.HIGH and GPIO.LOW to control the relay during 5 second intervals(repeats 2 times). But when I run the program, it immediately ons the relay but only seems to off after the whole code is executed (i.e GPIO.cleanup). I tried replacing GPIO.HIGH and GPIO.LOW with True and false and also 1 and 0 l.
I have also connected the raspberry Pi zero w using vnc. For the power source I used a 5v 550mA output adaptor.