Make the Circuit

Embed Size (px)

Citation preview

  • 7/30/2019 Make the Circuit

    1/5

    Step 4: Make the Circuit

    Related

    (/files/deriv/F5T/X6AJ/FIWH5RH0/F5TX6AJFIWH5RH0.LARGE.jpg)

    (/files/deriv/F55/1JMN/FIWH3S96/F551JMNFIWH3S96.LARGE.jpg)

    About This Instructable

    Posted:Jul 21, 2008

    License:

    149,664 views

    247 favorites

    (/member/kylemcdonald/)

    kylemcdonald(/member/kylemcdonald/

    Follow 154

    (/id/Structured-Light-3D-Scanning)

    (/id/Nandhopper-1-Bit-Noise-Synth)

    (/id/Lo-fi-Arduino-Guitar-Pedal)

    More by kylemcdonald

    electronics (/tag/type-id/category-

    technology/keyword-electronics/)

    diy (/tag/type-id/category-technology/keyword-diy/)

    sensor (/tag/type-id/category-technology/keyword-

    sensor/)

    processing (/tag/type-id/category-

    technology/keyword-processing/)

    arduino (/tag/type-id/category-technology/keyword-

    arduino/)

    3D (/tag/type-id/category-technology/keyword-3d/)

    Tags:

    Read analog data directly inProcessing (/id/Read-analog-data-directly-in-Processing/)

    by snebtor (/member/snebtor/)

    DIY 3D Controller by kylemcdonald (/member/kylemcdonald/)

    Download (/id/DIY-3D-Controller/?download=pdf) See All (/id/DIY-3D-Controller/?ALLSTEPS)

    (/id/DIY-3D-Controller/step3/Make-the-Connectors/) Jump To (/id/DIY-3D-Controller/step5/Finish-and-Attach-the-Connector/) 8 Steps

    Favori

    (/)

    let's make

    share what you make >

    (/about/submit.jsp)

    Explore (/tag/type-id/) Create (/about/submit.jsp) Contests (/contest/) Community (/community/) Login

  • 7/30/2019 Make the Circuit

    2/5

    Previous (/id/DIY-3D-Controller/step3/Make-the-Connectors/)

    Next (/id/DIY-3D-Controller/step5/Finish-and-Attach-the-Connector/)

    Post Comment

    (/member/Unit042/)

    Nov 29, 2008. 8:55 AM Reply (CYC5UYEFNZAHE1T)

    The "circuit" is just two resistors per piece of aluminum. To understand why they're there, it helps to

    know what we're doing with the Arduino. What we'll do with each pin, sequentially, is:

    Set the pin to output mode.

    Write a digital "low" to the pin. This means both sides of the capacitor are grounded and it willdischarge.

    Set the pin to input mode.

    Count how much time it takes for the capacitor to charge by waiting for the pin to go "high". Thisdepends on the values for the capacitor and the two resistors. Since the resistors are fixed, achange in capacitance will be measurable. The distance from ground (your hand) will be theprimary variable contributing to the capacitance.

    The 270k resistors provide the voltage to charge the capacitors. The smaller the value, the faster

    they'll charge. The 10k resistors affect the timing as well, but I don't completely understand their role.

    We'll make this circuit at the base of each wire.

    Solder the 10k resistor to the end of the wire opposite the alligator clip

    Solder the 270k resistor between the shield and the wire (plate). We'll shield the wire with thesame 5 V we use to charge the capacitors

    Unit042 (/member/Unit042/) says:

    Now that I've had a quiet few days, I'm finally building this thing. I've done similar R/C timing stuff toread the position of a variable resistor, but thishas me re-inspired (after forgetting about it for awhile)...!

    I'm gonna start with a single plate, to keep things simple... until I get my three plates workingogether.

    Then, I'm going to hack a usb mouse with a trackball, and make a touchless mouse! Granted,clicking, scroll wheel operations will take some thought, but still....

    "The 10k resistors affect the timing as well, but I don't completely understand their role."

    The 10k's limit current going through the I/O pins on the arduino to prevent burning it out.Usually, you want to limit it to 20mA or 0.02A for lighting LED's. Otherwise, 10mA is safer.

    The maximum amount of currrent going through any one of your arduino's pins is:5v / 10,000 = 0.0005A(Maximum voltage in the capacitor) divided by (resistor's value in ohms)equals (current passinghrough in amps.)

    or 0.5mA worst case scenario (caps completely full).You could lower the 10k's to 1k's for 5mA to lower the amount of time that the caps discharge,allowing faster reading and lower power consumption.

    hat? How can 5mA consume less than 0.5mA?

    See More (/tag/type-id/?q=)

    (/files/deriv/FBN/7X52/FIWH3S94/FBN7X52FIWH3S94.LARGE.jpg)

    (/files/deriv/FN1/0BTJ/FIWH3S95/FN10BTJFIWH3S95.LARGE.jpg)

    Halloween CapacitanceSensor (/id/Halloween-Capacitance-Sensor/)by programmr(/member/programmr/)

    Use the "Force" to drive aRemote Controlled Devicewith a DIY 3D capacitor!(/id/Use-the-Force-to-drive-a-Remote-Controlled-Devic/)

    3D AIR mouse | Arduino +Processing (/id/3D-AIR-mouse-Arduino-Processing/)

    by etgalim (/member/etgalim/)

    3D Printed Quadcopter(/id/3D-Printed-Quadcopter/)by therobotfish(/member/therobotfish/)

  • 7/30/2019 Make the Circuit

    3/5

    6(/member/kylemcdonald/)

    Nov 29, 2008. 10:34 AM Reply (CA9VE82FNZAHECJ)

    (/member/Unit042/)

    Nov 29, 2008. 11:09 AM Reply (CZ4F4B2FNZAHEF9)

    (/member/Unit042/)

    Nov 29, 2008. 11:11 AM Reply (CDPI9KWFNZAHEFP)

    ell, those numbers define rate of power flow. Remember that 270k? All the while the cap isdischarging, the 270k is feeding power down the drain, so the longer the capacitor takes to dischargehrough the arduino pin, the more power is wasted.

    It would be helpful if somebody gave an estimate as to how long to discharge the cap before readingcapacitance....

    kylemcdonald (/member/kylemcdonald/) (author) says:

    Hey Unit042,

    I tried making a "mouse" recentlyhttp://vimeo.com/2216027

    (http://vimeo.com/2216027) butI'm still limited by accuracyissues due to the 60 Hzinterference. I suggest you tryovercoming the interference first.Someone posted a capacitivesensing library (on/off) on the

    Arduino sit e recently :http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227388576/0(http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1227388576/0) that has avery simple principle I wasplanning on using: check the RCime on both the actual plate, and

    a small (or something shieldedfrom your hand) platesimultaneously. Spit out thedifference between the two.

    Thanks for all the insight on theresistors : )

    I wait very little time betweendischarging and readingcapacitance, if you check thecode. Something like 5-10 cyclesat 16 MHz

    Unit042 (/member/Unit042/) says:oah, quick reply! I just tried this with a picaxe (single plate, about 1/4th size of one of

    yours), as I do not have an arduino. I used a 10M-ohm (ten million ohm) instead of the 270k(slow things down for testing), but kept the 10k (had a dozen lying around). Turns out thatmy 08M at 4MHz is simply not fast enough to reliably time the R/C circuit, even with the10M-ohm resistor. I then switched to last-ditch non-timing software (after the cap is empty,set pin to input and immediately read it as an ADC, or analog to digital converter). This letme know that the circuit was working, and I got a value from it that varied a little bit whenmy hand got closer. A note to anyone who reads this: shielding matters! I used plainalligator clips to my (small) plates. I read the values, then, I twisted the two wires together(think twizzler candy), and the sensitivity improved markedly. If such a small thing as thatwill do this much, shielded wires are worth the bother, especially in something as "critical"as a mouse controller. (whoops, mymouse clicked and dragged my files to the recycle binall by itself!) Say.... I have a bunch of unused RCA cables in my attic... now I'm going toswitch to my basic stamp 2. It has some in-built software routines that may help. If thatfails, I'm making my tin foil capacitor bigger, or add a regular capacitor in parallel to lower

    he frequency to a readable level. If that fails, I'll resort to a discreet component analogsolution utilizing an oscillator and other cool stuff.

    Unit042 (/member/Unit042/) says:

    hoops! "I just tried this with apicaxe (single plate, about 1/4thsize of one of yours), as I do nothave an arduino. "

    The stuff in the parenthases wasalking about my capacitor, which

    is a single one, with two plates,1/8th the size of yours.

  • 7/30/2019 Make the Circuit

    4/5

    (/member/Unit042/)

    Nov 29, 2008. 11:22 AM Reply (C91XQA6FNZAHEGJ)

    6(/member/kylemcdonald/)

    Nov 29, 2008. 12:44 PM Reply (CH45OW2FNZAHEQG)

    (/member/Unit042/)

    Nov 29, 2008. 1:14 PM Reply (CUC5BM6FNZA8I8K)

    (/member/Unit042/)

    Nov 29, 2008. 4:59 PM Reply (CKNJS3DFNZA8IVI)

    Unit042 (/member/Unit042/) says:

    No, wait, my picaxe might havesomething also. Gotta search mydocumentation.... I think I'll set upa single opamp schmitt triggeredoscilator (already breadboardedfrom previous project) with thesensor, which will output a certainfrequency depending uponcapacitor's capacitance, and themicricontroller counts the numberof pulses (via in-built subroutines)sent from the oscillator over a(short) period of time.

    kylemcdonald (/member/kylemcdonald/) (author) says:

    I definitely encourage you to trydoing it off-chip and sendingdata back to the microcontroller.Notice that, by makingsomething that outputs afrequency, you're making aheremin :) This is the simplest

    kind I know:http://www.thereminworld.com/pic(http://www.thereminworld.com/pic

    I know in BASIC there's

    "rctime", but I haven't used PICsbefore.

    Also, I don't think RCA cablesare shielded, though nicer onesfor video might be.

    Unit042 (/member/Unit042/) says:

    It worked! Frequency (with 10Mega-ohm resistor) borders on 70Hz, going down to 60 Hzwhen my hand is near touching it.
    Schematic (simple indeed) is available upon request,but I'm still experimenting with it.

    Now, to increase resolution (accuracy), I caneither:
    1. Increase frequency counting time (but lower position reading speed)

    2. Increase frequency of single opamp schmitt oscillator (more counts allows me todecipher between 1352(close) and 1353(inch closer) for instance, instead of the current

    60(hand nearly touching) to 70(hand far away) range.)

    Hmmmm... I'm going with#2. Simple enough, I'll replace the 10 mega-ohm resistor with a 1M-ohm to increasefrequncy ten-unfold. (It's not ten fold because we're not folding things up, whe're un foldingour multiple of frequency---nevermind)

    Hey! Did you put those yellow boxes on theschematic just now, or were they there the whole time?

    ==============

    Oh, another reply. Goodie!

    I prefer off-chip stuff, leaving the programming tostuff that needs programming (just my opinion).

    Yes, theremin things are cool. Isaw one once. Only a single tone capability, but the non-touchness of it made itawesome! But yes, in principle, hand proximity causing a change in outputfrequency. I bet if I put the output frequency to a speaker, I'd be able to hear the 60-70Hzone.

    {shakes head of dreams of making a theremin with tricked-out touchlessone/volume controls}But that's not what I'm doing now, I'm making a mouse. A cool mouse.

    {yes, I need reminding}

    As for PIC stuff, the picaxe people put a bootstrap code init that lets me program it in basic. granted, there are odd things in the language, and otherwierd quirks, but it's the best money/ease of use thing I could find. It only cost me ~$20 toget started (programming cable included, software is free) VS Basic stamp: extremely easy,works every time, but takes a vampire to your wallet.

    rctime times how long a

    given input stays low, right? I was about to do that with my basic stamp, when I looked overhe picaxe documentation again.

    RCA is a video cable with shielding. It's the ones

    with the one pin in the middle surrounded by a ring of metal, kinda like BNC's or coax's. see:

    wikipedia:RCA connector

    I think I might name my device:
    Theremin-esqueCapacitive Appendage Proximity sensor Mouse Controller Thing (TCAP Mc Thing or TCAPMc.T)

    Unit042 (/member/Unit042/) says:

    I've ten un-folded and then doubled, then doubled again the frequency of the oscillator. Aftergetting a feel for the typical numerical values acquired, I then set an arbitrary thresholdbeyond which the picaxe would light an LED. This experiment resulted in a "hold your handclose to the pad and the LED lights" device. Pretty fun! Now, to make something useful... Iknow---a mouse!

  • 7/30/2019 Make the Circuit

    5/5

    1(/member/Fillitup4/)

    Mar 9, 2009. 8:49 PM Reply (CT3UB91FS1N6EF5)

    6(/member/kylemcdonald/)

    Mar 9, 2009. 9:07 PM Reply (CJMPEGOFRXUSXAT)

    Fillitup4 (/member/Fillitup4/) says:

    hey man.... could you post your code? I reallly really new to this and would like to know howyou counted the time for the pin to go high....

    kylemcdonald (/member/kylemcdonald/) (author) says:

    The end of instruction 6 has a linko the Arduino code used for this.

    bout Us

    ho We Are (/about/)

    vertise (/advertise/)

    ontact (/about/contact.jsp)

    bs (/community?categoryGroup=marketplace&category=jobs_internships)lp (/ community?categoryGroup=Help)

    Find Us

    Facebook (http://www.facebook.com/instructables)

    Youtube (http://www.youtube.com/user/instructablestv)

    Twitter (http://www.twitter.com/instructables)

    Pinterest (http://www.pinterest.com/instructables)

    esources

    r Teachers (/teachers/)

    tist s in Residence (/group/air/)

    onsorships (/sponsorship/)

    rums (/community/)

    swers (/ tag/type-question/?sort=RECENT)

    Mobile

    Download our new apps foriOS and android!

    Android

    (https://play.google.com/store/apps/details?

    id=com.adsk.instructables)

    iOS

    (https://itunes.apple.com/app/instructables/id586765571)

    Visit Our Store (http://store.instructables.com/)

    Go Pro Today (/account/gopro?sourcea=footer)

    let's make Copyright 2013 Autodesk Inc. All rights reserved (http:// usa.autodesk.com/adsk /servlet/ pc/index?id=20781545&siteID=Terms of service (/tos.html) | Privacy (http://usa.autodesk.com/privacy/) | Legal Notices & Trademarks (http://usa.autodesk.com/legal-notices-trademarks/) | Mob

    (http://m.instructabl