Is there any way to connect a sensor that outputs pulses in a PC system? For instance, it can be connected via raspi via the GPIOs. Is there another and most robust way to get the input to a PC?
-
\$\begingroup\$ What do you need to do with these pulses? Are you measuring timing? How wide are the pulses? Voltage levels? \$\endgroup\$– Ron BeyerJan 23, 2020 at 15:02
-
1\$\begingroup\$ Avoid asking "Can I..." because for sure this is possible for someone who can deal with PC hardware and software. We don't know your skill levels so maybe for you it isn't possible without studying PC IO programming. PCs aren't that suitable anymore for connecting a sensor directly. Even on your PC's motherboard there will be a chip between the (temperature, voltage) sensors and the CPU. There exist IO cards for PCs which come with a driver and perhaps examples to use the data in a program (for example Matlab). \$\endgroup\$– BimpelrekkieJan 23, 2020 at 15:08
-
\$\begingroup\$ @Bimpelrekkie You're probably thinking of Labview? I haven't seen dedicated I/O cards for Matlab... \$\endgroup\$– Ron BeyerJan 23, 2020 at 15:18
-
\$\begingroup\$ We need to know more about these pulses. Width, frequency, voltage. There are a number of options. \$\endgroup\$– evildemonicJan 23, 2020 at 15:18
-
1\$\begingroup\$ You could do a lot worse than "read pulses on the Pi and send over a network to the PC" \$\endgroup\$– pjc50Jan 23, 2020 at 15:54
2 Answers
Why not connect an Arduino to the input signal. Receive it and transmit the information to the PC via serial Port?
Present your actual requirement of the pulse width, timing requirment, and frequency. Suitable solution can be found. I will update my answer accordingly.
You can use printer (LPT) port. It contains some input lines: ACK (pin 10), BSY (pin 11), PE (pin 12), SEL (pin 13), ERR (pin 15). These inputs are LS-TTL, and groun is on pins 18...25.
Or, alternatively, you can use some input lines of serial port (COM): CD (pin 1), DSR (pin 6), CTS (pin 8), RI (pin 9). These inputs are more safe and tolerant, the electrical "0" level is typically -12V...0V, and "1" level is 3.5V...12V. Ground on pin 5.
In both cases you can read the input lines state by software.
-
2\$\begingroup\$ Of course, this is only true on systems that still have them - and their ability to handle narrow pulses under a modern operating system is not great. \$\endgroup\$– pjc50Jan 23, 2020 at 15:53
-
\$\begingroup\$ Of course, but it is still possible ;) Not too easy - I agree - but possible. \$\endgroup\$ Jan 23, 2020 at 15:55