IMAG5796

Braille-Uno – The arduino powered braille display

For this months ribot days I decided to carry out a braille based arduino project. I had idea early in the month for a refreshable braille display that could be used in public places (shops etc), so that people with sight loss could also be aware of constantly changing variables in their surroundings – such as latest offers, news updates and other piece of information that is constantly changing. Braille could be printed and changed over when this news changes, but why do that when an automated system can be put in place!

b

So the actual task of building the system wasn’t a very complex process, the parts consist of:

  • An arduino (I used an uno)
  • A breadboard
  • 6 solenoids (5v so the arduino can power them!)
  • A bunch of component cables for connecting the solenoids

 

brailleuno

As you can see there’s not too much to the circuit itself. The solenoids need a connection to 5v power and then to either be connected to the ground or to an input (which I have done).

IMAG5621

After creating the circuit I decided to create (a very shoddy) enclosure, just for demonstration purposes. Here’s a short video demonstrating the system displaying the word ‘arduino’ in braille!



Here’s the code for the arduino ‘sketch’, comments are provided for aid in understanding :) In a nutshell this is what is happening in the code:

  • We begin by ‘initialising’ the pins, we must set a high level to each so that the solenoids pins are down.
  • Next the serial port begins listening for any strings that may received.
  • When a string is received it is send to our convertStringToBraille() method.
  • This then breaks the strings up into individual characters so that the binary bit representation of that character can be retrieved from out array of binary strings.
  • Once received, this binary sequence is used when calling the sendBinaryToArduino() method.
  • Within this method we loop through the string and set each solenoid pin to the corresponding bit value in the binary string.

 

#define CHAR_ARRAY_SIZE 72
#define PIN_COUNT 6
 
byte byteRead;
 
int braillePins[] = { 2, 3, 4, 5, 6, 7 };
int refreshSpeed = 2000;
 
String inData;
String caps = "000001";
String number = "001111";
String space = "111111";
 
// Array of braille binary representations mapped to their equivalent letter
String chars[] = {"a", "100000",
                  "b", "110000",
                  "c", "100100",
                  "d", "100110",
                  "e", "100010",
                  "f", "110100",
                  "g", "110110",
                  "h", "110010", 
                  "i", "010100",
                  "j", "010110",
                  "k", "101000",
                  "l", "111000",
                  "m", "101100",
                  "n", "101110",
                  "o", "101010",
                  "p", "111100",
                  "q", "111110",
                  "r", "111010",
                  "s", "011100",
                  "t", "011110",
                  "u", "101001",
                  "v", "111001",
                  "w", "010111",
                  "x", "101101",
                  "y", "101111",
                  "z", "101001",
                  ".", "010011",
                  ",", "010000",
                  "!", "011010",
                  ";", "011000",
                  ":", "100011",
                  "@", "000100",
                  "&", "111101",
                  "+", "001101",
                  "-", "001001",
                  "=", "111111"
                };          
 
void setup() {                
  Serial.begin(9600);
 
  for (int i=0; i < PIN_COUNT; i++){     pinMode(braillePins[i], OUTPUT); // Set all pins as an output     digitalWrite(braillePins[i], HIGH);   }   delay(2000); // Give the solenoids a moment to set their state } void loop() {   // Implement variable speed using pentotiometer      // Here we listen for serial input to translate the words   // to braille representation   inData = "";   if( Serial.available() > 0 ){
    int h = Serial.available();
    for (int i = 0; i < h; i++) {
      inData += (char)Serial.read();
    }
    convertStringToBraille(inData);
    convertStringToBraille(space);
  }
}
 
void convertStringToBraille( String text ) {
 
 int stringLength = text.length();
 
 for( int i=0; i < stringLength; i++ ) {        char currentChar = text.charAt(i);        // Handle special case for capital letters,    // numbers, spaces and then standard lower    // case letters    if(currentChar>='A' && currentChar<='Z'){      sendBinaryToArduino(caps);    } else if(currentChar>='0' && currentChar<='1'){
     sendBinaryToArduino(number);
     delay(refreshSpeed);
     String braille = getBrailleEquivalent(isANumber(currentChar));
     sendBinaryToArduino(braille);
   } else if( currentChar == ' ' ){ 
     sendBinaryToArduino(space);
   } else {
     String braille = getBrailleEquivalent(currentChar);
     sendBinaryToArduino(braille);
   }
   delay(refreshSpeed);
 }
 
}
 
char isANumber( char c ){
  // In braille numbers 0 - 1 are shown as letters a - j with a
  // # in front of the letter, so here we just return the 
  // equivalent letter
  if(c == '0'){
    return 'j';
  } else if(c == '1'){
    return 'a';
  } else if(c == '2'){
    return 'b';
  } else if(c == '3'){
    return 'c';
  } else if(c == '4'){
    return 'd';
  } else if(c == '5'){
    return 'e';
  } else if(c == '6'){
    return 'f';
  } else if(c == '7'){
    return 'g';
  } else if(c == '8'){
    return 'h';
  } else if(c == '9'){
    return 'i';
  }
}
 
void sendBinaryToArduino(String binary){
  // Loop through the binary braille representation
  // and set the pin status for each bit
  for( int i = 0; i < binary.length(); i++ ) {
   char currentChar = binary.charAt(i);
 
   if( currentChar == '1') {
     digitalWrite(braillePins[i], LOW); 
   } else if ( currentChar == '0') {
     digitalWrite(braillePins[i], HIGH); 
   }
 
  }
}
 
String getBrailleEquivalent( char c ) {
  // Loop through the array of characters and match the character
  // parameter to return the binary equivelant
  for (int i=0; i < CHAR_ARRAY_SIZE; i++) {
     if (String(c) == chars[i]) {
       return chars[i+1];
       break;
     }
  }
 
}

IMAG5794

If I get time soon I’ll upload a circuit diagram incase anybody wishes to build something similar :) For now, enjoy and happy arduino-ing!

3 Comments

  1. JustinC

    You do realise that you are going to fry your arduino sooner or later, since the solenoids draw more current that arduino can handle, and there is not diodes in the schematic.

    • hitherejoe (Author)

      Yea I had intended to use diodes at first as I realised this would be an issue, but this was on a hack-day and I didn’t have all the parts I needed. THe solenoids are 5v which the arduino can supply so it’s ok for the short term. I guess I should add these into the schematic just to avoid frying anyones hardware!

      • JustinC

        Yes. Arduino can supply the voltage, but not the current needed. I/o pins can handle about 20mA if I remember correctly. You need transistors to handle the current.

Leave a Comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


8 − four =

Back

© hitherejoe. All rights reserved. Powered by WordPress.