Introduction: No TV Unless You Exercise!

Picture of No TV Unless You Exercise!

When I was a kid, I went to a science museum where there was a TV powered by a stationary bike that was hooked up to a generator. I’ve always thought it would be great if every TV worked that way- it would improve your health and use green energy.

This past winter I was looking for a way to stay in shape and I found an inexpensive bike stand that let me pedal my bike indoors. It worked fine but it was pretty boring, and I have trouble exercising when I'm not motivated. I remembered the TV powered by a bike and thought, "Yeah! THAT would make me want to keep going."

Well it turns out generators are pretty expensive, and turning your TV on and off repeatedly probably isn't good for it. So I made something that does the other part of the job- it makes the TV go dark unless you keep pedaling.

Update: added video of it in action

Step 1: Overview

Picture of Overview

The system has three components- a detector, an Arduino Nano, and a relay. The relay is hooked up inline to an RCA cable going from a video source to the TV. The Arduino looks for input from the detector, and if it doesn’t receive a signal within a certain amount of time (I’m using 10 seconds), it turns off the relay which opens the circuit and the input to the TV goes dark. I have a warning buzzer that goes off when there’s 2 seconds left in the countdown.

The detector I’m using is a black/white detector normally used for robot line following. I put a strip of black and white tape on the back wheel of my bicycle, which is attached to the bike stand. The Arduino is looking for BOTH black and white detections from the wheel (it is set to look for both so that you can't just position the wheel in a certain way to keep the video on). If it doesn't see both in 10 seconds, it activates a relay that turns off the video to the TV. Note- it doesn’t turn off the DVD player or the TV, it just disconnects the input until the pedaling starts again.

Once I had the code figured out, the only really tricky part was aligning the detector in the right place. You want it to be close to the wheel but not touching. I originally tried using a Hall magnetic detector, but I couldn't get it close enough to detect without it connecting occasionally.

Step 2: The Equipment

Picture of The Equipment

The bike stand is this one from Amazon: Amazon link

The sensor is a black/white detector, roughly $4.00 from ebay: ebay link

The Arduino is a Nano, but you could probably use any type: ebay link

The relay is a 5V relay, like this one: ebay link.

The input is a standard RCA cable like this one: Amazon link

The wires are standard F-F breadboard wires like this: ebay link

I don't remember where I got the LED or the buzzer, but they're basic stuff, and they're optional. I also used a mini breadboard but just about any would do

Step 3: Wiring

Picture of Wiring

The logic flow for this is: bike -> sensor -> Arduino -> relay -> TV input

The Arduino wiring shown is as follows:

Red: 5V power to relay

Brown: GND to relay

Orange: D3 control wire to relay


Blue: 3.3V power to detector

Green: GND to detector

Yellow: D12 input from detector


Detection LED: D11 to ground (optional)

Buzzer: D4 to ground (optional, would work with an LED too)

Step 4: RCA Cable Setup

Picture of RCA Cable Setup

Cut a standard RCA cable in half, and strip the ends. Inside the outer insulation will be an insulated inner wire and an un-insulated outer wire. Twist the outer wires together. Strip the inner wires, and put them in to the NO and COM terminals of the relay. Hook the RCA ends of the cables up in line between the video source and the TV. Now the video won't be able to go to the TV unless the relay is closed.

Step 5: The Code

Here's the logic behind the code: there are 2 "counter" variables- one for white detection and one for black. At the beginning, they're set to "countmax", which here is 10 seconds. Every 10 milliseconds, the Arduino looks for either a high or low detection, and it sets the counter for what it finds back to countmax while the other counter drops by 10. If either counter drops below "countwarn" (2 seconds), the buzzer sounds. If either counter drops below zero, it turns off the relay so the signal on the RCA cable is opened and nothing goes to the TV.

You can edit the variables to set the max and warning times. There are lots of Instructables here about uploading an .ino file to the Arduino. I'm using a Nano, but the Uno or any other should probably work. There must be better ways to write the code, but I'm a civil engineer not a computer programmer.

If I've done it right, bikerelay.ino is attached and that's the code you need (could somebody put it on github?). Here's the ugly text version if that didn't work:

int ledpin = 13; //activates arduino light when there's a detection
int ledpin2 = 11; //activates external LED or buzzer when there's a detection int outputpin = 3; //pin the relay control is attached to int sensorpin = 12; //pin the detector is attached to int warnpin = 4; //pin used to activate warning LED or buzzer int counter = 0; //countdown since last detection int counter2 = 0; //countdown since last non-detection

//change the next 2 settings to adjust the timer intervals int countmax = 10000; //maximum level of countdown timer. 1000 = 1 second int countwarn = 2000; //when to turn on warning pin. 1000 = 1 second void setup() { pinMode(ledpin, OUTPUT); pinMode(ledpin2, OUTPUT); pinMode(outputpin, OUTPUT); pinMode(warnpin, OUTPUT); pinMode(sensorpin, INPUT); counter = countmax; counter2 = countmax; //any line with "serial" is for debugging and should be commented out if not needed because it will slow the clock down //Serial.begin(9600); //Serial.print("count: "); //Serial.println(counter); //Serial.print("count2: "); //Serial.println(counter2); } void loop() { if ( digitalRead(sensorpin) ) //what to do when there is a non-detection { digitalWrite(ledpin,LOW ); digitalWrite(ledpin2,LOW ); counter = counter - 10; counter2 = countmax; } else //what to do when there is a detection { digitalWrite(ledpin,HIGH); digitalWrite(ledpin2,HIGH); counter = countmax; counter2 = counter2 - 10; }

//serial output lines for debugging //Serial.print("count: "); //Serial.println(counter); //Serial.print("count2: "); //Serial.println(counter2); //Serial.println("-----------"); //sound a warning if either counter is above 0 but under the "countwarn" level if ( counter > 0 && counter < countwarn || counter2 >0 && counter2 < countwarn) { digitalWrite( warnpin,HIGH ); } else { digitalWrite( warnpin,LOW ); }

//turn off the output if either counter drops below 0 //these settings are for an "active low" relay. Switch "HIGH" and LOW for an active high output if ( counter < 0 ) { digitalWrite(outputpin,HIGH ); counter = 0; } else if ( counter2 < 0) { digitalWrite(outputpin,HIGH ); counter2 = 0; } else { digitalWrite( outputpin,LOW ); }

delay(10); // wait time (miliseconds) before going again


Step 6: The Results

When you start pedaling, the relay will close and the video will go to the TV. If you stop pedaling for 8 seconds, the alarm will sound. Two more seconds, and the relay will open and no more TV for you. Back to pedaling!!

It would be pretty easy to add this to a treadmill too- just put a strip of white electrical tape on the tread and point the black/white detector at it. If you wanted to get really fancy you could hook it up to a weight set too.

If you build this and like it, it would be nice if you would make a small donation to your local Humane Society.

Thanks for reading!


DanielS352 (author)2016-05-17

Hey plays in traffic! Great Idea. I am actually working on a variation of this myself.

I just need some clarification on the RCA cable step.

I am currently trying to hook up my Raspberry Pi to this. I am using a 3.5 mm (4 pole) plug to RCA cable to connect it to the TV instead of an HDMI. If I strip this wire and insert into the relay, how will the relay be connected to the TV?

And what does it mean to have the "relay hooked up inline to an RCA cable going from a video source to the TV"? Thanks

Instead of the wire going straight from your Pi to the TV, it would go through the relay, which would open and close the connection. If the arduino doesn't see the detection, it will tell the relay to open, which will make the video going into your TV go dark

Hope this helps!

Thanks for your help! I got it to work

Darrenl5499 (author)2015-12-05

This is awesome! I just had a quick question. Would this work the same if you were to use an hdmi connection? If so what would you need to add?

Look for an HDMI breakout board, like this:

If you get two of them, you can connect all of the pins, except send one set through the relay, so it can be opened and closed. You'd have to experiment to see which pin to open.

Let us know how it goes!


DIY Hacks and How Tos made it! (author)2015-09-16

Thanks for the inspiration! You are awesome.

jedininja89 (author)2015-06-08

neat idea!

cthomas16 (author)2015-05-15

My High School English teacher did a similar thing to this -ible back in 1992. His kids had to pedal the bike in order to watch tv and it helped them appreciate books more. Thanks for the -ible!

daved10 (author)2015-05-15

Here is my commercial embodiment covered under my patent 6,179,746.

daved10 (author)2015-05-15

Here is my commercial embodiment covered under my patent 6,179,746.

daved10 (author)2015-05-15

Take a look at and see this in my patented product.

daved10 (author)2015-05-10

There are much easier ways to do this. Take a look at my US patent 6,179,746 that this is copying. Imitation is the sincerest form of flatrery as they say.

gotorobart (author)daved102015-05-12

would a 556 be able to sink the current needed to drive a relay like that? You would have to be pedaling quite fast to keep the design in the patent from cutting out :P

daved10 (author)gotorobart2015-05-13

A 556 can drive a reed relay.

gotorobart (author)daved102015-05-14

Ah Ive never seen one of those before. I guess you wouldn't need much throughput for the video signal. That is a cool idea, small coil on a reed switch greatly reduced current to close that.

daved10 (author)gotorobart2015-05-15

As a matter of fact, if you are talking about video signals, you might also be able to just use a fet like 2N7000.

SCHLEPIC (author)2015-05-12

This seems like a great alternative to manually powering the TV with a generator. Well done!

out-of-the-box (author)2015-05-09

I came up with another way of doing this without the arduino. Use a stepper motor or somesort of small electric generator such as a magnet and copper coil and implement the circuit in the picture. The motor will spin when the tire spins, as it spins it'll send a small voltage to the base of the pnp transistor which will keep the transistor off, once the wheel stops spinning it'll allow the base to go to ground which will allow the necessary voltage to flow through the collector and emitter right to the coil on the relay which will turn the relay off. Just sharing. :) still, great project!

