Silicon ChipUSB to PS/2 Keyboard & Mouse Adaptors - January 2025 SILICON CHIP
  1. Contents
  2. Publisher's Letter: Two new series for the magazine
  3. Feature: The Fox Report by Barry Fox
  4. Feature: Net Work by Alan Winstanley
  5. Feature: Max’s Cool Beans by Max the Magnificent
  6. Project: High-quality Microphone Preamplifier by Phil Prosser
  7. Feature: The History of Electronics, part one by Dr David Maddison
  8. Feature: Circuit Surgery by Ian Bell
  9. Feature: Techno Talk by Max the Magnificent
  10. Feature: The Quason VL6180X laser rangefinder module by Jim Rowe
  11. Project: USB to PS/2 Keyboard & Mouse Adaptors by Tim Blythman
  12. Project: Raspberry Pi-based Clock Radio, part two by Stefan Keller-Tuberg
  13. Subscriptions
  14. Feature: Precision Electronics, part one by Andrew Levido
  15. Project: Secure Remote Mains Switch, part two by John Clarke
  16. PartShop
  17. Market Centre
  18. Advertising Index
  19. Back Issues

This is only a preview of the January 2025 issue of Practical Electronics.

You can view 0 of the 80 pages in the full issue.

Articles in this series:
  • The Fox Report (July 2024)
  • The Fox Report (September 2024)
  • The Fox Report (October 2024)
  • The Fox Report (November 2024)
  • The Fox Report (December 2024)
  • The Fox Report (January 2025)
  • The Fox Report (February 2025)
  • The Fox Report (March 2025)
  • The Fox Report (April 2025)
  • The Fox Report (May 2025)
Articles in this series:
  • Win a Microchip Explorer 8 Development Kit (April 2024)
  • Net Work (May 2024)
  • Net Work (June 2024)
  • Net Work (July 2024)
  • Net Work (August 2024)
  • Net Work (September 2024)
  • Net Work (October 2024)
  • Net Work (November 2024)
  • Net Work (December 2024)
  • Net Work (January 2025)
  • Net Work (February 2025)
  • Net Work (March 2025)
  • Net Work (April 2025)
Articles in this series:
  • Max’s Cool Beans (January 2025)
  • Max’s Cool Beans (February 2025)
  • Max’s Cool Beans (March 2025)
  • Max’s Cool Beans (April 2025)
  • Max’s Cool Beans (May 2025)
  • Max’s Cool Beans (June 2025)
Articles in this series:
  • The History of Electronics, Pt1 (October 2023)
  • The History of Electronics, Pt2 (November 2023)
  • The History of Electronics, Pt3 (December 2023)
  • The History of Electronics, part one (January 2025)
  • The History of Electronics, part two (February 2025)
  • The History of Electronics, part three (March 2025)
  • The History of Electronics, part four (April 2025)
  • The History of Electronics, part five (May 2025)
  • The History of Electronics, part six (June 2025)
Articles in this series:
  • Circuit Surgery (April 2024)
  • STEWART OF READING (April 2024)
  • Circuit Surgery (May 2024)
  • Circuit Surgery (June 2024)
  • Circuit Surgery (July 2024)
  • Circuit Surgery (August 2024)
  • Circuit Surgery (September 2024)
  • Circuit Surgery (October 2024)
  • Circuit Surgery (November 2024)
  • Circuit Surgery (December 2024)
  • Circuit Surgery (January 2025)
  • Circuit Surgery (February 2025)
  • Circuit Surgery (March 2025)
  • Circuit Surgery (April 2025)
  • Circuit Surgery (May 2025)
  • Circuit Surgery (June 2025)
Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
Items relevant to "Raspberry Pi-based Clock Radio, part two":
  • Raspberry Pi Clock Radio main PCB [19101241] (AUD $12.50)
  • Raspberry Pi Clock Radio display PCB [19101242] (AUD $7.50)
  • Software for the Raspberry Pi based Clock Radio (Free)
  • Raspberry Pi Clock Radio PCB patterns (PDF download) [19101241-2] (Free)
Articles in this series:
  • Raspberry Pi Clock Radio, Pt1 (January 2024)
  • Raspberry Pi Clock Radio, Pt2 (February 2024)
  • Raspberry Pi-based Clock Radio, part two (January 2025)
