If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.
You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!
This is the documentation for my final project for EE47. For the project, I elected to do something different than an MP3 player. My interest is in low-cost computing platforms that might be beneficial to those in developing countries. Scaled back to the MCU-level, the best thing I could think of was an e-reader. But unlike been-there-done-that projects like the Wikireader, mine would be internet connected. This would provide an element of mutability and the ability to contextualize the content.
Point of View
I tried to design from the point of view of one who had limited experience with technology and computing platforms. The player would be for offline review of documents useful to the needs of low-income people in either urban or rural areas. Design of this type requires a user experience that is simple and intuitive, something that one who’s only experience from technology might be a very basic mobile phone could understand.
Figure 1: Point of view description. Note the focus on simplicity, intuitiveness, and meeting basic needs of document retrieval and playback.
Brainstorming
With a point of view in mind, I began brainstorming to come up with ideas for features and an interface. This session proved most productive. I came up with many features and needs that I would choose to implement and meet if the project were more long term. But what was most useful for our particular scale is that I began to refine the user interface experience. I moved from four random buttons (Rather non-intuitive – what are the mappings for these buttons? No affordances to narrow it down.) to a direction pad (more intuitive) and two buttons.
Figure 2: Brainstorming session. Note the evolution of the interface/control scheme.
Design
I tried to design the e-reader with my point of view and brainstorming ideas in mind. I refined my ideas through a verplank diagram.
Figure 3: My verplank diagram. Sums up the usage of the device.
Idea: A simple e-reader for knowledge dissemination in places with limited access to books or internet. Internet connectivity is included to obtain additional content when internet is available.
Metaphor: Like a Kindle for Wikipedia and/or useful tips to increase productivity and decrease poverty.
Model: A small, sturdy, Gameboy-advance like device.
Controls: Simple direction pad and selection buttons.
Error: Electronics are often expensive and difficult to interface with.
Display: A simple menu system.
Tasks: Playback of text-files, internet acquisition of new files.
Scenario: Usage in places with limited power and/or internet connectivity.
Execution
At this point, I had a fairly strong idea of what type of device I was trying to make. Now, the work was split into three tasks: building the case, assembling the hardware, and writing the software.
Case
Designing the case required a significant amount of work, but was made much easier due to the helpfulness of the lab manager, Marlo. As I was setting up m files in Solidworks I realized that I could simplify the interface once more, and use only four buttons. I realized a d-pad was all I really needed to navigate the menus. With this in mind, I settled on a separated d-pad design.
Figure 4: Separated d-pad interface
The rest of the case was designing a tabbed box in Solidworks. Unfortunately, I had to make the device much larger than I was hoping. Fitting a perf-board prototype in a case is a lot different than a PCB, so I decided to leave my
GBA-size aspirations for a future revision.
Figure 5: Size of the prototype case. Some 7x3x2.5 inches.
Electronics
I started by building the entire device on a breadboard. This involved the following components:
1 20x4 White on Blue character LCD from hacktronics
1 Wiznet812MJ Ethernet adapter for Teensy
4 buttons
1 microSD card/Sd card adapter
Miscellaneous wires, resistors, capacitors, etc.
It came out like so:
Figure 6: Breadboard prototype
With the device assembled, the next step was to move everything to a perf-board. This step proved extremely time consuming. I could not use a bus-board due to the odd pinout (10x2 parallel) of the Ethernet adapter. Making every connection manually is a slow and infuriating process. After some 10 hours, it was done.
Figure 7: Perfboard prototype
Note that the device runs off a AA battery stepped up to 5V. This is because the LCD was a 5V device (for power – 3.3V was fine for communication). The battery output was divided between the LCD and the 5V V-in on the bottom of the Teensy. In the future, I would implement some rechargeable solution, perhaps designed around the prevalence of 12V car batteries in the developing world.
Software
The next step was writing all of the software. Major hurdles included:
Writing a text-based interface with scrolling menus.
Properly outputting a “page” of text.
“Flipping” through “pages” of text
Downloading content from the internet
One should not underestimate the difficulty of any of these tasks. The final (internet) task was particularly tricky because of network connectivity. Connecting to the internet on a secure network connection is difficult. One must set the MAC address of the wiznet device (done in software) and then make sure the devices IP address (also assigned in software) will be validated. This might happen automatically, if you have selected an unused IP. It also might require communicating with a network administrator.
There are also a variety of ways one could approach the internet portion of this project. Due to time constraints, mine was very simple. I connected to a dedicated text file on my Stanford webspace an downloaded that file to the e-reader. This, however, does not provide a way for one to keep downloaded content and not overwrite it when something new comes along.
On this same train of thought, I did not have time to implement a way to remove or organize files. With more time, I would have implemented a more robust file management system. This might have pushed the bounds of the microcontroller, however, which was already at some 70% code capacity.
The state diagram came out as such:
Figure 8: State diagram.
The right button controls entering deeper into the menu system, while the left pulls one out. Left and Right also flip through pages of text (though this might chance to up and down based on user trials). Up and down are used for scrolling up and down through the home menu and file list.
Overall
The device came out looking like this:
Evaluation
Design: I believe my design plan was well formulated. The interface was quite functional, fairly intuitive, and very simple. The TeensyReader accomplishes its function (reading text files, downloading content from the internet) well with a minimum of complexity.
Execution: My execution was middling. The device was functional, but there was plenty of room for improvement. If I had more time, I would improve on the case. I would affix the buttons more securely (with some sort of glue instead of electrical tape). I would also have minimized the case size based on how large the perfboard came out. I would also install some sort of standoffs to create a sort of stand or slot for the perfboard, and affix the button using molex connectors so that the board could be easily removed and reconnected. Additionally, I would have liked to make the case of out a sturdier plastic instead of basswood. Overall, the device functioned – but at a minimum of true robustness, ease of use, and style.
Point of View: It is difficult to say if the device fit the point of view without field testing. “Action research,” is what educational school CTO Dr. Paul Kim calls it. I believe the device had the potential to meet the PoV well. However, a much more refined prototype and significant field tests would be required to truly determine this.
Process: My process was not ideal, but more or less as good as it could have been. The project was intensive both electronics-wise and software-wise. This left little time for refining the case and overall presentation, which would have been nice. I worked toward an ambitious bottom line – a functioning prototype of an internet connected e-reader – and in that sense I was successful and managed my time well. But in a perfect world, I would have worked longer hours to give each piece of the project the time it deserved.
Documentation: I believe my documentation addresses well the design considerations of the device as well as the difficulties of implementation. Combined with my project code, one could surely replicate this effort and hopefully improve upon it.
Video
Code
Master file:
// Use 40*13 = 520 bytes of EEPROM
#define MAX_FILE_COUNT 40
#define MAX_NAME_LENGTH 13
#include <mp3.h>
#include <mp3conf.h>
// include the SD library:
#include <SD.h>
#include <EEPROM.h>
//include LCD control
#include <LiquidCrystal.h>
//include ethernet
#include <SPI.h>
#include <Ethernet.h>
// Connections:
// rs (LCD pin 4) to Teensy pin 20
// rw (LCD pin 5) to Teensy pin 19
// enable (LCD pin 6) to Teensy pin 18
// LCD pin 15 to Vcc
// LCD pins d4, d5, d6, d7 to Teensy pins 16-13
LiquidCrystal lcd(20, 19, 18, 16, 15, 14, 13);
long lastDebounceTime = 0; // the last time the output pin was toggled
long debounceDelay = 350; // the debounce time; increase if the output flickers
int xPos = 0;
int yPos = 0;
int yV = 1;
//String txt = "I believe that to meet the challenges of our times, human beings will have to develop a greater sense of universal responsibility. Each of us must learn to work not just for one self, one's own family or one's nation, but for the benefit of all humankind.";
char text[81];
int maxLength = 0;
int charStart = 0;
int charStop = 80;
// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;
File doc;
int numFiles = 5;
#define HOME 1
#define LIST 2
#define READ 3
#define NET 4
//
//state control variable
// 1 = HOME
// 2 = LISTFILES
// 3 = READ
// 4 = NET
int state = HOME;
#define DEBUG // Comment this line to remove debugging features
#define sd_cs 12 // 'chip select' for SD car
#define read_buffer 512 // size of the microsd read buffer
//ethernet stuff
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {
0x1A, 0xAA, 0x2B, 0xBB, 0x3C, 0xCC };
byte ip[] = {
172,24,89,114 };
byte gateway[] = {
172,24,89,1 };
byte subnet[] = {
255,255,255,0 };
byte server[] = { 171,64,13,26 }; // stanford
Client client(server, 80);
/*
* initialize the processor speed, setup the fatfs sd card (or, mms)
* filesystem, setup mp3 playback and register the pins used (device
* specific configuration)
*/
void setup() {
//null terminate the doc-storage string
text[80] = '\0';
Serial.begin(9600); // initialize the serial terminal
pinMode(SS_PIN, OUTPUT); // change this to 53 on a mega
digitalWrite(SS_PIN, HIGH);
// see if the card is present and can be initialized:
if (!SD.begin(sd_cs)) {
Serial.println("Card failed, or not present");
// don't do anything more:
return;
}
// we'll use the initialization code from the utility libraries
// since we're just testing if the card is working!
if (!card.init(SPI_HALF_SPEED, sd_cs)) {
Serial.println("Initialization failed. Things to check:");
Serial.println("* is a card is inserted?");
Serial.println("* Is your wiring correct?");
Serial.println("* did you change the SD chipSelect pin to match your setup?");
return;
}
// Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
if (!volume.init(card)) {
Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
return;
}
if (!root.openRoot(&volume)) {
Serial.println("Failed to open root");
// don't do anything more:
return;
}
Serial.println("Card initialized.");
Serial.println("\nFiles found on the card (name, date and size in bytes): ");
// list all files in the card with date and size
root.ls(LS_R | LS_DATE | LS_SIZE);
Serial.println("Checking free memory...");
Serial.print("There are ");
Serial.print(get_free_memory(), DEC);
Serial.println(" bytes of free memory.");
Serial.print("~");
Serial.print(read_buffer, DEC);
Serial.println(" free bytes required for mp3 playing.");
// List all files to in the root directory.
// Maximum of MAX_FILE_COUNT files will be read
numFiles = ListFiles(&root);
root.close();
//LCD Stuff
lcd.begin(20,4); // columns, rows. use 16,2 for a 16x2 LCD, etc.
lcd.clear(); // start with a blank screen
lcd.setCursor(0,0); // set cursor to column 0, row 0 (the first row)
lcd.blink();
//state and UI control
attachInterrupt(0, buttonL, RISING);
attachInterrupt(1, buttonR, RISING);
attachInterrupt(2, buttonU, RISING);
attachInterrupt(3, buttonD, RISING);
//printTxt(txt, charStart, charStop);
//printLines(4);
home();
}
// Do nothing for now
void loop() {
while (1);
}
File Management
/*
* Adopted from the ladyada.net tutorial on Ethernet protocol
We really liked your descriptive video - very helpful for others, especially the problems you ran into. Your use scenarios, mind mapping, and interaction design were fantastic! We really like how you motivated your project with your own personal goals. Good job getting a tough new chip to work.
We wish your code could have been a little more extensively commented. It was a little hard for us to understand some things. We also wish we could see how your e-reader fit in the context of other low-cost readers (what's out there right now: One laptop per child, etc), but we do understand you're exploring the space. We also would have liked to see more description of the pinouts, protocol, and how you got it all to work.
So, if you had a chance to re-do this project, keeping in mind your intended use environment, how might you change the design or what parts might you swap out? (eg, would you use wireless ethernet instead or if so, would that blow your budget).
Overall, great work! We can see how much effort you put into it.
David, Akil, and Ben
You don't have permission to comment on this page.
Comments (1)
Akil Srinivasan said
at 9:32 pm on Aug 15, 2011
We really liked your descriptive video - very helpful for others, especially the problems you ran into. Your use scenarios, mind mapping, and interaction design were fantastic! We really like how you motivated your project with your own personal goals. Good job getting a tough new chip to work.
We wish your code could have been a little more extensively commented. It was a little hard for us to understand some things. We also wish we could see how your e-reader fit in the context of other low-cost readers (what's out there right now: One laptop per child, etc), but we do understand you're exploring the space. We also would have liked to see more description of the pinouts, protocol, and how you got it all to work.
So, if you had a chance to re-do this project, keeping in mind your intended use environment, how might you change the design or what parts might you swap out? (eg, would you use wireless ethernet instead or if so, would that blow your budget).
Overall, great work! We can see how much effort you put into it.
David, Akil, and Ben
You don't have permission to comment on this page.