Peanut-BOY

Hi there,
Apologies, but for the best experience, please view on a Larger Screen, or Continue to Browse

Peanut Boy

Peanut Boy

Peanut Boy

A Project pushing the limits of my understanding, creating an intersection between HCI, Physical Prototyping, and CS/Engineering

[Scroll Down]

The Agony,

The Pain &

The Success

Photos and Videos from the Process of Building Peanut Boy. Ranging from Collecting Data, to Testing, to Prototyping, to Failing, and of course to Finally Succeeding.

Their Ask

We interact with gadgets—both consciously and subconsciously—in our daily lives, relying on them to simplify tasks and enhance our daily lives. The challenge? Promote a project that meets this criteria, embracing creative freedom with tangible benefits to our personal lives

We interact with gadgets—both consciously and subconsciously—in our daily lives, relying on them to simplify tasks and enhance our daily lives. The challenge? Promote a project that meets this criteria, embracing creative freedom with tangible benefits to our personal lives

We interact with gadgets—both consciously and subconsciously—in our daily lives, relying on them to simplify tasks and enhance our daily lives. The challenge? Promote a project that meets this criteria, embracing creative freedom with tangible benefits to our personal lives

My Direction


A Fellow Robotic Device that can carry around Snacks, specifically designed for the chaotic and messy Architecture Studio environment. Programming it to traverse but as well as uplift fellow Studiomates within the daily studio environment


A Fellow Robotic Device that can carry around Snacks, specifically designed for the chaotic and messy Architecture Studio environment. Programming it to traverse but as well as uplift fellow Studiomates within the daily studio environment

A Fellow Robotic Device that can carry around Snacks, specifically designed for the chaotic and messy Architecture Studio environment. Programming it to traverse but as well as uplift fellow Studiomates within the daily studio environment

But How ?

Use an Arduino and a Bluetooth PC setup in C++ and Python to create a dual-communication network for Peanut Boy.


This network relays instructions and feedback about its onboard neural network, enhancing navigation in crowded spaces while having an RC override switch for added control

Use an Arduino and a Bluetooth PC setup in C++ and Python to create a dual-communication network for Peanut Boy.


This network relays instructions and feedback about its onboard neural network, enhancing navigation in crowded spaces while having an RC override switch for added control

Use an Arduino and a Bluetooth PC setup in C++ and Python to create a dual-communication network for Peanut Boy.


This network relays instructions and feedback about its onboard neural network, enhancing navigation in crowded spaces while having an RC override switch for added control

Hold Up,
Struggles much?

During prototyping, the process presented numerous challenges, both with hardware components and the physics involved.

During prototyping, the process presented numerous challenges, both with hardware components and the physics involved.

During prototyping, the process presented numerous challenges, both with hardware components and the physics involved.

IR Beam Reciever


The IR beam receiver faced challenges due to the light-bouncing effect. Despite efforts to limit the beam to a precise, pin-point scope, the infrared light from a generic remote bounced off surfaces, resulting in inaccurate readings from multiple directions. This interference prevented the receiver from achieving the intended directional control of the vehicle based on a focused light point. Ultimately, it was scratched in favor of more manual control.

IR Beam Reciever


The IR beam receiver faced challenges due to the light-bouncing effect. Despite efforts to limit the beam to a precise, pin-point scope, the infrared light from a generic remote bounced off surfaces, resulting in inaccurate readings from multiple directions. This interference prevented the receiver from achieving the intended directional control of the vehicle based on a focused light point. Ultimately, it was scratched in favor of more manual control.

IR Beam Reciever


The IR beam receiver faced challenges due to the light-bouncing effect. Despite efforts to limit the beam to a precise, pin-point scope, the infrared light from a generic remote bounced off surfaces, resulting in inaccurate readings from multiple directions. This interference prevented the receiver from achieving the intended directional control of the vehicle based on a focused light point. Ultimately, it was scratched in favor of more manual control.