Articles in this series:
  • Precision Electronics, Part 1 (November 2024)
  • Precision Electronics, Part 2 (December 2024)
  • Precision Electronics, part one (January 2025)
  • Precision Electronics, Part 3 (January 2025)
  • Precision Electronics, part two (February 2025)
  • Precision Electronics, Part 4 (February 2025)
  • Precision Electronics, Part 5 (March 2025)
  • Precision Electronics, part three (March 2025)
  • Precision Electronics, part four (April 2025)
  • Precision Electronics, Part 6 (April 2025)
  • Precision Electronics, Part 7: ADCs (May 2025)
  • Precision Electronics, part five (May 2025)
  • Precision Electronics, part six (June 2025)
Items relevant to "Secure Remote Mains Switch, part two":
  • Secure Remote Mains Switch receiver PCB [10109211] (AUD $7.50)
  • Secure Remote Mains Switch transmitter PCB [10109212] (AUD $2.50)
  • PIC16F1459-I/P programmed for the Secure Remote Mains Switch receiver (1010921R.HEX) (Programmed Microcontroller, AUD $10.00)
  • PIC16LF15323-I/SL programmed for the Secure Remote Mains Switch transmitter (1010921A.HEX) (Programmed Microcontroller, AUD $10.00)
  • Firmware and ASM source code for the Secure Remote Mains Switch [1010921A/R] (Software, Free)
  • Secure Remote Mains Switch PCB patterns (PDF download) [10109211/2] (Free)
  • Front panel label and drilling diagrams for the Secure Remote Mains Switch (Panel Artwork, Free)
Articles in this series:
  • Secure Remote Mains Switch, Part 1 (July 2022)
  • Secure Remote Mains Switch, Part 2 (August 2022)
  • Secure Remote Switch, Part 1 (December 2024)
  • Secure Remote Mains Switch, part two (January 2025)
