From ENGR005 2008
Revision as of 16:40, 8 December 2008 by Azhao1 (Talk | contribs)

Jump to: navigation, search


Project Origins

The idea for a drawbridge came from dinner with a non engineering major. While initially skeptical, we soon agreed that the idea was doable and, more importantly, interesting.

Project Description

We will be constructing and programming a plywood drawbridge using Matlab. It will be capable of detecting motion through use of a photoelectric sensor and lifting the two halves of the bridge as a response. It will use servos to wind up strings attached to the ends of the halves to lift them.


  • 4 servos
  • plywood
  • screws
  • duct tape
  • metal rods
  • photoelectric sensor
  • string



Our first design decision was how to raise the bridge, i.e. where exactly we would place the servos and in what configuration. Initially we planned to raise the bridge by attaching the servos to the bridge halves. Upon further consideration we decided upon a more indirect approach and implemented a drawbridge design where the servos would wind up strings attached to the end of the bridges. We figured that this design was more interesting and it would be easier for the servos to support the weight.

Additionally, we added an additioanl component by "robotizing" the bridge. We automated the bridge by triggering it with a light sensor. When an object blocked light from the sensor, the computer would recognize the dip in dispelled electrons and send a signal to the servos to turn and raise the bridge.

We began designing for construction by specifying rough dimensions of the bridge and of the individual parts. We decided that a 2.5 ft by 1 ft bridge was a substantial but convenient size to work with. From those dimensions we based the size of the rest of our parts. We had to take into account multiple considerations: 1. The height at which we suspended the servos, because it had to be tall enough to raise the bridge half (the half could not be significantly longer than the height of the pillars) and 2. The weight the bridge half would be, because that would affect the stability of the whole system.


Construction was done in the Swarthmore machine shop by Jared and Alan. We started by selecting wood pieces close to the sizes we wanted (as shown in our schematics drawn during the design process). Machinist Grant Smith assisted us in the cutting to produce specific wood pieces.

We then screwed the servos, in their respective metal frames, into wooden pillars. We then put the aluminum rod into the servo and attached the other end of the rod into another wooden pillar. The pillars were then screwed into the bases and the bases were finalized by screwing wooden supports beneath them.

We attached the bridge to the base with two pieces of duct tape and attached the bridge to the rod with two strings tied to the bridge's far end. The string was attached with black electrical tape.

We repeated the construction twice to produce two ends of the bridge.


Programming was done in MATLAB by Shiv and Kevin. The initial code written was untestable since the bridge was not complete, but testing revealed the lack of a "loop." This prevented MATLAB from receiving more than a single voltage value, which caused a timeout error. The final, working code is shown below.


s=instrfind;  %Find any serial links (we can have only 1) delete(s);  %... and delete.

%Create a new serial communications link - don't worry about details, %ask professor Cheever if you would like details. s=serial('COM1','Baudrate',115200,'Terminator','CR'); fopen(s);  %... and open it

%in order to test which values correspond to a boat passing

fprintf(s,'#1P1525#5P1525T10'); for i=1:50,


   fprintf(s,'VD');        %Inquire from connection "d"
   lw=fread(s,1)     %Read light sensor value.

   if (lw>127)


Final Result

Back to Final Project