## 4 The Hardware Design and Implementation  
We designed a user-friendly, low power consumption, and portable control unit to implement the proposed system's objectives. Figure 7 illustrates the hardware composition and relationship. The electrical scheme is divided into two subsystems operated by two microcontrollers; they are connected to one other via the serial interface (UART) through a master-slave relationship as demonstrated in Figure 8c. We used a twisted cord cable with  
Figure 5: 3D model structure and health object integration with the proposed wrist radial/ulnar deviation R/U attachment mechanism. Figure 6: 3D model structure and health object integration with the proposed hand forearm supination/pronation (S/P) attachment mechanism. a baud rate of 9600 bps to connect the two subsystems; this cable is flexible; it goes between 30 cm to 2 m; this feature allows the control unit holder (first-user) to move freely, without needing to be close to the patient or the machine. This interface enables the first subsystem (master), which serves as the interaction unit with the first user, to send a preprogrammed command characters to the second subsystem (slave). The first subsystem is composed of the following parts:  
1. A display unit, a 16 \(\times\) 2 LCD (Liquid Crystal Display), it is a low-cost, fundamental display module. Technically, it has 16-pin, which can display 16 characters per line; each character appeared in a 5 \(\times\) 7 pixel matrix. Functionally, it displays the preprogrammed therapy characters; unlike other primary display devices such as seven segments, there is no limitation of displaying unique and custom characters; as a function, all the control parameters display through it. 2. Three pushbuttons with LEDs, and a buzzer, is implemented. The first pushbutton is employed to start the therapy. The second pushbutton is utilized to pause/resume the therapy execution session temporarily, and the third pushbutton deactivates the actuation unit and cancels the therapy immediately; this is important as a safety feature at the hardware level. Furthermore, whenever a pushbutton clicks, the buzzer gives a piping sound to notify and confirm the taken action. 3. An incremental rotary encoder with a center pushbutton was employed. It is efficient input hardware for mechtronics systems, where the angular position is required; they come with buttons attached. It can be clicked by pressing the knob and is recognized by the Arduino just as any other pushbutton; the advantage of using rotary encoders is that their rotation is limitless. We have used a 24-pulse mechanical, incremental rotary encoder with a pushbutton switch to scroll through software designed menus and select control parameters options. 4. The master controller, an Arduino nano based on an AT-mega328P microcontroller, owns the advantage of low cost, compact size 18 \(\times\) 35 mm, persuasive functions, and lightweight 7 g, which significantly reduce the size and weight of the portable control. Arduino nano consists of 8 analog input pinouts, operates by 5 VDC operating voltage, 1 KB EEPROM, 2 KB SRAM, and 32 KB flash memory. The required current per each I/O pinouts is 40 mA. All input data and output commands of the first subsystem's pushbuttons, LEDs, buzzer, and LCD, and the incremental rotary encoder are controlled through it. Figure 7: Electrical of design of the FMRMS Continuous Passive Motion (CPM) machine. The second subsystem (slave) receives the first subsystem's commands; it is on an Arduino Uno board based on the ATmega328 microcontroller. Technically it has six digital I/O pins, six analog inputs, a 16 MHz crystal oscillator, the operating voltage is 5 VDC, 1 KB EEPROM, 2 KB SRAM, 32 KB flash memory, the required current per each I/O pinouts is 20 mA. This subsystem design to control the actuation unit. Beside the microcontroller, it essentially consists of the following parts. 1. Concerning the actuator, a hybrid bipolar dual shaft stepper motor is utilized in the actuation unit.