Jump Starting Transistor


Despite successfully completing the schematic and wiring on the PCB, the encoder initially failed to recognize the multi-layered board. To address this, we had to jumpstart the system by bridging a transistor between the power points and the ATMega328, J2 at the top left of the board This direct root-system flash allowed the onboard system to finally establish compatibility and function as intended.

Jump Starting Transistor


Despite successfully completing the schematic and wiring on the PCB, the encoder initially failed to recognize the multi-layered board. To address this, we had to jumpstart the system by bridging a transistor between the power points and the ATMega328, J2 at the top left of the board This direct root-system flash allowed the onboard system to finally establish compatibility and function as intended.

Jump Starting Transistor


Despite successfully completing the schematic and wiring on the PCB, the encoder initially failed to recognize the multi-layered board. To address this, we had to jumpstart the system by bridging a transistor between the power points and the ATMega328, J2 at the top left of the board This direct root-system flash allowed the onboard system to finally establish compatibility and function as intended.

L298N Motor Driver Failures


Although it might have seemed like user error at first, acquiring five motor drivers only for all of them to fail pointed to a more fundamental issue. The L298N drivers couldn’t handle the current required to alternate motor direction for the AdaFruit 3.3-6V motors. To resolve this, I hand-built an H-Bridge system on a breadboard, powered by two 9V batteries in parallel, with Power Darlington transistors forming the core structure. This setup was connected to an alternating current switch on the Arduino Uno, which managed the current output effectively.

L298N Motor Driver Failures


Although it might have seemed like user error at first, acquiring five motor drivers only for all of them to fail pointed to a more fundamental issue. The L298N drivers couldn’t handle the current required to alternate motor direction for the AdaFruit 3.3-6V motors. To resolve this, I hand-built an H-Bridge system on a breadboard, powered by two 9V batteries in parallel, with Power Darlington transistors forming the core structure. This setup was connected to an alternating current switch on the Arduino Uno, which managed the current output effectively.

L298N Motor Driver Failures


Although it might have seemed like user error at first, acquiring five motor drivers only for all of them to fail pointed to a more fundamental issue. The L298N drivers couldn’t handle the current required to alternate motor direction for the AdaFruit 3.3-6V motors. To resolve this, I hand-built an H-Bridge system on a breadboard, powered by two 9V batteries in parallel, with Power Darlington transistors forming the core structure. This setup was connected to an alternating current switch on the Arduino Uno, which managed the current output effectively.

Product
Breakdown

Product
Breakdown

Product
Breakdown

Dual 9v Parallel Battery

Dual 9v

Parallel Battery

Dual 9v

Parallel Battery

H-Bridge w/ Power Darlington Transistors

H-Bridge w/ Power Darlington Transistors

H-Bridge w/ Power Darlington Transistors

AdaFruit 3.3-6v Motor

AdaFruit 3.3-6v Motor

AdaFruit 3.3-6v Motor

Arduino R3

Arduino R3

Arduino R3

2x UltraSonic Radars

2x UltraSonic Radars

2x UltraSonic Radars

Bluetooth HC-06

Bluetooth HC-06

Bluetooth HC-06

System Online LED

System Online LED

Gallery

Gallery

Gallery

  • H-Bridge + Dual 9v Batteries

  • UltraSonic Radar

  • R3 + Bluetooth

  • 3.3-6v AdaFruit Motor

  • Bluetooth + Indicator

Code Blocks

Code Blocks

Code Blocks

import serial

ser = serial.Serial("COM14", 9600, timeout = 1) 
def retrieveData1():
    ser.write(b'1')
    data = ser.readline().decode('ascii')
    return data
def retrieveData2():
    ser.write(b'2')
    data = ser.readline().decode('ascii')
    return data
def retrieveData3():
    ser.write(b'3')
    data = ser.readline().decode('ascii')
    return data
def retrieveData4():
    ser.write(b'4')
    data = ser.readline().decode('ascii')
    return data
