the present invention will now be described in detail in conjunction with exemplary and preferred embodiments thereof by reference to the drawings . fig1 shows schematically a rear seat of a motor vehicle which is equipped with a headrest control system according to an embodiment of the invention , there is installed a reversible electric motor 3 on a rear side of a seat back 1 at a top end portion thereof for moving selectively a head rest 2 upwardly or downwardly between an upper limit position p1 and a lower limit or fully retracted position p2 . the reversible motor 3 is provided with a rotary encoder 4 for the purpose of detecting the position of the headrest 2 . a reference numeral 5 denotes a seat cushion having a side portion on which there are installed a headrest driving switch 6 constituting a first switch for driving the motor 3 to thereby move selectively the associated headrest 2 upwardly or downwardly and a switch 7 for moving a headrest of an assistant driver &# 39 ; s seat upwardly or downwardly , as will be made more apparent later on . in the case of the illustrated embodiment , each of the switches 6 and 7 may preferably be realized in the form of a slide type switch adapted to assume a &# 34 ; forward &# 34 ; position at which the motor is rotated in the forward direction to thereby cause the headrest to move upwardly and a &# 34 ; reverse &# 34 ; position at which the motor is rotated in the reverse direction to thereby cause the headrest to move downwardly , wherein the change - over of the switch between the two positions mentioned above is effected with the aid of a slidable manipulating member , as will be described in more detail hereinafter . since such type of switch itself is known in the art , any further description thereof will be unnecessary . a body pressure ( or weight ) sensor 8 is installed in the vicinity of the bottom surface of the seat cushion 5 for detecting the occupation of the seat by a passenger . this sensor 8 may preferably be constituted by a switch which is so designed that a detection signal ( on signal ) is produced when pressure , for example , of about 20 kg as a threshold level is applied to the seat cushion 5 . with the aid of the sensor or switch of such structure , it is possible to identify discriminatively whether an adult of a child passenger is sitting on the seat , in dependence on whether the sensor switch is closed ( on state ) or remains open ( off state ). it should here be mentioned that the headrest to which the invention is applied is not restricted to the vertically movable type illustrated in fig1 a , but the invention can equally be applied to such a headrest which is adapted to be tilted forwardly or rearwardly relative to the seat cushion 5 as illustrated by the dotted outlines p3 and p4 in fig1 a . similarly , the switches 6 and 7 are not restricted to the slide type switches . other known types of switches such as momentary type switch or a push - button type switch and others can equally be employed . further , these switches may be installed on the rear side of a back of a seat disposed in front of the seat now under consideration or alternatively in a door trim . of course , the body pressure ( weight ) sensor 8 is not restricted to the structure mentioned above . the seat described above can be mounted as a rear seat within the motor vehicle on the left and right sides , respectively . further , the seat may be installed to as an assistant driver &# 39 ; s seat . in that case , the switch 6 may be removed . fig1 b illustrates a driver &# 39 ; s seat provided with a driver operation switch 11 as a second switch for activating the motor 3 of the rear seat . next , a structure of the headrest control system according to an embodiment of the present invention will be described with reference to fig2 . the illustrated headrest control system comprises a right rear headrest input circuit 10r , a left rear headrest input circuit 10l , an assistant driver &# 39 ; s headrest input circuit 10a , a driver operation switch 11 installed in association with the driver &# 39 ; s seat and constituting a second switch , a microcomputer 20 , a right rear headrest drive circuit 30r , a left rear headrest driver circuit 30l and an assistant driver &# 39 ; s headrest drive circuit 30a . the right rear headrest input circuit 10r includes a body pressure ( weight ) sensor 8r mounted on a right rear seat , a right rear headrest drive switch 6r , an assistant driver &# 39 ; s headrest drive switch 7r , a rotary encoder 4r mounted in association with a right - hand motor 3r and a shaping circuit 12r for shaping a wave form of the pulse signal generated by the rotary encoder 4r , as will be seen in fig2 at an upper left portion thereof , wherein output signals of these circuits are inputted to the microcomputer 20 . the left rear headrest input circuit 10l is implemented in a configuration similar to that of the right rear input circuit 10r mentioned above , as shown in fig5 . the left rear headrest input circuit 10l is composed of a body pressure sensor ( designated by 8l for discrimination from the similar body pressure sensor 8r of the right rear headrest input circuit 10r mentioned above , corresponding designation being adopted for the components mention below ), a left rear headrest drive switch 6l , an assistant &# 39 ; s seat headrest drive switch 7l , a rotary encoder 4l mounted on the left - hand motor 3l and a shaping circuit 12l for shaping the pulse signal generated by the rotary encoder 4l , as will be described hereinafter . further , the assistant driver &# 39 ; s headrest input circuit 10a as shown in fig6 is composed of a body pressure ( weight ) sensor ( designated by 8a for discrimination from the body pressure sensors 8r and 8l , same suffix a being used for the other components mentioned below ), an assistant driver &# 39 ; s headrest drive switch 7a , a rotary encoder 4a mounted in association with the motor for the assistant &# 39 ; s seat headrest 3a , and a pulse shaper circuit 12a for shaping waveform of the pulse signal generated by the encoder 4a . in the case of the illustrated embodiment , however , the assistant &# 39 ; s seat headrest input circuit 10a includes no switch that corresponds to the rear headrest drive switches 6 . the microcomputer 20 includes a central processing unit ( cpu ) 21 , a read - only memory ( rom ) 22 for storing programs such as those illustrated in fig3 and 4 and a random access memory ( ram ) having areas for storing data representative of the upper limit positions p 1 , the lower limit positions p 2 and the final positions of the left and right rear headrests and the assistant &# 39 ; s seat headrest , respectively , and other data as well as work areas for the cpu 21 . additionally , the microcomputer 20 includes an input port for fetching the signals outputted from the input circuits 10r , 10l and 10a mentioned above and an output port for issuing headrest drive command signals to the left and right rear headrest drive circuits 30r , 30l and the assistant &# 39 ; s head rest drive circuit 30a , respectively , although these ports are not shown . the right rear headrest drive circuit 30r includes a relay circuit 31r connected to a power supply source (+ v ) such as an onboard battery or the like for driving the right - hand motor 3r in the forward direction to thereby move the right rear seat headrest upward , a relay circuit 32r also connected to the power supply source (+ v ) for rotating the right - hand motor 3r in the reverse direction to thereby move the right rear seat headrest downward , and transistors 33r and 34r serving for selective energization ( on ) and deenergization ( off ) of the relay circuits 31r and 32r , wherein the transistors 33r and 34r have respective bases connected to command outputs of the microcomputer 20 . since the left rear headrest drive circuit 30l and the assistant driver &# 39 ; s headrest drive circuit 30a ( illustrated in fig7 and 8 ) are each realized in a structure identical with that of the right rear headrest drive circuit 30r , further description of the former will be unnecessary . now , operation of the headrest control system of the structure described above will be elucidated with emphasis being put on the operation of the cpu 21 constituting the heart of the microcomputer 20 by reference to fig3 a , 3b and 4 . referring to fig3 a and 3b the headrest control system is set to operating state when an ignition switch ( not shown ) of the motor vehicle is turned on , whereupon a processing step st1 is executed by the cpu 21 for deciding whether the switch 6a of the right rear headrest input circuit 10r is in the position to move upwardly the associated headrest ( the forward position mentioned hereinbefore ). if the result of the decision step st10 is affirmative ( y ), the program proceeds to a step st2 where the transistor 33r of the right rear seat headrest drive circuit 30r is turned on to rotate the motor 3r in the forward direction for thereby moving the right rear seat headrest upwardly . so long as the switch 6r is held continuously at the forward position , the right rear seat headrest moves upward continuously through a loop constituted by the steps st1 , st2 and st1 . when the switch 6r is turned off , the transistor 33r becomes nonconductive to stop the motor 3r , whereupon the right rear headrest stops . at this time point , the cpu 21 fetches from the output of the encoder 4r the stop position data representing the position at which the right rear seat headrest stopped , the data being then stored as optimum in the position data ram 23 . in this case , when the right rear seat headrest has moved to the upper limit position p 1 , the motor 3r stops preventing the motor from being overloaded . when it is found at the step st1 that the switch 6r is not in the forward position for moving upwardly the headrest , the program proceeds to a step st3 where it is checked whether or not the switch 6r is in the position to move the headrest downward ( i . e ., the reverse position mentioned hereinbefore ). if the answer of this decision step st3 is affirmative ( y ), the program proceeds to a step st4 where the transistor 34r of the right rear headrest drive circuit 30r is turned on to rotate the motor 3r in the reverse direction for thereby moving downwardly the right rear seat headrest . thereafter , return is made to the step st1 . so long as the switch 6r is held continuously in the reverse position to move the headrest downwardly , the right rear seat headrest is continuously moved downwardly until the switch 6r is turned off , whereupon the transistor 34r becomes nonconductive to thereby stop the motor 3r and hence the downward movement of the right rear seat headrest . at this time point , the cpu 21 fetches the stop position data from the output of the encoder 4r , which data is then stored in the ram 23 . when it is found at the step st3 that the switch 6r is not in the reverse position to move the associated headrest downwardly , the program jumps to the step st5 where it is checked whether the left rear seat headrest operating switch 6l of the left rear headrest input circuit 10l is in the forward position to move the associated headrest upwardly . in case the result of the decision step st5 is affirmative ( y ), the program proceeds to a step st6 at which the transistor 33l of the left rear headrest drive circuit 30l is turned on , whereby the motor 3l is rotated in the forward direction to move the left rear seat headrest upwardly . so long as the switch 6l is continuously held in the forward position , the left rear headrest is continuously moved upwardly through a loop formed by the steps st5 , st6 , st1 , st3 and st5 until the switch 6l is opened , whereupon the transistor 33l becomes nonconductive to stop the motor 6l and hence the left rear headrest . at this time point , the stop position data is fetched from the output of the rotary encoder 4l to be stored in the ram 23 . on the other hand , when it is found at the step st5 that the switch 6l is not in the forward position to move upwardly the associated headrest , the program proceeds to the step st7 at which it is checked whether the switch 6l is in the reverse position to move downwardly the associated headrest . if the answer of this decision step st7 is affirmative ( y ), the program proceeds to a step st8 at which the transistor 34l of the left rear headrest drive circuit 30l is turned on to rotate the motor 3l in the reverse direction to thereby move downwardly the left rear seat headrest . thereafter , return is made to the step st1 . on the other hand , when it is found at the step st7 that the switch 6l is not in the reverse position to move downwardly the associated headrest , the program jumps to a step st9 where decision is made as to whether either the assistant &# 39 ; s seat headrest operation switch 7r belonging to the right rear headrest input circuit 10r or the assistant &# 39 ; s seat headrest operation switch 7l belonging to the left rear headrest input circuit 10l is in the forward position to move upwardly the assistant &# 39 ; s seat headrest . when the answer of the decision step st7 is affirmative , the program proceeds to a step st10 at which the transistor 33a of the assistant &# 39 ; s seat headrest drive circuit 30a is turned on to rotate the motor 3a in the forward direction for thereby moving upwardly the assistant &# 39 ; s seat headrest . thereafter , the step st1 is regained . on the other hand , when either one of the assistant &# 39 ; s seat headrest operation switches 7r and 7l is in the reverse position to move downwardly the assistant &# 39 ; s seat headrest , the program proceeds from the step st11 to a step st12 where the motor 3a is rotated in the reverse direction to thereby move downwardly the assistant &# 39 ; s seat headrest . subsequently , return is made to the step st1 . in case it is found at the step st11 that neither the assistant &# 39 ; s seat headrest drive switch 7r nor 7l is actuated , the program proceeds to a step st13 where it is checked whether the body pressure sensor 8r of the right rear headrest input 10r is closed or not . when the body pressure sensor 8r is closed ( in the on state ), the program proceeds to a step st14 at which the motor 3r is rotated in the forward or reverse direction in accordance with the last stop position data or optimum position data of the right rear seat headrest as stored in the ram 23 to thereby stop the right rear seat headrest at the position indicated by the data . thereafter , return is made to the step st1 . in case the body pressure sensor 8r is found as being open at the step st13 , the program proceeds to a step st15 at which time a decision is made as to whether the body pressure sensor 8l of the left rear headrest input circuit 10l is closed or not . when the body pressure sensor 8l is closed , the program proceeds to a step st16 at which the motor 3l is rotated in the forward or reverse direction in dependence on the last stop position of the left rear seat headrest stored in the ram 23 to thereby position correspondingly the left rear seat headrest , whereupon return is made to the step st1 . in this way , when a passenger who has occupied either the right or left rear seat most recently sits in the seat , the rear seat headrests can automatically be restored to the desired position ( steps st13 to st16 ). on the other hand , when the seat is occupied by a passenger who was not the last occupant , he or she can finely adjust the right rear headrest to a desired position by setting the right rear headrest operation switch 6r selectively to the forward or reverse position , as occasion requires ( steps st1 to st4 ). similarly , a passenger sitting on the left rear seat can finely adjust the left rear seat headrest to a desired position by moving the left rear headrest operation switch 6l to the forward or reverse position , as desired ( st5 to st8 ). further , unless the assistant driver &# 39 ; s seat is occupied , any of the passengers sitting on the right and left rear seats can move the assistant &# 39 ; s seat headrest to a desired position by correspondingly manipulating the associated assistant seat headrest operation switch 7r or 7l so that a good forward visibility can be assured ( steps st9 to st12 ). when it is found at the step st15 that the body pressure sensor 8l is open , the program proceeds to a step st17 where decision is made as to whether the body pressure sensor 8a of the assistant &# 39 ; s seat headrest input circuit 10a is closed or opened . when the body pressure sensor 8a is closed , the program proceeds to a step st18 where the motor 3a is rotated forwardly or reversely on the basis of the last stop position data of the assistant &# 39 ; s seat headrest as stored in the ram 23 , to thereby stop the assistant &# 39 ; s seat headrest at the corresponding position , whereupon the step st1 is regained . in this way , when the assistant &# 39 ; s seat occupied by a passenger is the last one remaining empty , the headrest of that seat can automatically be set at a desired position . in this conjunction , it should be mentioned that the assistant &# 39 ; s seat headrest may also be so implemented as to be susceptible to the fine positional adjustment as in the case of the rear seat headrests . when it is found at a step st17 that the body pressure sensor 8a is opened , the program proceeds to a step st19 where it is checked whether the driver &# 39 ; s operation switch 11 is closed or not . if it is closed , the program proceeds to steps st20 et seq . shown in fig4 . on the other hand , the step st1 is regained when the switch 11 is opened . at the step st20 , it is decided whether all the body pressure sensors 8r , 8l and 8a of the rear seats and the assistant driver &# 39 ; s seat are open or not . when all the body pressure sensors 8r , 8l and 8a are opened , the program proceeds to a step st21 where all the motors 3r , 3l and 3a are simultaneously rotated in the reverse direction to thereby move downwardly all the associated headrests simultaneously . subsequently , return is made to the step st1 . so long as the body pressure sensors 8r , 8l and 8a are in the open state , the associated headrests are continuously moved downwardly through a loop established by way of the steps st20 , st21 , st1 , st3 , st5 , st7 , st9 , st11 , st13 , st15 , st17 , st19 and st20 . when the headrests have attained the respective lower limit positions p2 or the fully retracted position , the motors 3r , 3l and 3a stop . on the other hand , unless all the body pressure sensors 8r , 8l and 8a are open at the step st20 , the program proceeds to a step st22 where it is checked whether the body pressure sensor 8r of the right rear headrest input circuit 10r is open or not . if the body pressure sensor 8r is open , the program proceeds to a step st23 where the right rear headrest is moved downwardly by rotating the motor 3r in the reverse direction to thereby move the right rear seat headrest downwardly . when the right rear seat headrest has attained the lower limit position p 1 , the motor 3r is stopped . similarly , when it is found at the steps st24 and st25 that the body pressure sensor 8l of the left rear headrest input circuit 10l is open , the left rear seat headrest is moved downwardly to the lower limit position p 1 , being followed by steps st26 and st27 where the assistant &# 39 ; s seat headrest is moved downwardly to the lower limit position p 1 in the case the body pressure sensor 8a is open . as will be appreciated from the above description , the driver can move downwardly the headrest ( s ) by operating the switch 11 , whereby a good backward visibility can be assured by way of an inside mirror when driving forward or directly when the motor vehicle is to be driven backward . in the foregoing description , it has been assumed that the headrests of the rear seats and that of the assistant driver &# 39 ; s seat are subjected to the control . it should however be appreciated that the headrest operation switch and other may also be provided for the driver &# 39 ; s seat for ensuring adjustability of the driver &# 39 ; s seat headrest to the optimum position . although the invention has been described in conjunction with the preferred embodiments thereof , it should be understood that various changes and modifications may readily be made by those skilled in the art without departing from the spirit and scope of the invention set forth in the claims .