Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | Re: Flow Meter

Discussion forum for the BasicX family of microcontroller chips.

Flow Meter - David_Basile - Feb 9 2:54:47 2008

I'm attempting to build a small watering system for some of my plants.
I have a chance to get a flow meter and was wondering if someone can
point me in the right direction on how to hook it up. I just want to
monitor how much water I'm using.

It is rated for 4.5 to 24vdc
Pulse output
1120 pulses per liter

Also am I correct in assuming that if I have an input voltage of 5vdc
that my pulse will be 5vdc?

Thanks in advance,
David



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: Flow Meter - Don Kirby - Feb 9 13:56:29 2008

Your assumption about voltage is correct. Most flow meters will
output a squarewave pulse of whatever voltage you drive the sensor with.

As for measuring the flow, there are a few different methods. You can
track the speed of the pulses to give you the rate of flow. You can
count the total number of pulses to track the total amount of liquid
that has passed through the sensor. You can also compute the total
amount by tracking the flow rate over time, although simply counting
the pulses is probably easier from a coding point of view.

As for actually hooking the meter up to your BasicX chip, it would
probably be best to check the datasheet for the flowmeter in question
to see if there are any special requirements such as pull-up/down
resistors and the like.

-Don

--- In b...@yahoogroups.com, "David_Basile" wrote:
>
> I'm attempting to build a small watering system for some of my plants.
> I have a chance to get a flow meter and was wondering if someone can
> point me in the right direction on how to hook it up. I just want to
> monitor how much water I'm using.
>
> It is rated for 4.5 to 24vdc
> Pulse output
> 1120 pulses per liter
>
> Also am I correct in assuming that if I have an input voltage of 5vdc
> that my pulse will be 5vdc?
>
> Thanks in advance,
> David
>



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: Flow Meter - David Sousa Mendes - Feb 9 16:03:15 2008

Hello
I used a similar technique to measure the wind (by pulses)
I counted the time between 2 followed transitions:
Here's the code:

do
WaitforInterrupt(bxPinRisingEdge)
Tempo_i=timer()
WaitforInterrupt(bxPinRisingEdge)
Tempo_f=timer()
Dtempo= tempo_f-tempo_i

'perform some math
Dtempo=CSng(86400)-tempo_i+tempo_f
Wind_Speed =CInt( CSng(3.6)*multiplier*CSng(10)/dtempo )
call delay (0.8)
loop

Hope it helps

David

----- Original Message -----
From: Don Kirby
To: b...@yahoogroups.com
Sent: Saturday, February 09, 2008 5:53 PM
Subject: [BasicX] Re: Flow Meter
Your assumption about voltage is correct. Most flow meters will
output a squarewave pulse of whatever voltage you drive the sensor with.

As for measuring the flow, there are a few different methods. You can
track the speed of the pulses to give you the rate of flow. You can
count the total number of pulses to track the total amount of liquid
that has passed through the sensor. You can also compute the total
amount by tracking the flow rate over time, although simply counting
the pulses is probably easier from a coding point of view.

As for actually hooking the meter up to your BasicX chip, it would
probably be best to check the datasheet for the flowmeter in question
to see if there are any special requirements such as pull-up/down
resistors and the like.

-Don

--- In b...@yahoogroups.com, "David_Basile" wrote:
>
> I'm attempting to build a small watering system for some of my plants.
> I have a chance to get a flow meter and was wondering if someone can
> point me in the right direction on how to hook it up. I just want to
> monitor how much water I'm using.
>
> It is rated for 4.5 to 24vdc
> Pulse output
> 1120 pulses per liter
>
> Also am I correct in assuming that if I have an input voltage of 5vdc
> that my pulse will be 5vdc?
>
> Thanks in advance,
> David
>

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

VBtoBXdemo.zip - "David E. Basile" - Feb 16 19:03:47 2008

I wanted to look at this example code and although it says all source
included but all that is in the zip file is the VB code. I downloaded it
right from the BasicX.com site
http://www.basicx.com/codeexamples/files/VBtoBXdemo.zip. Does any one have
the complete file with the BX source?

