PDA

View Full Version : Probe to PC Interface


drblank1
09/29/2006, 05:19 PM
I am in the design stage of using a PC to monitor and control my aquarium. The control part was easy. What I'm struggling with is finding an economical way of interfacing the probes (temp, pH, etc.) to the PC.

Does anyone know of a unit that would do this for me? PCI or USB is fine. I don't want to DIY an interface since my EE days are far behind me. I want to keep this part of the design less than $200. Something very simple.

If anyone has designed and built a probe to PC interface, I would be interested in purchasing it.

When I get to the point that I have successfully tested the design, I will share it with everyone. My goal here is to create a controller/monitor that would cost less than the standard controllers on the market (PC not included) with a robust GUI.

drblank1
10/05/2006, 06:40 AM
OK, after much reading here on RC and other websites, I have decided to go with the Phidgets 8/8/8 interface. It's what I need and the price is right. I have ordered it and should be here within the week.

But now, I will need to create probe amplifiers to interface with the 8/8/8. Does anyone have complete designs for pH, ORP, SG, and temp amps? (I guess I'll have to dust off the old EE toolbox)

And yes, I have seen the ph and ORP sensors offered by Phidgets. The cost is $80 for one. That would increase the cost of the project too much. I have also seen the Venier amps and don't want to go that route, although not as expensive.

I think it would be cheaper to build a pcb amp board myself for all four probes.

Matrexz
10/11/2006, 09:24 AM
Not a bad idea to make your own board. PCBFabexpress makes some great boards. I've had gread luck with them on my boards.

easttn
10/12/2006, 07:51 PM
This (http://www.edn.com/article/CA486574.html?spacedesc%3Ddesignideas) one works.

If you need a 0 - 5VDC voltage output, here (http://pdfserv.maxim-ic.com/en/an/AN823.pdf) is another.

figuerres
01/05/2007, 08:48 AM
Hmmm....

I am looking at the phidgets to do some reef stuff also...

what about using them to control a device ?

say I had a variable pump that used say 12 V DC and I wanted to use a digital computer to run the DC pump from say 0 to 12 volts based on a byte (0-255) ?

been a long time but I know there are classic voltage reg. IC's where I could stick a POT on two leads and a resitior on two others and get variable voltage....

now how might I replace the POt with a digital equiv that is driven by a computer -- and not risk frying the pc / interface !

any ideas out there ???

idealy I'd like to plug that into a phiget usb interface ....

marco_UK
01/05/2007, 01:44 PM
This is a big question and it sort of depends how into electronics you want to go. A variable voltage regulator LM317 will do this easily. An example circuit is given on most data sheets showing this IC with 4 transistors on the adjust pin. These you can drive with 4 digital i/o's giving 16 voltage levels and thus speeds. This would be fine providing the DC motor was less than 2Amps and you didn't mind the heatsink and resultant power loss. You could add another tranny to give 32 levels. Otherwise you could drive a DtoA converter and make a PWM circuit to give finer control, but that would mean more time behind the soldering iron !!!

figuerres
01/05/2007, 02:45 PM
<a href=showthread.php?s=&postid=8904894#post8904894 target=_blank>Originally posted</a> by marco_UK
This is a big question and it sort of depends how into electronics you want to go. A variable voltage regulator LM317 will do this easily. An example circuit is given on most data sheets showing this IC with 4 transistors on the adjust pin. These you can drive with 4 digital i/o's giving 16 voltage levels and thus speeds. This would be fine providing the DC motor was less than 2Amps and you didn't mind the heatsink and resultant power loss. You could add another tranny to give 32 levels. Otherwise you could drive a DtoA converter and make a PWM circuit to give finer control, but that would mean more time behind the soldering iron !!!

can you go over this a bit?

I mostly do software, been about 15-20 years since I did hardware like this...

if you can explain or show me an example of "An example circuit is given on most data sheets showing this IC with 4 transistors on the adjust pin. These you can drive with 4 digital i/o's giving 16 voltage levels and thus speeds. " and of the "PWM circuit"

I think I get the first one are we "Summing the outputs" of the transistors ? (kinda?)

and PWM - is this Pulse Wave Modulation ??
can you point me to any examples on the net??

I guess I'll have to get an LM317 and see the datasheet....
Just been a while....

also I'm thinking it would be usefull -- if I can hack it right
to have a small bit of flash memory so that for example a pc could write a value - like say 128 to a byte and then have the active control system use that memory cell to drive the LM317
then the pc can read the value to see what it's set to and write it to update / re-program it.
if I added a local control panel I'd read / set that also...
I guess to go that route I'd need some kind of mini-cpu
which may be what I want in the end...

this is just the start of this project for me.... doing some research before I start buying parts :)

marco_UK
01/05/2007, 03:39 PM
OK, Well firstly the LM317 route. The data sheet is here http://cache.national.com/ds/LM/LM117.pdf

This will work but it really is as you said kind of summing. You would not get a very linear output. The best bet would be to use a decoder ( logic chip 74154 ). With a 4 bit binary input "one of 16" output lines is set up. These lines could connect to one of 16 transistors. This way you could set the resistors to give you the 16 voltage steps you want.

The PWM method is more elegant. The following link my be helpful
http://www.cpemma.co.uk/pwm.html

In place of the VR1 reference you would connect a voltage from a Digital to Analog converter driven by you PC output. AD557
http://docs-europe.electrocomponents.com/webdocs/077f/0900766b8077fe5a.pdf is a simple 8 bit DAC that could do the job.

Your flash idea is normally done using a 74373 which is an 8bit latch and in code you remember what value you last set it to.

I hope this helps

figuerres
01/05/2007, 05:13 PM
<a href=showthread.php?s=&postid=8905886#post8905886 target=_blank>Originally posted</a> by marco_UK
OK, Well firstly the LM317 route. The data sheet is here http://cache.national.com/ds/LM/LM117.pdf

This will work but it really is as you said kind of summing. You would not get a very linear output. The best bet would be to use a decoder ( logic chip 74154 ). With a 4 bit binary input "one of 16" output lines is set up. These lines could connect to one of 16 transistors. This way you could set the resistors to give you the 16 voltage steps you want.

The PWM method is more elegant. The following link my be helpful
http://www.cpemma.co.uk/pwm.html

In place of the VR1 reference you would connect a voltage from a Digital to Analog converter driven by you PC output. AD557
http://docs-europe.electrocomponents.com/webdocs/077f/0900766b8077fe5a.pdf is a simple 8 bit DAC that could do the job.

Your flash idea is normally done using a 74373 which is an 8bit latch and in code you remember what value you last set it to.

I hope this helps

Yeah, thanks... I just got home and found the datasheets just beofre reading email :)

Next I'll look at the pwm and the rest of it....
looking at the data sheet gave me a good picture of how that would work....

now to read the links and see how far I get....
I found a book on USB that sounds like it might also help me get going:
http://www.lvr.com/usbc.htm

looks like it tells a lot about USB and how to connect the dots.

what I am ultimatly thinking of it to have say 4 or 8 seperate "controll channels" each with a set of pump settings.
so while the phidget I saw has 8 io's I might want say 4*4 or 4*8
for "flow" levels plus some time of day stuff
like:

go from 10% to 80% staring at 6am ending at 10am on pump #1
then ....

I'm not sure yet how much of this will be done by a pc or if I want to be able to send a set of values to some local storage / memory and have a local logic know how to follow thru

if I can download the values and let it do the steps then the pc can go off-line and not leave the system going wild / shut down etc...
this way the pc or WIndows CE device can send commands then sleep - read and log values - sleep and so on...
I am looking at for example:
http://www.arcom.com/devkit-wince-viper.htm
as the "Main Brain" of the system
I write windows and CE / Pocket PC software for a living...
so if I can use USB to glue the different bits to a CE touch screen that I can code for in .Net then I'm in hogg hevean!

but even with that "Brain" I want each device to have some level of self-control and not be totaly lost w/o the big box in back...
so that for example this can be a modular system, some parts can be working w/o all of them and make it expandable.

marco_UK
01/06/2007, 02:10 AM
Greart minds think alike ! I have the Arcom SBC windows XPembedded dev kit for the controller brain. IF you are going to use this as a PC then PC104 boards are your best bet. You will be able to get all sorts of things ( a/d boards for PH probes etc, digital cards ) They will just plug in on the PC104 bus which is the old ISA standard just in a 4"x4" form. They are addressed around #300H and the suppliers will give code examples in c and .h files etc.. I have a similar thing but USB from www.datx.com. I could write it in c but I have VEE (agilent ) which instantly gives a very gui front end. I agree embedding an industrial pc in the controller is a great plan. You can VPN in and remote onto the box, look at data in real time, look at a web cam. VEE can feed by water parameters straight into an excel file, command outlook to send an email to my work........the list goes on. The only thing I am doing is building a "Watchdog timer" external from the controller computer. A bit like an egg timer, if the software dosent reset this every minute it will expire and hit the computers reset button. That way if the software / system crashes the timer won't be cleared and the reset will occur. It sounds like a great system you are planning, if you want to avoid soldering there is a huge array of 5B instrumentation modules ( PH amp, temp ) out there that you can join to directly, not a cheap solution, but guaranteed to work and would save you a lot of time. Dont forget there is some digital I/O on the viper board.

If you wish the PC to sleep then the 74373 route will work fine. This will allow you to save 8 bit bytes on each one of them. They are addressable in that you have to load the byte in. With 10 digital lines you could bus 4 together and use the remaining 2 lines via a 2-4 decoder ( smaller version of the 74154 ) to chose which one of the 4 latches you wanted to send data to.

I hope it works well.

figuerres
01/06/2007, 07:52 AM
<a href=showthread.php?s=&postid=8910193#post8910193 target=_blank>Originally posted</a> by marco_UK
Greart minds think alike ! I have the Arcom SBC windows XPembedded dev kit for the controller brain. IF you are going to use this as a PC then PC104 boards are your best bet. You will be able to get all sorts of things ( a/d boards for PH probes etc, digital cards ) They will just plug in on the PC104 bus which is the old ISA standard just in a 4"x4" form. They are addressed around #300H and the suppliers will give code examples in c and .h files etc.. I have a similar thing but USB from www.datx.com. I could write it in c but I have VEE (agilent ) which instantly gives a very gui front end. I agree embedding an industrial pc in the controller is a great plan. You can VPN in and remote onto the box, look at data in real time, look at a web cam. VEE can feed by water parameters straight into an excel file, command outlook to send an email to my work........the list goes on. The only thing I am doing is building a "Watchdog timer" external from the controller computer. A bit like an egg timer, if the software dosent reset this every minute it will expire and hit the computers reset button. That way if the software / system crashes the timer won't be cleared and the reset will occur. It sounds like a great system you are planning, if you want to avoid soldering there is a huge array of 5B instrumentation modules ( PH amp, temp ) out there that you can join to directly, not a cheap solution, but guaranteed to work and would save you a lot of time. Dont forget there is some digital I/O on the viper board.

If you wish the PC to sleep then the 74373 route will work fine. This will allow you to save 8 bit bytes on each one of them. They are addressable in that you have to load the byte in. With 10 digital lines you could bus 4 together and use the remaining 2 lines via a 2-4 decoder ( smaller version of the 74154 ) to chose which one of the 4 latches you wanted to send data to.

I hope it works well.

XP Vs. CE is one question...

I have aout 40-50 handhelds that run CE 4.1 and they don't crash. the main problem is the users are not very "tech" and use pens / pencils onthe touch screen and they have to be replaced!
-- they dig pits into the touch panel!! :eek1:

but I know that XPe is different than std. XP also...
but CE 6 is looking really hot. more procs, more address space and so on...

I have over 5 years with saltwater, over 20 years with software development and systems work.... but now I'm bringing the two together....

5B ? can you give me a link ?? what is that ??

marco_UK
01/06/2007, 09:55 AM
5B is a simple range of amplifiers and input modules for data acquisition applications. Very user friendly and remove the need to solder everything up. One maker is AD http://www.analog.com/en/content/0,2886,774%255F868%255F113993,00.html . They sit on a backplane and will need a little PSU. They will then give a high level signal 0-5V etc for you to acquire on your A/D converter.

Sort of a building block approach, but saves a lot of messing around if electronics are not your thing.

OK about your 20 years software, I have similiar in electronics and control systems but 0 in saltwater. I am currently working on my controller, purchasing skimmers, reactors, pumps etc and drawing everything up in autocad before I start building. I am pleased to be able to offer some help on something I know a bit about. I am sure I will need a load of reef help when I get things up and running !!