Rotor HAT


Product ID: 12001

This Raspberry Pi HAT can drive up to 2 DC motors and 16 Servos with full PWM control.


**This product can work with the following models of Raspberry Pi:**

[[raspberry_pi:1aplus|A+]], [[raspberry_pi:1bplus|B+]], [[raspberry_pi:2b|2B]], [[raspberry_pi:3b|3B]], [[raspberry_pi:zero|Zero]]


* Communicating with the Raspberry Pi through I2C
* Can drive 2 DC motors
* Can drive up to 16 Servos(5V)/LEDs
* Standard 3-Pin (G/V/S) for servos
* Adjustable PWM frequency up to 16KHz, 12 bit resolution
* IR Receiver
* Up to 16 of this product can be linked together, to drive 256 Servos/LEDs


^ Released Year|2015 |
^ Size|Standard [[raspberry_pi:hat|HAT]] size |
^ Weight|27g |
^ Input Power Voltage for Motor/Servo|2.7V ~ 6.5V ❗ |
^ Motor Terminals Max Output Current|1A |

❗ **The output (operating) power voltage for the motors and servos (on Motor Terminal 1/2 and on Servo Pins) will be as same as the input voltage. Choose your power supply carefully so that it can be suitable for all of your motors and servos.**
===== Diagram =====


===== IR Receiver =====

The IR receiver on the Rotor HAT is connected to Raspberry Pi **GPIO26**.

To set up IR receiver, please refer to [[product:28007#how_to_set_up|<28007>IR Remote PiCobber]]. This tutorial is for IR Remote PiCobber, which uses GPIO18 for its IR receiver. So when you are following it, please make sure to put **gpio_in_pin=26** rather than **gpio_in_pin=18** into ”/boot/config.txt”. Something like this:

<code text>

===== Programming Guide =====
The following instruction shows you how to start programming the Rotor HAT in Python.

Firstly, you need to make sure I2C is enabled on your Raspberry Pi. If it’s not, please follow [[tutorial:rpi:configuring_i2c|this tutorial]] to enable it.

Before you run ”i2cdetect -y 1”, please connect a 5V power source to **P4**. Otherwise you would not be able to see the I2C addresses.

Next, install python-smbus:

”sudo apt-get install python-smbus”

==== Controlling Servos  ====

I2C address: 6F

Download example code – {{|}}

==== Controlling Motors ====

This product uses H-Bridge Voltage-Controlled Motor Driver, with **1A** Peak Drive Current for each channel(1A x 2Motors) and **2.7V to 6.5V** Operating Supply Voltage Range.

I2C address: 60 and 61

Download example code – {{|}}

==== IR Remote Controlling ====

With the help of some Python libraries, you can easily make an IR remote controlled robot with your TV controller, CD controller, etc. Here is an example: [[Tutorial:Making an IR Remote Controlled Robot with Rotor HAT]].

===== See Also =====

* [[:product|Products of Geekroo Technologies]]

Most Helpful FAQ for Rotor HAT