Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added docs/images/hardware/rs485adapter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/hardware/solenoid_scm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/hardware/switch_matrix_wire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 25 additions & 5 deletions docs/ppuc_hardware/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,20 @@ Use a paired cable (like speaker cable). Recommendation for wire cross section i
![solenoid wiring](../images/hardware/solenoid_wire.png)

### Direct LED
To connect a LED (including rectifier, current limiting resistor and capacitor) you can use a mid power output that closes the circuit to ground (same is true for drivers of the matrix boards wich could also be used). Therefore the LED must be supplied with a voltage of typically 6.3 V but 5 V will do as well with slightly reduced brightness. You could also use a high power output. In that case connect it like a solenoid and don't forget to adjust the PWM in the config file for correct voltage.
To connect a LED (including rectifier, current limiting resistor and capacitor) you can use a mid power output that closes the circuit to ground (same is true for drivers of the matrix boards wich could also be used). Therefore the LED must be supplied with a voltage of typically 6.3 V but 5 V will do as well with slightly reduced brightness.

Recommendation for wire cross section is 0.25 mm². You can roughly estimate a maximum current of 20 mA per LED.

<a id="section_pwm_and_leds"></a>
#### PWM and LEDs
You could also use a high power output and connect them like solenoids (with adjusted PWM value in the config file). In that case usually (depending on your voltage) an additional filter circuit is necessary. Unfiltered LEDs may burn if operated with a pulse current bigger than double the rated current. So be careful if you want reduce the voltage more than a factor of two. Many LEDs have a built in filter (they are called "flicker free" or likewise). Unfortunately no technical data is available, so you have to find out yourself. For example, the filtered LEDs I used were good at a factor of 4 (25 % PWM at 24 V) but burnt at a factor of 8 (12.5 % PWM at 48 V).

![direct led schematic](../images/hardware/direct_led_scm.png)

![direct led wiring](../images/hardware/direct_led_wire.png)

### LED Matrix
A LED matrix can only be controlled by the Out_8x10 board. Like in the switch matrix every LED must have a diode in series. The LEDs are connected to the high-side and low-side switches of the Out_8x10 board. Be aware that you need a high supply voltage (20 V) for the matrix as the LEDs are only on for a short time.
A LED matrix can only be controlled by the Out_8x10 board. Like in the switch matrix every LED must have a diode in series. The LEDs are connected to the high-side and low-side switches of the Out_8x10 board. Be aware that you need a high supply voltage (20 V) for the matrix as the LEDs are only on for a short time. Also be aware that the LEDs must have a filter (usually a resistor and capacitor) inside (called "flicker free" or likewise). See also chapter [PWM and LEDs](#section_pwm_and_leds).

Recommendation for wire cross section is 0.25 mm². You can roughly estimate a maximum current of 20 mA per LED.

Expand All @@ -148,10 +152,10 @@ Recommendation for wire cross section is 0.25 mm². You can roughly estimate a m
![led matrix wiring](../images/hardware/led_matrix_wire.png)

### LED Flasher
Flashers are connected like direct LEDs. Use a mid power output or connect them like solenoids (with adjusted PWM value in the config file).
Flashers are connected like direct LEDs. Use a mid power output or connect them like solenoids (with adjusted PWM value in the config file). See also chapter [PWM and LEDs](#section_pwm_and_leds).

### General Illumination (GI)
The GI (consisting of several LEDs in parallel) are usually connected like solenoids (with adjusted PWM value in the config file). But you can also use a mid power output (likewise the direct LEDs).
The GI can be connected like direkt LEDs (consisting of several LEDs in parallel). Use mid power outputs or high power outputs. When using higher voltages with PWM make sure you also read chapter [PWM and LEDs](#section_pwm_and_leds).

### Controlled LED Strip
Controlled LED strips (e.g. with WS2812B LEDs) are daisy chained LEDs that can be individually controlled. To archive that each LED has a chip inside. Power supply is 5 V and the single data line is connected to a special terminal (#25).
Expand Down Expand Up @@ -198,12 +202,28 @@ The bus connection shall be made in a line topology (one board to the next) usin
* IO_16_8_1: set JP2 for termination. Set JP1 and JP3 for biasing.
* IO_16x8_matrix, Opto_16, Out_8x10: set JP1 for termination (no biasing possible)

Use only exactly one bias network on the bus (no matter where). Terminate the bus at the geometrical start and at the geometrical end (not in between) and never add more than these two terminations.
Use only exactly one bias network on the bus (no matter where). Terminate the bus at the start (usually an adapter connected to the PC or Raspberry Pi) and at the end (the last board in line). Don't terminate in between and never add more than these two terminations.

![bus termination and bias](../images/hardware/bus_term_bias.png)

If you use a shielded cable you can connect the shield to the terminal called SHD. Shielding is not mandatory but twisted pair cable is recommended.

## RS485 Adapters
To connect the bus to a PC or Raspberry Pi, usually an adapter from USB to RS485 is used.

![USB to RS485 adapter](../images/hardware/rs485adapter.jpg)

These adapters come with different chips to to the job, which can be a source of issues. Additionally the chips can be configured by the operating system regarding the timing and buffers. In many applications this configuration is set for a minimum load for the operating system. In our use case it should be set to perform a rather quick response (small buffers, low latency timing).

Here is an example of the an FTDI chip FT232B: it won't work because of the latency timing. This is set to 16 ms per default. When changed to 2 ms it works with PPUC.
In Linux the setting can be changed in this device-file:
/sys/bus/usb-serial/devices/ttyUSB0/latency_timer
Just change the number from 16 to 2 with an text editor.

Another example: with the chip ch341 no changes are needed.

If you have more examples please let us know or write it down here.


## Thoughts on Power Supply
It can kill you! Be aware that you work with deadly voltages, especially on the primary side. If you don't know exactly what you are doing, leave it and ask for help on this part. I repeat: it can kill you, no joke!
Expand Down
13 changes: 7 additions & 6 deletions docs/ppuc_hardware/io_16_8_1.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# IO_16_8_1
This is the hardware for a standard IO card which was designed for the PPUC pinball project, but can be useful in other applications as well.
It is designed for being low cost and functional for experimental use.
Not everything is tested nor does it fulfill EMC or any other specifications.
It is designed for being low cost and functional for experimental use.
Not everything is tested nor does it fulfill EMC or any other specifications.
Use at your own risk!
To make use of anything of this project a basic understanding of electronics and programming is necessary. Nothing of it is "plug and play". I'm surely not liable for any damage to assemblies, pinball machines or even persons.

## Picture of the Board
![PCB Pic](https://github.com/PPUC/Hardware_IO_16_8_1/raw/main/IO_16_8_1/PCB_V010_TH.jpg)

## Name
[IO_16_8_1](https://github.com/PPUC/Hardware_IO_16_8_1/) as it has 16 inputs, 8 outputs and one special output.
[IO_16_8_1](https://github.com/PPUC/Hardware_IO_16_8_1/) as it has 16 inputs, 8 outputs and one special output.
Actually the inputs can also be used as outputs (see later in this document).

## Power Supply
Expand Down Expand Up @@ -39,8 +39,9 @@ The inputs In_2 and In_3 are designed for higher speed (100 kHz). The Pull-Up ca

The input terminals can also be "miss"used for a switch matrix. To do that (no matter if used as coloum or row) the input resistor (330 Ohm) must be short cut (or replaced by a zero Ohm type). Background: the 330 Ohm resistor protects the circuit if the terminal is used as an output and accidently a short cut is done at the terminal. Unfortunately the low voltage value gets too high when used in a switch matrix (diode voltage plus voltage drop due to added up currents through the resistor). This happens when more switches are closed at the same time. Instead you could also use the specially designed PCB "Hardware_IO_16x8_matrix" for your switch matrix.

The inputs In_13 to In_16 have an additional open drain output transistor that allows higher currents in case of being used as an output (up to 3 A at 25 °C ambient temperature). The outputs are internally pulled up by a 10k resistor to 5 V. A higher voltage (max. 30 V) can be applied externally but be sure to have your hardware and software! setup correctly as no protection for damage is provided in that case. Please be aware that the default state (before software takes over control) is "on".
If used as input In_13 to In_16 feature a memory (similar to a relay self-holding function). If the input has ever seen a low signal (e.g. switch closed to GND) it will stay that way until it gets an active high signal from the RP2040 (make the corresponding pin an output with signal "high" and then make it an input again). If this behavior is not wanted you can lift pin 3 of Q13 to Q16, then you have an input/output like e.g. terminal 1 with static behavior but no additional output power.
The inputs In_13 to In_16 have an additional open drain output transistor that allows higher currents in case of being used as an output (up to 3 A at 25 °C ambient temperature). The outputs are internally pulled up by a 10k resistor to 5 V. A higher voltage (max. 30 V) can be applied externally but be sure to have your hardware and software! setup correctly as no protection for damage is provided in that case. Please be aware that the default state (before software takes over control) is "on".
If used as input In_13 to In_16 feature a memory (similar to a relay self-holding function). If the input has ever seen a low signal (e.g. switch closed to GND) it will stay that way until it gets an active high signal from the RP2040 (make the corresponding pin an output with signal "high" and then make it an input again). If this behavior is not wanted you can lift pin 3 of Q13 to Q16, then you have an input/output like e.g. terminal 1 with static behavior but no additional output power.
Why not keep it simple and make all inputs the same? To give the choice to use the terminals as outputs (mid-power) as in pinball use case, there are often too many inputs and a lack on outputs. Therefore an output transistor to 4 of the I/O pins were added to be able to switch more power. As an side effect if this terminal is configured as an input it has this memory or self-holding characteristic (once triggered stays triggered). This can be dealt with by software, so that it actually acts like a normal input. In the end you have the benefit of mid-power-output but the drawback that the software getting more complex for the use case of a "normal" input. If you use the PPUC software and you have configured the terminal as an input, it acts like a normal input and you don't have to care about it.

## High Power Outputs
There are 8 high power outputs available. Usually they are connected to pinball solenoids or flashers. A recovery diode for the solenoids is placed on the pcb, so no need for diodes at the coils. The outputs are open drain and drive currents up to 20 A with a load connected to a voltage of up to 60 V. Be aware that the current is limited by the fuse F2. It will blow within about 1 s at 20 A. You might use a 10 A fuse if necessary.
Expand All @@ -54,6 +55,6 @@ One special output is available for high speed signals. The voltage is 5 V, it i
* Connect only one Flipper to a pcb if possible. The advantage is, that all the energy of the big capacitor is available for the flipper, which is usually the solenoid with the highest current. If you have more flipper fingers than PCBs then spread the flipper solenoids as even as possible across the PCBs (e.g. if you have 6 flipper fingers it's better to connect 2 per board instead of all 6 at one board).
* Wire related switches and solenoids for fast flip devices (e.g. flipper, bumper, sling, kick back) to the same pcb. Then you can archive the shortest possible time lag between activating the switch and firing the solenoid.
* RS485 termination: short JP2 at the end of the RS485 bus. There should also be a 120 Ohm resistor at the beginning of the bus (e.g. USB to RS485 adapter).
* RS485 biasing: short JP1 and JP3 exactly once at any point of the RS485 bus. Only do this if no resistors are installed on the USB to RS485 adapter.
* RS485 biasing: short JP1 and JP3 exactly once at any point of the RS485 bus. Only do this if no bias resistors are installed on the USB to RS485 adapter.
* It's recommended to use flipper coils for higher voltage (like 40 - 50 V) as they draw less current. Since Version 1.1.1 low resistance coils (designed for 24 V) should work as well. You should also change the fuse F2 to 10 A for that application.
* If the MOSFETs on the high power outputs are not available (or you want to use the big player brands) here are some alternatives (I haven't tested any of them, but they should work according to their specification): GL40N10A4 (seems to be the same as NCE0140KA), RD3P200SNFRA, NVD6824NL, IPD90N10S4L-06, LSGG10R085W3