def retrieveData5():
    ser.write(b'5')
    data = ser.readline().decode('ascii')
    return data
def retrieveData6():
    ser.write(b'6')
    data = ser.readline().decode('ascii')
    return data

while(True):
    uInput = input("Retrieve data? ")
    if uInput == '1':
        print(retrieveData1())
    if uInput == '2':
        print(retrieveData2())
    if uInput == '3':
        print(retrieveData3())
    if uInput == '4':
        print(retrieveData4())
    if uInput == '5':
        print(retrieveData5())
    if uInput == '6':
        print(retrieveData6())
    else:
        ser.write(b'0')
import serial

ser = serial.Serial("COM14", 9600, timeout = 1) 
def retrieveData1():
    ser.write(b'1')
    data = ser.readline().decode('ascii')
    return data
def retrieveData2():
    ser.write(b'2')
    data = ser.readline().decode('ascii')
    return data
def retrieveData3():
    ser.write(b'3')
    data = ser.readline().decode('ascii')
    return data
def retrieveData4():
    ser.write(b'4')
    data = ser.readline().decode('ascii')
    return data
def retrieveData5():
    ser.write(b'5')
    data = ser.readline().decode('ascii')
    return data
def retrieveData6():
    ser.write(b'6')
    data = ser.readline().decode('ascii')
    return data

while(True):
    uInput = input("Retrieve data? ")
    if uInput == '1':
        print(retrieveData1())
    if uInput == '2':
        print(retrieveData2())
    if uInput == '3':
        print(retrieveData3())
    if uInput == '4':
        print(retrieveData4())
    if uInput == '5':
        print(retrieveData5())
    if uInput == '6':
        print(retrieveData6())
    else:
        ser.write(b'0')
import serial

ser = serial.Serial("COM14", 9600, timeout = 1) 
def retrieveData1():
    ser.write(b'1')
    data = ser.readline().decode('ascii')
    return data
def retrieveData2():
    ser.write(b'2')
    data = ser.readline().decode('ascii')
    return data
def retrieveData3():
    ser.write(b'3')
    data = ser.readline().decode('ascii')
    return data
def retrieveData4():
    ser.write(b'4')
    data = ser.readline().decode('ascii')
    return data
def retrieveData5():
    ser.write(b'5')
    data = ser.readline().decode('ascii')
    return data
def retrieveData6():
    ser.write(b'6')
    data = ser.readline().decode('ascii')
    return data

while(True):
    uInput = input("Retrieve data? ")
    if uInput == '1':
        print(retrieveData1())
    if uInput == '2':
        print(retrieveData2())
    if uInput == '3':
        print(retrieveData3())
    if uInput == '4':
        print(retrieveData4())
    if uInput == '5':
        print(retrieveData5())
    if uInput == '6':
        print(retrieveData6())
    else:
        ser.write(b'0')
// Project for 05-333 Gadgets and Sensor Course @ Carnegie Mellon University
// Project Code by Andrew Chan

#include <SoftwareSerial.h>

SoftwareSerial HC06(2,3); // HC06-TX Pin 2, HC06-RX to Arduino Pin 3

int LED = A5; // Use whatever pins you want 

int motorLeft = 9;
int motorRight = 10;

// defines pins numbers for the first sensor
const int trigPin1 = A2;
const int echoPin1 = A3;

// defines pins numbers for the second sensor
const int trigPin2 = A0;
const int echoPin2 = A1;

// defines variables
long duration1, duration2;
int distance1, distance2;

bool autoDrive = true;

void setup() {
  HC06.begin(9600); // Baudrate 9600 , Choose your own baudrate
  Serial.begin(9600);
  pinMode(LED, OUTPUT);

  pinMode(motorLeft, OUTPUT);  
  pinMode(motorRight, OUTPUT);

  pinMode(trigPin1, OUTPUT); // Sets the trigPin as Output
  pinMode(echoPin1, INPUT); // Sets the echoPin as Input

  pinMode(trigPin2, OUTPUT); // Sets the trigPin as Output
  pinMode(echoPin2, INPUT); // Sets the echoPin as Input

}

// void autoCar(int distance1, int distance2) {
//   if (distance1 < 200 && distance2 < 200) {
//     killSwitch();
//   }


// }

void moveForward() {
  analogWrite(motorLeft, 50);
  analogWrite(motorRight, 50);
}

void turnRight() {
  analogWrite(motorRight, 0);
  analogWrite(motorLeft, 70);
}

void turnLeft() {
  analogWrite(motorLeft, 0);
  analogWrite(motorRight, 70);
}

void killSwitch() {
  analogWrite(motorLeft, 0);
  analogWrite(motorRight, 0);
}


void loop() {

  digitalWrite(trigPin1, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin1, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin1, LOW);
  duration1 = pulseIn(echoPin1, HIGH);
  distance1 = duration1 * 0.34 / 2;
  Serial.print("Distance Sensor 1: ");
  Serial.println(distance1);

  delay(10); // Added delay between sensor readings

  digitalWrite(trigPin2, LOW);
  digitalWrite(trigPin2, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin2, LOW);
  duration2 = pulseIn(echoPin2, HIGH);
  distance2 = duration2 * 0.34 / 2;
  Serial.print("Distance Sensor 2: ");
  Serial.println(distance2);

  if (autoDrive == true) {
    if (distance1 > 300 && distance2 > 300) {
      moveForward();
    }
    if (distance1 < 300) {
      turnRight();
    }
    if (distance2 < 300) {
      turnLeft();
    }
    else if (distance1 < 300 && distance2 < 300) {
      turnLeft();
    }
  }
  


  if (HC06.available() > 0) { // When HC06 receives something
    char receive = HC06.read(); // Read from Serial Communication
    Serial.println(receive);
    if (receive == '1') { //OVERRIDE SWITCH -------KILLS MOVEMENT
      killSwitch();
      autoDrive = false;
    } 
    else if (receive == '2') {
      moveForward();
    }
    else if (receive == '3') {
      turnLeft();
    }
    else if (receive == '4') {
      turnRight();
    }
    else if (receive == '5') {
      autoDrive = true;
    }
    // else if (receive == '5') {
    //   autoCar(distance1, distance2);
    // }
    // // else {
    //   autoCar();
    // }

  }
}
// Project for 05-333 Gadgets and Sensor Course @ Carnegie Mellon University
// Project Code by Andrew Chan

#include <SoftwareSerial.h>

SoftwareSerial HC06(2,3); // HC06-TX Pin 2, HC06-RX to Arduino Pin 3

int LED = A5; // Use whatever pins you want 

int motorLeft = 9;
int motorRight = 10;

// defines pins numbers for the first sensor
const int trigPin1 = A2;
const int echoPin1 = A3;

// defines pins numbers for the second sensor
const int trigPin2 = A0;
const int echoPin2 = A1;

// defines variables
long duration1, duration2;
int distance1, distance2;

bool autoDrive = true;

void setup() {
  HC06.begin(9600); // Baudrate 9600 , Choose your own baudrate
  Serial.begin(9600);
  pinMode(LED, OUTPUT);

  pinMode(motorLeft, OUTPUT);  
  pinMode(motorRight, OUTPUT);

  pinMode(trigPin1, OUTPUT); // Sets the trigPin as Output
  pinMode(echoPin1, INPUT); // Sets the echoPin as Input

  pinMode(trigPin2, OUTPUT); // Sets the trigPin as Output
  pinMode(echoPin2, INPUT); // Sets the echoPin as Input

}

// void autoCar(int distance1, int distance2) {
//   if (distance1 < 200 && distance2 < 200) {
//     killSwitch();
//   }


// }

