I always wanted an On Air sign, so I decided to make my own with changing colors, and connected to the internet to let people around me and the world that I am filming, stuck and debugging, on a food break, or done filming.
I painted the sign using conductive paint and I used a Raspberry Pi Zero W and connected it to Bare Conductive’s PiCap to read which parts of the paint I touched. I connected three GPIOs to three relays to be able to switch the RBG LEDs off/on. I powered the Pi and the relays with a 5V battery pack and powered the lights with a 12V battery pack.
To be able to control the RGB LEDs, I used a relay to be able to switch each color off and on. Raspberry Pi's GPIOs do not provide enough current to switch the relays or power the LEDs so I built a driver circuit.
The schematic shows how the lights are connected to the relay and to the pi. The Raspberry Pi turns the transistor on, which triggers the relay and the light connected to the relay.
Relay = to be able to switch the LEDs On/Off.
Diode = to provide the path of the current when the coil is switched off. And keep other components from frying.
Transistor = The relay needs a large current to switch, so we use a transistor to amplify the current from the Pi to the relay.
Resistor = To regulate the current from the GPIO to the transistor and have the right current go through the relay.
Check out the schematics to see how it all works!
The Raspberry Pi, should have internet connection to Tweet and will run the script that controls the Pi Cap. No further set ups needed.
To tweet my status, I used Raspberry Pi's tutorial on how to get started with Twitter's API. https://www.raspberrypi.org/learning/getting-started-with-the-twitter-api/
To get my Pi Cap set up with my Raspberry Pi Zero, I followed Bare Conductive's tutorial: https://www.bareconductive.com/make/setting-up-pi-cap-raspberry-pi-zero/
import RPi.GPIO as GPIO import time from twython import Twython import signal, sys, MPR121 import datetime now = datetime.datetime.now() sensor = MPR121.begin() touch_threshold = 40 release_threshold = 20 sensor.set_touch_threshold(touch_threshold) sensor.set_release_threshold(release_threshold) from auth import ( consumer_key, consumer_secret, access_token, access_token_secret ) twitter = Twython( consumer_key, consumer_secret, access_token, access_token_secret ) #GPIO pin numbers red = 12 green = 13 blue = 15 GPIO.setmode(GPIO.BOARD) GPIO.setup(red, GPIO.OUT) GPIO.setup(green, GPIO.OUT) GPIO.setup(blue, GPIO.OUT) def turnColor(R,G,B): if R == True: GPIO.output(red, GPIO.HIGH) else: GPIO.output(red, GPIO.LOW) if G == True: GPIO.output(green, GPIO.HIGH) else: GPIO.output(green, GPIO.LOW) if B == True: GPIO.output(blue, GPIO.HIGH) else: GPIO.output(blue, GPIO.LOW) while True: if sensor.touch_status_changed(): sensor.update_touch_data() #Loop trough the PiCap's pins for i in range(12): if sensor.is_new_touch(i): if i == 1: #Neutral State: White LEDs turnColor(True,True,True) elif i == 3: #Started Filming State: Blue LEDs turnColor(False,False,True) message = "I started filming a new video! Woooooo! #newvideosoon" + now.strftime("%H:%M:%S") twitter.update_status(status=message) print("Tweeted: %s" % message) elif i == 5: #Stuck State: Red LEDs turnColor(True,False, False) message = "I am stuck. Prototype down. Still filming though.. #debugging #newvideosoon" + now.strftime("%H:%M:%S") twitter.update_status(status=message) print("Tweeted: %s" % message) elif i == 7: #Eating State: Purple LEDs turnColor(True,True,False) message = "Pizza time #filmingfood" twitter.update_status(status=message) print("Tweeted: %s" % message) elif i == 9: #Done Filming State: Green LEDs turnColor(False,True, False) message = "I am done filming. Woooooo! #editingtime #newvideosoon" + now.strftime("%H:%M:%S") twitter.update_status(status=message) print("Tweeted: %s" % message) else: #Neutral State: White LEDs turnColor(True, True, True)
Did you replicate this project? Share it!I made one
Love this project? Think it could be improved? Tell us what you think!