Hello friends, I hope you all are doing great. Today, I am going to share the new PS2 Wireless Controller Library for Proteus Simulation. The 2.4 GHz PS2-style game pad with its little receiver is the favourite remote control of robot builders: two analog sticks, sixteen buttons, two rumble motors, a range of several metres - and a receiver that speaks a simple four-wire protocol any Arduino can handle. With this library you can run a full Proteus simulation of that receiver, drive its controller from a pop-up, and watch every byte of the protocol go by.
PS2 Wireless Controller Library for Proteus
Latest version: V1.0 (December 2026, this tutorial)
Other robot parts: L298N Motor Driver · Planetary Gear Motor · Joystick Module
Helping Tools
- Serial Monitor Advance: a serial terminal window for the UART of your board
- Serial Monitor Expert: the serial monitor with extra debugging tools
- LCD Library for Proteus V3.0: 16x2, 20x4 and I2C LCDs to show your readings
The demo is the classic project for this pad: a two-wheeled robot car with an L298N - throttle on the left stick, steering on the right, a horn that makes the controller rumble, and a turbo button.
NOTICE: Our team has put a lot of effort into these small parts: the bodies, the animation and the pop-ups are all our own design, and you get them free. Your feedback is the fuel that keeps us going, so please tell us what you think in the comments below or in the joystick board of our forum. And if our free libraries help you, you can buy us a coffee. So, let's get started with the PS2 Wireless Controller Library for Proteus Simulation:
What Is a PS2 Wireless Controller?
It is a game pad in the familiar two-grip shape - a D-pad, four face buttons, four shoulder buttons, SELECT and START, two analog sticks that also click as buttons - sold with a small 2.4 GHz receiver. The controller and the receiver pair by themselves when both are powered; the receiver then answers a microcontroller exactly as the original wired controllers did, so the same code and the same libraries work for both. For makers that is the attraction: a complete, ergonomic remote control for a few dollars, with no radio code to write.
| PS2 wireless controller kit | |
|---|---|
| Radio | 2.4 GHz, controller to receiver |
| Interface | ATT, CLK, CMD, DAT (and VCC, GND) |
| Bit order | LSB first, CLK idle high |
| Buttons | 16, active low |
| Sticks | 2 x 2 axes, 0 - 255, centre 128 |
| Rumble | a small (on / off) and a large (0 - 255) motor |
| Supply | 3.3 - 5 V (follow the receiver board) |
The Protocol on Four Wires
The microcontroller is the master. It pulls ATT (attention) low to start a packet and sends the clock on CLK, which idles high. On every clock pulse one bit goes each way at once: the host puts a bit on CMD, the receiver puts a bit on DAT. Bytes travel least significant bit first. The receiver changes DAT on the falling edge and reads CMD on the rising edge, so the host reads DAT while the clock is low. DAT is an open-drain output: it needs a pull-up, which on an Arduino is simply INPUT_PULLUP. When the packet is done, the host lets ATT go high again.
The Poll, Byte by Byte
Almost everything happens in one packet, the poll. The host sends 0x01, then the command 0x42, then 0x00, then zeros (or the rumble values); the receiver answers 0xFF, then its ID, then 0x5A, then the data.
| Byte | Host sends | Receiver answers |
|---|---|---|
| 0 | 0x01 | 0xFF |
| 1 | 0x42 (poll) | ID: 0x41 digital, 0x73 analog |
| 2 | 0x00 | 0x5A |
| 3 | small motor | SELECT L3 R3 START UP RIGHT DOWN LEFT |
| 4 | large motor | L2 R2 L1 R1 TRIANGLE CIRCLE CROSS SQUARE |
| 5 - 8 | 0x00 | RX, RY, LX, LY (analog mode only) |
The buttons are active low: a 0 bit means pressed. The sticks run from 0 to 255 with 128 in the middle; up and left are 0.
Digital and Analog Mode
A controller wakes up in digital mode, ID 0x41, with only the two button bytes. To get the sticks the host switches it to analog mode with a short configuration sequence: 0x43 with a 1 enters the config mode (the ID becomes 0xF3), 0x44 with 1 and 3 selects analog and locks the MODE button so a stray press cannot switch it back, 0x4D maps the rumble motors to the poll's bytes 3 and 4, and 0x43 with a 0 leaves the config mode. From then on the ID is 0x73 and every poll carries six data bytes.
Pairing and the LEDs
Until the controller and the receiver have found each other, the receiver answers every byte with 0xFF. A good sketch waits for an ID other than 0xFF before it does anything else. The receiver shows the state on its LEDs: the green LINK LED blinks while it searches and stays on when it is paired; the red MODE LED lights in analog mode. The model pairs 0.6 s after power-on and draws both LEDs on the sheet.
Features of the PS2 Wireless Controller Library for Proteus Simulation
- A real-looking receiver: the 42 x 28 mm receiver at its real size with its header and the LINK and MODE LEDs, which light as on the real one.
- The protocol: the poll, the config mode, analog and digital mode with the lock, the status command and the rumble mapping.
- A controller in the pop-up: every button lights while it is held, both sticks move, ANALOG lights, and the grips show the rumble.
- The last packet, decoded: the host's bytes and the receiver's answer side by side, with the ID, the buttons and the sticks spelled out.
- A demo sequence: buttons and sticks that drive a robot car without a hand on the mouse - or the pop-up's chips for your own tests.
- A complete package: about 1.9 MB with the library, our L298N and gear motors, our Arduino UNO V4.0 and the demo, without the source code of the model.
The PS2 Receiver in Proteus
The device is PS2RECEIVERTEP in TEPPS2PAD.LIB, under Modules > Wireless, with the prefix U and the model TEPPS2PAD.DLL. Search PS2 or receiver in Pick Devices. The header has VCC, DAT, CMD, ATT, CLK and GND. Three properties: CONTROLLER (ON or OFF at the start), MODE (the mode at power-on) and DEMO (the demo sequence or the pop-up only).
Download PS2 Wireless Controller Library for Proteus Simulation
Click the button below to download PS2-Wireless-Controller-Library-for-Proteus-v1.0.zip (about 1.9 MB, without the source code of the models):
PS2 Wireless Controller Library for Proteus V1.0- README.txt: installation, the demo, the wiring, troubleshooting and the limits of the simulation.
- Proteus Library Files:
TEPPS2PAD.LIB,TEPL298N.LIB,TEPPLANETARY.LIBandArduinoV4TEP.LIB. - Proteus Model Files: the DLLs of the same names and
TEPARDUINO.DLL. - Arduino Code: the demo sketch (no library).
- Proteus Simulation: the demo project, its HEX file and copies of the DLLs.
No Proteus yet? Read How to Download and Install Proteus 7 and 8. New to libraries? Follow How to Install a New Library in Proteus.
How to Install PS2 Wireless Controller Library for Proteus Simulation
- Close Proteus and extract the whole zip file, for example to your Desktop.
- Copy the files from Proteus Library Files into the LIBRARY folder of Proteus.
- Copy the files from Proteus Model Files into the MODELS folder.
- Delete
TEPPS2PAD.IDXfrom the LIBRARY folder if it is there. - Start Proteus, press P and search for PS2.
Proteus Simulation of a PS2 Robot Car
The demo uses an A3 sheet with our Arduino UNO Library for Proteus V4.0, the receiver U1 on D10 to D13 - DAT on D12, CMD on D11, ATT on D10, CLK on D13 - and the motor stage from our L298N Motor Driver Library for Proteus: ENA on D9, IN1 and IN2 on D8 and D7 for the left wheel, ENB on D6, IN3 and IN4 on D5 and D4 for the right. The wheels are two 12 V gear motors from our Planetary Gear Motor Library for Proteus. The Arduino's monitor is built in, the same window as our TEP Serial Monitor Advance for Proteus. Open PS2-Robot-Car-ArduinoUnoV4.pdsprj.
The Sketch
The sketch needs no library; the protocol is short enough to write by hand. One byte goes out and one comes in, bit by bit:
uint8_t ps2Byte(uint8_t out) {
uint8_t in = 0;
for (uint8_t i = 0; i < 8; i++) {
digitalWrite(CMD, (out >> i) & 1);
digitalWrite(CLK, LOW);
delayMicroseconds(5);
if (digitalRead(DAT)) in |= 1 << i;
digitalWrite(CLK, HIGH);
delayMicroseconds(5);
}
At start-up it waits for the controller, then sends the four configuration packets for analog mode with rumble:
ps2Packet(ENTER_CONFIG, sizeof ENTER_CONFIG);
ps2Packet(SET_ANALOG, sizeof SET_ANALOG);
ps2Packet(MAP_RUMBLE, sizeof MAP_RUMBLE);
ps2Packet(EXIT_CONFIG, sizeof EXIT_CONFIG);
Every 20 ms it polls and mixes the sticks for a tank drive: the throttle from the left stick, the steering from the right, added for one wheel and subtracted for the other, with a dead zone around the centre:
int throttle = 128 - rx[8], steer = rx[5] - 128; // LY: up = 0; RX: right = 255
if (abs(throttle) < 12) throttle = 0;
if (abs(steer) < 12) steer = 0;
PS2 Controller Simulation Results
Open the project and press Run. The demo runs 4.8 simulated seconds and took a little under two minutes on our PC with the pop-up open and the pictures being taken. Click the receiver for its pop-up. Every number below comes from one simulation run, the demo exactly as it ships.
Pairing and Setup
The receiver powers up and starts searching: LINK blinks on the sheet. The sketch is already polling, and for the first 0.6 s every one of its packets comes back as 0xFF - eleven of them, the Check page counts. At 0.601 s the controller pairs, LINK stays on, and the first real poll at 0.645 s brings back ID 0x41: digital mode, buttons only. The sketch prints "Controller found" and runs its four configuration packets within 8 ms: 0x43 enters the config mode at 0.697 s, 0x44 switches to analog and locks the MODE button at 0.700 s - the red MODE LED lights on the receiver - 0x4D maps the rumble motors at 0.702 s, and 0x43 leaves the config mode at 0.705 s. From then on every poll answers 0x73, with six data bytes.
Forward and Turning
The demo presses START at 0.90 s and the sketch prints "START: armed". Then the left stick goes forward: LY falls to 0 and both wheels get 165, the 65 % limit without the turbo. At 1.6 s the right stick swings right (RX 255): the left wheel stays at 165 while the right one drops to 1, and the car curves to the right. The pop-up at 1.8 s shows that moment - the left stick up, the right stick to the right, and the last packet with RX 0xFF, RY and LX 0x80 and LY 0x00 in its bytes 5 to 8. Next, with the left stick back at the centre and the right stick to the left, the wheels run -165 and 165: the car spins on the spot.
Reverse and the Horn
At 2.6 s the left stick goes all the way down (LY 255) and both wheels run backwards at -164. From 2.70 s the demo holds CROSS, and the sketch answers with the horn: it puts 200 into the poll's byte 4, the large rumble motor. The pop-up at 2.85 s shows CROSS lit, the marks beside the grips that mean the controller is shaking, the tile "small off, large 200", and in the last packet the host's byte 4 as 0xC8 and the receiver's button byte 0xBF - bit 6, CROSS, at 0.
Turbo
TRIANGLE at 3.40 s switches the turbo on ("TRIANGLE: turbo on"), and when the left stick goes forward again both wheels get the full 255. At 4.0 s the pop-up shows the stick up, both wheels at full speed on the monitor and on the motors' readouts. The demo ends with the sticks back in the centre and START at 4.40 s: "START: disarmed", and the car stops. 206 polls in 4.8 s - a steady 50 a second.
The Graphs, the Event Log and the Check Page
The Graphs page plots the left stick's Y, the right stick's X, the number of buttons held and the large rumble motor through the whole drive. The Event log tells the setup step by step, then every button the demo pressed. The Check page sums up the run: the receiver at 5.00 V, paired, with 11 packets answered 0xFF before the pairing; analog mode with the lock after one config entry; 206 polls, 50 a second at the end, 221 packets in all; four button presses - START twice, TRIANGLE and CROSS once each; and the rumble motors mapped by 0x4D.
The Arduino's monitor is the driver's view: "Controller found", "Analog mode, rumble on: ID 0x73", "START: armed", then four times a second the sticks and the two wheel speeds - "LY 0 RX 255 | L 165 R 1" in the turn, "LY 255 RX 128 | L -164 R -164" in reverse, "CROSS: horn (rumble)", "TRIANGLE: turbo on", "LY 0 RX 128 | L 255 R 255" - and finally "START: disarmed".
Why a Dead Zone?
A real stick never rests exactly at 128. Springs, wear and the potentiometers leave it a few counts off, and a sketch that takes every count seriously makes the car creep forward or turn slowly when nobody is touching the pad. The sketch ignores anything within 12 counts of the centre, which is about 5 % of the travel. The same idea is behind our Joystick Module Library for Proteus, the wired thumb stick that uses the very same kind of potentiometers.
Tank Mixing in One Line
A car with two driven wheels steers by running them at different speeds. Adding the steering to the throttle for the left wheel and subtracting it for the right gives everything at once: both sticks centred - stop; throttle alone - straight; steering alone - the wheels turn opposite ways and the car spins on the spot; both - a curve. The constrain() keeps the sum inside what analogWrite() can take, and the turbo limit scales the whole thing down when it is off.
Try It Yourself
- Set MODE to ANALOG and remove the configuration packets: the sticks work, but the rumble does not until 0x4D is sent.
- Switch the controller OFF in the pop-up while the car runs: the receiver answers 0xFF and the sketch should stop the motors - add that check.
- Set DEMO to NO and drive with the toolbar chips: hold Start, then Up or Down on the D-pad as a digital throttle.
- Change the dead zone from 12 to 40 and watch how far the stick must move before the car reacts.
- Raise the poll period from 20 ms to 200 ms: the car still drives, but the steering feels late.
Ideas to Extend the Demo
- A tracked robot with a servo turret on the right stick.
- A robot arm: one stick per joint pair, the shoulder buttons for the gripper.
- A failsafe: no valid poll for 200 ms - stop everything.
Your Own Sketches
The demo sketch is in the zip file, and you can change it in the Arduino IDE. New to Arduino? Start with our Arduino Tutorial for Beginners. Export the compiled binary, and set the UNO's PROGRAM property to the new file. Our guide on How to get the HEX file from Arduino shows you where the file ends up.
Things to Know Before Using a Real PS2 Wireless Controller
- Supply: many receivers want 3.3 V; check yours before connecting 5 V.
- Pull-up: DAT is open drain - INPUT_PULLUP or an external 10 kohm.
- Pairing: power the receiver first, then press the controller's START or its power switch; wait for LINK to stay on.
- Clock: 50 to 250 kHz works for most; slow down if the bits come back wrong.
- Polling: keep polling at least every 50 ms, or some controllers fall back to digital mode or sleep.
Troubleshooting
- Every byte is 0xFF: the controller is off or still pairing, or ATT is not low during the packet.
- The ID stays 0x41: analog mode was never set - send 0x43, 0x44, 0x43.
- Garbled buttons: DAT has no pull-up, or DAT is read on the wrong clock edge (read it while CLK is low).
- No rumble: 0x4D was not sent in config mode, or the motor byte is 0.
- The part is not simulated:
TEPPS2PAD.DLLis missing from MODELS and from the project folder.
Limitations of the Simulation
- The receiver's protocol - the poll, the config commands, the modes, the rumble mapping - follows the way these receivers work; the receiver is our own drawing.
- Our own figures: the pairing in 0.6 s, the sticks moving over 120 ms, the demo sequence.
- Not modelled: the ACK line (it is not on the receiver boards' header), the pressure-sensitive buttons, the radio range.
- Arduino is a name of Arduino; this library is not made or endorsed by Arduino, Labcenter or any controller maker.
- Tested in Proteus 8.5 in November 2026 (the demo as shipped). Proteus 7 is not supported.
So, that was all about the PS2 Wireless Controller Library for Proteus Simulation. I hope it gets your next robot moving - in the simulation first, and on the floor right after. If you have any questions, ask in the comments and I will help you out. Till the next tutorial, take care and have fun!