void moveForward() {
  analogWrite(motorLeft, 50);
  analogWrite(motorRight, 50);
}

void turnRight() {
  analogWrite(motorRight, 0);
  analogWrite(motorLeft, 70);
}

void turnLeft() {
  analogWrite(motorLeft, 0);
  analogWrite(motorRight, 70);
}

void killSwitch() {
  analogWrite(motorLeft, 0);
  analogWrite(motorRight, 0);
}


void loop() {

  digitalWrite(trigPin1, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin1, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin1, LOW);
  duration1 = pulseIn(echoPin1, HIGH);
  distance1 = duration1 * 0.34 / 2;
  Serial.print("Distance Sensor 1: ");
  Serial.println(distance1);

  delay(10); // Added delay between sensor readings

  digitalWrite(trigPin2, LOW);
  digitalWrite(trigPin2, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin2, LOW);
  duration2 = pulseIn(echoPin2, HIGH);
  distance2 = duration2 * 0.34 / 2;
  Serial.print("Distance Sensor 2: ");
  Serial.println(distance2);

  if (autoDrive == true) {
    if (distance1 > 300 && distance2 > 300) {
      moveForward();
    }
    if (distance1 < 300) {
      turnRight();
    }
    if (distance2 < 300) {
      turnLeft();
    }
    else if (distance1 < 300 && distance2 < 300) {
      turnLeft();
    }
  }
  


  if (HC06.available() > 0) { // When HC06 receives something
    char receive = HC06.read(); // Read from Serial Communication
    Serial.println(receive);
    if (receive == '1') { //OVERRIDE SWITCH -------KILLS MOVEMENT
      killSwitch();
      autoDrive = false;
    } 
    else if (receive == '2') {
      moveForward();
    }
    else if (receive == '3') {
      turnLeft();
    }
    else if (receive == '4') {
      turnRight();
    }
    else if (receive == '5') {
      autoDrive = true;
    }
    // else if (receive == '5') {
    //   autoCar(distance1, distance2);
    // }
    // // else {
    //   autoCar();
    // }

  }
}
// Project for 05-333 Gadgets and Sensor Course @ Carnegie Mellon University
// Project Code by Andrew Chan

#include <SoftwareSerial.h>

SoftwareSerial HC06(2,3); // HC06-TX Pin 2, HC06-RX to Arduino Pin 3

int LED = A5; // Use whatever pins you want 

int motorLeft = 9;
int motorRight = 10;

// defines pins numbers for the first sensor
const int trigPin1 = A2;
const int echoPin1 = A3;

// defines pins numbers for the second sensor
const int trigPin2 = A0;
const int echoPin2 = A1;

// defines variables
long duration1, duration2;
int distance1, distance2;

bool autoDrive = true;

void setup() {
  HC06.begin(9600); // Baudrate 9600 , Choose your own baudrate
  Serial.begin(9600);
  pinMode(LED, OUTPUT);

  pinMode(motorLeft, OUTPUT);  
  pinMode(motorRight, OUTPUT);

  pinMode(trigPin1, OUTPUT); // Sets the trigPin as Output
  pinMode(echoPin1, INPUT); // Sets the echoPin as Input

  pinMode(trigPin2, OUTPUT); // Sets the trigPin as Output
  pinMode(echoPin2, INPUT); // Sets the echoPin as Input

}

// void autoCar(int distance1, int distance2) {
//   if (distance1 < 200 && distance2 < 200) {
//     killSwitch();
//   }


// }

void moveForward() {
  analogWrite(motorLeft, 50);
  analogWrite(motorRight, 50);
}

void turnRight() {
  analogWrite(motorRight, 0);
  analogWrite(motorLeft, 70);
}

void turnLeft() {
  analogWrite(motorLeft, 0);
  analogWrite(motorRight, 70);
}

void killSwitch() {
  analogWrite(motorLeft, 0);
  analogWrite(motorRight, 0);
}


