analog to ttl

If your 'analog' is already going from 0 to 5 volts its already 'digital'.

--
Luhan Monat: luhanis(at)yahoo(dot)com
http://members.cox.net/berniekm
"Any sufficiently advanced magick is
indistinguishable from technology."
Reply to
Luhan Monat
Loading thread data ...

I would use a Schmitt trigger if you want a good clean digital output. Maybe a 74HC14. These are cheap.

You need to give the IC +5 volts and ground. Connect your analog signal to the input of one section (there are 6 total) and the output of the first section to the input of the second section. The output of the second section will be your digital signal. Connect unused inputs (4 of them) to ground.

The switching point will be somewhere around +2 to +2.5 volts. It will be slightly different for positive-going vs. negative-going signals.

Sorry I can't draw internet schematics or pictorials. Electronics texts and data sheets will give the pin connections.

Reply to
Clive Tobin

Might be. At exactly at what input voltage do you want the TTL output to change from low to high. Then, at exactly what input voltage do you want the output to transition back from high to low?

Reply to
John Popelish

What you need is a one bit analog to digital converter. These are otherwise known as comparators. One that would probably serve your purposes would be something like an LM393.

formatting link

It has two inputs and an open collector output. You connect a resistor, say, 10k ohms from the output to +5 volts to produce a 5 volt output swing. Any time the + input is more positive than the - input, the output turns off, allowing the resistor to pull the voltage up to +5. Any time the + input is more negative than the - input, the output transistor turns on, pulling the voltage down to very close to the negative supply voltage (zero volts, in this case).

You can connect a potentiometer or voltage divider between the +5 volt supply and ground to set the decision voltage. If you connect that voltage to the - input and your analog voltage to the + input, you can set the input level that swings the output. Switch the + and - inputs if you want the output to swing low when the input is high.

Reply to
John Popelish

hello i have an analog 0-5v i wish to change to a digital (ttl) 0-5v. I assume it is as simple as hooking up a transistor. am i right...

Reply to
dimention11

I will want this to switch from approx 2v to on(5v) if this can be adjusted it would be even better.

Reply to
dimention11

I wish it to switch at 2v from 0v to 5v approx

I dont want no 1v to 4.5v just 0v or 5v (within reason). just because it is operating on 5v does not mean it is digital...

Reply to
dimention11

Philips data gives Vthr +ve going as ~ 2.4V and Vthr -ve going as 1.4V. I.e.

1V of hysteresis.

formatting link

Maybe too much ? In which case an LM311 does the trick. Or LM393 / 339 if dual or quad needed. The OP will have to learn how to configure hysteresis though.

Graham

Reply to
Pooh Bear

--
Try this: (View in a non-proportional font like Courier)

+5V>-------+---------+--------+
           |         |        | 
           |         |      [1k]
           |         |        |  
           |     +---|-[100K]-+ 
           |     |   |        |
VIN>--[1K]-------+--|+\\       |
           |        |  >------+-->VOUT
         [10k]-------+-----+---+----------->GND


Adjust the switching voltage with the 10k pot and be sure to ground
the inputs and the output of the other comparator.
Reply to
John Fields

Others have given a lot of replies. There are a whole series of 'questions' that vary the answer. The first (already mentioned) is the switching 'point'. However there are two values here. The 'on' point', and the 'off' point. A degree of hysteresis is normally needed to avoid instability. On a comparator, this is achieved by a small amount of positive feedback applied around the comparator. Schmitt trigger gates have this type of behaviour built in. However there is also the question of speed (if the required switching rates are high, it may well alter the solution), 'direction' (whether you want/mind the output being inverted, so a high level gives a logic '0', and a low level a logic '1'), what load the digital output needs to drive etc.. A very 'cheap' solution for certain of these combinations, is the TL431 voltage regulator IC!. This is a three terminal IC, whose output pin is pulled 'low', when it's reference input rises above 2.495 (typical) volts. Connect the reference input to your analog signal, and the output to +5v, via a resistor, and this gives an inverting output, which otherwise just about meets your specification, and is small, and cheap. It might be a solution.

Best Wishes

Reply to
Roger Hamlett

--
What are you talking about? 

And please bottom post. It makes it much easier to follow a
discussion.
Reply to
John Fields

Probably the one I've marked with the '*'s.

I've also crossposted this to sci.electronics.basics, because others could benefit from the discussion so far, and it kinda belongs there anyway. :-)

Incidentally, John - I noticed your hysteresis feedback, and I concur, albeit one might have to do some calculations to get a specific amount. To my techie eye, it looks like about 1%, which is definitely enough to keep it from osculating[sic]. ;-)

Cheers! Rich

Reply to
Rich Grise

looks good but omit the connection from vin- to ground.

Reply to
Mook Johnson

You might be. If the "analog" value switches between 0 and 5V, you could 'almost' do a direct connection. For a true TTL input I might use 100 ohms in series with the 'analog' and the TTL.

Perhaps the best (and more expensive) way to do this is with a comparator, where you can decide between inverting and non-inverting, and adjust the voltage where it switches between 0 and 1. If noise is a problem that you want to reduce or eliminate in the TTL input, you can set up positive feedback in the comparator to create hysteresis (it may switch to 1 when the voltages goes over 3V and to 0 when the voltage goes below 1V).

-----

formatting link

Reply to
Ben Bradley

Hi guys thanks for all the help. after looking a bit more closely at my system. i discovered some extra specifications i will need.

when system is low output voltage must be 0v or as close as I can get it. this is very important...

at the moment i think i will go with John fields idea using a lm311

---------------------------------------------------------------

+5V>-------+---------+--------+ | | | | | [1k] | | | | +---|-[100K]-+ | | | | VIN>--[1K]-------+--|+\\ | | | >------+-->VOUT [10k]-------+-----+---+----------->GND

Adjust the switching voltage with the 10k pot and be sure to ground the inputs and the output of the other comparator.

--------------------------------------------------------------------

do i need -vin tied to ground seems like this could draw a lot of current with some settings of the 10kpot...

Reply to
dimention11

--
Geez, I completely missed that! Thanks. :-)
Reply to
John Fields

There should be a high value resistor from the - input of the LM311 to grund ( say 100k ) not a link.

Graham

Reply to
Pooh Bear

--
No, that\'s an error. Sorry about that. It should look like this:

+5V>-------+---------+--------+
           |         |        |
           |         |      [1k]
           |         |        |
           |     +---|-[100K]-+
           |     |   |        |
VIN>--[1K]-------+--|+\\       |
           |        |  >------+-->VOUT
         [10k]-------+---------+----------->GND

Also, if you want the output _very_ close to ground you could raise
the value of the pullup resistor in order to decrease the collector
current in the comparator\'s output transistor.  What are you planning
on driving with the comparator.
Reply to
John Fields

[snip circuit]

I'd say, if you want it that hard on and hard off, and _FAST_, I'd put some kind of HCMOS buffer after the comparator. The thing with a naked comparator is that when the open-collector turns off, the rise time is dictated by your pullup resistor and the capacitance of the laser's input. With a (an?) HCMOS buffer, it'll go within millivolts of the rails within nanoseconds. HCMOS is kewl! ;-)

Good Luck! Rich

Reply to
Rich Grise

this is for driving the ttl modulation for a laser driver, when input is low laser is on when high it is off

at the moment it does not switch to full power for some patterns (laser graffix/display/show system). i want it to be either on(full power) or off, and not have a variable power.

on the laser driver I can switch (invert) so 5v is on and 0v is off. so i will have a look at inverting the signal and using an inverting comarator to see if this gives me more power when on.

Reply to
dimention11

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.