Constructional project U S B ▶ P S / 2 Keyboard Adaptor Numerous devices still use PS/2 keyboards, even though USB keyboards have been around for 20 years. That’s because PS/2 is very easy to interface with a microcontroller, so kit-built computers like the VGA PicoMite include a PS/2 keyboard interface. This Adaptor allows you to connect a USB keyboard to a VGA PicoMite or anything else that needs a PS/2 keyboard. By Tim Blythman W hile it’s still possible to buy PS/2 keyboards, they aren’t as widespread as they used to be. USB keyboards often have better features, and wireless USB keyboards are pretty cheap these days. Wireless PS/2 keyboards exist but are no longer common, making this Adaptor especially useful. We recently came across a nice design that is based on a Raspberry Pi Pico microcontroller module. It allows a USB keyboard and mouse to connect to a computer that expects a PS/2 keyboard and mouse; see https://github. com/No0ne/ps2x2pico The hardware presented there is not much more than a Pico board, a level shifter board and some flying leads. We decided to develop a slight- VGA PicoMite version kit (SC6861, ~ £18) - ps2x2pico version kit (SC6864, ~ £20) Both kits include everything except the Jiffy box and 6-pin mini-DIN to mini-DIN cable. The mounting hardware and optional headers/sockets are present. The Pico is supplied blank and requires programming. 6-pin mini-DIN cable (SC6869, ~ £6): 1.5m long PS/2 cable. Two cables are required if using both the keyboard and mouse. 42 Image Source: https://unsplash.com/photos/ZByWaPXD2fU ly slicker design that would be more robust and easy to use with the VGA PicoMite computer that we published last month. We’re presenting two designs here, with one designed specifically to work with the VGA PicoMite. It should also work fine with any computer system that expects a PS/2 keyboard, including older PCs and boot-to-BASIC computers such as the MaxiMite or Colour MaxiMite. This project was also prompted by enquiries about the USB Keyboard and Mouse Adaptor for Micros (February 2020), asking us to add a PS/2 interface. The PS/2 keyboard protocol “PS/2” refers to the IBM Personal System/2 computer that introduced this interface. The physical side of the PS/2 protocol is quite simple and consists of two lines that are normally pulled up to 5V. The connected devices (eg, keyboard and host computer) can either leave the lines high or pull them down to 0V using a transistor collector/drain. This allows communications in both directions without conflict. The lines are called CLOCK and DATA, and electrically, the protocol is very similar to I2C. Each byte is sent on the DATA line as a start bit (0), eight bits, an odd parity bit, then a high stop bit. The level on the DATA line is much the same as would be seen on an asynchronous serial line using the ‘8O1’ (eight data bits, odd parity, one stop bit) setting. However, there is a CLOCK line, which is specified as operating at 10-16.7kHz, so it is a synchronous protocol. The keyboard always provides the CLOCK signal, and the only time the host controls it is to briefly pulse it low to signal that it wants to send data. When the host sends its data, it depends on the keyboard to drive the clock signal as the host drives the DATA line. Some of the commands the host can send include those to set the lock key LEDs (Caps Lock, Num Lock & Scroll Lock) and to set the ‘typematic’ rate and delay. Typematic is the term for automatic key press repeats when keys are held down. Since USB keyboards do not implement typematic, we need to emulate that feature. The host can also query the keyboard Practical Electronics | January | 2025 USB to PS/2 Adaptors The PCB shown at left fits into the VGA PicoMite case and replaces the PS/2 socket with its USB socket. Six pin headers connect the two PCBs. The construction is a bit fiddly, but the tidy result is worth the effort. The PCB shown at right is the ps2x2pico version and has more features such as a mouse adaptor. Due to its larger size, it needs to be fit into a UB5 Jiffy box, but it can convert a USB keyboard/mouse combo to work with two PS/2 ports and it supports wireless USB devices. about its status and identity. For the most part, though, data is sent from the keyboard to the host when keys are pressed or released. The PS/2 ‘scancodes’ that the keyboard sends do not neatly map to anything like the ASCII codes or the USB scancodes sent by USB keyboards. In fact, PS/2 scancodes correspond to the original physical location of the keys on the keyboard, as adjacent keys often have similar codes. The mapping was clearly chosen to simplify the scanning and encoding of keys by the keyboard, leaving the hard work of decoding the scancodes to software on the host computer. A PS/2 mouse works similarly, although it sends button presses and movement changes instead of scancodes. The host can command it to set parameters like sampling (update) rate and scaling. So, apart from the scancode interpretation that is needed, the PS/2 protocol is fairly simple and is easy enough to implement as it is driven by the keyboard. We can control the clock rate since we are trying to emulate a keyboard. Circuit details As mentioned earlier, the first circuit is specifically designed to work with the VGA PicoMite. A second circuit Practical Electronics | January | 2025 is intended to match the circuit used by No0ne’s ps2x2pico software. PCBs are available for both. Electrically, both are very simple, and most components are present to interface a 3.3V Pico microcontroller board to the 5V levels used by the PS/2 interface. Each circuit has a corresponding PCB; we will describe their differing software and construction later. We think the first version (Fig.1) is the best choice if you want to connect a USB keyboard to a VGA PicoMite. However, if you’re going to interface to an old PC with both PS/2 mouse and keyboard connections, we recommend building the second version. VGA PicoMite version Fig.1 shows the circuit for this version of the Adaptor. It uses a Raspberry Pi Pico microcontroller board (MOD1), a pair of USB connectors (CON1 and CON2), a 6-pin mini-DIN socket (as used for PS/2), CON3, and a few other components. USB sockets CON1 and CON2 are connected in parallel. Those who know USB will realise that both connectors cannot be used simultaneously; they are alternatives, and only one should The Adaptor is a neat install in a VGA Picomite, replacing the PS/2 socket with a USB socket. 43 Constructional project Fig.1: Q1 & Q2 act as voltage level converters connecting the 5V PS/2 bus to the 3.3V Pico. That allows the Pico software to convert signals from a USB keyboard to the PS/2 protocol. CON1 and CON2 give two different mounting locations for the USB socket. be fitted. They are the same socket type (both type A) but are in different locations on the PCB to suit various applications. The data lines from CON1 (or CON2) head via 22W resistors to consecutive pins on MOD1. Although the RP2040 chip on the Pico has native support for USB, some clever people have written a library that uses the Pico’s PIO (programmable input/output) peripheral as a USB controller. The general-­purpose I/O pins do not have internal 22W resistors as required for USB communications, hence our adding them. Two more of the Pico’s pins (carrying the CLOCK and DATA signals) connect to a level-shifting arrangement based on 10kW resistors and Mosfets Q1 and Q2. An identical arrangement is used on the VGA PicoMite to interface the 3.3V Pico to the 5V levels used on the PS/2 bus. This configuration is well-suited to voltage level conversion on open-­ collector busses and is commonly used with I2C interfaces. The resistors pull up the lines on each side to either 3.3V or 5V. The gate is at the same voltage as the source, so the Mosfet’s channel is off, and its body diode is reverse-­ biased due to the 5V rail being higher than the 3.3V rail. If the 3.3V logic line (connected to the Mosfet source) is pulled down, the gate is at a higher voltage than the source and the Mosfet switches on, propagating the low level to the 5V 44 logic side. If the 5V logic line goes low, the source is pulled down via the Mosfet’s body diode, the Mosfet switches on, and the low level is also seen on the 3.3V side. Releasing the low level allows the source to rise until the Mosfet switches off and each side returns to its initial state, with both sides pulled up by their respective resistors. One more pin of the Pico is connected to a 1kW resistor and then to ground via the LED. The latter is a status indicator, with the LED lit by bringing the digital pin high. The 5V pins of all the connectors are tied together so that any connector can supply 5V as needed. Since CON1 (or CON2) is a host USB-A port, it will power a downstream USB device like a keyboard. In normal operation, power will come from CON3, since it will be connected to a PS/2 host. If necessary, power could be provided to the circuit via the Pico’s USB socket. The Pico has an integrated 3.3V regulator, with its output available at the 3V3 OUT pin. In this case, it is only used as a reference voltage for the level-shifting circuitry. The ps2x2pico version Fig.2 shows the second circuit. It has a Pico (MOD1), USB type-A socket (CON1), two 6-pin mini-DIN sockets (CON2 & CON3) and a mini-USB socket (CON4). CON4 only has its power (VBUS & GND) pins connected. The ps2x2pico name has been coined for the software by its creator, No0ne. We are simply using it to identify the version of the hardware that we have developed to work with their software. The eight 10kW resistors and four Mosfets implement four logic level-­ shifting channels identically to the first circuit. The 5V sides of two channels go to CON2 for a PS/2 keyboard, while the other two connect to CON3 for a PS/2 mouse. The 3.3V sides of the level shifters connect to pins on MOD1, while CON1 connects the USB data lines to a pair of pads. These are intended to be connected to a matching pair of pads on the underside of the Pico, and thus the USB D− and D+ lines on its USB controller. Finally, LED1 and its 1kW ballast resistor connect to another of the Pico’s I/O pins. It’s possible to replace CON1 with a USB-OTG adaptor fitted into the Pico’s micro-USB socket; that is what is shown in the photos at https://github. com/No0ne/ps2x2pico We felt that having fixed sockets made for a more robust solution. The fixed socket arrangements also lend our final PCB design to being installed in a Jiffy box. Software Despite their almost identical functionality, the two circuits use vastly Practical Electronics | January | 2025 USB to PS/2 Adaptors Fig.2: like in Fig.1, many of the components are responsible for interfacing the 3.3V Pico with the 5V PS/2 bus. Those components are duplicated for connections to both a PS/2 keyboard and mouse. The USB data line ‘test’ pads at upper right connect CON1 to the Pico’s USB port. different software implementations. The code at https://github.com/No0ne/ ps2x2pico is built using the Pico’s C SDK (software development kit). It uses the RP2040’s internal USB controller peripheral in host mode, and implements the PS/2 interface using the PIO peripheral. The PIO is a programmable state machine that can be used to emulate many I/O and communications peripherals. It was used in the VGA PicoMite project published in the December 2024 issue to generate the VGA video output signals. Using the internal USB controller in host mode is easier but it also means that the controller cannot operate in device mode, for example, to provide debugging data over a virtual serial port. Plus the USB data connection must be made via the test pads on the Pico, instead of standard header pins. Our software instead uses the PIO to emulate a USB host peripheral based on a library available within the Arduino IDE. Thus, we used the Arduino IDE to build our software. Practical Electronics | January | 2025 The USB host implementation means that the PIO peripheral cannot provide the PS/2 interface, so we have written it to work using GPIO pins and timer interrupts instead. This timer operates at 50kHz and is divided into four phases to give a nominal 12.5kHz PS/2 clock frequency. Using the Arduino IDE also allows us to customise the code more easily, and we have ensured that it works well with the VGA PicoMite. Some key events require more than one byte to be sent on the PS/2 line, so a queue has been implemented to ensure that data moves in an orderly fashion. It should also guard against brief bursts of keyboard activity overwhelming the Adaptor. As we mentioned, the software must map scancodes from the USB scanset to the PS/2 scanset. We use what is known as Set 2, the default for PS/2 keyboards. The mapping is not quite one-toone. USB keyboards report the state of the modifier keys (Ctrl, Shift, Alt etc) as bits in a status byte rather than as scancode events. So, we have to con- vert the changes in these status bits into the key-up and key-down events that PS/2 keyboards generate. Some keys, such as Pause, have odd mappings that must be handled uniquely. That is because the Pause feature was originally invoked by the Ctrl+NumLock key combination, meaning that a single keystroke maps to eight bytes to send on the PS/2 line. The Adaptor must also send repeated key-down events to emulate the typematic feature. With USB keyboards, that is usually handled by the host computer’s software. The ps2x2pico software does not control the LED provided on the second circuit; we simply added it to the PCB in case users wish to modify or update the software to do so. Note that both versions of the software support USB hubs, so if you need to attach a separate keyboard and mouse, you only need to add a hub. If you are using a wireless keyboard and mouse, consider buying them together; in that case, both keyboard and mouse will usually share a single wireless USB receiver. 45 Constructional project Parts List – VGA PicoMite USB to PS/2 Converter 1 PCB double-sided PCB coded 07111231, 42 × 66mm 1 Raspberry Pi Pico programmed with 0711123A.UF2 (MOD1) 1 UB5 Jiffy box ● 2 M3 × 10mm panhead machine screws ● 4 M3 hex nuts ● 2 M3 flat washers ● 6 header pins ♦ 1 M3 × 5mm panhead machine screw ♦ 1 M3 × 6mm tapped spacer ♦ 2 20-way pin headers (optional, for MOD1) 2 20-way female header sockets (optional, for MOD1) 1 PCB mount USB-A horizontal socket (CON1 or CON2) 1 6-pin mini-DIN socket (CON3) ● 1 6-pin mini-DIN to 6-pin mini-DIN cable ● Semiconductors 1 3mm green LED (LED1) 2 2N7002 N-channel Mosfets, SOT-23 (Q1, Q2) Resistors (all M3216/1206 SMD, ¼W) 1 1kW 2 22W 4 10kW ● only needed if installing the Adaptor in a Jiffy box ♦ only required if installing the Adaptor inside a VGA PicoMite Hardware The VGA PicoMite version PCB has been designed so it can sit directly above the main PCB of the VGA PicoMite and fit into the VGA Pico­Mite’s recommended case, as shown on page 43. In this configuration, the CON3 PS/2 connector is not fitted, and the corresponding pads on the two PCBs are directly connected with header pins or similar (shown on page 50). There is the option of fitting the USB socket where the PS/2 socket would have been, meaning that you can now plug a USB keyboard in where you would have otherwise plugged a PS/2 keyboard. You could use the other USB socket location instead, although you would need to cut a hole in the side of the VGA PicoMite case to access it. Another option is to mount either PCB inside a UB5 Jiffy box. The assembled PCB is secured to the Jiffy box’s lid. Slots for the various connectors can be made by simply cutting down from the top edge of the box, which is easier than trying to hollow out a shape in the side of the box. In this configuration, the LED should be mounted on the underside of the PCB to allow it to shine through the box lid. We’ll provide more guidance on these options later. Programming the Pico Fig.3: three 3mm holes are needed in the Jiffy box lid to accommodate the PCB coded 07111231. Two are for mounting screws and the third allows the LED to shine through. You could use the blank PCB as a jig to mark out the holes or confirm your measurements. 46 We recommend programming the Pico before fitting it to the board, especially since the ps2x2pico version uses the USB socket normally used for program uploads. Connect the Pico to a computer, holding in the white BOOTSEL button as you do so. A drive labelled RPI-RP2 should appear. Upload the firmware by copying the respective UF2 file to that drive. Use the file “0711123A.UF2” for the VGA PicoMite version. After programming, it will reappear as a virtual USB-serial port, so you can check that such a device appears on your system. Sending a ~ character to that serial port will toggle debugging mode, but you won’t see much of note until it is connected in-circuit. The ps2x2pico version requires the “ps2x2pico.UF2” file. There won’t be any obvious clues that programming has completed except that the drive will disappear. The ps2x2pico version behaves as a USB host, so you shouldn’t see any USB devices. Practical Electronics | January | 2025 USB to PS/2 Adaptors That software is under active development, so keep an eye out for updates. We used version 0.7 in our testing and it is included in the software downloads. This software is copyrighted by No0ne and released under an MIT open-source license. In the software bundle, we’ve also provided a PS2_HOST sketch that we used for testing. The bundle includes the UF2 file for this sketch. It is designed to work with the VGA PicoMite version of the hardware, and simply provides a PS/2 host port on the CON3 mini-DIN socket. Communication is via a virtual USB serial port on the Pico (via the micro-USB socket). This software will report any packets received and their equivalent keys (if the device is a keyboard). Host packets can be sent by typing their hexadecimal codes followed by Enter. There is an assortment of PS/2-related links at the bottom of https://github.com/ No0ne/ps2x2pico and some of those list host commands. Construction The first circuit, the VGA Pico­Mite version, corresponds to the PCB coded 07111231 (34 × 65.5mm). The second version that supports both a keyboard and mouse uses a PCB coded 07111232 (48 × 58mm); we will refer to it as the ps2x2pico version. The Keyboard Adaptor can be fitted inside the VGA PicoMite case or a Jiffy box as shown here. This enclosure has the holes made as per Fig.3. To keep everything compact, we’ve primarily used surface-mounting components. You should have tools such as a finetipped iron, tweezers and magnifiers. Useful consumables include solder wire, flux paste and solder-wicking braid. The small PCBs can be held in place with Blu-Tack or similar while soldering (if you don’t have a PCB-holding vice). Having an appropriate solvent on hand is also a good idea, so you can clean up any flux residue left after soldering. If you are building a version to fit into a Jiffy box, you can use the bare PCB to mark out the location of the holes that are needed. That is usually easier than using our drilling and cutting diagrams, although you have that option too. There are two holes for M3 mounting screws in the VGA PicoMite version, plus a 3mm hole for the LED, as shown in Fig.3. The ps2x2pico version uses three mounting holes, plus one LED hole, although the default software does not make use of the LED, so you could omit it. Fig.4 is the cutting and drilling diagram for that version. The screw holes can easily be marked by running a pencil (the thin tip of a 0.7mm mechanical pencil is ideal) around or through the holes. The LED holes can be marked using the two holes through their pads on the PCB. Draw a line between those marks and then a smaller line across the exact middle of the one you drew to find the centre of the LED hole. There are some cuts to be made in the sides of the boxes, which are easily made by using the assembled PCBs as guides while mounted on the lids. Fig.4: the hole at centre left is only needed if the LED is fitted; the other three holes are for mounting the PCB coded 07111232. The cutout regions are necessary to accommodate the various sockets. You might find it easier to remove the red shaded region and glue the tab back in later. Practical Electronics | January | 2025 47 Constructional project VGA PicoMite ver. assembly The PCB overlay for this version is shown in Fig.5. Use that and the photo shown opposite as a guide to fitting the parts to the PCB. Before assembling the PCB, if you are going to install it in the VGA PicoMite, carefully break off the two PCB tabs that are attached by ‘mouse bites’. Grasp the main part of the PCB with one hand, then use a pair of wide-nosed pliers to flex and break off the tabs. Do this outside to avoid inhaling any fragments of fibreglass. If you need to use a file to clean up the rough edges of the mouse bites, do that outside too. If you are fitting this PCB to a Jiffy box, one tab is used to help secure the PCB while the other fills the gap in the edge of the box adjacent to the USB socket. Neither is essential to the electrical operation of the circuit. Apply flux to the PCB for the surface mounting components. Place each in their marked locations, using the relevant overlay diagram as a guide, and tack one lead. Check that each component is within their pads before soldering the remaining lead(s). Use your solvent to clean up the PCB after the surface mounting components have been fitted and allow the PCB to dry. Solder LED1 next. There are cathode (K) markings on both sides of the PCB to allow it to be fitted to either side. If you are installing it in the Jiffy box, solder it to the back of the PCB (the side with the Silicon Chip logo). It should be flush against the PCB. If you are fitting it to the VGA PicoMite then solder it to the front of the PCB, with about 10mm of lead between the LED’s body and the PCB. Later, the LED’s leads can be bent to aim it out through the front of the enclosure near the SD card socket. Of course, you should ensure the shorter lead goes to the pin marked K. Now connect the Pico to the PCB; there are three ways to do this. Firstly, you could solder the Pico directly to the PCB. This requires no extra parts but means that the Pico needs to be accurately aligned to the pads on the PCB. You could use M2 screws in the corner holes to temporarily secure the Pico, ensuring correct alignment during soldering. Or you could instead solder pin headers to the Pico (as though you were going to use it on a breadboard). You could then solder female header sockets to the PCB and slot the Pico onto them, or solder the Pico’s headers directly to the PCB. If installing the Adaptor in a Jiffy Box, there are no height requirements that would restrict using headers. The clearance is tighter inside the VGA PicoMite case, so you need to solder the Pico directly to the PCB or use male headers only; using sockets makes the assembly too tall. ps2x2pico ver. construction Fig.6 is the PCB overlay for this ver- Fig.5: assembly of the PCB designed for the VGA PicoMite is straightforward, as there are only 13 components. It’s important to make sure the orientation of the LED and the Pico is correct when attaching those components. 48 sion. You can use that and the photo shown next to Fig.6 to help you assemble the PCB. To fit out the PCB for the ps2x2pico version, apply flux to the pads for all the surface-mounting components, including CON4, the mini-USB socket. If you only plan to use the default firmware, you can omit the 1kW resistor and the LED, as that firmware will not drive them. If you want to modify the firmware to use the LED, it should be fitted to the rear of the PCB if you are using the Jiffy case. Otherwise, you might like to fit it to the top if you are using the bare board. Place CON4 first and locate it on the PCB with the pegs on its underside. Clean the iron’s tip and apply a small amount of fresh solder. Touch it to the pad on the PCB and the solder should run onto the lead. Use a generous amount of heat and solder to secure the four larger pads that connect to the shell and use the solder wick to draw away any excess solder if there are bridges between the pads. Then fit the four transistors, followed by the eight resistors. With the surface-mounted parts in place, you can clean off the excess flux and allow the PCB to dry. As with the VGA PicoMite version, you can install the Pico directly to the PCB or on headers. An important difference is that the two small pads (TP2 and TP3) on the Pico near its microUSB socket must also be connected to Fig.6: there are a total of 19 components to fit for the ps2x2pico version. The default firmware does not use LED1 and the 1kW resistor, so you can leave them off unless you plan to modify the software. Practical Electronics | January | 2025 USB to PS/2 Adaptors the corresponding pads on the PCB. If you are surface-mounting the Pico, it should be possible to flow solder through the PCB and onto the pads on the Pico. You could tin the pads on the PCB and Pico with a small amount of solder to ensure that surface tension pulls the solder all the way through. If you aren’t sure, the best way to guarantee a good connection is to surface-­mount some short pieces of stiff wire, such as axial lead offcuts, to the underside of the Pico. This will also need to be done if you plan to use headers to mount the Pico; it is what we did, and you can see it in the photo at upper right on page 50. If you are using headers, solder the male headers to the underside of the Pico; the female header sockets are fitted to the top of the PCB. Connect the Pico to the PCB (by soldering the bottom of the male headers or by pressing it into the female headers). The short wire leads should protrude through the pads in the PCB, allowing them to be soldered to it. When that is done, the CON1 USB socket and CON2/CON3 mini-DIN sockets can be fitted. VGA PicoMite version testing To finalise the Jiffy box version of the VGA PicoMite PS/2 Adaptor, solder the CON3 mini-DIN socket, ensuring it is down hard against the PCB. The USB socket can then only be soldered to the CON1 location. The Adaptor should be complete The Wireless for the Warrior books are references for the history and development of radio communication equipment used by the British Army from the very early days of wireless up to the 1960s. Volumes 1, 3 & 4 are still available. Order a printed copy now from: https:/ https: //pemag.au/link/ac20 enough to perform a functional test at this stage. Plug a USB keyboard (or USB wireless receiver) into the USB socket and then plug the mini-DIN cable into the mini-DIN socket. Connect the other end of the miniDIN cable to the PS/2 socket of the computer and power it on. After a second or two, you should see the green LED light up. That indicates the Adaptor has recognised that a keyboard is attached. The LED will flicker if either the host computer or keyboard tries to communicate. Although the LED is programmed only to light up if a keyboard is connected, we have seen some wireless mouse receivers that also cause it to happen. We suspect this type of receiver is a generic type that supports both keyboards and mouses and thus enumerates as a keyboard, even though that is not necessary for its operation with a mouse. Jiffy box Drill the two holes in the lid of the Jiffy Box, plus the one for the LED. Thread a machine screw from the outside and secure each with a nut inside. Each nut forms a thin spacer to keep the PCB off the lid. Then thread the PCB over the screws and fasten it in place with washers and screws. You can now make the two U-shaped cutouts in the sides of the box. Either ◀ The ps2x2pico version of the PCB is compact and uncomplicated. We omitted the 1kW resistor and the LED from our build as they are not driven by the default firmware. We decided to include them in the design in case constructors want to add support, which should not be too hard. ◀ This is the same VGA PicoMite version as shown on page 43, but built as a standalone board to be fitted into a Jiffy box. In this case, the USB socket can go in the CON1 position as the CON3 mini-DIN socket covers the CON2 position. Practical Electronics | January | 2025 49 Constructional project ◀ The headers don’t protrude through the top of the PCB so that the USB socket can be soldered over the top. Using three pairs of 0.1in pin headers means that the individual pins do not come loose during soldering. The plastic has been filed down slightly on the middle pair due to the pad spacing being less than 2.54mm (0.1in) on the mini-DIN socket. We’ve also pushed the plastic shroud so that the pins are only 1.6mm (the PCB thickness) above the shroud. ◀ We used lead offcuts to directly connect the TP2 & TP3 pads on the Pico to the USB pads on the PCB underneath. Even if you are soldering the Pico directly to the PCB, we recommend soldering the two leads to the Pico. use our cutting diagram, or place the mounted PCB against the box to mark out the sides. The easiest way to make these is to use a fine saw or very sharp knife (such as a hobby knife) to make the vertical cuts. Carefully score the horizontal cut on the outside of the box and then gently flex the tab with a pair of widenosed pliers until it snaps off. The hobby knife can then be used to neaten and fine-tune the shape of the cutouts until the lid slots fully into place. This version is completed by screwing the lid of the Jiffy box in place. Installing in a VGA PicoMite Installing the Adaptor inside the VGA PicoMite is a bit more fiddly, as it requires stacking the PS/2 and USB connectors. You should have already removed the two PCB tabs by snapping them off; do so now if you have not. Solder the pin headers to the underside of the PCB in the six pads belonging to the mini-DIN connector. Make sure that the headers do not protrude above the PCB at all. We found the easiest way to do this was to separate the pin headers into pairs of two pins and then locate them into adjacent holes. The plastic surrounding the middle pins may need to be filed down a bit to give clearance; unfortunately, the mini-DIN socket does not have a standard 2.54mm (0.1in) pitch between all pins. It helps to slide the pins along the plastic so that only a small amount (about the PCB thickness) protrudes. The photo opposite shows how the PCB looks with the header pins attached. Next, solder the USB socket above the PCB in the location marked CON2 Parts List – ps2x2pico USB to PS/2 Converter 1 double-sided PCB coded 07111232, 58 × 52mm 1 Raspberry Pi Pico programmed with ps2x2pico.UF2 (MOD1) 2 20-way pin headers (optional, for MOD1) 2 20-way female header sockets (optional, for MOD1) 1 PCB mount USB-A horizontal socket (CON1) 2 6-pin mini-DIN sockets (CON2, CON3) 1 surface mounting mini-USB socket (CON4) 1 UB5 Jiffy box 3 M3 × 10mm panhead machine screws 6 M3 hex nuts 3 M3 flat washers 2 short pieces of wire (if mounting the Pico on headers) 2 6-pin mini-DIN to 6-pin mini-DIN cables Semiconductors 1 3mm green LED (LED1; optional) 4 2N7002 N-channel Mosfets, SOT-23 (Q1-Q4) Resistors (all M3216/1206 SMD, ¼W) 8 10kW 1 1kW (only needed it fitting LED) 50 and attach the 6mm spacer next to the LED. The Adaptor PCB can now be slotted onto the VGA PicoMite. Make sure that it is square and does not contact any components underneath. Solder the six pins to join it to the VGA PicoMite’s PCB. You might find that you need to slightly enlarge the back panel hole for the USB socket, since it is larger than the mini-DIN socket. You will also need to drill a hole for the LED in the front panel. Fig.7 shows the suggested panel modifications for those two holes. Connect a USB keyboard, then power on the VGA PicoMite. The LED should light up, then flicker as the PicoMite initialises. ps2x2pico version testing The Adaptor can be tested by connecting it to a PS/2-­compatible computer using a pair of 6-pin mini-DIN cables. Connect the keyboard and mouse to the USB socket using a hub, if necessary. We imagine many people will use a wireless keyboard and mouse combination, in which case a single compact receiver is all that needs to be plugged into the USB socket. The mini-USB socket is provided in case extra power is needed; the socket on the Pico cannot be used to supply power as it is working in host mode. Attach the machine screws to the lid of the Jiffy box and secure them on the inside using three of the nuts. Slide the PCB over the screws, then secure it to the lid with washers and screws. Use the Fig.4 cutting diagram to make the U-shaped slots in the side of the Jiffy box to accommodate the Practical Electronics | January | 2025 USB to PS/2 Adaptors Fig.7: this diagram shows modifications to the H0376 instrument case used for the VGA PicoMite. The added LED for the PS/2 Adaptor sits on the front panel near the SD card socket, while the cutout for the USB socket overlaps the original location of the miniDIN socket on the rear panel. connectors. A sharp hobby knife or fine-toothed saw are good choices here. Finally, attach the lid to the box with its included screws. Jiffy box labels Figs.8 & 9 show panel artwork that can be applied to the lids of the Jiffy boxes. Fig.9 helpfully marks the dis- tinction between the keyboard and mouse sockets. Conclusion We continue to be impressed by the capabilities of the Raspberry Pi Pico, and this application is a perfect use for its abilities. We’re sure there are many readers out there with PS/2 equipment who will make use of the option to use a modern USB keyboard on their legacy devices. You can find a list of helpful links listed below: • github.com/No0ne/ps2x2pico/ • wiki.osdev.org/PS/2_Keyboard • wiki.osdev.org/PS/2_Mouse PE Figs.8 & 9: this simple label (shown at top) can be affixed to the top of the Jiffy box for the VGA PicoMite Adaptor. The label below will help users differentiate between the otherwise identical mouse and keyboard sockets. We’ve omitted the hole for the LED as we expect most readers will not use it. Both labels are shown at actual size. Practical Electronics | January | 2025 51