Interfacing a Pressure Transducer to a Protoboard
tae2010
Posts: 38
Hi there,
Ive been using a USB Protoboard for the past few weeks and Ive wanted to interface an MSI 0-100psi pressure transducer that I have. I know it runs on 5 volts, and I plan to use an external regulated power supply to drive it, but I wanted to know how I can interface the board to the signal pin ( the sensor outputs 0.5-4.5 volts). Also I want the board to be able to convert the read voltages into·pressure values·and display·the data·in the propterminal on regular intervals.
The long term goal of this project is to control when a solenoid valve turns on and off based on the pressure reading.
It seems like a simple thing to do, but if someone can point me in the right direction as far as wiring and code is concerned, it would help a lot.
Thanks
Ive been using a USB Protoboard for the past few weeks and Ive wanted to interface an MSI 0-100psi pressure transducer that I have. I know it runs on 5 volts, and I plan to use an external regulated power supply to drive it, but I wanted to know how I can interface the board to the signal pin ( the sensor outputs 0.5-4.5 volts). Also I want the board to be able to convert the read voltages into·pressure values·and display·the data·in the propterminal on regular intervals.
The long term goal of this project is to control when a solenoid valve turns on and off based on the pressure reading.
It seems like a simple thing to do, but if someone can point me in the right direction as far as wiring and code is concerned, it would help a lot.
Thanks
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
Red wire to +5V
Black to GND
Green to an ADC with a voltage divider.
The hardest thing will be to calibrate the ADC, maybe have an analoge pressure sensor connected as a reference whilst u adjust the ADC.
The coding should be easy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"powered by Propeller" domed stickers $1.50 - Find them here
Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net
The Sarah Myatt Fund - Help Sarah and Her Family Fight Quadriplegia HERE
Post Edited (tae2010) : 5/7/2010 3:44:28 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
The code for interfacing it can be found here obex.parallax.com/objects/180/
I can't help you with connecting it up as I haven't used it before however DACs are pretty easy to connect.
Usualy just:
VDD to 5V
VSS to GND
Ref to a pot between 0v and 5v
Ch1 to the green wire from your sensor
Dout, Din, Clk and Cs all go to prop pins via a resister.
Please confirm this with someone else before conecting it though.
I hope this makes things clearer for you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"powered by Propeller" domed stickers $1.50 - Find them here
Check out my Design and Technology project for my Higher School Certificate www.ecosureblog.net
The Sarah Myatt Fund - Help Sarah and Her Family Fight Quadriplegia HERE
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
Post Edited (Leon) : 5/7/2010 12:26:30 PM GMT
Based on my understanding, Vdd would hook into Vref and Vcc. /CS, CLK and D0 would all hook into pins on the board, and Vin - & GND would hook into Vss. (I'll probably end up using the 3202 since I dont need many analog inputs)
But then what will Din hook into?
Just trying to verify if Ive got this so I dont mess up my sensor.
Thanks.
Post Edited (tae2010) : 5/8/2010 2:17:02 AM GMT
Post a schematic of how you propose to wire it up, it'll be easier to check it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
Post Edited (Leon) : 5/8/2010 10:01:38 PM GMT
Also does my wiring diagram look fine?
Post Edited (tae2010) : 5/8/2010 11:47:51 PM GMT
Use resistors; they are much more stable, easier to mount and cheaper.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
Thanks for helping me out.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
Post Edited (Leon) : 5/9/2010 10:13:27 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM
http://lh3.ggpht.com/_JitqFAafVeQ/S_9VDWG-IoI/AAAAAAAAAGk/-JhztlgSt1c/ADC Circuit.png
And the code:
(Edit: for some reason the image wont appear, so I included the link of it)
Post Edited (tae2010) : 5/28/2010 5:44:01 AM GMT
I'll keep you posted on any updates. At the moment, since I cant get the ADC and the code to work, Im working on the user interface part of the project.
In your Object block, should "Parallax Serial Terminal" be "Parallax_Serial_Terminal" or some other name that has no spaces? Maybe I'm wrong but I didn't think SPIN is very fond of spaces.
But you never start the PST. You need to include:
Jim
Tar-nation! I didn't know that. Thanks for correcting me!
The major problem Im experiencing is that the decimal keeps including a -1 in the numbers to the right of the decimal place. Also the voltage isnt as high as its supposed to be. Im using a 1k ohm pot to change values, so is that why my voltage read is so low?
Heres the code, perhaps someone can tell me what Im doing wrong? As I always say, Two sets of eyes are always better than one.
All those variables are setup as Longs, except adcRead, which is setup as a word.
Thanks everyone for helping!
Post Edited (tae2010) : 6/20/2010 2:55:10 AM GMT
What were you doing wrong
I'm interesting because you were using my code and I want to make sure there was no mistake in it.
Harprit
Only reason it wasnt working before, is I forgot to start the serial connection. Its working now, Im just not sure if its working correctly. The max output voltage the Propeller is outputting is only 2volts, and Im supplying a 5V supply to the pot that is changing the analog input. The maximum the Propeller puts out should be around 2.5v. So I dont know what Im doing wrong in my setup or if Im missing a key bit of info from the 3202 spec sheet.
Harprit
Thanks for taking the time to take a look at whats wrong. That last bit of code I used one of the tutorials supplied with the Digital (ADC) package that you can buy. Except that tutorial was for the Stamp, so I had to change the code to get it to work on the Propeller.
Its easier for me to send you my hand written stuff that way.
I will make up your ckt and get you a solution/notes of some sort.
This seems manageable. Might take a day or two.
Then you can post it all for all to see.
H