High Contrast Braille Keypad With Indicator Lights
by boysenberry in Circuits > Sensors
2314 Views, 15 Favorites, 0 Comments
High Contrast Braille Keypad With Indicator Lights
This project is a collaboration between Nicholas Nguyen and Daniel Wang. We are both grade 11 students. Our submission for the 3D Printing Student Design Challenge is a Braille keypad with indicator lights and high contrast text, specifically designed for sensory accommodation. The Braille keypad controls a stepper motor with a wooden rod attached to it that can be used as a latch for a door or safe.
The brain of the keypad is the Arduino UNO, and the firmware was written in the Arduino IDE. All the 3D printed parts were designed in Fusion360 and printed on an Anycubic i3 Mega S. We also used Tinkercad for the electrical design of this project.
Supplies
3D Printer
PLA Filament
Arduino UNO
Stepper Motor
Stepper Motor Driver Board
Breadboard
Jumper Wires
Breadboard-Compatible Pushbuttons
Hot Glue Gun & Sticks
Paint
Key Design
The steps for creating a key are shown in the video above and the files are linked below. Feel free to download the design files for the keys and change them in Fusion360. You can modify the text size, font, height of the key, or chamfer.
To start, we defined the key size. The keys on laptops are around 20mm, but this isn't really low-dexterity friendly. Since the keypad is designed with accessibility in mind, we decided to make the individual keys 30mm wide. We decided to design the keypad with 9 keys featuring letters 1-9 to have a nice square form factor.
We researched some keypads and looked at their design to find out what we could do to make them more accessible. One thing that a lot of keypads seemed to lack was Braille text, so we included it in our design. We followed the Braille text standards published by Braille Literacy Canada. The standards are summarized below:
a. The spherical radius of each dot should be 0.75-0.80mm. The base diameter of each dot should be 1.5-1.6mm.
b. Each dot should have a height of 0.6-0.9mm.
c. Horizontal and vertical distance between two dots in the same cell should be 2.3-2.5mm.
Finally, the numbers are cut into the key so that they can be filled in with paint to create high contrast text. This feature helps users who might benefit from visual accommodations.
Keypad & Enclosure Design
The keypad is designed with 4mm spacing between adjacent keys and 9.5mm spacing between the outer keys and the edge of the keypad. The square holes in the design are for mounting the keys and there are also recessed slots for the keys.
We designed the enclosure to fit the Arduino UNO board, the breadboard, and all the wires. There is an internal structure to prevent the Arduino from sliding around. The enclosure lid has slots for the wiring to run from the inside to the keypad.
We've combined the keys, keypad, and enclosure into one file to make 3D printing much easier. All the parts fit within a 200mm x 200mm footprint so that you can easily print them on most hobby 3D printers.
3D Printing
Once you have the file from the previous step, you need to import it into a slicing software to 3D print the parts. Using UltiMakerCura, we created this demonstration video. We've used a 25% infill density for a mix of good strength and fast printing time. If you don't have a 3D printer, we recommend checking with your local library or makerspace.
Electrical Connections
The Arduino digital pins are capable of detecting whether a signal state is low (0 volts) or high (5 volts). This means that we can use the pushbuttons to control the signal state, sending the Arduino a low signal when the button isn't being pressed, and sending a high signal when the button is being pressed.
To do this, we can place the pushbutton between 5V and ground. A resistor is placed between the pushbutton and ground so that when the button is pressed, there is a voltage drop across the resistor and the Arduino detects a high signal. When the button isn't being pressed, there is no voltage drop across the resistor and so the Arduino detects a low signal.
The Tinkercad design below demonstrates the connections that you need to make for a single pushbutton. You'll need to duplicate these connections for the other 8 pushbuttons. Once you've done that, glue the keys to the buttons, and the buttons to the keypad.
You will also need to connect the stepper motor and its driver to pins 10, 11, 12, and 13. The green LED should be connected to pin A1 and the red LED to pin A0.
The Code
#include <Stepper.h>
int STEPS=32; //the number of steps/revolutions that the stepper motor has (the model we are using is 28BYJ-48 which has 32 steps/revolution)
Stepper stepper(STEPS, 10,11,12,13); //setting up the pins that the motor is utilizing on the arduino
//constant variables that will not change
const int buttonPin1 = 1; // the number of the pushbutton pins on the arduino boards
const int buttonPin2 = 2;
const int buttonPin3 = 3;
const int buttonPin4 = 4;
const int buttonPin5 = 5;
const int buttonPin6 = 6;
const int buttonPin7 = 7;
const int buttonPin8 = 8;
const int buttonPin9 = 9;
const int ledPin = A0; // the number of the LED pins
const int ledPin2 = A1;
int count1 = 0; //tracking the number of times a bushputton got pressed
int count2 = 0;
int count3 = 0;
int count4 = 0;
int count5 = 0;
int count6 = 0;
int count7 = 0;
int count8 = 0;
int count9 = 0;
// variables that are not constant will change:
int state1 = 0; // variable for reading the pushbutton states (HIGH/LOW)
int state2 = 0;
int state3 = 0;
int state4 = 0;
int state5 = 0;
int state6 = 0;
int state7 = 0;
int state8 = 0;
int state9 = 0;
// These tracks the previous states of the buttons
int prev1 = 0;
int prev2 = 0;
int prev3 = 0;
int prev4 = 0;
int prev5 = 0;
int prev6 = 0;
int prev7 = 0;
int prev8 = 0;
int prev9 = 0;
// totalcount is the total number of times the buttons got pressed collectively
int totalcount = 0;
void setup() {
// put your setup code here, to run once:
//initialize the LEDs as outputs
pinMode(ledPin, OUTPUT);
pinMode(ledPin2, OUTPUT);
//initialize the pushbutton pin as an input:
pinMode(buttonPin1, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(buttonPin3, INPUT);
pinMode(buttonPin4, INPUT);
pinMode(buttonPin5, INPUT);
pinMode(buttonPin6, INPUT);
pinMode(buttonPin7, INPUT);
pinMode(buttonPin8, INPUT);
pinMode(buttonPin9, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
//setting the states to read the states of the pushbuttons
state1 = digitalRead(buttonPin1);
state2 = digitalRead(buttonPin2);
state3 = digitalRead(buttonPin3);
state4 = digitalRead(buttonPin4);
state5 = digitalRead(buttonPin5);
state6 = digitalRead(buttonPin6);
state7 = digitalRead(buttonPin7);
state8 = digitalRead(buttonPin8);
state9 = digitalRead(buttonPin9);
//these 'if' statements will detect if there is a change in state of the pushbuttons. If it reads 'HIGH', it indicates that it has been pressed(switched from LOW to HIGH state)
if (state1 != prev1){
delay(10);
if (state1 == HIGH){
count1++;
}
else{}
}
if (state2 != prev2){
delay(10);
if (state2 == HIGH){
count2++;
}
else{}
}
if (state3 != prev3){
delay(10);
if (state3 == HIGH){
count3++;
}
else{}
}
if (state4 != prev4){
delay(10);
if (state4 == HIGH){
count4++;
}
else{}
}
if (state5 != prev5){
delay(10);
if (state5 == HIGH){
count5++;
}
else{}
}
if (state6 != prev6){
delay(10);
if (state6 == HIGH){
count6++;
}
else{}
}
if (state7 != prev7){
delay(10);
if (state7 == HIGH){
count7++;
}
else{}
}
if (state8 != prev8){
delay(10);
if (state8 == HIGH){
count8++;
}
else{}
}
if (state9 != prev9){
delay(10);
if(state9 == HIGH){
count9++;
}
else{}
}
//setting the previosu state to the current state for future state change detections
prev1 = state1;
prev2 = state2;
prev3 = state3;
prev4 = state4;
prev5 = state5;
prev6 = state6;
prev7 = state7;
prev8 = state8;
prev9 = state9;
totalcount = count1 + count2 + count3 + count4 + count5 + count6 + count7 + count8 + count9; // used to count the length of the code entered (should be 4 in this case)
if (totalcount == 4){
//password is 1436
if (count1 == 1 && count2 == 0 && count3 == 1 && count4 == 1 && count5 == 0 && count6 == 1 && count7 == 0 && count8 == 0 && count9 == 0){ //if all of the counts are correct, the password is deemed correct
digitalWrite(ledPin2, HIGH); //green LED turns on
count1 = 0; // Reset all our counters to 0 to restart the process
count2 = 0;
count3 = 0;
count4 = 0;
count5 = 0;
count6 = 0;
count7 = 0;
count8 = 0;
count9 = 0;
totalcount = 0;
delay(5000);
digitalWrite(ledPin2,LOW); //green LED turns off
stepper.setSpeed(100);//the speed at which the motor will turn
for(int i=0;i<100;i++){//stepper motor "opens" the lock (rotates up)
stepper.step(-5);
}
delay(10000); //waits 10 seconds to automatically lock
for(int i=0;i<100;i++){//stepper motor "closes" the lock (rotates down)
stepper.step(5);
}
}
else if((count1 != 1 || count2 != 0 || count3 != 1 || count4 != 1 || count5 != 0 || count6 != 1 || count7 != 0 || count8 != 0 ||count9!=0) && totalcount == 4){ //if any of the counts are wrong AND the password length is 4 digits, the entered password is deemed incorrect
//red LED starts flashing to indicate the incorrect password
digitalWrite(ledPin,HIGH);
delay(250);
digitalWrite(ledPin,LOW);
delay(250);
digitalWrite(ledPin, HIGH);
delay(250);
digitalWrite(ledPin,LOW);
delay(250);
digitalWrite(ledPin, HIGH);
delay(250);
digitalWrite(ledPin,LOW);
delay(250);
digitalWrite(ledPin, HIGH);
delay(250);
digitalWrite(ledPin,LOW);
delay(250);
digitalWrite(ledPin, HIGH);
count1 = 0; // Reset all our counters to 0 to start the process over again
count2 = 0;
count3 = 0;
count4 = 0;
count5 = 0;
count6 = 0;
count7 = 0;
count8 = 0;
count9 = 0;
totalcount = 0;
delay(500);
digitalWrite(ledPin, LOW); //red LED turns off, indicating a new password can be entered
}
}
}
Test
Once you've connected everything and uploaded the code to the Arduino, it's time to test the keypad to make sure it works. As always, it's a good idea to test first before you put everything together so you can debug any issues. Loose wires have caused some issues for us, so you may want to check that all the electrical connections are good.
Final Product
Congratulations - you're finished! If you have any questions, feel free to leave a comment below.