Thanks in advance.
David
[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: Flow Meter - "David E. Basile" - Feb 26 7:30:34 2008

Yes this helps but my problem is I have 3 different meters and if I'm
correct I can only use one pin on the BX24 (pin 11) with WaitForInterrupt.
Using something like CountTransitions halts any multitasking (which I may
end up using) and then I would have to guess (I assume) at how long to count
the transitions. Any pulse counting functions seem to be limited to just
one pin (InputCapture).

Is there an efficient way to monitor 3 pins and count the pulses on the BX24
with either functions already available to the BX hardware or by using some
external hardware source? As I stated before there are 1120 pulses per
liter and it would only run for short burst when the valve would be open.
Maybe 4 to 5 liters in a day.

Thanks in advance,

David

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
David Sousa Mendes
Sent: Saturday, February 09, 2008 3:27 PM
To: b...@yahoogroups.com
Subject: Re: [BasicX] Re: Flow Meter

Hello
I used a similar technique to measure the wind (by pulses)
I counted the time between 2 followed transitions:
Here's the code:

do
WaitforInterrupt(bxPinRisingEdge)
Tempo_i=timer()
WaitforInterrupt(bxPinRisingEdge)
Tempo_f=timer()
Dtempo= tempo_f-tempo_i

'perform some math
Dtempo=CSng(86400)-tempo_i+tempo_f
Wind_Speed =CInt( CSng(3.6)*multiplier*CSng(10)/dtempo )
call delay (0.8)
loop

Hope it helps

David

----- Original Message -----
From: Don Kirby
To: basicx@yahoogroups. com
Sent: Saturday, February 09, 2008 5:53 PM
Subject: [BasicX] Re: Flow Meter

Your assumption about voltage is correct. Most flow meters will
output a squarewave pulse of whatever voltage you drive the sensor with.

As for measuring the flow, there are a few different methods. You can
track the speed of the pulses to give you the rate of flow. You can
count the total number of pulses to track the total amount of liquid
that has passed through the sensor. You can also compute the total
amount by tracking the flow rate over time, although simply counting
the pulses is probably easier from a coding point of view.

As for actually hooking the meter up to your BasicX chip, it would
probably be best to check the datasheet for the flowmeter in question
to see if there are any special requirements such as pull-up/down
resistors and the like.

-Don

--- In basicx@yahoogroups. com,
"David_Basile" wrote:
>
> I'm attempting to build a small watering system for some of my plants.
> I have a chance to get a flow meter and was wondering if someone can
> point me in the right direction on how to hook it up. I just want to
> monitor how much water I'm using.
>
> It is rated for 4.5 to 24vdc
> Pulse output
> 1120 pulses per liter
>
> Also am I correct in assuming that if I have an input voltage of 5vdc
> that my pulse will be 5vdc?
>
> Thanks in advance,
> David
>

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: Flow Meter - "James R. Parish" - Feb 26 10:55:37 2008

What I would do is run the pulses through a simple transistor and RC
networking feeding an OPAMP turning them into an Analog Voltage that
could be measured on any of the 8 ADC pins of the BX24. The high
impedance input to the OPAMPS would hold the output steady while you
polled the inputs of the BX24. I have been playing with Pumps for a few
weeks now using the BX24's DACPIN with an RC setup to vary the output of
an OpAmp from 0-12v and it works pretty slick. It should work in the
other direction as well.

What would be slick is have 3 small TASKs running, one on each ADC pin
updating a VARIABLE on the fly.

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf
Of David E. Basile
Sent: Monday, February 25, 2008 7:47 PM
To: b...@yahoogroups.com
Subject: RE: [BasicX] Re: Flow Meter

Yes this helps but my problem is I have 3 different meters and if I'm
correct I can only use one pin on the BX24 (pin 11) with
WaitForInterrupt.
Using something like CountTransitions halts any multitasking (which I
may
end up using) and then I would have to guess (I assume) at how long to
count
the transitions. Any pulse counting functions seem to be limited to just
one pin (InputCapture).

Is there an efficient way to monitor 3 pins and count the pulses on the
BX24
with either functions already available to the BX hardware or by using
some
external hardware source? As I stated before there are 1120 pulses per
liter and it would only run for short burst when the valve would be
open.
Maybe 4 to 5 liters in a day.

Thanks in advance,

David

_____

From: b...@yahoogroups.com [mailto:
b...@yahoogroups.com ] On Behalf Of
David Sousa Mendes
Sent: Saturday, February 09, 2008 3:27 PM
To: b...@yahoogroups.com
Subject: Re: [BasicX] Re: Flow Meter

Hello
I used a similar technique to measure the wind (by pulses)
I counted the time between 2 followed transitions:
Here's the code:

do
WaitforInterrupt(bxPinRisingEdge)
Tempo_i=timer()
WaitforInterrupt(bxPinRisingEdge)
Tempo_f=timer()
Dtempo= tempo_f-tempo_i

'perform some math
Dtempo=CSng(86400)-tempo_i+tempo_f
Wind_Speed =CInt( CSng(3.6)*multiplier*CSng(10)/dtempo )
call delay (0.8)
loop

Hope it helps

David

----- Original Message -----
From: Don Kirby
To: basicx@yahoogroups. com
Sent: Saturday, February 09, 2008 5:53 PM
Subject: [BasicX] Re: Flow Meter

Your assumption about voltage is correct. Most flow meters will
output a squarewave pulse of whatever voltage you drive the sensor with.

As for measuring the flow, there are a few different methods. You can
track the speed of the pulses to give you the rate of flow. You can
count the total number of pulses to track the total amount of liquid
that has passed through the sensor. You can also compute the total
amount by tracking the flow rate over time, although simply counting
the pulses is probably easier from a coding point of view.

As for actually hooking the meter up to your BasicX chip, it would
probably be best to check the datasheet for the flowmeter in question
to see if there are any special requirements such as pull-up/down
resistors and the like.

-Don

--- In basicx@yahoogroups. com,
"David_Basile" wrote:
>
> I'm attempting to build a small watering system for some of my plants.

> I have a chance to get a flow meter and was wondering if someone can
> point me in the right direction on how to hook it up. I just want to
> monitor how much water I'm using.
>
> It is rated for 4.5 to 24vdc
> Pulse output
> 1120 pulses per liter
>
> Also am I correct in assuming that if I have an input voltage of 5vdc
> that my pulse will be 5vdc?
>
> Thanks in advance,
> David
>

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: Flow Meter - "nje...@ihug.co.nz" - Feb 26 15:42:24 2008

What is the pulse rate ?

David E. Basile wrote:

> Yes this helps but my problem is I have 3 different meters and if I'm
> correct I can only use one pin on the BX24 (pin 11) with WaitForInterrupt.
> Using something like CountTransitions halts any multitasking (which I may
> end up using) and then I would have to guess (I assume) at how long to
> count
> the transitions. Any pulse counting functions seem to be limited to just
> one pin (InputCapture) .
>
> Is there an efficient way to monitor 3 pins and count the pulses on
> the BX24
> with either functions already available to the BX hardware or by using
> some
> external hardware source? As I stated before there are 1120 pulses per
> liter and it would only run for short burst when the valve would be open.
> Maybe 4 to 5 liters in a day.
>
> Thanks in advance,
>
> David
>
> _____
>
> From: basicx@yahoogroups. com
> [mailto:basicx@yahoogroups. com ] On
> Behalf Of
> David Sousa Mendes
> Sent: Saturday, February 09, 2008 3:27 PM
> To: basicx@yahoogroups. com
> Subject: Re: [BasicX] Re: Flow Meter
>
> Hello
> I used a similar technique to measure the wind (by pulses)
> I counted the time between 2 followed transitions:
> Here's the code:
>
> do
> WaitforInterrupt( bxPinRisingEdge)
> Tempo_i=timer( )
> WaitforInterrupt( bxPinRisingEdge)
> Tempo_f=timer( )
> Dtempo= tempo_f-tempo_ i
>
> 'perform some math
> Dtempo=CSng( 86400)-tempo_ i+tempo_f
> Wind_Speed =CInt( CSng(3.6)*multiplie r*CSng(10) /dtempo )
> call delay (0.8)
> loop
>
> Hope it helps
>
> David
>
> ----- Original Message -----
> From: Don Kirby
> To: basicx@yahoogroups. com
> Sent: Saturday, February 09, 2008 5:53 PM
> Subject: [BasicX] Re: Flow Meter
>
> Your assumption about voltage is correct. Most flow meters will
> output a squarewave pulse of whatever voltage you drive the sensor with.
>
> As for measuring the flow, there are a few different methods. You can
> track the speed of the pulses to give you the rate of flow. You can
> count the total number of pulses to track the total amount of liquid
> that has passed through the sensor. You can also compute the total
> amount by tracking the flow rate over time, although simply counting
> the pulses is probably easier from a coding point of view.
>
> As for actually hooking the meter up to your BasicX chip, it would
> probably be best to check the datasheet for the flowmeter in question
> to see if there are any special requirements such as pull-up/down
> resistors and the like.
>
> -Don
>
> --- In basicx@yahoogroups. com,
> "David_Basile" wrote:
> >
> > I'm attempting to build a small watering system for some of my plants.
> > I have a chance to get a flow meter and was wondering if someone can
> > point me in the right direction on how to hook it up. I just want to
> > monitor how much water I'm using.
> >
> > It is rated for 4.5 to 24vdc
> > Pulse output
> > 1120 pulses per liter
> >
> > Also am I correct in assuming that if I have an input voltage of 5vdc
> > that my pulse will be 5vdc?
> >
> > Thanks in advance,
> > David
> > [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>------------------------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.5.516 / Virus Database: 269.21.1/1297 - Release Date: 25/02/2008 9:22 a.m.
>
>



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Flow Meter - Tom Becker - Feb 28 20:32:43 2008


> Rise & Fall times 2uS max
> Max frequency 280Hz
> 'K' Factor 1120 approximately
> 4.5 to 24vdc (Pull up resistor required)

It would be easier to suggest an interface if we can see the metering
device schematic. Can you provide a link?

In general, it would seem possible to produce 280x2x3 events per
second with three flowmeters, full blast. That might seem to be an
impractical worst case (you won't be flooding your plants, I imagine),
but it might be true, briefly, after you open your irrigation supply
valve as the downstream lines fill. Of course, you can limit that by
restricting the supply rate.

If you have the three meter signals connected to three adjacent input
pins, one brute-force method of counting the changes is to tightly
loop, reading the three pins simultaneously and determining which, if
any, of the pins have changed since the last loop iteration, and
accumulating corresponding counts. The most-simple BX-24 loop will
run at ~8kHz; I think that is fast enough to capture the 1.68kHz
worst-case change rate, but if the processor needs to do much else,
you might lose some counts using this method.

Another way is to use some external hardware to drive the processor
interrupt line when any meter state changes; a few 7400-series ICs can
do that. Your code, then, wouldn't need to spin, looking for changes;
it only needs to determine which of the three sources caused the
interrupt. You can do that with three input pins, as above, which you
can read when an interrupt occurs.

Does that help?
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: Flow Meter - "David E. Basile" - Feb 28 21:40:24 2008

Tom,

These are beverage flow meters. Here is the site

http://www.jlcinternational.com/liquid_turbine_flowmeters_titan.htm

The data sheet

http://www.jlcinternational.com/datasheets/Titan/beverage_meter.pdf

And the manual

http://www.jlcinternational.com/manuals/Titan/Beverage_meter_instructions.pd
f

I actually selected these because I now have two projects going on. one for
plants and one for my kegerator but both will hopefully work in the same
way. Trigger an interrupt so I can count the pulses.

It would be safe to say that only one flow meter would be active at one time
for both projects and not for very long. In the kegerator project it would
only be per glass of beer and I can't drink that much but it would be just
to track how much I've drawn from the keg(s). The circuit for the plants
would be the same way since they are just starter plants. One meter for
water and another for a fertilizer / water mixture but I want to monitor how
much I am applying and how much I have used over a period of time.

As for the loop that is what I tried in my first test but probably a bit
different than what you are suggesting. I just had a loop that monitored
the pin and counted the number of times the pin when high. Again, this
worked but I have no way to really test the accuracy since I don't have any
test equipment and there would be times that the meter would stop on the
rise pulse (I'm assuming) so the pin would stay high until the flow meter
took another blast. This of course would give me a false count.

I looked at Al Williams PAKVII the other night and thought that might be
able to work but it almost seemed like overkill but never having done this
before it might be just the ticket. Is there a certain version of the 7400
series I should look at that way I can grab the datasheet and see how I
would interface this with the BX24? Again, most of my stuff with the BX24
has been relays, sound modules and leds so this is all new to me.

Yes Tom this did help. Maybe the documentation above will make my "muddy"
description clearer.

Thanks

David

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
Tom Becker
Sent: Thursday, February 28, 2008 8:30 PM
To: b...@yahoogroups.com
Subject: [BasicX] Re: Flow Meter

> Rise & Fall times 2uS max
> Max frequency 280Hz
> 'K' Factor 1120 approximately
> 4.5 to 24vdc (Pull up resistor required)

It would be easier to suggest an interface if we can see the metering
device schematic. Can you provide a link?

In general, it would seem possible to produce 280x2x3 events per
second with three flowmeters, full blast. That might seem to be an
impractical worst case (you won't be flooding your plants, I imagine),
but it might be true, briefly, after you open your irrigation supply
valve as the downstream lines fill. Of course, you can limit that by
restricting the supply rate.

If you have the three meter signals connected to three adjacent input
pins, one brute-force method of counting the changes is to tightly
loop, reading the three pins simultaneously and determining which, if
any, of the pins have changed since the last loop iteration, and
accumulating corresponding counts. The most-simple BX-24 loop will
run at ~8kHz; I think that is fast enough to capture the 1.68kHz
worst-case change rate, but if the processor needs to do much else,
you might lose some counts using this method.

Another way is to use some external hardware to drive the processor
interrupt line when any meter state changes; a few 7400-series ICs can
do that. Your code, then, wouldn't need to spin, looking for changes;
it only needs to determine which of the three sources caused the
interrupt. You can do that with three input pins, as above, which you
can read when an interrupt occurs.

Does that help?

Tom

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: Flow Meter - rosa...@aol.com - Feb 28 22:40:39 2008

Hi,

I have a suggestion. What you don't use a CD4040 12 bit counter for reading the pulses. By using it you do not need the interrupt because the counter keep counting until you reset it and you can read it at any time. The only problem is that you need to use 12 input from the BX 24 since the CD4040 is a parallel output. I do not know how many spare you have. You may be need to use the BX 35 with 27 inputs.
rosarite



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Re: Flow Meter - Tom Becker - Feb 28 22:47:32 2008

> ... Al Williams PAKVII...

That's one way to do it, but I think you can spend less than $25.

Here's one way, not perfectly ideal but functional, I think:
[I'm not trying to describe a schematic but, instead, the concept. If
you aren't familiar with TTL or CMOS logic, this might sound foreign,
but it is not difficult.] Provide power (5 to 24v; 5v is handy on BX-24
pin 21) and ground to the meters. The flowmeter pulse output is an
open-collector NPN transistor, so it can tie directly to a processor
input pin; in code, configure those pins for InputPullup. Also, tie the
same meter pulse output to one input of an XOR gate; the other XOR input
will come from a corresponding processor output pin that's used to
acknowledge an input pin state change. OR the three XOR gate outputs to
the BX-24 interrupt pin.

Conceptually, an XOR gate is a single-bit comparator, a "not_equal"
gate; if the inputs are the same the output is low, otherwise it is
high. Consequently, when the flowmeter output states are matched by
corresponding acknowledge pins, there is no interrupt; if any pin does
not match, an interrupt results. The interrupt-handling code then needs
to determine which pin(s) differ, count appropriately, and invert the
corresponding acknowledge pin(s). When all pins match, the interrupt
level will fall and your interrupt-handler task code will wait for the
next interrupt to occur when something changes again.

Other tasks can be reporting the counts, watching switches, reading
commands, whatever.
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: Flow Meter - "David E. Basile" - Feb 29 2:46:30 2008

I never had any experience with using the BX24 for pulse counting or flow
meters so I hope I get this info right.

Rise & Fall times 2uS max
Max frequency 280Hz
'K' Factor 1120 approximately
4.5 to 24vdc (Pull up resistor required)

For laughs and giggles I hooked it up to an input on the BX24 and tested it
with a small bit of code that just counted the number of times the pin went
high. It worked but I'm sure it's not very accurate. Originally I thought
this would be a breeze, and it might be for someone who has LOTS of
experience but it will be a challenge for me.

Any help or suggestions would be greatly appreciated.

David

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
n...@ihug.co.nz
Sent: Tuesday, February 26, 2008 3:28 PM
To: b...@yahoogroups.com
Subject: Re: [BasicX] Re: Flow Meter

What is the pulse rate ?

David E. Basile wrote:

> Yes this helps but my problem is I have 3 different meters and if I'm
> correct I can only use one pin on the BX24 (pin 11) with WaitForInterrupt.
> Using something like CountTransitions halts any multitasking (which I may
> end up using) and then I would have to guess (I assume) at how long to
> count
> the transitions. Any pulse counting functions seem to be limited to just
> one pin (InputCapture) .
>
> Is there an efficient way to monitor 3 pins and count the pulses on
> the BX24
> with either functions already available to the BX hardware or by using
> some
> external hardware source? As I stated before there are 1120 pulses per
> liter and it would only run for short burst when the valve would be open.
> Maybe 4 to 5 liters in a day.
>
> Thanks in advance,
>
> David
>
> _____
>
> From: basicx@yahoogroups. com
> [mailto:basicx@yahoogroups. com ] On
> Behalf Of
> David Sousa Mendes
> Sent: Saturday, February 09, 2008 3:27 PM
> To: basicx@yahoogroups. com
> Subject: Re: [BasicX] Re: Flow Meter
>
> Hello
> I used a similar technique to measure the wind (by pulses)
> I counted the time between 2 followed transitions:
> Here's the code:
>
> do
> WaitforInterrupt( bxPinRisingEdge)
> Tempo_i=timer( )
> WaitforInterrupt( bxPinRisingEdge)
> Tempo_f=timer( )
> Dtempo= tempo_f-tempo_ i
>
> 'perform some math
> Dtempo=CSng( 86400)-tempo_ i+tempo_f
> Wind_Speed =CInt( CSng(3.6)*multiplie r*CSng(10) /dtempo )
> call delay (0.8)
> loop
>
> Hope it helps
>
> David
>
> ----- Original Message -----
> From: Don Kirby
> To: basicx@yahoogroups. com
> Sent: Saturday, February 09, 2008 5:53 PM
> Subject: [BasicX] Re: Flow Meter
>
> Your assumption about voltage is correct. Most flow meters will
> output a squarewave pulse of whatever voltage you drive the sensor with.
>
> As for measuring the flow, there are a few different methods. You can
> track the speed of the pulses to give you the rate of flow. You can
> count the total number of pulses to track the total amount of liquid
> that has passed through the sensor. You can also compute the total
> amount by tracking the flow rate over time, although simply counting
> the pulses is probably easier from a coding point of view.
>
> As for actually hooking the meter up to your BasicX chip, it would
> probably be best to check the datasheet for the flowmeter in question
> to see if there are any special requirements such as pull-up/down
> resistors and the like.
>
> -Don
>
> --- In basicx@yahoogroups. com,
> "David_Basile" wrote:
> >
> > I'm attempting to build a small watering system for some of my plants.
> > I have a chance to get a flow meter and was wondering if someone can
> > point me in the right direction on how to hook it up. I just want to
> > monitor how much water I'm using.
> >
> > It is rated for 4.5 to 24vdc
> > Pulse output
> > 1120 pulses per liter
> >
> > Also am I correct in assuming that if I have an input voltage of 5vdc
> > that my pulse will be 5vdc?
> >
> > Thanks in advance,
> > David
> > [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
>----------------------------------------------------------
>
>No virus found in this incoming message.
>Checked by AVG Free Edition.
>Version: 7.5.516 / Virus Database: 269.21.1/1297 - Release Date: 25/02/2008
9:22 a.m.

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: Flow Meter - "David E. Basile" - Mar 1 23:00:42 2008

Tom,

Thanks again. I "believe" I got it :-). So if I understand you correctly I
could use a 7486 (Quad 2-Input Exclusive-OR Gate) to accomplish this. Your
explanation seems quite easy to follow.

>From your description of the function for the XOR gate I would assume it
will not be 100% accurate when all the code is in place but should be pretty
close? It would be nice to have 100% accuracy but I just want to be close
as possible.

Thanks again for all your help.

David

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
Tom Becker
Sent: Thursday, February 28, 2008 10:27 PM
To: b...@yahoogroups.com
Subject: Re: [BasicX] Re: Flow Meter

> ... Al Williams PAKVII...

That's one way to do it, but I think you can spend less than $25.

Here's one way, not perfectly ideal but functional, I think:
[I'm not trying to describe a schematic but, instead, the concept. If
you aren't familiar with TTL or CMOS logic, this might sound foreign,
but it is not difficult.] Provide power (5 to 24v; 5v is handy on BX-24
pin 21) and ground to the meters. The flowmeter pulse output is an
open-collector NPN transistor, so it can tie directly to a processor
input pin; in code, configure those pins for InputPullup. Also, tie the
same meter pulse output to one input of an XOR gate; the other XOR input
will come from a corresponding processor output pin that's used to
acknowledge an input pin state change. OR the three XOR gate outputs to
the BX-24 interrupt pin.

Conceptually, an XOR gate is a single-bit comparator, a "not_equal"
gate; if the inputs are the same the output is low, otherwise it is
high. Consequently, when the flowmeter output states are matched by
corresponding acknowledge pins, there is no interrupt; if any pin does
not match, an interrupt results. The interrupt-handling code then needs
to determine which pin(s) differ, count appropriately, and invert the
corresponding acknowledge pin(s). When all pins match, the interrupt
level will fall and your interrupt-handler task code will wait for the
next interrupt to occur when something changes again.

Other tasks can be reporting the counts, watching switches, reading
commands, whatever.

Tom

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Flow Meter - Tom Becker - Mar 1 23:41:09 2008

> ... 7486 (Quad 2-Input Exclusive-OR Gate)...

The modern form of that gate is the 74HC86, yes, but any 74x86 should
work. I think I would diode-OR those gate outputs, but you can use
two cascaded gates in a 74HC32 (Quad 2-input OR) to behave as a
3-input OR, if you like.

Since the BX-24 active interrupt level is low, you'll need to invert
the OR output. You can do that with the remaining XOR, one input tied
high and its output tied to the interrupt pin.

You can also use signal diodes (1N914, 1N4148), though, to OR the XOR
outputs by pulling the processor interrupt pin (with its internal
pullup enabled) _low_ if any of the XOR gates is _low_. This means
your acknowledge output pin data must be inverted, i.e. to match an
input state, acknowledge with its inverse. Whether you do this or use
upright XORs with an inverted OR gate, your interrupt task should
WaitForInterrupt(bxPinLow).

If this was a high-speed problem, I would probably latch the XOR
inputs on the leading edge of the interrupt to be certain none of them
change before code can identify the interrupt source. Since the
inputs are likely to change pretty slowly in your application, though,
I don't think latching is necessary to still achieve good counting
accuracy.

This should work well for you.

Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Flow Meter - Tom Becker - Mar 2 11:33:56 2008

In schematic form, here are my two proposals:
http://rightime.com/images/Misc/int.gif
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: Flow Meter - "David E. Basile" - Mar 3 14:05:30 2008

Tom,

Thanks a million. I'm going to order some parts tonight and give this a
shot. I'll probably be back with questions once I have everything assembled
and some code in place.

Appreciate the help and the schematic.

David

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
Tom Becker
Sent: Sunday, March 02, 2008 11:15 AM
To: b...@yahoogroups.com
Subject: [BasicX] Re: Flow Meter

In schematic form, here are my two proposals:
http://rightime.
com/images/Misc/int.gif

Tom

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

CallTask question - "David E. Basile" - Mar 3 19:15:55 2008

I'm using some code from the BX24 site that allows you to send and receive
data from the BX24 to PC. It uses CallTask to run a loop that monitors the
RS232 port and sends or receives data. My question is after the task is
running can you jump out of that task loop and run another sub routine and
then return to the task or does that halt the task?

It watches for a command byte and depending on if the byte is a send or
receive byte the loop will send data. I would like to go a little farther
and if for example the command byte is a Z then have it send the PC the
value from pin 12 and if it's Y send the value from pin 11. In my tests the
loop continued to work just using GetPin but once I put in a For - Next loop
it seemed like the task quit running. I'm not sure it was halting but my
first command was to turn on the on board LED and when just using GetPin or
GetADC the LED would go on. When I added the for - next loop the LED would
go on and then off and I didn't put code in to turn the LED off.

Removing the CallTask and just running the code in a Do Loop it seemed to
work fine no matter what.

Thanks in advance,

David

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Voltage Divider - "David E. Basile" - Mar 4 4:39:43 2008

I know I seem to be bombarding the list with questions and for all of those
who have given me input I really appreciate the help.

I have a temperature controller that has an analog output I would like to
read since the controller will be in a "hard to see" place. The output is
0-10 volts which is a linear representation of the sensor temperature with 0
volts = -30F and 10 volts = +220F. If I am correct this will be .04 volts
for each degree.

With a possible 10 volt input which I don't think I'll ever see as my temp
will be between +30 and +40 I would still need a voltage divider. Since,
for a lack of a technical term, I just need to split the voltage can I use
two 47k resistors or any two same size resistors to do this? From there run
that voltage to an ADC input and make the calculations for the actual
temperature? How will this voltage difference affect the temperature
calculations?

Thanks,

David

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Voltage Divider - Tom Becker - Mar 4 17:02:31 2008

> ... [from 0-10v] can I use two 47k resistors or any two same size
resistors...

I'm surprised this hasn't been answered; anyone breathing here?

Yes, two identical resistors in series between a low-impedance sensor
output and ground will show half the sensor voltage at the midpoint;
from a 0-10v sensor, you should see a 0-5v voltage that represents the
temperature over the 250F (-30F to +220F) sensor range.

If you measure that scaled voltage with a 10-bit, 5v ADC, the
resolution will be (250/1024) ~= 0.244 degreeF/bit. +30F should
appear as an ADC count, therefore, of ((+30-(-30) * 0.244) ~= 15.

If you want greater resolution, an opamp can provide both gain and
offset; you could, for example, configure a +20F to +60F range over
the ADC 5v range with an opamp and a few precision resistors or
adjustable pots to achieve a resolution of (40/1024) ~= 0.039 degreeF/bit.

If the signal has some noise on it (most do, without effort), you can
also use some simple signal processing to advantage; 100 averaged
samples will gain you an additional decimal digit of resolution, or
~0.0244 degreeF/bit, for example, if the noise is random (most isn't,
but is close enough to be useful).
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: CallTask question - Don Kirby - Mar 4 22:44:23 2008

The CallTask() method of running a subroutine work much the same way
as a regular Call(). The major difference is that when you use
CallTask(), the sub that you are calling doesn't actually run. Not
immediately anyway.

You've stumbled upon one of the great features of the BasicX platform,
multitasking.

When you call a 'task', the processor sets aside some memory (that
you've already defines as the 'task queue'), and places that task in a
list of available tasks. Sub Main() is another task, one which is
running all the time.

Basically, what you want to do is start your RS-232 task using
CallTask() at the beginning of Main(). After that call, you can have
main do whatever you want; call a sub, sleep for a while, wait for
some user input, or even start more tasks. You're free to do whatever
you want to do.

The tasks that you start most often use a Do-Loop so they never end.
They just run along doing their own thing, while the rest of the
application is free to do what it wishes.

Obviously, the more tasks you have running, the slower things get, but
you don't have to worry about that just yet.

A few details to bear in mind:
Each task requires a certain amount of memory to perform its'
function(s). Determining the proper amount is usually by trial and
error; start high and work your way down. If you application freezes,
or doesn't function they way you think it should, you may need to
increase the task queue size. The actual amount of memory required is
dependent on what the task is doing, which system calls it uses, and
how much space it needs for local variables.

Speaking of variables, tasks cannot have parameters like a regular
subroutine. If you need to get data from one task to another, or from
Main(0 (or another sub) to a task (or vice versa), you'll have to
either use global variables (bad idea) or an inter-task communication
queue to do it.

The global method is easy, just declare a variable outside of any
subroutine, meaning before or after the Sub()/End Sub statements.
That makes the variable visible to all of the tasks and subs in that
module.

The other method, which is more difficult, be better programming
practice, is to use a queue, like the task stack queue or a com port
input/output queue. The advantage with this method is that you that
you run less risk of more than one task modifying a variable at the
same time (causes major headaches). You send a byte or two to the
queue, the task removes it and does what it needs to do with it, then
places it perhaps in a global output only variable or another queue.
The idea being that you don't want to have more than one task or
subroutine writing to a variable. Particularly important with
multitasking environments where all of these things happen at the same
time (not really, but functionally yes) is to keep these sorts of
things isolated from each other.

So, you can run your sub as a sub, or as a task. If you need to do
more than one thing at a time, tasks are the way to go. Any sub can
be a task, so long as it has no parameters, and you define and open a
task stack queue for it's memory requirements. Sub Main() is a task
is itself and has a task queue that is defined by the processor, so
you don't have to worry about that one.

Just for reference, I'm working on an application now that has 6 or so
tasks, and although complicated, it works quite well. Netmedia states
that the BasicX platform can run many simultaneous tasks (something
like a thousand) but I would imagine that the loop time is very slow.

Hope that clears it up a little for you.

-Don
--- In b...@yahoogroups.com, "David E. Basile" wrote:
>
> I'm using some code from the BX24 site that allows you to send and
receive
> data from the BX24 to PC. It uses CallTask to run a loop that
monitors the
> RS232 port and sends or receives data. My question is after the task is
> running can you jump out of that task loop and run another sub
routine and
> then return to the task or does that halt the task?
>
>
>
> It watches for a command byte and depending on if the byte is a send or
> receive byte the loop will send data. I would like to go a little
farther
> and if for example the command byte is a Z then have it send the PC the
> value from pin 12 and if it's Y send the value from pin 11. In my
tests the
> loop continued to work just using GetPin but once I put in a For -
Next loop
> it seemed like the task quit running. I'm not sure it was halting
but my
> first command was to turn on the on board LED and when just using
GetPin or
> GetADC the LED would go on. When I added the for - next loop the
LED would
> go on and then off and I didn't put code in to turn the LED off.
>
>
>
> Removing the CallTask and just running the code in a Do Loop it
seemed to
> work fine no matter what.
>
>
>
> Thanks in advance,
>
> David
>
> [Non-text portions of this message have been removed]
>



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: CallTask question - "David E. Basile" - Mar 6 9:50:56 2008

Don,

That is some GREAT information. Never had to a need to do any multitasking
and to be honest I always felt it was way above my head but your explanation
makes it very clear and makes it sound quite simple. I'm sure I'll hit a
stumbling block along the way but this explains a lot and gives me some
troubleshooting tips if I should have problems before I come to the list for
help.

Thanks again.

David

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
Don Kirby
Sent: Tuesday, March 04, 2008 10:40 PM
To: b...@yahoogroups.com
Subject: [BasicX] Re: CallTask question

The CallTask() method of running a subroutine work much the same way
as a regular Call(). The major difference is that when you use
CallTask(), the sub that you are calling doesn't actually run. Not
immediately anyway.

You've stumbled upon one of the great features of the BasicX platform,
multitasking.

When you call a 'task', the processor sets aside some memory (that
you've already defines as the 'task queue'), and places that task in a
list of available tasks. Sub Main() is another task, one which is
running all the time.

Basically, what you want to do is start your RS-232 task using
CallTask() at the beginning of Main(). After that call, you can have
main do whatever you want; call a sub, sleep for a while, wait for
some user input, or even start more tasks. You're free to do whatever
you want to do.

The tasks that you start most often use a Do-Loop so they never end.
They just run along doing their own thing, while the rest of the
application is free to do what it wishes.

Obviously, the more tasks you have running, the slower things get, but
you don't have to worry about that just yet.

A few details to bear in mind:
Each task requires a certain amount of memory to perform its'
function(s). Determining the proper amount is usually by trial and
error; start high and work your way down. If you application freezes,
or doesn't function they way you think it should, you may need to
increase the task queue size. The actual amount of memory required is
dependent on what the task is doing, which system calls it uses, and
how much space it needs for local variables.

Speaking of variables, tasks cannot have parameters like a regular
subroutine. If you need to get data from one task to another, or from
Main(0 (or another sub) to a task (or vice versa), you'll have to
either use global variables (bad idea) or an inter-task communication
queue to do it.

The global method is easy, just declare a variable outside of any
subroutine, meaning before or after the Sub()/End Sub statements.
That makes the variable visible to all of the tasks and subs in that
module.

The other method, which is more difficult, be better programming
practice, is to use a queue, like the task stack queue or a com port
input/output queue. The advantage with this method is that you that
you run less risk of more than one task modifying a variable at the
same time (causes major headaches). You send a byte or two to the
queue, the task removes it and does what it needs to do with it, then
places it perhaps in a global output only variable or another queue.
The idea being that you don't want to have more than one task or
subroutine writing to a variable. Particularly important with
multitasking environments where all of these things happen at the same
time (not really, but functionally yes) is to keep these sorts of
things isolated from each other.

So, you can run your sub as a sub, or as a task. If you need to do
more than one thing at a time, tasks are the way to go. Any sub can
be a task, so long as it has no parameters, and you define and open a
task stack queue for it's memory requirements. Sub Main() is a task
is itself and has a task queue that is defined by the processor, so
you don't have to worry about that one.

Just for reference, I'm working on an application now that has 6 or so
tasks, and although complicated, it works quite well. Netmedia states
that the BasicX platform can run many simultaneous tasks (something
like a thousand) but I would imagine that the loop time is very slow.

Hope that clears it up a little for you.

-Don

--- In basicx@yahoogroups. com, "David E.
Basile" wrote:
>
> I'm using some code from the BX24 site that allows you to send and
receive
> data from the BX24 to PC. It uses CallTask to run a loop that
monitors the
> RS232 port and sends or receives data. My question is after the task is
> running can you jump out of that task loop and run another sub
routine and
> then return to the task or does that halt the task?
>
> It watches for a command byte and depending on if the byte is a send or
> receive byte the loop will send data. I would like to go a little
farther
> and if for example the command byte is a Z then have it send the PC the
> value from pin 12 and if it's Y send the value from pin 11. In my
tests the
> loop continued to work just using GetPin but once I put in a For -
Next loop
> it seemed like the task quit running. I'm not sure it was halting
but my
> first command was to turn on the on board LED and when just using
GetPin or
> GetADC the LED would go on. When I added the for - next loop the
LED would
> go on and then off and I didn't put code in to turn the LED off.
>
> Removing the CallTask and just running the code in a Do Loop it
seemed to
> work fine no matter what.
>
> Thanks in advance,
>
> David
>
> [Non-text portions of this message have been removed]
>

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: Voltage Divider - "David E. Basile" - Mar 9 10:52:20 2008

Tom,

As you might have seen from my other message I'm trying to implement the
temperature controller now. I have the two 4.7K resistors for my voltage
divider. This might be a case of "the man with two tempertures will never
know the correct temperature but the man with one will". The controller has
a LCD readout and right now it is 58 degrees. The ADC pin reads 378. So
378 * 0.244=92.232 and 92.232-30 = 62.232 which makes it off by about 4
degrees.

Am I calculating this correctly or is it possible the resolution on the
controller display may be greater. I'm "assuming" the display is correct
and I would say it is because I have a DS1820 sitting right by the
controller sensor and it is reading 58.10 while the controller display is at
58.

Thanks again,
David

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
Tom Becker
Sent: Tuesday, March 04, 2008 4:42 PM
To: b...@yahoogroups.com
Subject: [BasicX] Re: Voltage Divider

> ... [from 0-10v] can I use two 47k resistors or any two same size
resistors...

I'm surprised this hasn't been answered; anyone breathing here?

Yes, two identical resistors in series between a low-impedance sensor
output and ground will show half the sensor voltage at the midpoint;
from a 0-10v sensor, you should see a 0-5v voltage that represents the
temperature over the 250F (-30F to +220F) sensor range.

If you measure that scaled voltage with a 10-bit, 5v ADC, the
resolution will be (250/1024) ~= 0.244 degreeF/bit. +30F should
appear as an ADC count, therefore, of ((+30-(-30) * 0.244) ~= 15.

If you want greater resolution, an opamp can provide both gain and
offset; you could, for example, configure a +20F to +60F range over
the ADC 5v range with an opamp and a few precision resistors or
adjustable pots to achieve a resolution of (40/1024) ~= 0.039 degreeF/bit.

If the signal has some noise on it (most do, without effort), you can
also use some simple signal processing to advantage; 100 averaged
samples will gain you an additional decimal digit of resolution, or
~0.0244 degreeF/bit, for example, if the noise is random (most isn't,
but is close enough to be useful).

Tom

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: Flow Meter - "David E. Basile" - Mar 9 17:14:48 2008

Tom,

To be honest I didn't realize I was changing the subject line but must have
been if you noticed it but I'm thought I started a new message thread for
"BX24 to PC - Extra character" and didn't re-use the current "Flow Meter"
thread. As for the the code problem with getting extra characters, Don
Kinzer emailed me and told me I was sending the string to the queue
incorrectly. I should have been using PutQueueStr instead of just PutQueue.
He also sent me the code for that sub routine but after going back and
looking at the BasicX library I noticed there was a PutQueueStr routine and
never thought that was the problem until Don told me about it but it has
fixed the problem. He told me "In BasicX, the first byte of a String data
type gives the number of characters in the string - in this case 5. The
second byte is always &HFF (except for fixed-length strings) and the third
and subsequent bytes are the characters of the string itself."

Sorry for the confusion with the ADC, 1-Wire, and LCD. I was just trying to
lend as much information as possible and as I understand it... I didn't do a
very good job. The code I started with, to clear things up was BX24toPC.zip
from the BasicX site. It shows how to send and receive bytes to and from
the PC to BX. I changed it to send text which is where my problem started.
For this project I always try to get it working on the BX, verify the data
and then work on sending it to the PC. Sending individual bytes worked fine
with the code but when I decided to just send a text string is where I ran
into the problem. I only made reference to the 1-Wire code just incase there
was some connection to the problem (which I know now there wasn't) but
mentioned the LCD because the original 1-Wire code has some LCD positioning
codes and just wanted everyone to know... I had removed those before
attempting to use it.

Now everything is working fine. The strings are being transfered from the
BX to the PC using PutQueueStr and I "now" realize if I had sent my code
someone would have probably spotted that right off. The only other issue
I'm having is referenced in my message about the Voltage Divider which
should still be on subject to the original question.

Sorry for the confusion Tom. Didn't mean to do it intentionally.

David

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
Tom Becker
Sent: Sunday, March 09, 2008 2:53 PM
To: b...@yahoogroups.com
Subject: [BasicX] Re: Flow Meter

David, I'm losing you. I am brain-dead today, I admit, but your
communication practices make helping more difficult.

Within this thread, Flow Meter, for example, you've changed the
subject line three times, embedding problems within problems.
Changing the subject line in Yahoo Groups does not start a new subject
thread and makes it very difficult to follow one concern. Yahoo does
not sort these things for you; you must reply to each thread within
that thread, not just change the subject line to the name of another
thread. Use separate threads for each issue.

You refer to "the code from the BasicX site". This Yahoo group Files
section contains many years of code contributions - and the Comm
section is the largest, I think. Be specific or, better, show the
code to which you refer, concisely.

I asked that you show us how you transmit the problem string in
BasicX. You described it, I guess, but in essay form that also
contain ADC, 1-wire, COM1 and LCD mentions. Show your pertinent code;
we can read BasicX - often better than English. If necessary, build a
small example that we can reproduce; that exercise alone will often
expose the cause.

My suggestion is that you back up and focus on one problem at a time.
Strip your code of everything but the comm issue; fix that by
initially using a string constant - not converted and scaled data from
an interfaced instrument, then incorporate the instrument data and,
perhaps, address resolution and accuracy.

Tom

[Non-text portions of this message have been removed]



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Voltage Divider - Tom Becker - Mar 9 17:37:24 2008

> ... right now it is 58 degrees. [] 62.232 [] makes it off by about
4 degrees.

A four-degree error over a range of 250 degrees is ~1.6% error, well
within the probable tolerance of your resistive voltage divider if you
are using 5% parts. I'll bet you can easily trim it with a small pot
between the two resistors to calibrate it; a 500ohm pot between two
4700ohm resistors will provide about +/- 2.5% trimming.

You can also do the equivalent in code by multiplying the calculated
temperature by a factor of your determination, perhaps (1.0-0.016)~=
0.984 for those particular resistors at that temperature.
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

Re: Flow Meter - Tom Becker - Mar 11 9:47:55 2008

David, I'm losing you. I am brain-dead today, I admit, but your
communication practices make helping more difficult.

Within this thread, Flow Meter, for example, you've changed the
subject line three times, embedding problems within problems.
Changing the subject line in Yahoo Groups does not start a new subject
thread and makes it very difficult to follow one concern. Yahoo does
not sort these things for you; you must reply to each thread within
that thread, not just change the subject line to the name of another
thread. Use separate threads for each issue.

You refer to "the code from the BasicX site". This Yahoo group Files
section contains many years of code contributions - and the Comm
section is the largest, I think. Be specific or, better, show the
code to which you refer, concisely.

I asked that you show us how you transmit the problem string in
BasicX. You described it, I guess, but in essay form that also
contain ADC, 1-wire, COM1 and LCD mentions. Show your pertinent code;
we can read BasicX - often better than English. If necessary, build a
small example that we can reproduce; that exercise alone will often
expose the cause.

My suggestion is that you back up and focus on one problem at a time.
Strip your code of everything but the comm issue; fix that by
initially using a string constant - not converted and scaled data from
an interfaced instrument, then incorporate the instrument data and,
perhaps, address resolution and accuracy.
Tom



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )

RE: Re: Voltage Divider - "David E. Basile" - Mar 15 21:18:38 2008

Thanks Tom. I'm going to pick up a few precision resistors and use a pot to
get it close which should be fine for my purposes.

David

_____

From: b...@yahoogroups.com [mailto:b...@yahoogroups.com] On Behalf Of
Tom Becker
Sent: Sunday, March 09, 2008 5:35 PM
To: b...@yahoogroups.com
Subject: [BasicX] Re: Voltage Divider

> ... right now it is 58 degrees. [] 62.232 [] makes it off by about
4 degrees.

A four-degree error over a range of 250 degrees is ~1.6% error, well
within the probable tolerance of your resistive voltage divider if you
are using 5% parts. I'll bet you can easily trim it with a small pot
between the two resistors to calibrate it; a 500ohm pot between two
4700ohm resistors will provide about +/- 2.5% trimming.

You can also do the equivalent in code by multiplying the calculated
temperature by a factor of your determination, perhaps (1.0-0.016)~=
0.984 for those particular resistors at that temperature.

Tom

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )