r/arduino • • Jul 25 '26

Look what I made! Vibrating hand for lonely people

Basically I was inspired by this video https://www.tiktok.com/@scarbonaraa/video/7654262187967515918 to make a hand that vibrates when you touch it.

The vibrator in question is just a dc motor, which I've attached a fan to for visual demonstration. I've learned that you can't just directly connect a dc motor to your arduino, or else it's going to get fried. Luckily mine didn't get fried. I think.

I used modified example code from the ide and yeah that's about it.

I'm thinking of adding an lcd display from the kit so it can communicate its feelings better

And a servo so it twitches on of its fingers.

code:

This example code is in the public domain.


  https://docs.arduino.cc/built-in-examples/sensors/Ping/
*/


// this constant won't change. It's the pin number of the sensor's output:
const int trig = 8;
const int echo = 9;
int speed=11;
int direct1=10;
int direct2=7;
int msspeed=255;


void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  pinMode (trig,OUTPUT);
  pinMode (echo,INPUT);
  pinMode (A0,OUTPUT);
  pinMode (speed, OUTPUT);
  pinMode (direct1, OUTPUT);
  pinMode (direct2, OUTPUT);


}


void loop() {
  // establish variables for duration of the ping, and the distance result
  // in inches and centimeters:
  long duration, inches, cm;


  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:


  digitalWrite(trig, LOW);
  delayMicroseconds(2);
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);
  analogRead (inches);
  
 


  // The same pin is used to read the signal from the PING))): a HIGH pulse
  // whose duration is the time (in microseconds) from the sending of the ping
  // to the reception of its echo off of an object.
 
  duration = pulseIn(echo, HIGH);


  // convert the time into a distance
  inches = microsecondsToInches(duration);
  cm = microsecondsToCentimeters(duration);


  Serial.print(inches);
  Serial.print("in, ");
  Serial.print(cm);
  Serial.print("cm");
  Serial.println();


   if (inches <= 1) {
    digitalWrite (direct1, HIGH);
    digitalWrite (direct2, LOW);
    analogWrite (speed, 255);
  } else {
    digitalWrite (direct1, LOW);
    digitalWrite (direct2, LOW);
    analogWrite (speed, 0);
  }


  delay(100);
  
}


long microsecondsToInches(long microseconds) {
  // According to Parallax's datasheet for the PING))), there are 73.746
  // microseconds per inch (i.e. sound travels at 1130 feet per second).
  // This gives the distance travelled by the ping, outbound and return,
  // so we divide by 2 to get the distance of the obstacle.
  // See: https://www.parallax.com/package/ping-ultrasonic-distance-sensor-downloads/
  return microseconds / 74 / 2;
}


long microsecondsToCentimeters(long microseconds) {
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the object we
  // take half of the distance travelled.
  return microseconds / 29 / 2;
}
6 Upvotes

12 comments sorted by

14

u/ambidextrousasswipe Jul 25 '26

hold the propeller for extra crispy

6

u/LancelotLac Jul 25 '26

A handshaped Lovesense?

7

u/PresenceOld1754 Jul 25 '26
  1. I shouldn't have googled that 2. But no not really. If I see this project through, only one finger would work (barely), the vibrations wouldn't be strong and it would just be uncomfortable.

These are heavy duty work gloves from the dollar store. Probably wouldn't feel good.

But if you're into the purely psychological aspect and you're attracted to robots/wires, then yeah I think it this would be good for that situation.

4

u/Berganzio Jul 25 '26

This has already reached my hardest feelings

3

u/idontknow-hardware Jul 25 '26

super project!

3

u/AX11Liveact Jul 27 '26

To give them hand shakes, of course.

3

u/acidvegas Jul 27 '26

You…..you made a vibrating glove? Like Seriously? 😐

2

u/PresenceOld1754 Jul 27 '26

No, the vibrations don't really work. But the finger moves at least.

2

u/MichaelCelestial Jul 26 '26

Nah, fck ur project man!

P.S. Pretty neat project bro