Rctime functions
Yianie
Posts: 49
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
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
http://mech.vub.ac.be/teaching/info/mechatronica/finished_projects_2012/Twinbot1/media/downloads/SharpGP2D12Snrs.pdf
http://www.noisemantra.com/BASICStampAnalogInput.htm
Don'y know if it works, as I don't own one of those sensors.
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.
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
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!