Go to Post Backstabbing your opponents at the last second will not help you win friends and word will get around pretty quick. Your team will be shunned and distrusted for years. People have long memories, and some of us mentors have been playing this game since you kids were playing with blocks. - ChrisH [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-10-2006, 18:10
Josh Siegel's Avatar
Josh Siegel Josh Siegel is offline
lurker
#0448 (Crandroids)
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Bloomfield Hills, Michigan
Posts: 67
Josh Siegel will become famous soon enough
Send a message via AIM to Josh Siegel Send a message via MSN to Josh Siegel
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   Spotlight this post!  
Unread 10-10-2006, 20:14
Rickertsen2 Rickertsen2 is offline
Umm Errr...
None #1139 (Chamblee Gear Grinders)
Team Role: Alumni
 
Join Date: Dec 2002
Rookie Year: 2002
Location: ATL
Posts: 1,421
Rickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant futureRickertsen2 has a brilliant future
Send a message via AIM to Rickertsen2 Send a message via Yahoo to Rickertsen2
Re: ADC advice needed

Quote:
Originally Posted by Josh Siegel
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!
To make things simple you could use a microcontroller with integrated ADC. Microchip has many PICs with the amount of analog inputs you need, UARTs for rs232 and a thing called a CCP module which can be used to capture the PWM pulsetrain.

the 18F4220 is just an example
__________________
1139 Alumni

Last edited by Rickertsen2 : 10-10-2006 at 20:18.
  #3   Spotlight this post!  
Unread 11-10-2006, 19:00
Josh Siegel's Avatar
Josh Siegel Josh Siegel is offline
lurker
#0448 (Crandroids)
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Bloomfield Hills, Michigan
Posts: 67
Josh Siegel will become famous soon enough
Send a message via AIM to Josh Siegel Send a message via MSN to Josh Siegel
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   Spotlight this post!  
Unread 11-10-2006, 21:47
ZZII 527's Avatar
ZZII 527 ZZII 527 is offline
"Scale Electric Vehicle"
AKA: Shane Colton
FRC #0097
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Cambridge, MA
Posts: 366
ZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond repute
Send a message via AIM to ZZII 527
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.
__________________
MIT Mechanical Engineering
>> College Mentor, Team 97: Cambridge Rindge and Latin School with The Edgerton Center, MIT Mechanical Engineering, Bluefin Robotics, and Draper Laboratory
>> Alumnus, Team 527: Plainedge HS

Last edited by ZZII 527 : 11-10-2006 at 21:58.
  #5   Spotlight this post!  
Unread 11-10-2006, 23:06
Josh Siegel's Avatar
Josh Siegel Josh Siegel is offline
lurker
#0448 (Crandroids)
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Bloomfield Hills, Michigan
Posts: 67
Josh Siegel will become famous soon enough
Send a message via AIM to Josh Siegel Send a message via MSN to Josh Siegel
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   Spotlight this post!  
Unread 12-10-2006, 01:47
yongkimleng yongkimleng is offline
deus ex programmeur
AKA: James Yong
FTC #0747
Team Role: Mentor
 
Join Date: Aug 2006
Rookie Year: 2004
Location: Singapore, West
Posts: 134
yongkimleng is a jewel in the roughyongkimleng is a jewel in the roughyongkimleng is a jewel in the rough
Send a message via MSN to yongkimleng
Re: ADC advice needed

Quote:
Originally Posted by Josh Siegel
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.
the 2004 edubot is a very stable platform for your work imho, but the price... 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.
__________________
| jamesyong.net |
FVC2007, FTC2008
  #7   Spotlight this post!  
Unread 17-10-2006, 17:27
Josh Siegel's Avatar
Josh Siegel Josh Siegel is offline
lurker
#0448 (Crandroids)
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Bloomfield Hills, Michigan
Posts: 67
Josh Siegel will become famous soon enough
Send a message via AIM to Josh Siegel Send a message via MSN to Josh Siegel
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   Spotlight this post!  
Unread 18-10-2006, 00:02
yongkimleng yongkimleng is offline
deus ex programmeur
AKA: James Yong
FTC #0747
Team Role: Mentor
 
Join Date: Aug 2006
Rookie Year: 2004
Location: Singapore, West
Posts: 134
yongkimleng is a jewel in the roughyongkimleng is a jewel in the roughyongkimleng is a jewel in the rough
Send a message via MSN to yongkimleng
Re: ADC advice needed

Quote:
Originally Posted by Josh Siegel
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.
I dont know about CMPS03, but did you say I2C ? EDU RC has no I2C port, unless you write the interfacing code via an IO pin yourself.
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.
__________________
| jamesyong.net |
FVC2007, FTC2008
  #9   Spotlight this post!  
Unread 18-10-2006, 15:22
Josh Siegel's Avatar
Josh Siegel Josh Siegel is offline
lurker
#0448 (Crandroids)
 
Join Date: Nov 2003
Rookie Year: 2003
Location: Bloomfield Hills, Michigan
Posts: 67
Josh Siegel will become famous soon enough
Send a message via AIM to Josh Siegel Send a message via MSN to Josh Siegel
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   Spotlight this post!  
Unread 18-10-2006, 23:39
yongkimleng yongkimleng is offline
deus ex programmeur
AKA: James Yong
FTC #0747
Team Role: Mentor
 
Join Date: Aug 2006
Rookie Year: 2004
Location: Singapore, West
Posts: 134
yongkimleng is a jewel in the roughyongkimleng is a jewel in the roughyongkimleng is a jewel in the rough
Send a message via MSN to yongkimleng
Re: ADC advice needed

Quote:
Originally Posted by Josh Siegel
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?
yes, if it isn't a standard radio protocol, you have to measure the pulse width urself either using the microcontroller's CCP function or interrupt function. Read my previous post's points 1 and 2.. you may want to check out the datasheet's info on CCP too. The CCP and timers can be configured to measure ANY pulse width.. the problem is finding out which pin the CCP goes to
__________________
| jamesyong.net |
FVC2007, FTC2008
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 04:32.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi