1. You can now buy finished microcontroller project from us, Check out the Store for the complete list of projects.
  2. Need a custom project, Send us some details about your project. So that we can quote the price for it.

digital speedometer with 8051 Microcontroller

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by edzahid, Aug 8, 2008.

  1. edzahid

    edzahid New Member

    Likes Received:
    0
    Trophy Points:
    0
    hi
    i have an idea to build digital speedometer with distance travel in kilometer/meter ,show the speed (km/h) and to find how much distance total distance.
    need to press push botton if wanna to display other measurement.

    i want to use 16x2 lcd, 8051 cip, and Photomicrosensor or hall-effect sensor.

    I want to use it in my Bicycle and further in my bike
    sensor should be easy to install and simple too
    How to start?
  2. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
    Its a good project, You can use hall effect sensor. Measure the distance traveled for one revolution of the wheel.
    For each revolution's you can measure the Distance traveled. From the distance you can get the speed with respect to time.
    Use AT89C2051 microcontroller.
  3. edzahid

    edzahid New Member

    Likes Received:
    0
    Trophy Points:
    0
    Can you help me with the schematic diagram?
  4. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
    Use this circuit, do needed changes for AT89C2051 microcontroller
    [​IMG]
  5. ankitloud

    ankitloud New Member

    Likes Received:
    0
    Trophy Points:
    0
  6. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
    You can download the source code from here
  7. shenoy

    shenoy New Member

    Likes Received:
    0
    Trophy Points:
    0
    Hi

    I have an idea to build a speedometer for bikes using magnets ... I have thought of using reed switch as the sensing element and I need your help in building the basic circuit .... I have seen the above circuit diagram..

    1) what modification is needed in the above ckt ?
    2) which microcontroller is required for this project ...?

    Please provide me with the circuit diagram ...
    waiting for your sooner reply ...

    Regards,
    shenoy

    shenoy
  8. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
    The reed switches cant sense for high speed. you have to use the Hall effect sensors.
  9. edzahid

    edzahid New Member

    Likes Received:
    0
    Trophy Points:
    0
    hi again mr binu.

    here is my progress on electronic speedometer..

    here is my circuit.. the there is no sensor connection.. because only use one wire.
    fyi..im using photo diode sensor...
    [​IMG]

    here is my actual circuit.. before this..im using assembly to test the connection LCD and Switch to 8051.. and i manage to get the result..
    *when on the power*
    [​IMG]
    *button 1 pressed*
    [​IMG]
    *button 2 pressed*
    [​IMG]
    *button 3 pressed*
    [​IMG]

    and here is the coding im used ..
    Code (Text):
    1. SW1 EQU P3.0
    2. SW2 EQU P3.1
    3. SW3 EQU P3.2
    4.  
    5. INIT: MOV A,#38H ; initialization
    6. ACALL CMD   ; issue command
    7. MOV A,#0EH  ; LCD On, cUrsor ON, cursor blinking OFF
    8. ACALL CMD
    9. MOV A,#01H  ; Clear LCD
    10. ACALL CMD
    11. MOV A,#06H  ; Shift cursor right
    12. ACALL CMD
    13. MOV A,#82H  ; Cursor: line 1, position 2
    14. ACALL CMD  
    15. MOV A,#3CH  ; 2nd line
    16. ACALL CMD
    17. MOV A,#01000101B    ; E
    18. ACALL DISPLAY
    19. MOV A,#01001100B    ; L
    20. ACALL DISPLAY
    21. MOV A,#01000101B    ; E
    22. ACALL DISPLAY
    23. MOV A,#01000011B    ; C
    24. ACALL DISPLAY
    25. MOV A,#01010100B     ;T
    26. ACALL DISPLAY
    27. MOV A,#01010010B    ; R
    28. ACALL DISPLAY
    29. MOV A,#01001111B    ; O
    30. ACALL DISPLAY
    31. MOV A,#01001110B    ; N
    32. ACALL DISPLAY
    33. MOV A,#01001001B    ; I
    34. ACALL DISPLAY
    35. MOV A,#01000011B    ; C
    36. ACALL DISPLAY
    37. MOV A,#0C3H       ; JUMP TO 2nd LINE, position 3
    38. ACALL CMD
    39. MOV A,#01010011B ; S
    40. ACALL DISPLAY
    41. MOV A,#01010000B    ; P
    42. ACALL DISPLAY
    43. MOV A,#01000101B    ; E
    44. ACALL DISPLAY
    45. MOV A,#01000101B    ; E
    46. ACALL DISPLAY
    47. MOV A,#01000100B ; D
    48. ACALL DISPLAY
    49. MOV A,#01001111B    ; O
    50. ACALL DISPLAY
    51. MOV A,#01001101B    ; M
    52. ACALL DISPLAY
    53. MOV A,#01000101B    ; E
    54. ACALL DISPLAY
    55. MOV A,#01010100B     ;T
    56. ACALL DISPLAY
    57. MOV A,#01000101B    ; E
    58. ACALL DISPLAY
    59. MOV A,#01010010B    ; R
    60. ACALL DISPLAY
    61.  
    62.  
    63. POLL:
    64.         SETB SW1
    65.         SETB SW2
    66.         SETB SW3
    67.         JNB SW1,SW1_Tmp
    68.         JNB SW2,SW2_Tmp
    69.         JNB SW3,SW3_Tmp
    70.         JMP POLL
    71.  
    72. SW1_Tmp:
    73.         AJMP DISP_SW1
    74. SW2_Tmp:
    75.         AJMP DISP_SW2
    76. SW3_Tmp:
    77.         AJMP DISP_SW3
    78.         JMP POLL
    79.  
    80. DISP_SW1:
    81. MOV A,#01H  ; Clear LCD
    82. ACALL CMD
    83. MOV A,#80H  ; Cursor: line 1, position 3
    84. ACALL CMD
    85. MOV A,#3CH  ; 2nd line
    86. ACALL CMD
    87. MOV A,#01010011B ; S
    88. ACALL DISPLAY
    89. MOV A,#01110000B ; p
    90. ACALL DISPLAY
    91. MOV A,#01100101B ; e
    92. ACALL DISPLAY
    93. MOV A,#01100101B ; e
    94. ACALL DISPLAY
    95. MOV A,#01100100B ; d
    96. ACALL DISPLAY
    97. MOV A,#00101000B ; (
    98. ACALL DISPLAY
    99. MOV A,#01101101B ; m
    100. ACALL DISPLAY
    101. MOV A,#00101111B ; /
    102. ACALL DISPLAY
    103. MOV A,#01110011B ; s
    104. ACALL DISPLAY
    105. MOV A,#00101001B ; )
    106. ACALL DISPLAY
    107. MOV A,#0C1H       ; JUMP TO 2nd LINE, position 13
    108. ACALL CMD
    109. MOV A,#00110000B ; 0
    110. ACALL DISPLAY
    111. MOV A,#00101110B ; .
    112. ACALL DISPLAY
    113. MOV A,#00110000B ; 0
    114. ACALL DISPLAY
    115.  
    116. JMP POLL                ; JUMP TO POLL FOR NEW KEY PRESS
    117.  
    118. MOV A,#B ;
    119. ACALL DISPLAY
    120.  
    121. DISP_SW2:
    122. MOV A,#01H  ; Clear LCD
    123. ACALL CMD
    124. MOV A,#80H  ; Cursor: line 1, position 3
    125. ACALL CMD
    126. MOV A,#3CH  ; 2nd line
    127. ACALL CMD
    128. MOV A,#01000011B ; C
    129. ACALL DISPLAY
    130. MOV A,#01110101B ; u
    131. ACALL DISPLAY
    132. MOV A,#01110010B ; r
    133. ACALL DISPLAY
    134. MOV A,#01110010B ; r
    135. ACALL DISPLAY
    136. MOV A,#01100101B ; e
    137. ACALL DISPLAY
    138. MOV A,#01101110B ; n
    139. ACALL DISPLAY
    140. MOV A,#01110100B ; t
    141. ACALL DISPLAY
    142. MOV A,#00100000B ;
    143. ACALL DISPLAY
    144. MOV A,#01000100B ; D
    145. ACALL DISPLAY
    146. MOV A,#01101001B ; i
    147. ACALL DISPLAY
    148. MOV A,#01110011B ; s
    149. ACALL DISPLAY
    150. MOV A,#01110100B ; t
    151. ACALL DISPLAY
    152. MOV A,#01100001B ; a
    153. ACALL DISPLAY
    154. MOV A,#01101110B ; n
    155. ACALL DISPLAY
    156. MOV A,#01100011B ; c
    157. ACALL DISPLAY
    158. MOV A,#01100101B ; e
    159. ACALL DISPLAY
    160. MOV A,#0C1H       ; JUMP TO 2nd LINE, position 16
    161. ACALL CMD
    162. MOV A,#01101101B ; m
    163. ACALL DISPLAY
    164. JMP POLL
    165.  
    166. DISP_SW3:
    167. MOV A,#01H  ; Clear LCD
    168. ACALL CMD
    169. MOV A,#80H  ; Cursor: line 1, position 3
    170. ACALL CMD
    171. MOV A,#3CH  ; 2nd line
    172. ACALL CMD
    173. MOV A,#01010100B ; T
    174. ACALL DISPLAY
    175. MOV A,#01101111B ; o
    176. ACALL DISPLAY
    177. MOV A,#01110100B ; t
    178. ACALL DISPLAY
    179. MOV A,#01100001B ; a
    180. ACALL DISPLAY
    181. MOV A,#01101100B ; l
    182. ACALL DISPLAY
    183. MOV A,#00100000B ;
    184. ACALL DISPLAY
    185. MOV A,#01000100B ; D
    186. ACALL DISPLAY
    187. MOV A,#01101001B ; i
    188. ACALL DISPLAY
    189. MOV A,#01110011B ; s
    190. ACALL DISPLAY
    191. MOV A,#01110100B ; t
    192. ACALL DISPLAY
    193. MOV A,#01100001B ; a
    194. ACALL DISPLAY
    195. MOV A,#01101110B ; n
    196. ACALL DISPLAY
    197. MOV A,#01100011B ; c
    198. ACALL DISPLAY
    199. MOV A,#01100101B ; e
    200. ACALL DISPLAY
    201. MOV A,#0C1H       ; JUMP TO 2nd LINE, position 3
    202. ACALL CMD
    203. MOV A,#01101101B ; m
    204. ACALL DISPLAY
    205. JMP POLL
    206.  
    207.  
    208. CMD:
    209. MOV P1,A
    210. CLR P3.5
    211. CLR P3.4
    212. SETB P3.3
    213. CLR P3.3
    214. ACALL DELAY
    215. RET;
    216.  
    217. DISPLAY:MOV P1,A
    218. SETB P3.5
    219. CLR P3.4
    220. SETB P3.3
    221. CLR P3.3
    222. ACALL DELAY
    223. RET;
    224.  
    225. DELAY: CLR P3.3
    226. CLR P3.5
    227. SETB P3.4
    228. MOV P1,#0FFh
    229. SETB P3.3
    230. MOV A,P1
    231. JB ACC.7,DELAY
    232.  
    233. CLR P3.3
    234. CLR P3.4
    235. RET;
    236.  
    237. END
    238.  
    and here is the model im using to test this electronic speedometer..
    [​IMG]

    here is my sensor.. i already test this sensor..and its work well
    as nothing block his way.. it will send voltage, v=0.15v
    and if that this block his way.. output voltage is v=5.10v
    [​IMG]

    so the main problem here is..im not really good at writing a program in assembly either in c language..
    so if u can help me with this.. here is my email.. ed_zahid@yahoo.com

    *1st button=show the speed (m/s)
    *2nd button=show current distance travel
    *3rd button=show total distance travel
    *using atmel 89S51
    *12Mhz crystal
    *LCD LMB162ABC
  10. Binu

    Binu Administrator

    Likes Received:
    138
    Trophy Points:
    63
Loading...

Share This Page