FreshRSS

Normální zobrazení

Jsou dostupné nové články, klikněte pro obnovení stránky.
PředevčíremHlavní kanál

How to properly connect a bidirectional data line to Raspberry Pi 5 GPIO? [Project details & documentation inside]

How to properly connect a bidirectional data line to Raspberry Pi 5 GPIO? [Project details & documentation inside]

I am new to the Pi community and my head is spinning from learning all about GPIO pins, voltages, and communication protocols. Though it has been fun learning all these new concepts.

I am struggling to properly connect a bidirectional data wire from an external machine [coin hopper] to my Raspberry Pi 5. When I use my Pi to send a request to the hopper, I get no response. I'm not sure if I am setting up this data wire correctly, so I would love insights from the community.

High-level Project Details and Objective

  • My project is an automated coin identifier & sorter. I am using a Raspberry Pi 5

https://preview.redd.it/haj0u0tc6cfd1.png?width=720&format=png&auto=webp&s=32dbe2ed85517b33461accfd85448970b0f9e0d8

  • Here is a video of the most recent project prototype [coin hopper has not been added to the system yet]
  • Have the Pi be able to transmit data to & receive data from a coin hopper
  • I am using Python
  • The coin hopper uses the ccTalk & UART serial interface protocol
  • Avoid frying my coin hopper and Pi
  • I am using a 16-gauge solid core copper wire [insulated] for the power supply and data wire

Details

I am trying to connect a Coin Hopper [Money Controls SCH 2 model] to my Pi 5. The SCH2 uses a 10-pin Moxel connection scheme and uses a bi-directional serial data line.

SCH2 Coin Hopper

10-pin Molex Serial Connector

Pin Configurations

SCH2 Online Manual/Documentation

SCH2 uses the serial interface ccTalk & UART protocol**. ccTalk** is a very old protocol which makes sense as the coin hopper was produced in 2005.

From Manual

From ccTalk Wikipedia page: https://en.wikipedia.org/wiki/CcTalk

The coin hopper is powered by a 24v power supply. Below is what the power supply looks like

Power Supply from Amazon: https://www.amazon.com/dp/B07VL8W6MQ

I am using a female terminal connector adapter to connect the 24v wire and ground wire from the coin hopper directly to the power supply. [Pins 4 & 6 on the hopper]

https://preview.redd.it/izfz20md3cfd1.jpg?width=4372&format=pjpg&auto=webp&s=687b11ebcf7062054fd895d12df19754a5cdc2fa

https://preview.redd.it/1k3y8y0e3cfd1.jpg?width=3046&format=pjpg&auto=webp&s=2eb38827f83b1dac8fa4daa5cddf2508fa943ee4

I read that since the coin hopper uses 24v, it could damage the Pi 5 as the Pi operates at 3.3v logic level. Even though the only connection from the coin hopper to the Pi is with the bi-directional data line. As such, I am using a 3.3V/5V to 3.6V/24V 4 Channel Voltage Converter Optocoupler board. The board is NOT bi-directional.

Voltage Converter from Amazon: https://www.amazon.com/dp/B07WFGTNQC

To better communicate with the Pi's GPIO, I am using this GPIO expansion board

GPIO Extenstion board from Amazon: https://www.amazon.com/dp/B08GKQMC72

This GPIO expansion board has a TXD and RXD port.

My current understanding

  • Pi5 GPIO structure does not allow for bi-directional data communication. As such I need to use my GPIO extension board which has a TXD [Transmit] and RXD [Receive] port. I can not connect the coin hopper's bi-directional data wire solely to the TXD or RXD port and expect bi-directional communication
  • Since the coin hopper operates at 24v, I assume it uses 24v logic level. As such, a voltage converter is needed. Though, I am unsure why as I would think a data wire is not powering anything, just sending data and thus very low voltage.
  • The ground wire from the coin hopper [Pin 6] should connect to the ground socket on the power supply female terminal.

Outstanding Questions

  • What do I need to consider to connect the coin hopper's bi-directional data wire to the Pi? Am I missing a key part/board?
  • Do I need to use the UART serial protocol? Is there a better alternative that will still work with the coin hopper?
  • Do I need a GPIO extension board? If so, is my current extension board appropriate?
  • Do I need a voltage converter board? If so, is my current converter board appropriate? Do I need to get a bi-directional converter board? [My current one is not bi-directional]
  • Should the ground wire from the coin hopper [Pin 6] connect to the ground socket on the power supply? Or should the ground wire from the coin hopper [Pin 6] connect to the ground socket on the GPIO extension board on the Pi?
  • Does it matter if my wires are solid or stranded copper?

