Mohammed Shabaj Ahmed
2019-08-14
Figure 1: Showing how participants were requested to position the hardware.
This project explores how social robots can support long-term behaviour change in health contexts. Developed during my PhD, it investigates whether daily interactions with a socially assistive robot (SAR) can help users form healthy habits. The full codebase and documentation are available below.
Explore the Full Project
View the complete project on GitHubThis research examines the psychological and behavioural effects of interacting with a SAR for three weeks and how SARs can encourage positive behaviour changes through habit formation, in an ecologically valid setting. The study is structured around:
During the three-week study, participants interact with the SAR twice daily. These interactions were designed to reinforce behaviour through repetition and reflection:
This study employed a three-week between-subjects design to explore the role of socially assistive robots (SARs) in habit formation, comparing two conditions: robot-assisted and screen-only. Participants chose an exercise-related behaviour to develop into a habit and performed it in response to a daily cue defined through implementation intentions. Participants were fully informed that the technology aimed to influence their behaviour. The primary variable of interest was the SAR's presence and its influence on habit formation.
In this study, the robot was not there to guide a participant through the process of performing a behaviour, nor was it there to cue a behaviour. Instead, the robot was present to provide a consistent reminder and self-reflection to participants to perform the behaviour, and the physical embodiment enabled the participant to feel like they were having a conversation with a social agent whose expressivity would adjust based on the responses that the participant provided.
Participants were randomly assigned to one of two conditions:
Figure 2 illustrates the overall study procedure. All participants followed the same initial steps but diverged during the study period into either the robot-assisted or screen-only condition before converging again for the post-study questionnaire and interview.
The study comprised four phases:
Figure 2: Visual representation of the study procedure. Participants completed onboarding and priming sessions before being randomly assigned to either the robot-assisted or screen-only condition for the 21-day study period. The two conditions converged again for the final post-study interview and questionnaires.
This project adopts a microservice architecture, where each service is designed to be stateless, storing its configuration and runtime state in a centralised database. Inter-service communication is handled using the Message Queuing Telemetry Transport (MQTT) protocol, which acts as a lightweight message broker supporting event-driven data exchange.
Figure 3 presents an overview of the system architecture, including all active services and the MQTT topics used for communication. This diagram serves to illustrate how loosely coupled services interact to create a cohesive robot behaviour control system.
Figure 3: Overview of the system architecture showing all stateless services and the MQTT messages exchanged between them. Each service communicates through specific topics to maintain a modular and loosely coupled system.
An event-driven communication model is employed to ensure the robot responds dynamically to internal and external events. A centralised control system governs the robot's behaviour, implemented as a hybrid state machine that combines reactive and deliberative components:
This event-based architecture provides a clear separation between reactive and deliberative actions while ensuring near real-time responsiveness. Figure 4 illustrates the FSM used in the deliberative layer, showing its two high-level states: active and error, and the sub-states that can only be entered from the active state.
Figure 4: Hierarchy of states within the finite state machine (FSM). The system transitions between two high-level states: active and error. From the active state, it can enter sub-states such as interacting, configuring, and reminding.
All services are stateless, and the state is stored in the centralised database. This ensures:
MQTT facilitates service-to-service communication. The messaging patterns used in this project were:
Within individual services, a custom event dispatcher facilitates decoupled communication between the business logic and communication scripts. This dispatcher maintains a dictionary of event handlers keyed by unique event_name identifiers, where the value is the function to be called. Event and associated payload are dispatched synchronously to the registered handler function, ensuring predictable first-in-first-out (FIFO) message handling. This approach separates the core business logic from the messaging layer, providing flexibility to modify the underlying message broker with minimal code refactoring.
Additionally, Python event queues were used to communicate between state machines. These queues were used to request state transitions. The communication flow is as follows:
An illustration of this communication hierarchy and flow between the state machine layers is depicted in Figure 5.
Figure 5: Illustration of the communication flow between the subsumption state machine (SS), finite state machine (FSM), and behaviour tree (BT). The FSM subscribes to queues from both SS and BT and manages state transitions accordingly. The BT subscribes only to the FSM to receive high-level behaviour commands.
A screen-based user interface was included to increase transparency around the data being collected (DR9) and to provide participants with an additional modality for interacting with the robot beyond voice dialogue. The user interface was implemented as a Web App using Flask and consisted of four main pages: Home, Check-In, History, and Settings. Each screen was designed to support a specific function, such as initiating interactions, tracking progress, or adjusting configuration settings. The interface also provided real-time feedback on the robot's current state and offered users insight into the data being processed.
Displays the participant's implementation intention, along with the time of the next scheduled reminder and the number of days remaining in the study (Figure 6.A). To access other screens, participants could click the “Open” button located at the top left corner, which revealed a menu for navigation (Figure 6.B).
Figure 6.A: Home Screen. Figure 6.B: Menu Screen.
To start a check-in, a user must first navigate to the check-in page. A green “Start Check-In” button initiated the dialogue (Figure 7.A). The check-in interface resembled a messaging application, displaying both the robot's questions and the participant's previous responses in a scrollable chat-like format (Figure 7.B). This design helped participants stay oriented during the conversation and review what had already been discussed. Upon completion, participants could choose to save or redo their responses. If no action was taken within 20 seconds, the check-in was saved automatically.
Figure 7.A: Check-in screen. Figure 7.B: Conversation history.
The history page allowed participants to view their check-in activity over time. This screen displays the days on which the participant had completed a check-in, providing an overview of adherence to the intervention and the data collected (Figure 8).
Figure 8: History screen.
The settings page provided controls for modifying aspects of the study configurations. This included options for adjusting the reminder time (Figure 9.A), robot eye colour, robot volume and touchscreen brightness (Figure 9.B).
Figure 9.A: Settings screen - reminder. Figure 9.B: Settings screen - robot customisation.
Given the long-term nature of the study, robust error management was essential. In the event of a fatal error, an error screen was displayed to inform the participant of the issue. This screen included a description of the error to support debugging and maintain system transparency (Figure 10).
Figure 10: Connection error message.
To support autonomous, real-world deployment in participants' homes, the system was built using off-the-shelf components for reliable performance and consistent operation over a 21-day study period. The setup consisted of the following six main components: a Vector 2.0 robot, a Raspberry Pi 5, a portable 4G Wi-Fi router, an external USB microphone, an external USB speaker, and a 5-inch touchscreen LCD. Figure 11 illustrates the component integration, with Figure 1 showing how participants where requested to position the hardware.
Figure 11: Hardware setup used for in-home deployment of the SAR system. The Raspberry Pi 5 served as the central controller, connected to a touchscreen (via the DSI connector), an external USB microphone, an external USB speaker, Vector Robot and a portable 4G Wi-Fi router, which established a local network for communicating with the Vector robot. All peripherals were powered via the Raspberry Pi's USB ports, and the system operated from a single USB-C 5A power supply.
This project explored how a socially assistive robot (SAR) could support healthy habit formation through daily interactions in a real-world, in-home setting. Over a three-week period, participants engaged with either a robot-assisted or screen-only system designed to promote physical activity via structured reminders and self-reflective check-ins.
The findings revealed that embodiment matters: participants in the robot-assisted condition reported stronger emotional engagement, greater perceived companionship, and a heightened sense of accountability. These relational effects translated into improved motivation and enjoyment compared to the screen-only group. However, both systems helped users reflect on their behaviours — highlighting the potential of structured, conversational coaching, even without embodiment.
At the same time, the study identified critical limitations. Technical issues like voice recognition errors and system instability negatively impacted user trust and long-term engagement. Participants also expressed a desire for more adaptive, personalised dialogue and greater flexibility in how reminders were delivered.
In response, this project contributed three new design requirements to guide future development:
Overall, this research demonstrates the promise of SARs in promoting healthy behaviour change — but also underscores the need for reliable systems and thoughtful interaction design. By combining embodiment with adaptive, user-centred features, future socially assistive robots can become powerful allies in supporting long-term health and well-being.
Explore the Full Project
View the complete project on GitHub