out-of-the-box (author)2015-05-09

Relay like this project! See what I did there... I was thinking about maybe doing it but without the arduino.

SussoGobbino (author)2015-05-07

Damn, I had the very same concept idea!
I am disabled and should keep in motion, but I just lazily sit using the PC.
I found one of those small pedals to put under a desk and use on a standard chair, brought it home, and I wanted to modify it so that it would turn the PC off if I stopped pedaling.
My mother comes up and says it's an incredibly stupid idea and tells me to throw the stuff away.

And here I am, still lazily sitting at the desk.

Give it a shot! It doesn't have to be hooked up to the bike stand- that's just how I wanted to use it. I'm pretty sure you could use just about any sensor, and the Arduino is just looking for the sensor to change. I'm thinking about making one attached to a weight set and putting a really long max-out time on it

There's a lot of possibilities for a TV, but to apply it to a PC you need to have free arms, that's why the standalone pedals were the best idea... I will surely do it when and if I find another scrapped at the junkyard!

Tenire (author)SussoGobbino2015-05-08

As noted, the key here is interrupting the signal, not the power. run the ends of a video cable through the contacts of an ice cube relay, perhaps?

I've considered this myself, but using a bike-light genny and ice-cube relay as opposed to Arduino. Somebody did it in the 80's with one of the old school TV's that would come back on if you plugged it in, as opposed to having to push the power button every time. The idea's not new, but your approach is, and I applaud you for it.

