Skip to main content
extra info
Source Link
Martin Foot
  • 826
  • 6
  • 14

You have several options, each has advantages and disadvantages:

  • You can connect each of your wires directly to a parallel port if your PC has one as these typically use TTL logic levels. Note that it's a good idea to use ribbon cables or some tape / elastic bands as lots of wires here can be a pain.
  • You can send data over a Serial port fairly easily with any AVR or programmable chip. These typically have serial libraries in C that you can use that can read the output from your dice and write it to the serial port in the form of an ascii symbol. Note that serial RS-232 serial uses different logic levels to your 74 series circuits (rather than 0v and 5v they use somewhere between -3 and -25v for logic 1 and 3v and 25v for logic 0. You need to specify the baud rate of transmission in both your transmitter and your receiving software. Assuming you have a power supply capable of negative voltages you can use something like a MAX232 to convert the levels for you nice and easily.
  • There's several commercial systems that make this easier if you don't have access to output to serial manually. For instance the Arduino doesn't need any of that, it has it's own FTDI chip and can send serial data straight over USB which you can read via a virtual serial port on any modern computer. It's a bit more expensive than doing it manually (AVRs are very cheap) but very simple to do, they provide a C-like library to program them and you do everything over USB. There's even a programs that show you how to use serial. You would simply read the the logic values from your dice, convert them to a number and write them to serial.
  • There's some very expensive options such as using infra-red (if you have a receiver) or bluetooth (very expensive, and requires an AVR or similar device to use it).

For reading data on the other side, there's some nice libraries such as PySerial which allow you to read serial data in Python, or you can do it directly from C/C++ on Linux as there's usually a serial port defined as /dev/ttyS* (/dev/ttyUSB* in the case of Arduino's virtual serial ports). The GNU screen program allows two way communication with any device as well, and in Windows MATLAB also has the ability to read in serial data, and I'm sure it's possible in other languages - I've just never tried it.

If you're not too experienced with the systems I'd recommend the Arduino. It has many more uses than the fairly simple circuit you're after and might be a little overkill, but you can do a lot of awesome things with it and it's an all in one solution that doesn't require any extras.

Edit: The serial port options I described all allow data to be sent both ways very easily, you should note that you'll need to add some extra circuitry to your dice circuit in order to use this with a parallel port.

You have several options, each has advantages and disadvantages:

  • You can connect each of your wires directly to a parallel port if your PC has one as these typically use TTL logic levels. Note that it's a good idea to use ribbon cables or some tape / elastic bands as lots of wires here can be a pain.
  • You can send data over a Serial port fairly easily with any AVR or programmable chip. These typically have serial libraries in C that you can use that can read the output from your dice and write it to the serial port in the form of an ascii symbol. Note that serial RS-232 serial uses different logic levels to your 74 series circuits (rather than 0v and 5v they use somewhere between -3 and -25v for logic 1 and 3v and 25v for logic 0. You need to specify the baud rate of transmission in both your transmitter and your receiving software. Assuming you have a power supply capable of negative voltages you can use something like a MAX232 to convert the levels for you nice and easily.
  • There's several commercial systems that make this easier if you don't have access to output to serial manually. For instance the Arduino doesn't need any of that, it has it's own FTDI chip and can send serial data straight over USB which you can read via a virtual serial port on any modern computer. It's a bit more expensive than doing it manually (AVRs are very cheap) but very simple to do, they provide a C-like library to program them and you do everything over USB. There's even a programs that show you how to use serial. You would simply read the the logic values from your dice, convert them to a number and write them to serial.
  • There's some very expensive options such as using infra-red (if you have a receiver) or bluetooth (very expensive, and requires an AVR or similar device to use it).

For reading data on the other side, there's some nice libraries such as PySerial which allow you to read serial data in Python, or you can do it directly from C/C++ on Linux as there's usually a serial port defined as /dev/ttyS* (/dev/ttyUSB* in the case of Arduino's virtual serial ports). MATLAB also has the ability to read in serial data, and I'm sure it's possible in other languages - I've just never tried it.

If you're not too experienced with the systems I'd recommend the Arduino. It has many more uses than the fairly simple circuit you're after and might be a little overkill, but you can do a lot of awesome things with it and it's an all in one solution that doesn't require any extras.

You have several options, each has advantages and disadvantages:

  • You can connect each of your wires directly to a parallel port if your PC has one as these typically use TTL logic levels. Note that it's a good idea to use ribbon cables or some tape / elastic bands as lots of wires here can be a pain.
  • You can send data over a Serial port fairly easily with any AVR or programmable chip. These typically have serial libraries in C that you can use that can read the output from your dice and write it to the serial port in the form of an ascii symbol. Note that serial RS-232 serial uses different logic levels to your 74 series circuits (rather than 0v and 5v they use somewhere between -3 and -25v for logic 1 and 3v and 25v for logic 0. You need to specify the baud rate of transmission in both your transmitter and your receiving software. Assuming you have a power supply capable of negative voltages you can use something like a MAX232 to convert the levels for you nice and easily.
  • There's several commercial systems that make this easier if you don't have access to output to serial manually. For instance the Arduino doesn't need any of that, it has it's own FTDI chip and can send serial data straight over USB which you can read via a virtual serial port on any modern computer. It's a bit more expensive than doing it manually (AVRs are very cheap) but very simple to do, they provide a C-like library to program them and you do everything over USB. There's even a programs that show you how to use serial. You would simply read the the logic values from your dice, convert them to a number and write them to serial.
  • There's some very expensive options such as using infra-red (if you have a receiver) or bluetooth (very expensive, and requires an AVR or similar device to use it).

For reading data on the other side, there's some nice libraries such as PySerial which allow you to read serial data in Python, or you can do it directly from C/C++ on Linux as there's usually a serial port defined as /dev/ttyS* (/dev/ttyUSB* in the case of Arduino's virtual serial ports). The GNU screen program allows two way communication with any device as well, and in Windows MATLAB also has the ability to read in serial data, and I'm sure it's possible in other languages - I've just never tried it.

If you're not too experienced with the systems I'd recommend the Arduino. It has many more uses than the fairly simple circuit you're after and might be a little overkill, but you can do a lot of awesome things with it and it's an all in one solution that doesn't require any extras.

Edit: The serial port options I described all allow data to be sent both ways very easily, you should note that you'll need to add some extra circuitry to your dice circuit in order to use this with a parallel port.

Source Link
Martin Foot
  • 826
  • 6
  • 14

You have several options, each has advantages and disadvantages:

  • You can connect each of your wires directly to a parallel port if your PC has one as these typically use TTL logic levels. Note that it's a good idea to use ribbon cables or some tape / elastic bands as lots of wires here can be a pain.
  • You can send data over a Serial port fairly easily with any AVR or programmable chip. These typically have serial libraries in C that you can use that can read the output from your dice and write it to the serial port in the form of an ascii symbol. Note that serial RS-232 serial uses different logic levels to your 74 series circuits (rather than 0v and 5v they use somewhere between -3 and -25v for logic 1 and 3v and 25v for logic 0. You need to specify the baud rate of transmission in both your transmitter and your receiving software. Assuming you have a power supply capable of negative voltages you can use something like a MAX232 to convert the levels for you nice and easily.
  • There's several commercial systems that make this easier if you don't have access to output to serial manually. For instance the Arduino doesn't need any of that, it has it's own FTDI chip and can send serial data straight over USB which you can read via a virtual serial port on any modern computer. It's a bit more expensive than doing it manually (AVRs are very cheap) but very simple to do, they provide a C-like library to program them and you do everything over USB. There's even a programs that show you how to use serial. You would simply read the the logic values from your dice, convert them to a number and write them to serial.
  • There's some very expensive options such as using infra-red (if you have a receiver) or bluetooth (very expensive, and requires an AVR or similar device to use it).

For reading data on the other side, there's some nice libraries such as PySerial which allow you to read serial data in Python, or you can do it directly from C/C++ on Linux as there's usually a serial port defined as /dev/ttyS* (/dev/ttyUSB* in the case of Arduino's virtual serial ports). MATLAB also has the ability to read in serial data, and I'm sure it's possible in other languages - I've just never tried it.

If you're not too experienced with the systems I'd recommend the Arduino. It has many more uses than the fairly simple circuit you're after and might be a little overkill, but you can do a lot of awesome things with it and it's an all in one solution that doesn't require any extras.