A couple of days ago, I was reading my usual book(Learning Python by Mark Lutz) on my bed. It later became difficult to concentrate on my book because I kept shifting reading positions which led to continuously adjusting the book stand’s back support.
DING! And an idea came to mind. What if I make an adjustable book stand so I don’t have to adjust it manually from behind?
Hmm… And it seemed like a pretty feasible idea.
The Adjustable Book Stand
So I made an adjustable book stand that uses Servo motors to control the book stand angle. The controls are two button switches that adjust to the user’s preferred reading angle.
Materials Used:
- 1 Arduino Uno
- 2 Analog Servo Motors
- 2 Momentary Switch
- 2 LEDs (Green and Red)
- Tons of wires
- Corrugated Board
- Masking Tape
- Basswood
The Challenges:
Without having a decent design and hardware-creation background, I was struggling to determine which materials work best in this scenario. So I had been a frequent visitor at the AboveGround Art Supplies and Curry’s Art Supplies Stores for days, continuously checking to see how each material would fit in my (1) budget, and (2) the book stand.
Another intriguing challenge was building the book stand from scratch! It was the first time that I have used a saw and a drill gun without adult supervision. Well, my grandparents checked up on me for a while, just to (1) tease me about the mess in my room, and (2) checking if all my appendages are still intact. But yay! I was and will continue to be proud of myself for that.
While closing the enclosure for the controls, one of my momentary switches broke apart. So I had to cut the wires for the broken part, resolder a new switch and reconnect the wires. It was a good thing that I had a backup switch then, else I would’ve ran from my place to the nearest electronic shop for that.
Future Iterations:
I would probably work on finding better design solutions to the book stand so it can be a portable and nifty gadget. Also, since the Servo motors couldn’t handle heavy weights, I may look into designing better gear design solutions so I could change it into a DC motor or any similar motor which uses gears and belts.
Source Code:
/*
* @date 10/11/12
* @author Ruzette Tanyag
* @version Book Stand Source version 1.3
* @description:
* Source code for adjustable book stand. It uses two Servo motors to
* adjust the angle of the stand. User interacts by pushing either two of
* the momentary switches to determine the desired angle of the book stand.
* @link
* @license
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include <Servo.h>
#define LEFT_SERVO_PIN 3
#define RIGHT_SERVO_PIN 5
#define DOWN_CTRL_MOMSWITCH_PIN 8
#define UP_CTRL_MOMSWITCH_PIN 9
#define DOWN_CTRL_LED_PIN 6
#define UP_CTRL_LED_PIN 7
/*
* Servo declarations
*/
Servo leftCtrlServo;
Servo rightCtrlServo;
/*
* Stores angle activity to pushed to the Servo motors.
*/
int rotateCtr;
/*
* Arduino Constructor
*/
void setup(){
initPinMode();
initNumbers();
}
/*
* Arduino Loop
*
* Reads momentary switches activity. If either one is turned on, it lights the
* corresponding LED, increments/decrements the rotateCtr by 2 and pushes the value
* to the Servo motors.
*
*/
void loop(){
int downCtrlRead = digitalRead(DOWN_CTRL_MOMSWITCH_PIN);
int upCtrlRead = digitalRead(UP_CTRL_MOMSWITCH_PIN);
if((downCtrlRead == HIGH) && (upCtrlRead == LOW)){
digitalWrite(DOWN_CTRL_LED_PIN, HIGH);
if(rotateCtr >= 0){
rotateCtr -= 2;
servoWrite(rotateCtr);
}
}else if((downCtrlRead == LOW) && (upCtrlRead == HIGH)){
digitalWrite(UP_CTRL_LED_PIN, HIGH);
if (rotateCtr <= 90){
rotateCtr += 2;
servoWrite(rotateCtr);
}
}else{
digitalWrite(DOWN_CTRL_LED_PIN, LOW);
digitalWrite(UP_CTRL_LED_PIN, LOW);
}
delay(20);
}
/*
* Initializes pins on the Arduino board.
*/
void initPinMode(){
leftCtrlServo.attach(LEFT_SERVO_PIN);
rightCtrlServo.attach(RIGHT_SERVO_PIN);
pinMode(DOWN_CTRL_MOMSWITCH_PIN, INPUT); // Set INPUT on Down Control Momentary Switch
pinMode(UP_CTRL_MOMSWITCH_PIN, INPUT); // Set INPUT on Up Control Momentary Switch
pinMode(DOWN_CTRL_LED_PIN, OUTPUT); // Set OUTPUT on Down Control LED
pinMode(UP_CTRL_LED_PIN, OUTPUT); // Set OUTPUT on Up Control LED
}
/*
* Initializes counters for counter increments and debugging purposes.
*/
void initNumbers(){
Serial.begin(9600); // Initializing Serial class for debugging purposes
rotateCtr = 0; // Initialize rotateCtr var
}
/*
* Writes value to both Servo motors
*/
void servoWrite(int ctr){
int temp = map(ctr, 0, 179, 179, 0);
leftCtrlServo.write(temp);
rightCtrlServo.write(ctr);
}







