This Forum is Dedicated For all The Object Oriented PIC Lovers .......... The concept behind OOPic is straight forward. Use preprogrammed multitasking Objects from a library of highly optimized Objects to do all the work of interacting with the hardware. Then write small scripts in Basic, C, or Java syntax styles to control the Objects. During operation, the Objects run continuously and simultaneously in the background while the scripts run in the foreground telling the objects what to do.

Friday, September 14, 2007

[oopic] Re: Oopic and the LM335 Temperature Sensor

--- In oopic@yahoogroups.com, "dickydodds" <dicky@...> wrote:
>
> Guys,
>
> I am having a bit of trouble interfacing an LM335 to the Ooopic ADC
> lines and wondered if someone has already been here and got a circuit
> which works.
>
> I cant seem to get a reliable reading or a precise enough measurement.
> Even if I try to use the extvref line with a voltage as low as 4 volts
> (which deosnt seem to make a difference) - I just cant seem to get a
> correct reading. It deosnt help that the oopic cant do floating point
> math.
>
> Deos anyone have a suitable circuit that would allow me to read up to
> 5 lm335 temp chips but with some sort of op amp subtractor, say, to
> remove 2 volts so I can more or less read the true temperature
> directly, or at least make a eeprom lookup table to get the correct
> values?
>
> Any help, thought appreciated.
>
> I have tried both firmware Version 1 and 2.2+ on Oopic 2's.
>
> Cheers,
> dicky
>


I don't know what value of R1 you selected but the input impedance of
the A/D converter is going to be a problem. I might try 2k or so
because most of the specs are at 1 mA for Ir (the (5V - Sensor Output)
/ 0.001). There is the possibility that the input impedance of the
A/D converter is pulling enough current to 'starve' the sensor. This
will certainly occur if the resistor is much higher than 2k. An op
amp between the sensor and A/D pin will solve this.

Next, hook everything up and then measure the signal going into the
A/D pin with a digital voltmeter. See if it is constant. Better yet,
look at it with a scope. If there is any noise or wiggling, the A/D
conversion won't improve it. You might need to add a small capacitor
to ground at the pin. Try 0.01 ufd or 0.1 ufd.

You can use oEEPROM to read/write from EEPROM memory. It would be
better to put the table at a high address in the hopes that
reprogramming the OOPic won't overwrite it. On the S board, use the
E1 socket and a separate EEPROM. Maybe write a program to set up the
EEPROM and then your A/D program can just use it without the code
overhead of creating it. It depends on how much program space you
have left with your application.

If you need 5 A/D inputs, you better be using the S board.

You can learn everything you need to know about offset and scaling in
Chapter 4 of "Op Amps For Everyone"
http://www.ti.com/litv/pdf/slod006b

One advantage of using an op amp
for offset and scaling is lowering the output impedance to drive the
A/D converter.

Richard



Yahoo! Groups Links

<*> To visit your group on the web, go to:

http://groups.yahoo.com/group/oopic/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:

http://groups.yahoo.com/group/oopic/join

(Yahoo! ID required)

<*> To change settings via email:
mailto:oopic-digest@yahoogroups.com
mailto:oopic-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
oopic-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:

http://docs.yahoo.com/info/terms/

No comments: