Page 57 - Hacking Roomba
P. 57

38       Part I — Interfacing




                             packet group. Perhaps the two most useful values in the power sensors packet for hacking are the
                             battery current and battery charge. By observing the current you can tell how much power the
                             project is consuming when it does different things. By watching the charge level you can tell
                             when Roomba is almost out of juice and needs to be recharged.


                              byte 16   7       6       5       4       3       2       1       0
                             charging              values: 0:not charging, 1:charging recovery, 2:charging,
                               state                  3:trickle charging, 4:waiting, 5:charging error
                              byte 17   7       6       5       4       3       2       1       0
                              battery
                              voltage                         range 0 to 65535 mV
                             (high byte)
                              byte 18   7       6       5       4       3       2       1       0
                              battery
                              voltage                         range 0 to 65535 mV
                             (low byte)
                              byte 19   7       6       5       4       3       2       1       0
                              battery
                              current                       range -32768 to 32767 mA
                             (high byte)
                              byte 20   7       6       5       4       3       2       1       0
                              battery

                              current                       range -32768 to 32767 mA
                             (high byte)
                              byte 21   7       6       5       4       3       2       1       0
                              battery
                              temp-                      range -128 to 127 degrees Celsius
                              erature
                              byte 22   7       6       5       4       3       2       1       0
                              battery
                              charge                         range 0 to 65535 mAh
                             (high byte)
                              byte 23   7       6       5       4       3       2       1       0
                              battery
                              charge                         range 0 to 65535 mAh
                             (low byte)
                              byte 24   7       6       5       4       3       2       1       0
                              battery
                              capacity                       range 0 to 65535 mAh
                             (high byte)
                              byte 25   7       6       5       4       3       2       1       0
                              battery
                              capacity                       range 0 to 65535 mAh
                             (low byte)
                             FIGURE 2-7: ROI sensor packet group 3, power and charging sensors
   52   53   54   55   56   57   58   59   60   61   62