An excerpt from our Engineering Design Notebook:

  • To test out the systems sensors and where to code a cutoff level for triggering an output, we designed the following code to read all sensor inputs and display the information in a simple and digestible format, as well as display when various systems were activated:

  • //all sensors and outputs are renamed according to the function

//input sensors

int buckleSensor = A0; //detects if buckle is buckled or not

int bValue = 0; //value being read by arduino from buckle contact sensor

int seatSensor = A1; // detects if seat is occupied

int sValue = 0; //value being read by arduino from seat pressure sensor

int handlebarSensor = A2; // detects if stroller is being pushed

int hValue = 0; //value being read by arduino from handlebar pressure sensor

int daylightSensor = A3; //detects how light it is outside

int dValue = 0; //value being read by arduino from light sensor

//digital pins connected to output

//unbuckle warning

int warning = 4; // arduino reads "warning" as digital pin 1

//collision avoidance system

int emBrake = 2; // arduino reads "emBrake" as digital pin 2

int nightLight = 3; // arduino reads "nightLight" as digital pin 3

void setup() {

Serial.begin(9600);//start up serial connection

//arduino sets all designated digital pins as outputs

pinMode(warning,OUTPUT);

pinMode(emBrake,OUTPUT);

pinMode(nightLight,OUTPUT);

}

void loop() {

//arduino reads all sensor values and stores them under separate names

hValue = analogRead(handlebarSensor); //arduino reads handlebar value under category "hValue"

sValue = analogRead(seatSensor); //arduino reads seat pressure sensor value under category "sValue"

dValue = analogRead(daylightSensor); //arduino reads LDR value under category "dValue"

bValue = analogRead(buckleSensor); //arduino reads buckle contact sensor value under category "bValue"

//arduino prints all sensor values on serial monitor.

Serial.println("Handlebar Pressure Value | Seat Pressure Value | Buckle Contact Sensor | LDR Sensor Value"); // names of sensor value categories are displayed on monitor

// handlebar pressure value and meaning are displayed

if (hValue < 1000) {

Serial.print("HANDS ON");

}

else {

Serial.print("HANDS OFF");

}

Serial.print(" ");

Serial.print(hValue);

Serial.print(" |");

//arduino prints seat presure sensor values and meaning

if (sValue<1000)

{

Serial.print("SEAT OCCUPIED");

}

else {

Serial.print("SEAT UNOCCUPIED");

}

Serial.print(" ");

Serial.print(sValue);

Serial.print(" |");

//arduino prints buckle contact sensor values and meaning

if (bValue < 20) {

Serial.print(" SEAT BUCKLED");

}

else {

Serial.print(" SEAT UNBUCKLED");

}

Serial.print(" ");

Serial.print(bValue);

Serial.print(" |");

//arduino prints LDR value and meaning

if (dValue>400)

{

Serial.print("NIGHT");

}

else {

Serial.print("DAY");

}

Serial.print(" ");

Serial.print(dValue);

Serial.println(" ");

  • This code displayed large amounts of data which allowed us to determine at what readings our outputs should be triggered

  • Multiple iterations of this code were developed when the circuits were tested with a variety of resistors and environments


Below is a picture of the Serial Monitor during the testing:

  • Testing:

    • All sensor readings were displayed on screen while sensors were subjected to variety of conditions to determine at what point a sensor reading definitively interprets an environment correctly

      • LDR readings were noted as being below 400 when in light to medium shade, with above being dark enough to be considered night

      • Force sensors were tested to see what the reading is even when handlebars lightly being held or child shifting weight slightly, less than 1000 indicates sensor detects pressure

        • foam handle bar cover removed to improve handlebar sensor accuracy, which was seriously impaired when foam expanded after released, causing a false pressure reading to be detected and the emergency brake to not be activated when hands were removed

      • Contact sensor measured low when buckled, never more than 20

        • The contact sensor broke and displayed Seat Unbuckled and was only found out because of the sensor code. Contact sensor was then replaced

      • Screenshot of Serial Monitor Sensor Readings

    • After the readings were recorded, all serial monitor code was removed to allow the arduino to operate independently of computer

    • Each system was tested independently for durability and performance

      • Nightlight worked perfectly and activated only when designed to, although a bright LED was used due to budget constraints, limiting performance

      • Warning System worked in 80% of our tests, with root causes of failure being due to wires being unplugged, improper hand placement on sensor. Durability of sensor will be increased dramatically when wires are no longer exposed. Performance was good, though led wasn’t a sufficient warning when in bright light. The system never activated when it wasn't intended to

      • Emergency Brake: Worked roughly 65% of time. Solenoids proved to be increasingly unreliable as tests were conducted, often activating and deactivating when unintended, overheating, vibrating, and buzzing. When activated as intended it performed well, slowing the stroller and bringing it to a stop. Root cause of system failure is unknown, though suspected to be from too much voltage, as a resistor was not included in the circuit.

    • Conclusion of test results: Although the systems performed well when activated, the inconsistency of when they activate needs to be improved. Integrating wires into stroller frame would solve much of the problems, as well as give the product a cleaner look, and adding a resistor to the solenoids would likely make them more reliable. Arduino could be integrated into stroller pouch with only the battery being exposed to provide easy access for replacing it. Led will be replaced with a headlight in production model to improve visibility. Overall, the stroller demonstrated the potential and viability of this product, though much work is left to be done before it is market-ready.