I've got a mechanical IR cut filter that I'm planning on using to convert the IR PiCamera to a Normal light version depending on the levels of ambient light (+/- external IR LED array). This particular mechanical IR filter I think is based on a solenoid that moves the IR filter when a current is applied. If I connect it 5V and GND, it moves the IR filter one way. To move it back, I need to swop V and GND around. I had the idea of using an L293D ic in the same way as used to run a DC motor forwards or backwards as a way of achieving the same effect of manually swopping the polarity around of the 5v and GND connections.
I've built my bread board as follows, which is based on the following blog post:
My main modification is to remove the external batteries for the 'motor Vcc' input and substitue with the 5V supply of the Pi, on the basis that the IR cut filter is activated by connecting directly to the 5V pin and GND.
My layout is as follows:
Code as follows:
- Code: Select all
import RPi.GPIO as GPIO
from time import sleep
Motor1A = 16
Motor1B = 18
Motor1E = 22
print "Going forwards"
print "Going backwards"
print "Now stop"
The problem is that I just get 0V across pin 3 and 6 of the L293D.
I can detect voltage changing as per the code in the enabling GPIO lead and both the other two, but cannot get any output to work. Power form the Pi seems okay, and GPIO pins go high / low as they should.
Any ideas - or have a made silly mistake ?