Pages: [1]   Go Down
Author Topic: do i need to use a schmitt trigger here?  (Read 1815 times)
0 Members and 1 Guest are viewing this topic.
ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 993
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i'm reading a signal that will take any of several values in the 0-3.3v range and i've used up all my analog inputs. 

i'd be satisfied to know when the signal goes to 3.3 so in principle i could just hook it up and hope for the best but i seem to recall that giving the avr's sloppy inputs on digital pins is not a good idea.  should i use a schmitt trigger gate to clean up the signal?  any suggestions on a commonly available part?

i already have an lm358 type op-amp in the signal path so if there is a way to use that or something like it that would be great.

i've googled til i'm blue in the face but i can't tell if i'm overthinking this or what common practice would be.
Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not enough information for the answer.

What kind of asignal you are expecting? High frequency or something between 0 to 100hz, what? And when it should be triggered, if signal is anything between 0 to 3.3V, is 0.01V enough?

What? Where? How often? It's friday! That cool!

Cheers,
Kari

Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 993
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks, sorry for the imprecision.  the input signal is a cyclic stairstep series of values changing maybe 200 hz e.g 0v, 1v, 2.06v, 3.15v then back to 0 and repeating.  because i know the sequence i can accept any trigger point as long as i know which it is.  now that i look at it the 0v is probably the solidest signal.

first question: is it in fact a bad idea to just feed this to a digital pin?
Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

Offline Offline
Jr. Member
**
Karma: 0
Posts: 89
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
If you need only know if the signal is over one level (3  volts for example),of course yo can use one S.Trigger.One very affordable is SN74LS13 and you can use a pot. in the input for make some adjust
 just in case
Logged

Montreal
Offline Offline
Faraday Member
**
Karma: 30
Posts: 2602
Per aspera ad astra.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can put lm358 in comparator mode, with output attached to arduino digital input (directly if OP
powered with +5V), apply input signal on one input and connect second one to the pot. In this case, varying pot "set" point you will change "trigger" level.
 
Logged

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 993
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok good, i must have some 74ls.. chips around.

i also will try this op-amp circuit with like 5:1 amplification and see if that keeps everything except the 0's safely in high territory:


@magician - thanks, the circuit above must be like using a pot.
« Last Edit: March 25, 2011, 10:25:39 am by bill2009 » Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

0
Offline Offline
Shannon Member
****
Karma: 214
Posts: 12424
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From your description it sounds like the 1->0 transistion can only happen at one place in your waveform, so use that as a trigger.  The AVR input pins have some hysteresis if I remember correctly so that should help (unless too much noise).


Another approach is using analog multiplexing to free-up some analog input pins.
Logged

[ I won't respond to messages, use the forum please ]

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 129
Posts: 8589
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use a proper comparator you won't need any resistors because you can compare against the 3v3 supply.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Shannon Member
****
Karma: 214
Posts: 12424
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If you use a proper comparator you won't need any resistors because you can compare against the 3v3 supply.

But the levels listed above are all below 3.3V...
Logged

[ I won't respond to messages, use the forum please ]

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 993
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If you use a proper comparator you won't need any resistors because you can compare against the 3v3 supply.

my supply is 5v.  the 3v is just the highest voltage in the circuit i'm examining.
Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 993
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
From your description it sounds like the 1->0 transistion can only happen at one place in your waveform, so use that as a trigger.  The AVR input pins have some hysteresis if I remember correctly so that should help (unless too much noise).

if the op-amp circuit works i'll be hoping to push that 1v up to as close to vcc as it will go so yes, i'll trigger there.
Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 993
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
if the op-amp circuit works i'll be hoping to push that 1v up to as close to vcc as it will go so yes, i'll trigger there.

very nice - with a 2k and 10k resistor the op-amp circuit pulls everything except the 0v just about up to +V. 

now back to the software drawing board.
Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great.

Where is that signal coming from?

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

ottawa, canada
Offline Offline
God Member
*****
Karma: 6
Posts: 993
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Where is that signal coming from?
it's one of the inputs to a multiplexed LCD from a clock.  They use these stairstep waveforms that gyrate around each other to control the voltages across the individual segments.  There are 4 backplanes and 8 segment signals all changing every 5ms.  I only need one of the backplanes to synchronize with since they are predictable and repetitive. One of the digits (the leading "1") is only ever wholly on or off so i'm using this trick to catch one backplane and that leading segment.  That leaves me 6 analog pins to get the 3 other digits at 2 per digit.

it's a crazy way to tell the time but i'm enjoying playing with it and, hey - I've learned that the avr adc's are quite low impedance and how to use an op-amp comparator!

There's some pictures of the clock here http://arduino.cc/forum/index.php/topic,51464.0.html

« Last Edit: March 26, 2011, 03:12:49 pm by bill2009 » Logged

Bill Rowe
Olduino - An Arduino for the First of Us
www.olduino.wordpress.com

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok!
 smiley

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Pages: [1]   Go Up
Jump to: