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

See Also

DSPFPGAElectronics

Discussion Groups | BasicX | voltage sensor


Advertise Here

Discussion forum for the BasicX family of microcontroller chips.

voltage sensor - Author Unknown - Sep 15 16:24:00 2000

Hi,

I am trying to make a voltage sensor for the bx24
it has to be able to read up to 72 volts i am totally stumped so if anyone has any ideas please send them to me
thanks

kevin



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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


Re: voltage sensor - Tony Brenke - Sep 15 18:06:00 2000

could you start off with a pre-scaler read that with a a/d converter.
as you read it if the reading is not close to full scale (5v I guess)
the set the prescaler down one knotch and read again. for instance start with a voltage divider of 15 to 1. full scale
reading of 4.8v at 72 volts.

if the reading is near 3.4v (50) then switch to pre-scaler of 10 to 1
and read again. 10-1 would give reading of 5v
--- wrote:
> -------------------------- eGroups Sponsor
>
> Hi,
>
> I am trying to make a voltage sensor for the bx24
> it has to be able to read up to 72 volts > i am totally stumped so if anyone has any ideas please send them to
> me
> thanks
>
> kevin
__________________________________________________
/">http://mail.yahoo.com/





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

Re: voltage sensor - Schatzie Walton - Sep 16 8:03:00 2000

The easiest way is to use a voltage divider and a single supply opamp.

The voltage divider consists of a 1 meg resistor and a 50K
resistors in series. One end of the 50K goes to ground. The junction
of the two resistors going to a the "+" opamp (via another 1 meg
resistor). Bypass the "+" terminal with a 0.01 ceramic cap to ground.
The "-" input of the OPAMP is connected to the output. For 100V in,
the output of the divider should be about 4.76V.

The OPAMP is there for isolation. You don't want to fry your BX24's
ADCs with an inadvertent application of more than 5V. You can limit
the output of the op amp with a zener diode. OPAMPS are cheap,BX24's
aren't.
--- In , kj62@y... wrote:
> Hi,
>
> I am trying to make a voltage sensor for the bx24
> it has to be able to read up to 72 volts > i am totally stumped so if anyone has any ideas please send them to
me
> thanks
>
> kevin





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

Re: voltage sensor - Author Unknown - Sep 20 2:12:00 2000

I have a similar circuit that could well do with some protection,

Could you explain 'Bypass the + Terminal' - Maybe an ASCII diagram
would be good.

I take it that the 0.01 ceramic Cap is 0.01uf.

Thanks.

Ken

--- In , "Schatzie Walton" <jdwalton@h...> wrote:
> The easiest way is to use a voltage divider and a single supply
opamp.
>
> The voltage divider consists of a 1 meg resistor and a 50K
> resistors in series. One end of the 50K goes to ground. The
junction
> of the two resistors going to a the "+" opamp (via another 1 meg
> resistor). Bypass the "+" terminal with a 0.01 ceramic cap to
ground.
> The "-" input of the OPAMP is connected to the output. For 100V in,
> the output of the divider should be about 4.76V.
>
> The OPAMP is there for isolation. You don't want to fry your BX24's
> ADCs with an inadvertent application of more than 5V. You can
limit
> the output of the op amp with a zener diode. OPAMPS are
cheap,BX24's
> aren't. >
> --- In , kj62@y... wrote:
> > Hi,
> >
> > I am trying to make a voltage sensor for the bx24
> > it has to be able to read up to 72 volts
> >
> >
> > i am totally stumped so if anyone has any ideas please send them
to
> me
> > thanks
> >
> > kevin





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

0->255 - Paul J. Csonka - Sep 20 21:34:00 2000

Good evening,

Is there a way to store ADC values directly to a 0 to 255 range?
Here 255 would be 5V of course.

I would like to avoid dealing with large integer values for one
program. A byte would be quite nice instead.

Thank you for your time,
Paul



______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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

Re: 0->255 - Author Unknown - Sep 21 15:55:00 2000

Divide the output of GetADC() by 4? Ex.

