Eamon Magd
Published

We Interrupt This Program to Bring You… TV-B-Gone!

Built a £9 TV-B-Gone to turn off TVs remotely using infrared. Tested it in an electronics store, powered by a Raspberry Pi and servo motor

BeginnerShowcase (no instructions)3 hours498
We Interrupt This Program to Bring You… TV-B-Gone!

Things used in this project

Story

Read more

Code

TV Switch off

Python
import RPi.GPIO as GPIO
import time

# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)

# Initialize PWM on pin 17
pwm = GPIO.PWM(17, 50)  # 50Hz pulse

# Start PWM
pwm.start(0)

def set_angle(angle):
    duty = angle / 18 + 2
    GPIO.output(17, True)
    pwm.ChangeDutyCycle(duty)
    time.sleep(1)
    GPIO.output(17, False)
    pwm.ChangeDutyCycle(0)

# Rotate servo to trigger TV-B-Gone
set_angle(90)  # Example angle for pressing the button

# Stop PWM and clean up
pwm.stop()
GPIO.cleanup()

Credits

Eamon Magd
4 projects • 2 followers
Hi, I’m Eamon! An inventor, Computer Scientist and gamer, with an endless list of ideas. I have a yellow cockatiel.
Contact

Comments

Please log in or sign up to comment.