Shop OBEX P1 Docs P2 Docs Learn Events
Rctime functions — Parallax Forums

Rctime functions

YianieYianie Posts: 49
edited 2014-10-09 15:40 in General Discussion
Hello again to all. I am new to controllers so please forgive me if I speak beneath you. I am learning a lot about the RCTIme fuction. I have read the manual, but would like to use this fuction to measure voltage, temperature, humidity and what ever is possible. I know there are means of adding more IC's, but the problem is that I am a mechanical engineer, so electronics are not quite my strong area. I have done internet searches, found some things, but is there a particular publication or website dedicated to the design and applications of the RCTIME function? Need to measure voltage in the range of 0-100V and do a lot of other things. Thank you.....

Comments

  • ercoerco Posts: 20,256
    edited 2014-10-08 15:21
    You can RCtime it with some hardware fiddling, but IMO you're better off adding one ADC chip that has 4-8 channels. Lots of documentation available.
  • ercoerco Posts: 20,256
    edited 2014-10-09 00:08
    erco wrote: »
    Lots of documentation available.

    Parallax, my favorite Parallax document is GONE! You formerly provided a most useful PDF showing how to use an ADC0831 with a BS2 to read a Sharp GP2D12, and I pointed it out numerous times:

    http://forums.parallax.com/showthread.php/125972-sharp-GP2Y0A21YK0F-ir-distance-sensor?p=977741&viewfull=1#post977741

    and http://forums.parallax.com/showthread.php/145094-Interfacing-a-Sharp-IR-distance-sensor-to-a-Basic-Stamp?p=1155210&viewfull=1#post1155210

    It's very frustrating to not be able to find it. I searched to no avail. It used to be at http://www.parallax.com/dl/docs/prod/acc/SharpGP2D12Snrs.pdf but that's a dead end now. Please restore it.

    @Yianie: Sorry for my rant, please see http://noisemantra.com/BASICStampAnalogInput.htm for a simple one-transistor interface.

    Here are two less-user friendly versions of the ADC0831 interface and BS2 code than Parallax formerly provided: http://crustcrawler.com/code/sharp_ir_ADC0831_reader.bs2

    and http://forums.parallax.com/showthread.php/62397-Sharp-GP2D12-ADC0831-and-BS2

    FYI, the ADC0831 is a one channel ADC, but it also comes in 4 and 8 channel flavors. Can you guess their part numbers?

    ADC0834 and ADC0838, of course!

    See also Tracy Allen's very helpful page at http://www.emesystems.com/stamp.html
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-10-09 08:45
    Not sure of the file you speak of, but I will look into it today.
  • ercoerco Posts: 20,256
    edited 2014-10-09 08:57
    Thanks, it was a 3-5 page PDF provided in resources when you sold the Sharp GP2D12 on that page. Recently it was unlisted but still there. Now it's just gone. It was perfect for showing how to use an ADC0831. Required reading as far as I'm concerned!
  • PublisonPublison Posts: 12,366
    edited 2014-10-09 09:46
    And the RC TIME function:

    http://www.noisemantra.com/BASICStampAnalogInput.htm

    Don'y know if it works, as I don't own one of those sensors.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2014-10-09 13:14
    Here's a direct link to my RCTIME page for the BASIC Stamp.
    http://emesystems.com/BS2rct.htm

    The circuit proposed at noisemantra is marginal at best. It depends on the exact current gain of the transistor, which varies widely from part to part and is not at all stable with temperature. Irreproducible. The author of that page noted the shortcomings.

    The best way to improve it is to use a cheap op-amp in conjunction with a transistor. Example here. The combination accurately converts the voltage to current for the RCTIME function. At that point though, you should be asking, why not be using a real ADC for the voltage input? RCTIME is best suited for measuring resistance (thermistor, photoconductor) and current (photodiode), or sensors like the AD590 that transmit their signal as a current. RCTIME also works pretty well for measurements of voltage greater than 3 volts or less than 0 volts, things like the battery volts powering the BASIC Stamp. The region between 0 and 3 volts is too near the BASIC Stamp's switching threshold.
  • GenetixGenetix Posts: 1,754
    edited 2014-10-09 14:18
    The Basic Analog and Digital Kit shows how to use an ADC031 to measure voltage.
    http://www.parallax.com/product/28155
    Here is a direct link to the text:
    http://www.parallax.com/downloads/basic-analog-and-digital-text

    Parallax no longer sells this kit but many of the parts are still available. It shows how to measure temperature using an LM34 and ADC0831. Everything is available under Downloads & Documentation.
    http://www.parallax.com/product/28176

    Parallax sells a number of sensors but if you plan to use many of the more advanced sensors together you might want to consider using the Propeller instead. Propeller Spin resembles the PBASIC the Stamp uses. The Stamp is easy to program and use but it some cases it is too slow or has too little memory. The more powerful modules such as the BS2px are not only faster and have more memory but also have built-in commands for using Parallel LCD modules and I2C devices.
    http://www.parallax.com/catalog/sensors

    It really depends on what you need to do. Also many standard lab instruments have Serial Output that can be read and stored or send directly to a PC. MakerPlot formally known as StampPlot is a good tool for recording and displaying measurement data. The Process Control text has some good examples.
    http://www.parallax.com/downloads/process-control-text
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-10-09 14:22
    The document Publison linked was for the GP2D12 specifically and I am not sure if the current model was a direct replacement for that. By the way, that is most likely why the document was taken down since it refers to a specific model of Sharp sensor. I will have to do some updates to the document before it can be uploaded. Until then you can use the one Publison linked, it that is the same document you're referring to.
  • ercoerco Posts: 20,256
    edited 2014-10-09 15:40
    Yes, Jim/Publison saved the day with the PDF he provided. Whether or not Parallax still sells that particular sensor, it's a 5V analog sensor like many others, still relevant for BS2 users. The Sharp GP2Y0A21YK0F sensor you currently sell is probably a drop-in replacement. Even if the calibration is slightly different, that document shows exactly how to hook it up to the ADC0831 and provides the BS2 code. I'd link to that doc on the Sharp GP2Y0A21YK0F page. Currently, the only doc provided is the Sharp datasheet, much less useful to beginners.

    I figured the same ADC info was somewhere inside the analog/digital text, but it's not easy, quick or fun to dig thru that. The short dedicated PDF Jim provided is perfect, compact, and should not be casually discarded until a replacement is posted for the Sharp GP2Y0A21YK0F.

    Speaking of which, another MIA fave of mine is the "Weekend Application Kit for IR" which Parallax similarly stopped hosting years ago. Another EXTREMELY valuable, compact PDF about reading Sony IR codes. Once again, the info is available in the longer Boebot and IR text, but that is not convenient. Fortunately, Jameco still hosts that document: http://www.jameco.com/Jameco/Products/ProdDS/282933APP.pdf

    Please don't let these valuable jewels slip away!
Sign In or Register to comment.