-1

I'm trying to gain external control of a laser, which takes a TTL input. I want to use my Pi as this input, and I'm wondering how exactly I can do that. Does it have something to do with the serial ports, like the UART TX pin?

I don't know if the TTL input actually requires 5V or if anything up to 5V is fine: my manual says "Provide TTL signals (0 to +5 Vdc, 10-20μsec wide pulses)." My supervisor didn't seem to think we'd need a transistor.

benchump
  • 1
  • 1

2 Answers2

0

"TTL" is called that because electronic digital logic circuits are composed of groupings of transistors. When you are asked to provide a TTL signal, it just means a digital signal (ie., one which transmits information/control by varying between two states). This is exactly what the GPIOs do, albeit at 3.3V. TTL doesn't necessarily mean 5V although historically that is the most common.

If the signal is specified as 5V that is what you need. You can accomplish via a logic level shifter, of which there are many explanations here and elsewhere online. It is really quite simple, just never forget a common ground is required and don't connect anything until the meaning of that (also quite simple) is clear in your mind.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
0

You can try it and see if your supervisor is correct. Look at the laser data sheet it should show you exactly what the input requirements are. Watch the minimum and maximum input voltage values. It may work but leave you with very little overhead making it susceptible to noise. Look at the Texas Instruments SN74LV1T34 Buffer Logic Level Shifter, It is designed to do what you want. It is a SMD device which may place it out of reach for you. You could possibly use a 74LS14 or similar part with two sections in series (they invert) to translate your signal.

Reason it will probably work: The typical minimum input HIGH voltage (VIH) for TTL is 2 V, or any voltage that is at least => 2 V will be read in as a logic 1 (HIGH) by a TTL device. You will also notice that there is range of about 0.7 V between the output of one device and the input of another. This is sometimes referred to as noise margin. These numbers are approximations and may vary by part and manufacturer. Check the data sheet to be sure.

Gil
  • 1,228
  • 4
  • 5