In theory, I think this could possibly be a commercially viable product. How much weight could we lose if we have to work for our entertainment?

SussoGobbino (author)Tenire2015-05-09

There are really a lot of applications, for a PC you could make a USB device which cuts the power to the keyboard/mouse, or which disconnects the video signal as done in this I'ble.

It would surely be a great incentive to exercise.

alcurb (author)2015-05-07

The idea is great, but I would much prefer to harness the energy output rather than wasting it to friction and heat. Since your project employed a certain level of sophistication, I know you would be able to build a generator system that can smooth out the electrical power output from pedaling. You would need some supercaps for fast charging and smoothing, maybe a storage gel battery for short rest breaks. Of course you'd also need an inverter to provide AC to the the TV. The stand you got is a nice one, but there are cheaper ones on Amazon and Ebay if you do some shopping. On Amazon you get get them for around 50USD. Your initial stumbling block of finding a cheaper generator is not a big one because you can use brushed motors, or other motors with magnets and coils inside, as generators. Motors are pretty cheap if you buy them used pulled from other equipment. They can also be scavenged from some discarded appliances. When you go out to a junk dealer, take a voltmeter with you; hook the voltmeter to the motor terminals and give the motor a spin. If you get some volts, you got a winner.

plays in traffic (author)alcurb2015-05-08

This project was more for motivation than generation. I don't think the average TV would handle being turned on-and-off repeatedly very well, which is why instead of turning off the power, I just turned off the input.

If you want to make a generator, I really liked this one:

mycroft07 (author)2015-05-07

Wow, it's really cool :D
The purpose of your project is to make the
TV go dark unless we keep pedaling, right? So the energy which we
produce from cycling isn't used to turn on the TV, is it? Because at
first I thought that this project is like making a bike-generator for
turning on the TV .__.

But it's pretty cool and I really want to try to make it xD
I'm waiting for your answer, thanks before :D

Right- it's not a generator, it's a motivator. Somebody with better electrical skills could probably make it a generator, but I just wanted something that make me want to keep exercising

chobbs1957 (author)2015-05-07

Love it!

afastovets (author)2015-05-07

mycroft07 (author)2015-05-07

cyberpigue (author)2015-05-07

Way back in the 70's there was an article in Mother Earth News about an off-grid guy who pedaled a bike to power his little black and white TV. I always thought it would be fun to do!

alcurb (author)cyberpigue2015-05-07

Have you ever watched "Soylent Green"?

cyberpigue (author)alcurb2015-05-07

Yes, way back when it first came out. Was there a pedal TV in it?

alcurb (author)cyberpigue2015-05-07

There was a pedal light bulb as I recall. They had to generate their own power.

ImmaleeR (author)2015-05-06

I've always thought that all the gyms in the world should be harnessing the energy expenditure.

wiedenheft (author)2015-05-05

I wonder if this would work with a treadmill... :)

I think it should- you just need black and white for the sensor to pick up. Try putting a piece of white electrical tape on the tread

hbridge88 (author)2015-05-06

You are brilliant!

jdad (author)2015-05-05

I have been thinking about this for years. Bravo!

wmada (author)2015-05-05

amazing man. been wanting to build one for a year or so. Ill be the one msgn you during my build.thanks man

FriXs (author)2015-05-04

Very cool idea. Possibly a way to stop my kids watching TV excessively. I've seen shoes, which save the time you walk which you can use to watch TV, but they are quite expensive.

Could you add a video please?

plays in traffic (author)FriXs2015-05-05

Video of it in action:

About This Instructable




More by plays in traffic:No TV unless you exercise!Make An Old House More Energy Efficient With Inset Storm WindowsCraftsman Style Sliding Doors
Add instructable to: