The body of the SEEED PET is an HCR (House care robot) mobile robot kit which is a two wheel drive mobile robot platform which has three levels included; Seeeduino V328 is used as the mother board, electronic brick shield V4 and bees shield are used as extension boards. Ultra Sonic range measurement moduleSG-5010 ServoL298 Dual H-Bridge Motor DriverBluetooth Beeaccelerator module and line finder brick are used for functioning.
2 x Seeeduino V328
1 x HCR mobile robot kit
2 x Bluetooth beehttp://www.seeedstudio.com/depot/bluetooth-bee-p-598.html?cPath=2
1 x Ultrasonic range measurement module
1 x L298 Dual H-Bridge Motor Driver
1 x SG-5010 Servo
2 x electronic brick shield V4
2 x Bees shield
1 x 3-axis accelerator module
3 x Line finder brick
1 x rechargeable storage battery.
Now you can Start to make your own electronic pet
SEEED PET demo code
For more information please visit our blog:http://www.seeedstudio.com/blog/
Step 1: Make the SEEED PET Move
TIPS: The speed of the DC motor is control by the PWM duty cycle input from EA and EB (on the L298 Board), there are three pairs PWM output pins on Seeeduino V328( digital pin(3,11 ),(5,6) ,(9,10) each parenthesis is a pair of PWM controlled by Tx/Cx), the default frequencies for Seeeduino V328 are: Pins 5 and 6: 1KHz, Pins 9, 10, 11, and 3: 500Hz. When I use the default frequency(here are pins 9 and 10) to drive the DC motors, it is very noisy, and I was told that the frequency should be higher so that the DC motor would be in its better performance and the noise would be reduced, so I change the frequency at 32Khz(it is reference frequency from the motor supplier).
Here is the reasons why I choose PWM pair pins 9 and 10(related to TIMER1): pair 3 and 11(related to TIMER2) are obvious cannot be used, coz pin3 is used for interrupt 1(INT1) input from the DC motor. PWM pair pins 5 and 6 are related to TIMER0, it is a default Timer/Cunter for many arduino libraries, if it is changed the function like delay() will be incorrect(if you change the default frequency 1khz to 32Khz the function delay() will speed up to 32 times) . As to how to change the frequency you can refer to mega328’s datasheet.
You may complain why my pet can walk straight, that is because the different friction and some other factors between the two DC motors are inevitable. The good thing is the two DC motors of SEEED PET have their own encoders based on photoelectric, each one have two channels output A and B, can be used as quadrature encoding. In this project, because Seeeduino V328 only have two external interrupt inputs(digital pins 2 and 3 ), so I only use one channel of each DC motor to measure the speed of wheel. In this way speed control can be achieved, walking straight won’t be a problem.