byte bVal

bVal = CByte( GetADC(13) \ 4 )

This would actually get you a maximum of 256. You could simply
subtract 1 from GetADC to get a max of 255 (I think the division will
always truncate).

If that doesn't work, convert the getADC output to a single and divide
by 4.0157. Use CByte to convert the result to a byte.
On Wed, 20 Sep 2000 19:34:11 -0700 (PDT), you wrote:
>
>Good evening,
>
> Is there a way to store ADC values directly to a 0 to 255 range?
>Here 255 would be 5V of course.
>
> I would like to avoid dealing with large integer values for one
>program. A byte would be quite nice instead.
>
> Thank you for your time,
>Paul
**************************************
Do not taunt Happy Fun Ball.




______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


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

Re: 0->255 - Paul J. Csonka - Sep 22 0:41:00 2000

Hello Mikey,

Thanks, this is what one would clearly do. I had thought there was a
newer ADC function which stores directly to a byte. That would be more
desireable, as I wouldn't have to take precious program time to convert.
Perhaps I was thinking of ADC to Com which is relatively new...

Thank you for your help,
Paul On Thu, 21 Sep 2000 wrote: > Divide the output of GetADC() by 4? Ex.
>
> byte bVal
>
> bVal = CByte( GetADC(13) \ 4 )
>
> This would actually get you a maximum of 256. You could simply
> subtract 1 from GetADC to get a max of 255 (I think the division will
> always truncate).
>
> If that doesn't work, convert the getADC output to a single and divide
> by 4.0157. Use CByte to convert the result to a byte. >
> On Wed, 20 Sep 2000 19:34:11 -0700 (PDT), you wrote:
> >
> >Good evening,
> >
> > Is there a way to store ADC values directly to a 0 to 255 range?
> >Here 255 would be 5V of course.
> >
> > I would like to avoid dealing with large integer values for one
> >program. A byte would be quite nice instead.
> >
> > Thank you for your time,
> >Paul
> >
> >
> >
> >
> >
>
> **************************************
> Do not taunt Happy Fun Ball.





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

Re: 0->255 - Author Unknown - Sep 22 17:07:00 2000

I don't think I'd worry too much about the time needed to do the
arithmetic compared to the time needed to do the ADC, although I'm
unsure of how long the divide by 4 operation would take.

If this is a concern, you could just shift the ADC result right two
places to effectively get a divide by 4 (assuming you can shift
integer values right on the bx-24 -- I haven't actually checked). This
should be pretty speedy. On Thu, 21 Sep 2000 22:41:23 -0700 (PDT), you wrote: >Hello Mikey,
>
> Thanks, this is what one would clearly do. I had thought there was a
>newer ADC function which stores directly to a byte. That would be more
>desireable, as I wouldn't have to take precious program time to convert.
> Perhaps I was thinking of ADC to Com which is relatively new...
>
> Thank you for your help,
>Paul >On Thu, 21 Sep 2000 wrote:
>
>>
>> Divide the output of GetADC() by 4? Ex.
>>
>> byte bVal
>>
>> bVal = CByte( GetADC(13) \ 4 )
>>
>> This would actually get you a maximum of 256. You could simply
>> subtract 1 from GetADC to get a max of 255 (I think the division will
>> always truncate).
>>
>> If that doesn't work, convert the getADC output to a single and divide
>> by 4.0157. Use CByte to convert the result to a byte.
>>
>>
>>
>> On Wed, 20 Sep 2000 19:34:11 -0700 (PDT), you wrote:
>> >
>> >Good evening,
>> >
>> > Is there a way to store ADC values directly to a 0 to 255 range?
>> >Here 255 would be 5V of course.
>> >
>> > I would like to avoid dealing with large integer values for one
>> >program. A byte would be quite nice instead.
>> >
>> > Thank you for your time,
>> >Paul
>> >
>> >
>> >
>> >
>> >
>>
>> **************************************
>> Do not taunt Happy Fun Ball.
>>
>>
> **************************************
Do not taunt Happy Fun Ball.





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