This has been a confusing journey but I'm excited to get the coin hopper up and running. The idea is to automate my coin sorter so that I don't have to place a coin manually each time. The Pi will communicate with the hopper to queue up the next coin after a coin has gone through the sorter.

Edit: Clarification on what I have already done and tested

I have already attached the GPIO extension board and voltage convertor to the Pi

https://preview.redd.it/3u7k8y2k6efd1.png?width=683&format=png&auto=webp&s=ea358c61f93acddc69b68d87ebc58500697ff65d

https://preview.redd.it/fdisgigl6efd1.png?width=696&format=png&auto=webp&s=a9c7b61604c49e8ad1bb1fa509d80a99762537f1

On the voltage convertor there, on the left side in the picture, are ports indicating Input & Ground. On the right side is Voltage Output and Ground. I connected a 22-gauge wire from IN1 [Input 1] to the GPIO extension board [TXD]. I also connected the wire from the input ground port to the ground port on the GPIO extension board [next to the TXD port.

https://preview.redd.it/dy69vjm97efd1.png?width=553&format=png&auto=webp&s=bb9449eba777f728aecaba64adcf4a36a7fba5ff

https://preview.redd.it/2rz3oeb87efd1.png?width=562&format=png&auto=webp&s=25535bcc934c1d3d1997ea7dcf63a04a594c91c7

For the connection with the coin hopper, I connected the data cable wire from the hopper to V1 and a ground wire from the hopper in G.

https://preview.redd.it/xufskpgl7efd1.png?width=567&format=png&auto=webp&s=4f3ec1c81607a318c7a90118811a757ca8461233

I am trying to send a command from the Pi through to the GPIO extension board. That data then goes through the extension board to the data cable wire to the coin hopper.

However, the coin hopper does not send a response back confirming communication.

Below is what I have done to troubleshoot:

  • Testing Communication Protocols:
    • Verified ccTalk protocol uses UART for serial communication.
    • Ensured the correct baud rate (9600 8N1) for ccTalk messages.
    • Enabled the Pi serial port and confirmed the correct serial is online and avaliable
  • Software and Library Installations:
    • Installed and configured pyserial for serial communication.
submitted by /u/SomeGuyInDeutschland to r/RASPBERRY_PI_PROJECTS
[link] [comments]

How to properly connect a bidirectional data line to Raspberry Pi 5 GPIO? [Project details & documentation inside]

How to properly connect a bidirectional data line to Raspberry Pi 5 GPIO? [Project details & documentation inside]

I am new to the Pi community and my head is spinning from learning all about GPIO pins, voltages, and communication protocols. Though it has been fun learning all these new concepts.

I am struggling to properly connect a bidirectional data wire from an external machine [coin hopper] to my Raspberry Pi 5. When I use my Pi to send a request to the hopper, I get no response. I'm not sure if I am setting up this data wire correctly, so I would love insights from the community.

High-level Project Details and Objective

  • My project is an automated coin identifier & sorter. I am using a Raspberry Pi 5

https://preview.redd.it/haj0u0tc6cfd1.png?width=720&format=png&auto=webp&s=32dbe2ed85517b33461accfd85448970b0f9e0d8

  • Here is a video of the most recent project prototype [coin hopper has not been added to the system yet]
  • Have the Pi be able to transmit data to & receive data from a coin hopper
  • I am using Python
  • The coin hopper uses the ccTalk & UART serial interface protocol
  • Avoid frying my coin hopper and Pi
  • I am using a 16-gauge solid core copper wire [insulated] for the power supply and data wire

Details

I am trying to connect a Coin Hopper [Money Controls SCH 2 model] to my Pi 5. The SCH2 uses a 10-pin Moxel connection scheme and uses a bi-directional serial data line.

SCH2 Coin Hopper

10-pin Molex Serial Connector

Pin Configurations

SCH2 Online Manual/Documentation

SCH2 uses the serial interface ccTalk & UART protocol**. ccTalk** is a very old protocol which makes sense as the coin hopper was produced in 2005.

From Manual

From ccTalk Wikipedia page: https://en.wikipedia.org/wiki/CcTalk

The coin hopper is powered by a 24v power supply. Below is what the power supply looks like

Power Supply from Amazon: https://www.amazon.com/dp/B07VL8W6MQ

I am using a female terminal connector adapter to connect the 24v wire and ground wire from the coin hopper directly to the power supply. [Pins 4 & 6 on the hopper]

https://preview.redd.it/izfz20md3cfd1.jpg?width=4372&format=pjpg&auto=webp&s=687b11ebcf7062054fd895d12df19754a5cdc2fa

https://preview.redd.it/1k3y8y0e3cfd1.jpg?width=3046&format=pjpg&auto=webp&s=2eb38827f83b1dac8fa4daa5cddf2508fa943ee4

I read that since the coin hopper uses 24v, it could damage the Pi 5 as the Pi operates at 3.3v logic level. Even though the only connection from the coin hopper to the Pi is with the bi-directional data line. As such, I am using a 3.3V/5V to 3.6V/24V 4 Channel Voltage Converter Optocoupler board. The board is NOT bi-directional.

Voltage Converter from Amazon: https://www.amazon.com/dp/B07WFGTNQC

To better communicate with the Pi's GPIO, I am using this GPIO expansion board

GPIO Extenstion board from Amazon: https://www.amazon.com/dp/B08GKQMC72

This GPIO expansion board has a TXD and RXD port.

My current understanding

  • Pi5 GPIO structure does not allow for bi-directional data communication. As such I need to use my GPIO extension board which has a TXD [Transmit] and RXD [Receive] port. I can not connect the coin hopper's bi-directional data wire solely to the TXD or RXD port and expect bi-directional communication
  • Since the coin hopper operates at 24v, I assume it uses 24v logic level. As such, a voltage converter is needed. Though, I am unsure why as I would think a data wire is not powering anything, just sending data and thus very low voltage.
  • The ground wire from the coin hopper [Pin 6] should connect to the ground socket on the power supply female terminal.

Outstanding Questions

  • What do I need to consider to connect the coin hopper's bi-directional data wire to the Pi? Am I missing a key part/board?
  • Do I need to use the UART serial protocol? Is there a better alternative that will still work with the coin hopper?
  • Do I need a GPIO extension board? If so, is my current extension board appropriate?
  • Do I need a voltage converter board? If so, is my current converter board appropriate? Do I need to get a bi-directional converter board? [My current one is not bi-directional]
  • Should the ground wire from the coin hopper [Pin 6] connect to the ground socket on the power supply? Or should the ground wire from the coin hopper [Pin 6] connect to the ground socket on the GPIO extension board on the Pi?
  • Does it matter if my wires are solid or stranded copper?

This has been a confusing journey but I'm excited to get the coin hopper up and running. The idea is to automate my coin sorter so that I don't have to place a coin manually each time. The Pi will communicate with the hopper to queue up the next coin after a coin has gone through the sorter.

Edit: Clarification on what I have already done and tested

I have already attached the GPIO extension board and voltage convertor to the Pi

https://preview.redd.it/3u7k8y2k6efd1.png?width=683&format=png&auto=webp&s=ea358c61f93acddc69b68d87ebc58500697ff65d

https://preview.redd.it/fdisgigl6efd1.png?width=696&format=png&auto=webp&s=a9c7b61604c49e8ad1bb1fa509d80a99762537f1

On the voltage convertor there, on the left side in the picture, are ports indicating Input & Ground. On the right side is Voltage Output and Ground. I connected a 22-gauge wire from IN1 [Input 1] to the GPIO extension board [TXD]. I also connected the wire from the input ground port to the ground port on the GPIO extension board [next to the TXD port.

https://preview.redd.it/dy69vjm97efd1.png?width=553&format=png&auto=webp&s=bb9449eba777f728aecaba64adcf4a36a7fba5ff

https://preview.redd.it/2rz3oeb87efd1.png?width=562&format=png&auto=webp&s=25535bcc934c1d3d1997ea7dcf63a04a594c91c7

For the connection with the coin hopper, I connected the data cable wire from the hopper to V1 and a ground wire from the hopper in G.

https://preview.redd.it/xufskpgl7efd1.png?width=567&format=png&auto=webp&s=4f3ec1c81607a318c7a90118811a757ca8461233

I am trying to send a command from the Pi through to the GPIO extension board. That data then goes through the extension board to the data cable wire to the coin hopper.

However, the coin hopper does not send a response back confirming communication.

Below is what I have done to troubleshoot:

  • Testing Communication Protocols:
    • Verified ccTalk protocol uses UART for serial communication.
    • Ensured the correct baud rate (9600 8N1) for ccTalk messages.
    • Enabled the Pi serial port and confirmed the correct serial is online and avaliable
  • Software and Library Installations:
    • Installed and configured pyserial for serial communication.
submitted by /u/SomeGuyInDeutschland to r/RASPBERRY_PI_PROJECTS
[link] [comments]
❌
❌