bREAL
  • Home
  • About
  • Software
  • Electrical
  • Mechanical
We wrote the code for our converter in Arduino C and Python. The code mapped all 27 letters to their respective combinations of 6 pins in Braille. It would take in a text file, then, eight characters at a time, convert it to Braille characters. These characters would then be displayed by sending current to the appropriate individual pins in the circuit. The code also detects when a key on the keyboard was pushed, and refreshes the eight displayed characters by actuating the same eight characters again (to unlock the latch) to then actuating the next eight characters in the text file.
Go to Github

Testing

We tested pin actuation using LEDs connected to the Arduino with 330 ohm resistors. This was for easier setup and to give us time to manufacture the solenoids while writing the code in parallel. We also had separate testing code for assembly-line testing the solenoids, but this didn't allow us to test how much current all the pins together would draw from the power source. We were able to write working controls for the pins, but unfortunately were not able to source enough current to our homemade solenoids to see all the pins actuate correctly eight characters at a time. Check out what happened in the electrical section, or scroll down to see the code!

Arduino Code

Serial Write

To connect the Arduino, connect the pins in the #define (the blue ones) from the Arduino to solenoids l1-l6, l7-l12, l13-l18, l19-l24, l25-l30, l31-l36, l37-l42, l43-l48 where each set of 6 I/O pins maps to solenoids 1-6 in order as follows:
1       6
2       5
3       4
So l7 would map to 1, l8 would map to 2, l9 would map to 3, etc. 
Picture
Picture
Picture
Picture

Python Code

Character MapPing

This converts all lowercase characters to decimal values converted from a binary encoding using the 6 character mapping above. So if the character to be is 'a', solenoid 1 should be high, so the binary value would be 100000, which is 32 in decimal. When it is written to the serial monitor in Arduino, these numbers translate correctly to a byte 00100000 which actuates a character. 
Picture

Serial Transfer

This actually finds and writes to the serial monitor in Arduino over pySerial using a string (which can also be pulled from a text file). You can modify the number of characters to actuate by changing chr_limit to how many characters you plan to actuate. It also pads the string with spaces to make sure that there are always an evenly divisible number of characters coming in by the chr_limit. 
Picture
Picture
Create a free web site with Weebly