Discomfort Alert

rainyliveshere

Jul 4, 2026
25
Joined
Jul 4, 2026
Messages
25
Hello. In 2019, I made this circuit using Seedstudio’s Grove-GSR sensor. I named it ‘Discomfort Alert’. This circuit measured the output of the sensor and showed it in the OLED display. When the output value crossed a threshold value, the buzzer made a sound. It made a sound when the person wearing the sensor needed to pee. I did this project keeping disabled patients and baby patients in my mind. The project was very close to my heart. The concept came when my only son who was 2.5 yr old that time was suffering from dengue. He was admitted in a hospital and the docs always told me to keep a record of his urine output. After coming back to my office from leave , I started this project.

Screenshot 2026-07-25 001808.png

The code-
C:
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display;
const int BUZZER=3;
const int GSR=A0;
int threshold=0;
int sensorValue;
void setup(){
 long sum=0;
 Serial.begin(9600);
 pinMode(BUZZER,OUTPUT);
 digitalWrite(BUZZER,LOW);

 delay(1000);
 for(int i=0;i<500;i++)
 {
 sensorValue=analogRead(GSR);
 sum += sensorValue;
 delay(5);

 }
 threshold = sum/500;

 Serial.print("threshold =");
 Serial.println(threshold);
}
void loop(){
 int temp;
 sensorValue=analogRead(GSR);

display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

  // Clear the buffer.
 display.clearDisplay();
 display.display();

 display.setTextSize(1);
 display.setTextColor(WHITE);
 display.setCursor(0,0);
 display.print("Threshold =");
 display.println(threshold);
 display.print("sensorValue =");
 display.print(sensorValue);
 display.display();
 display.clearDisplay();
 Serial.print("sensorValue=");
 Serial.println(sensorValue);
 Serial.print(",");
 Serial.print("Threshold=");
 Serial.println(threshold);

 temp = threshold - sensorValue;
if(abs(temp)>80)
 {
 sensorValue=analogRead(GSR);
 temp = threshold - sensorValue;
 if(abs(temp)>80){
 digitalWrite(BUZZER,HIGH);
 Serial.println("Go to toilet");
 delay(3000);
 digitalWrite(BUZZER,LOW);
 delay(1000);}
 }
}

I want suggestions to make the project usable in practical life. Yes, I wore it and tested my circuit but this arrangement is not useable for a real disabled person in real life. Another thing I noticed was, the threshold value could be different for different people in different environment. It looked like, I had to set the threshold value after testing on the individual who was going to wear it.

I am also thinking about replacing the breadboard with a custom PCB. That would make the device smaller and more reliable. I am considering using Card edge connectors to simplify module connections and improve the overall design. Do you think this is a good approach? Are there better connector options for a small wearable device?

Any suggestion for the betterment of this project is welcome.
 

danadak

Feb 19, 2021
1,089
Joined
Feb 19, 2021
Messages
1,089
The threshold value could be simple use of A/D to measure a pot of some
kind, a simple knob based setting control.

Why edge connector, you have a lot of I/O pins in design ? What is the connector connecting ?

As far as processor choice, consider a ESP32, Like ESP32C3 Supermini board. Reason is
as you go deeper into design it can do WIFI and or Bluetooth to expand usability of design.
You can use the Arduino IDE for its IDE. If you need more I/O there are other board versions
that give you this.

1787146626071.png
 
Last edited:

rainyliveshere

Jul 4, 2026
25
Joined
Jul 4, 2026
Messages
25
Why edge connector, you have a lot of I/O pins in design ? What is the connector connecting ?

Not really for the number of I/O pins. I was considering it for modular connections. The sensor could remain on a separate board.
The main PCB would contain the controller. The display and buzzer could also be separate. A removable connection could simplify assembly and testing. But I'm not sure it's the best choice. That's why I asked for suggestions. Would board-to-board connectors be more suitable here?
 

danadak

Feb 19, 2021
1,089
Joined
Feb 19, 2021
Messages
1,089
For small number I/O Molex might be a good choice. But we do not know enough
about bandwidth of communication I/O and sensor interface and other anticipated
connections. If you need a lot of connector insertions/removals thats a consid-
eration as well. As well as DC I and V considerations.
 
Top