void loop() {

  digitalWrite(trigPin1, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin1, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin1, LOW);
  duration1 = pulseIn(echoPin1, HIGH);
  distance1 = duration1 * 0.34 / 2;
  Serial.print("Distance Sensor 1: ");
  Serial.println(distance1);

  delay(10); // Added delay between sensor readings

  digitalWrite(trigPin2, LOW);
  digitalWrite(trigPin2, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin2, LOW);
  duration2 = pulseIn(echoPin2, HIGH);
  distance2 = duration2 * 0.34 / 2;
  Serial.print("Distance Sensor 2: ");
  Serial.println(distance2);

  if (autoDrive == true) {
    if (distance1 > 300 && distance2 > 300) {
      moveForward();
    }
    if (distance1 < 300) {
      turnRight();
    }
    if (distance2 < 300) {
      turnLeft();
    }
    else if (distance1 < 300 && distance2 < 300) {
      turnLeft();
    }
  }
  


  if (HC06.available() > 0) { // When HC06 receives something
    char receive = HC06.read(); // Read from Serial Communication
    Serial.println(receive);
    if (receive == '1') { //OVERRIDE SWITCH -------KILLS MOVEMENT
      killSwitch();
      autoDrive = false;
    } 
    else if (receive == '2') {
      moveForward();
    }
    else if (receive == '3') {
      turnLeft();
    }
    else if (receive == '4') {
      turnRight();
    }
    else if (receive == '5') {
      autoDrive = true;
    }
    // else if (receive == '5') {
    //   autoCar(distance1, distance2);
    // }
    // // else {
    //   autoCar();
    // }

  }
}

Python

Python

Python

C++

C++

C++

This code excludes the full neural network API, intentionally omitted. However, it still functions with a feedback loop system

This code excludes the full neural network API, intentionally omitted. However, it still functions with a feedback loop system

This code excludes the full neural network API, intentionally omitted. However, it still functions with a feedback loop system

Reflection

Reflection

Reflection

This project, with its many challenges, was a fulfilling experience I had long wanted to pursue. It counted as a CS elective, but more importantly, it satisfied my inner child’s dream of creating "cool shit." Though the project was unfinished, lacking its 3D-printed shell, I felt its raw form added value. Its introduction to the architecture studio boosted morale and strengthened my prototyping skills, giving me greater confidence in tackling complex challenges. It also sparked my involvement with OpenGym's Physical Data Collection hardware, where my work on tripwire and monitoring systems drew on my experience in front-end technical design and back-end implementation to enhance accuracy, longevity, and data feedforwarding.


This project, with its many challenges, was a fulfilling experience I had long wanted to pursue. It counted as a CS elective, but more importantly, it satisfied my inner child’s dream of creating "cool shit." Though the project was unfinished, lacking its 3D-printed shell, I felt its raw form added value. Its introduction to the architecture studio boosted morale and strengthened my prototyping skills, giving me greater confidence in tackling complex challenges. It also sparked my involvement with OpenGym's Physical Data Collection hardware, where my work on tripwire and monitoring systems drew on my experience in front-end technical design and back-end implementation to enhance accuracy, longevity, and data feedforwarding.


This project, with its many challenges, was a fulfilling experience I had long wanted to pursue. It counted as a CS elective, but more importantly, it satisfied my inner child’s dream of creating "cool shit." Though the project was unfinished, lacking its 3D-printed shell, I felt its raw form added value. Its introduction to the architecture studio boosted morale and strengthened my prototyping skills, giving me greater confidence in tackling complex challenges. It also sparked my involvement with OpenGym's Physical Data Collection hardware, where my work on tripwire and monitoring systems drew on my experience in front-end technical design and back-end implementation to enhance accuracy, longevity, and data feedforwarding.


Projects? More Below…

Projects? More Below…

Am I interesting?

contact me!

Am I interesting?

contact me!

Glassmorphism

Create Glassmorphism effect in Figma using this plugin.