|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
ADC advice needed
Hi all,
I'm building a sensor unit with 11 analog inputs and 1 PWM device. At a minimum, I would like to get the 11 analog sensors hooked up to a single RS232 line. Their specs are as follows: 0-2.54V, 10mV incriments (meaning 8-bit on a 0-2.54V sensor, or 10-bit on a 0-5v). I would like to sample them at least 10 times per second. Are there any (inexpensive/sampleable) ADC's that I can wire the sensors to, and get an RS232 output that I can plug into the computer? I'd love to somehow get a string like this: A055B155C254 and so on - so that I do not have to have a serial out line to ask for specific data. Also, is there any way to make an ADC take PWM data? If not, I will be integrating several RS232 lines, so I can capture that in my microcontroller. Thanks! |
|
#2
|
||||
|
||||
|
Re: ADC advice needed
Quote:
the 18F4220 is just an example Last edited by Rickertsen2 : 10-10-2006 at 20:18. |
|
#3
|
||||
|
||||
|
Re: ADC advice needed
The only problem with that is that I don't have a programmer for it. I could build one, but if there's an ADC that already does (nearly) what I want, why would I need the extra features?
I was planning on using a Parallax SX48 at first, anyway, but my board arrived dead so I have been unable to get any of the code for my project tested. Other options? Easy programmers? I can code, but would rather the focus be on using the data once it is collected, not collecting it in the first place.. |
|
#4
|
||||
|
||||
|
Re: ADC advice needed
You probably won't be able to find a single chip that does all that. You could look for a data aquisition board, which will be more pricey.
For a similar project, I did exactly as Rickertsen2 described with a PIC 16F877. I got a kit with breadboard/programmer from www.machinescience.org (now an official FIRST supplier), which has a good web-based compiler. It took me some time to learn all the microcontroller specifics, but with the analog inputs, a multiplexer, and capture modules, you can read in all your signals and then send out bytes via the same RS-232 programmer that comes with the kit. The advantage over a DAQ board is that you have complete control over the processing and data format. Last edited by ZZII 527 : 11-10-2006 at 21:58. |
|
#5
|
||||
|
||||
|
Re: ADC advice needed
I have a few consumer level DA boards like Phidgets, but they don't have the speed or inputs I need.
I was looking at the 2004 Edubot - it has up to 16 analog inputs. The resolution isn't wonderful, but could this work? It seems like I could get all 11 sensors onboard, and use a DO to control the timing. I could capture the PWM from the PWM in portion. The nice thing about this is the easy debug command, and I could put the filtering on the external board... My only question left, then, is if I could somehow manage to tie a GPS into the TTL line? Is there sufficient sample code, that I could somehow capture and parse the data, to spit out from the program/debug port? This would enable me to put every sensor device on one line, and take some of the processing load off the computer. |
|
#6
|
|||
|
|||
|
Re: ADC advice needed
Quote:
not sure you are comfortable with it. it has all you need! Yes the TTL serial is accesible. there are sample codes online to assist you with using it. Code written in MCC with C18 for C code support.oh but beware it can only run off 5v to 9v supply. Anything more you'll probably spoils omething, anything less it'll shut down. Its made for 7.2v nominal battery packs. |
|
#7
|
||||
|
||||
|
Re: ADC advice needed
I am using the 2004 controller now and having some luck, I just need to write a filtering algorithm to help clean up the data some. My question, though, is on the interfacing of my PWM sensor.
I know this is meant only for a true radio system, but shouldn't there be some other way to measure pulse width? My sensor is wired properly, with the 5V to the 5V, that tied to the I2C lines according to the documentation, GND to GND, and PWM to the signal wire. I am using a CMPS03 sensor, and the pulse widths relate as follows: 1mS to 36.99mS, or 1uS/degree with a 1mS offset. The signal goes low for 65mS between pulses. Is there any way to make this work? I'm getting a radio data error, and the values show up as 127 regardless of how the sensor faces. |
|
#8
|
|||
|
|||
|
Re: ADC advice needed
Quote:
If i'm not wrong you'll have to: 1) custom code the CCP on the microprocessor to process your custom-pwm signal, or 2) tie the pwm source to an interrupt pin, have a 16bit running timer in the background, have the interrupt trigger on both rising and falling edges, and write code to capture the timer's values per interrupt trigger. The difference between the captured values should be proportional to the pulse width. hope this helps, but I'm abut skeptical on method 2 unless you have a way to pull the whole 16bit value in 1 command instead of 2 seperate 8 bit reads to ensure accuracy. ![]() |
|
#9
|
||||
|
||||
|
Re: ADC advice needed
Thank you, but my question is more about PWM sensors -
The compass has an I2C output, but it also has PWM output capability. I think the issue is that it isn't a standard radio protocol; is there some way to make it work? |
|
#10
|
|||
|
|||
|
Re: ADC advice needed
Quote:
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ADC problem | sjung9442 | Programming | 4 | 17-02-2006 11:12 |
| Welder advice needed | Rickertsen2 | Technical Discussion | 15 | 09-01-2006 16:26 |
| error with adc.h | incognito_NICK | Programming | 2 | 05-02-2005 23:27 |
| adc.h missing | pagemauck | Programming | 9 | 16-11-2004 06:56 |
| Expert advice needed!!! | punarhero | Technical Discussion | 16 | 01-03-2004 11:34 |