Teensy – Username and Password Auto Filler

In this project we’re going to make our own hardware password management tool.

Watch the video below to see how it works

Resources

I recommend you to take a look at those posts below to learn more about the Teensy board.

Parts Required

autofiller parts

You can use the preceding links or go directly to MakerAdvisor.com/tools to find all the parts for your projects at the best price!

Schematics

autofiller schematics

Upload the code below

Note: With a few changes this projects also works with the Arduino Leonardo

/*
 Created by Rui Santos
 
 All the resources for this project:
 https://randomnerdtutorials.com/
 
 Based on some Arduino code examples 
 */
 
//inlude the bounce library 
#include <Bounce.h>

// Creating Bounce objects for each button makes detecting changes very easy.
Bounce button3 = Bounce(3, 10);  
Bounce button4 = Bounce(4, 10);  
Bounce button5 = Bounce(5, 10);  

void setup() { 
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
} 

void loop() {
  // updates all the buttons
  // don't use long delays in the loop
  button3.update();
  button4.update();
  button5.update();
  
  // when you press the buttons
  if (button3.fallingEdge()) {
    Keyboard.print("usermame_1");
    Keyboard.set_key1(KEY_TAB);
    Keyboard.send_now();
    Keyboard.print("password_1"); 
    Keyboard.set_key1(KEY_ENTER);
    Keyboard.send_now();
  }
  if (button4.fallingEdge()) {
    Keyboard.print("usermame_2");
    Keyboard.set_key1(KEY_TAB);
    Keyboard.send_now();
    Keyboard.print("password_2"); 
    Keyboard.set_key1(KEY_ENTER);
    Keyboard.send_now();
  }
  if (button5.fallingEdge()) {
    Keyboard.print("usermame_3");
    Keyboard.set_key1(KEY_TAB);
    Keyboard.send_now();
    Keyboard.print("password_3"); 
    Keyboard.set_key1(KEY_ENTER);
    Keyboard.send_now();
  }
  
  // release all the keys
  Keyboard.set_modifier(0);
  Keyboard.set_key1(0);
  Keyboard.send_now();
}

View raw code

Do you have any questions? Leave a comment down below!

Thanks for reading. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.



Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »
Learn how to build a home automation system and we’ll cover the following main subjects: Node-RED, Node-RED Dashboard, Raspberry Pi, ESP32, ESP8266, MQTT, and InfluxDB database DOWNLOAD »

Enjoyed this project? Stay updated by subscribing our newsletter!

2 thoughts on “Teensy – Username and Password Auto Filler”

  1. Hello, I was wondering, if you wanted to add another button where would it be and what Ohm would the resistor need to be? Please reply.
    Thanks,
    Charlie

    Reply
    • If you’re using the teensy you don’t need resistor, you can use the internal pullup resistors from the microcontroler.
      You can use the next pins Charlie,
      Thanks for asking

      Reply

Leave a Comment

Download Our Free eBooks and Resources

Get instant access to our FREE eBooks, Resources, and Exclusive Electronics Projects by entering your email address below.