3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Arduino Basics: RCtime

Arduino Basics: RCtime
RCtime is a function for the Arduino that finds its roots in Basic-based micro controller programming languages (such as the Basic Stamp). This function basically counts the amount of time it takes to charge a capacitor through a resistor and returns a digital value. In some sense, it is a simple hack for analog to digital conversion. The general purpose of such a circuit would be to read analog sensors when all of the analog pins on the board are occupied or, more commonly, when you need a higher resolution than the puny A/D pins on the Arduino currently have to offer. Although, keep in mind that unlike the built in analog pins, the response of RCtime is not linear.

Aside from reading analog sensors, you can do a number of other swell things like monitor voltage, current and capacitance. I'm not going to go over them here, but you can read more about them on this page.

 
Remove these adsRemove these ads by Signing Up
 

Step 1Go get stuff

Go get stuff
To do this you will need:

An Arduino
A breadboard
A resistor (220 ohm to 1K)
A capacitor (0.1uF)*
A potentiometer (or any other resistive sensor)
Wire and whatnot

*note that changing the capacitor will change the resolution of the circuit. To increase the resolution, you simply need to increase the size of the capacitor. Try using a 1uF electrolytic capacitor and compare the difference (remember that is is polarized and the + side should connect to the power source).

The resolution can also be changed, but less significantly, by changing the resistor value. Just make sure to keep it in the range of 220 ohm to 1K.
« Previous StepDownload PDFView All StepsNext Step »
12 comments
Sep 16, 2011. 1:03 AMkenyer says:
Hi Randofo,

How do I get my sketch in a nice comment-box like you did?
My pages always become a mile long when I add code and this looks so much nicer.

Peter
Apr 23, 2011. 9:54 AMGernerakos says:
Exactly what kind of arduino do we need? Beacuse i have to buy a new one. The old one is broken:(
Mar 1, 2011. 4:42 PMjakebaldwin says:
Seems like somebody took frenzy's look, eh Randy?

lawls.
Mar 2, 2011. 10:22 AMjakebaldwin says:
Oh, I see... Yeah, he seems like he's good at what he does, taking awesome pictures and all.
Mar 1, 2011. 7:00 AMtrabeccas says:
Nice look!
Feb 28, 2011. 11:09 AMfrenzy says:
RC TIME YEEEEEEEEAAAAAAAAAAAHHHHHHHHHH
Feb 26, 2011. 7:33 PMimrobot says:
you know what is awesome? you remind me of Kingpin (AKA Joe Grand) with the glasses and the sweatshirt for some reason.  
Feb 25, 2011. 1:53 PMcomputergeek321 says:
waht dose this do
Feb 25, 2011. 1:46 PMComputothought says:
Can not wait to try that with a pc, just have to rewrite the code.
Feb 25, 2011. 10:46 AMangelabchua says:
I will give you 5 stars if you wear those glasses to work everyday.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
2330
Followers
200
Author:randofo(Randy Sarafan loves you!)
I am the Technology Editor here at Instructables. I am also the author of the books 'Simple Bots,' and '62 Projects to Make with a Dead Computer'. Subscribing to me = fun and excitement!