Integza
Published © CC BY

Self-Punching Helmet

How to get punched playing video games!

IntermediateFull instructions providedOver 1 day2,961
Self-Punching Helmet

Things used in this project

Hardware components

SparkFun 28BYJ-48 Stepper Motor
×1
BOOSTXL-ULN2003 ULN2003A Dual Stepper Motor BoosterPack
Texas Instruments BOOSTXL-ULN2003 ULN2003A Dual Stepper Motor BoosterPack
×1
Arduino UNO
Arduino UNO
×1
Elegoo Prototype Expansion Board
×1
Elegoo MAX7219 LED Display
×1
Elegoo Passive Buzzer
×1
Adafruit ESP32 Feather
×1
Adafruit Power Bank 5V
×1
Battery, 3.7 V
Battery, 3.7 V
×1
USB-A to B Cable
USB-A to B Cable
×1

Software apps and online services

Arduino IDE
Arduino IDE
Visual Studio 2017
Microsoft Visual Studio 2017

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
3D Printer (generic)
3D Printer (generic)

Story

Read more

Custom parts and enclosures

Future Gadget #001 - 3D Models

Here you can find all the 3D Models used in the project.

Schematics

Future Gadget #001-Circuit Schematics

Here you can find an image with all the components properly connected.

Code

Code for the Arduino Uno

C#
This is the code programmed on the Arduino IDE that needs to be uploaded to the respective board.
#include <Stepper.h>
#include "LedControl.h"
#include "pitches.h"
const int stepsPerRevolution = 1024;
Stepper myStepper(stepsPerRevolution, 4, 5, 6, 7);

LedControl lc=LedControl(12,10,11,1);


int melody[] = {
  NOTE_C5, NOTE_D5, NOTE_E5, NOTE_F5, NOTE_G5, NOTE_A5, NOTE_B5, NOTE_C6};

/* we always wait a bit between updates of the display */
unsigned long delaytime1=500;
unsigned long delaytime2=50;

void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW); 
  myStepper.setSpeed(12);
  // initialize the serial port:
   /*
   The MAX72XX is in power-saving mode on startup,
   we have to do a wakeup call
   */
  lc.shutdown(0,false);
  /* Set the brightness to a medium values */
  lc.setIntensity(0,8);
  /* and clear the display */
  lc.clearDisplay(0);
}
 
// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // print out the value you read:
  Serial.println(sensorValue);
    
  if (sensorValue > 450){
    tone(8, melody[7], 3000);
    digitalWrite(LED_BUILTIN, HIGH); 
    LEDsON();
    myStepper.step(stepsPerRevolution);
    delay(500);

    LEDsOFF();
    myStepper.step(-stepsPerRevolution);
    delay(500);

    
  }
  else{
    digitalWrite(LED_BUILTIN, LOW); 
  }
  delay(200);  
   // delay in between reads for stability
}

void LEDsON() {
  /* here is the data for the characters */
  byte a[8]={B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111,B11111111};


  /* now display them one by one with a small delay */
  lc.setRow(0,0,a[0]);
  lc.setRow(0,1,a[1]);
  lc.setRow(0,2,a[2]);
  lc.setRow(0,3,a[3]);
  lc.setRow(0,4,a[4]);
  lc.setRow(0,5,a[5]);
  lc.setRow(0,6,a[6]);
  lc.setRow(0,7,a[7]);
 
}

void LEDsOFF() {
  /* here is the data for the characters */
  byte a[8]={B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000};


  /* now display them one by one with a small delay */
  lc.setRow(0,0,a[0]);
  lc.setRow(0,1,a[1]);
  lc.setRow(0,2,a[2]);
  lc.setRow(0,3,a[3]);
  lc.setRow(0,4,a[4]);
  lc.setRow(0,5,a[5]);
  lc.setRow(0,6,a[6]);
  lc.setRow(0,7,a[7]);
 
}

Code for the ESP32 Feather Board

C#
This is the code programmed on the Arduino IDE that needs to be uploaded to the respective boards.
#include "BluetoothSerial.h" //Header File for Serial Bluetooth, will be added by default into Arduino

BluetoothSerial ESP_BT; //Object for Bluetooth

int incoming;
void setup() {
  Serial.begin(9600); //Start Serial monitor in 9600
  ESP_BT.begin("ESP32_LED_Control"); //Name of your Bluetooth Signal
  pinMode(13, OUTPUT);
   digitalWrite(13, HIGH);
   delay(2000);
   digitalWrite(13, LOW);
  
  
}

void loop() {
  Serial.println("5");    
  if (ESP_BT.available()) //Check if we receive anything from Bluetooth
  {
    incoming = ESP_BT.read(); //Read what we recevive   
    if ( incoming == 53)
    {
      digitalWrite(13, HIGH);
      delay(500);
      digitalWrite(13, LOW); 
    }

     if ( incoming == 54)
    {
      digitalWrite(13, HIGH);
      delay(500);
      digitalWrite(13, LOW); 
    }
  }
  delay(20);
}

VS Studio App

C#
This is the app that interfaces the computer with the helmet.
No preview (download only).

Credits

Integza

Integza

3 projects • 12 followers
I have a lot of weird ideas and a degree in mechatronics and that should explain my videos.

Comments