Robert Poser
Published

Tap Tap Automat

Automatic tap tester based on a Particle Photon, relay shield, lift magnet, boring socket for stylus fixture and Paperino ePaper display.

IntermediateShowcase (no instructions)3 hours1,468
Tap Tap Automat

Things used in this project

Hardware components

Photon
Particle Photon
×1
Particle Relay Shield
×1
Paperino ePaper Display
×1
Lift magnet
×1
Power Supply 24V
×1
Item Profile 40x40x1200mm
×1
Guard Rail WSQ & WJ200QM-01-AL
×1
Boring Socket
×1

Hand tools and fabrication machines

thread cutter, saw

Story

Read more

Code

Tap Tester Machine

Arduino
Runs a predefined number of taps (e.g. 1.000) with a predefine frequency automatically (e.g. 2Hz)
/* ****************************************************************************************
   Demo project to control an Automatic Tap Tester via Particle Photon/Relay Shield/Lift
   magnet/Guard Rail & Paperino ePaper screen. More details can be found here:
   https://www.hackster.io/projects/958d9c
   
   We invested time and resources providing this open source code. Please support Paperino 
   open source hardware by purchasing this product @Crowdsupply @Paperino @Plasticlogic 
   @Watterott, https://www.crowdsupply.com/robert-poser/paperino 
   Created by Marco Mews, Robert Poser, Nov 3rd 2017, Dresden/Germany
**************************************************************************************** */
#include <Adafruit_GFX.h>
#include <PL_microEPD.h>
#include <RelayShield.h>

#define EPD_RST     A0
#define EPD_BUSY    A1
#define EPD_CS      A2
#define TAP_NBR     1000            // Number of Taps
#define TAP_DELAY   500             // Tap delay in ms

RelayShield myRelays;
PL_microEPD display(EPD_CS, EPD_RST, EPD_BUSY);  
int         i=0;                    // Tap counter
int         led1 = D7;

void setup() {
    pinMode(led1, OUTPUT);
    pinMode(WKP, INPUT_PULLDOWN);

    myRelays.begin();
    myRelays.on(1);

    SPI.begin();                    // SPI-Bus initialisation
    SPI.setBitOrder(MSBFIRST);                 
    SPI.setDataMode(SPI_MODE0); 
    SPI.setClockDivider(SPI_CLOCK_DIV4);
    
    display.begin();                // Paperino ePaper initialisation and refresh screen 
    display.setTextSize(4);
}

void loop() {

    if (i<TAP_NBR){
        if (myRelays.isOn(1))       // myRelays.isOn(1) will return TRUE if relay 1 on and FALSE if it's off
            myRelays.off(1);        // myRelays.off(#) will switch relay # off
        else{                       // If it wasn't already on, then turn it on
            myRelays.on(1);         // myRelays.on(#) will switch relay # on
            digitalWrite(led1, HIGH);
            delay(50);
            digitalWrite(led1, LOW);
            i+=1;
            display.clear();
            display.setCursor(4,16);
            display.print(i);
            display.update(EPD_UPD_MONO);
        }
        delay(TAP_DELAY);           // Tape delay
    }
    else {
        display.setTextSize(2);
        display.clear();
        display.setCursor(4,20);
        display.print(i);
        display.print(" taps");
        display.setCursor(4,35);
        display.print("done!");
        display.update(EPD_UPD_MONO);
        delay(5000);
        myRelays.off(1); 
        System.sleep(SLEEP_MODE_DEEP);
    }
}

Tap Tap Machine

Arduino
Translates a tap of your finger into an automatic tap with with a defined surface, weight & height. Not sure what at this point for what this could be useful for.
/* ****************************************************************************************
   Demo project to control an Automatic Tap Tester via Particle Photon/Relay Shield/Lift
   magnet/Guard Rail & Paperino ePaper screen. More details can be found here:
   https://www.hackster.io/projects/958d9c
   
   We invested time and resources providing this open source code. Please support Paperino 
   open source hardware by purchasing this product @Crowdsupply @Paperino @Plasticlogic 
   @Watterott, https://www.crowdsupply.com/robert-poser/paperino 
   Created by Marco Mews, Robert Poser, Nov 3rd 2017, Dresden/Germany
**************************************************************************************** */

SYSTEM_MODE(SEMI_AUTOMATIC);
#include <Adafruit_GFX.h>
#include <PL_microEPD.h>
#include <RelayShield.h>

#define EPD_RST     A0
#define EPD_BUSY    A1
#define EPD_CS      A2
#define ACC_CS      D6

RelayShield myRelays;
PL_microEPD display(EPD_CS, EPD_RST, EPD_BUSY);  
BO_BMA250   accel(ACC_CS);
int         i=1;                    // Tap counter
int         led1 = D7;

void setup() {
    pinMode(led1, OUTPUT);
    pinMode(WKP, INPUT_PULLDOWN);

    myRelays.begin();
    myRelays.off(1);

    SPI.begin();                    // SPI-Bus initialisation
    SPI.setBitOrder(MSBFIRST);                 
    SPI.setDataMode(SPI_MODE0); 
    SPI.setClockDivider(SPI_CLOCK_DIV4);
    
    display.begin();                // Paperino ePaper initialisation and refresh screen 
    display.setTextSize(4);
    accel.begin();
    accel.activateTapOnInt1();
}

void loop() {
    if (digitalRead(WKP)==HIGH) {   //if tap on paperino then switch relay on & off once
        myRelays.on(1);
        digitalWrite(led1, HIGH);
        delay(500);
        myRelays.off(1);
        digitalWrite(led1, LOW);
        display.clear();
        display.setCursor(4,16);
        display.print(i);
        display.update(EPD_UPD_MONO);
        i+=1;
        accel.clearLatchedInt1();
    }
}

Credits

Robert Poser

Robert Poser

4 projects • 5 followers
Thanks to Marco Mews.

Comments