Mindy Mosher
Published © GPL3+

Pix-G Gif Cam with IR Flash Attachment

The awesome Pix-E gif cam with a IR LED flash attachment!

IntermediateShowcase (no instructions)2 hours2,081
Pix-G Gif Cam with IR Flash Attachment

Things used in this project

Hardware components

Adafruit Super-bright 5mm IR LED - 940nm
×1
20mm Transparent LED Lens Reflector Collimator 8 Degree
×1
Adafruit N-channel power MOSFET - 30V / 60A
×1
Raspberry Pi NoIR Camera
×1
Raspberry Pi Zero
Raspberry Pi Zero
×1
Adafruit PowerBoost 500 Charger
×1
Adafruit LiPo 2500mAh battery
×1
Adafruit 16mm Momentary Illuminated Pushbutton
×1
10 Ohm 1w resistor
×1

Software apps and online services

Raspberry Pi Raspbian Jessie with PIXEL

Hand tools and fabrication machines

Monoprice Maker Ultimate 3D Printer
Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

Pix-G Modified gif cam with flash module

Modified camera model with flash housing

Schematics

Pix-G Modified gif cam circuit

Camera circuit with added IR LED and MOSFET

Code

Modified Pix-E gifcam python code

Python
This code includes the flash on GPIO pin 13, as well as turning the flash on before the pictures begin, and turning it off once the pictures are done. I also changed the number of pics in the gif to make it slightly longer.
import picamera
from time import sleep
import time
import RPi.GPIO as GPIO
from os import system
import os
import random, string

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
button = 19 #Button GPIO Pin

GPIO.setup(button, GPIO.IN, pull_up_down=GPIO.PUD_UP)
led_1 = 12 #Status LED GPIO Pin
GPIO.setup(led_1, GPIO.OUT)
led_2 = 21 #ON/OFF LED Pin
GPIO.setup(led_2, GPIO.OUT)

flash = 13
GPIO.setup(flash, GPIO.OUT)


########################
### Variables Config ###
########################
num_pics = 8 #Number of pictures to take in Gif
gif_delay = 15 #How much delay in between those pictures (in hundredths of a second)    

camera = picamera.PiCamera()
camera.resolution = (540, 405)
camera.rotation = 90
#camera.brightness = 70
camera.image_effect = 'none'
GPIO.output(led_2, 1)
print('System Ready')

def random_generator(size=10, chars=string.ascii_uppercase + string.digits):
    return ''.join(random.choice(chars) for x in range(size))

while True:
    input_state = GPIO.input(button) # Sense the button
    randomstring = random_generator()
    if input_state == False:
	
	GPIO.output(flash, 1)

        GPIO.output(led_1, 1)
        print('Gif Started')
        for i in range(num_pics):
    		camera.capture('image{0:04d}.jpg'.format(i))
        filename = '/home/pi/gifcam/gifs/' + randomstring + '-0'

	GPIO.output(flash, 0)

        GPIO.output(led_1, 0)
    	print('Processing')
        graphicsmagick = "gm convert -delay " + str(gif_delay) + " " + "*.jpg " + filename + ".gif" 
        os.system(graphicsmagick)
        print('Done')
        print('System Ready')
    else :
        # Switch on LED
        GPIO.output(led_1, 1)
        time.sleep(0.35)
        GPIO.output(led_1, 0)
        time.sleep(0.35)
        
       

Original Pix-E gifcam code

Credits

Mindy Mosher

Mindy Mosher

1 project • 2 followers
I like to make things.
Thanks to Nick Brewer, Rob Mosher, and Shayna Brewer.

Comments