Introduction
This product is a carrier specifically developed for the UNIHIKER. It uses a tilted edge connector slot to provide the screen with the best viewing angle. It integrates dual DC motor drive, which can be powered separately. At the same time, the board carries RGB lights, infrared transmission, infrared reception functions, and extends 10* 3Pin ports and 4* I2C ports. In combination with DFRobot's powerful Gravity product system, the UNIHIKER can create unlimited possibilities.
Features
- Supports dual DC motor, controlled by 4* I/O
- Multiple power supply methods, USB, DC head, terminal block are available
- Tilted edge connector slot, the screen has the best viewing angle
- Onboard infrared transmission and reception and RGB lights, more playability
- All spare IOs are led out, good expandability
- Supports 5V I2C, stronger compatibility
- U-shaped USB adapter cable,UNIHIKER can be power supply by the carrier board
- Multiple indicator lights, power, motor power, motor signal indicator lights, convenient for debugging
Specification
- Power interface:
- DC2.1 interface: 6~12V
- TypeC interface: 5V
- Working voltage: 3.3V
- I/O expansion header:
- 3Pin: 10* I/O ports, 3.3V
- 4Pin I2C: 3* 3.3V, 1* 5V
- Motor interface: DC Motor x2
- USB adapter port: HY2.0 4Pin interface, used to power the UNIHIKER
- Power switch: controls the power supply of the USB adapter port and the motor drive
- Mounting hole: M3x4
- Onboard components:
- WS2812 RGB light x3
- Infrared transmitter x1
- Infrared receiver x1
- Size: 98x58.5mm / 3.86x2.30in
- Weight: 70g
Functional Diagram
- IR TX: Infrared transmission feature, controlled in the same way as regular infrared transmission modules.
- IR RX: Infrared reception feature, controlled in the same way as regular infrared reception modules.
- RGB LED: The on-board RGB light is a series of three WS2812 lights, controlled in the same way as regular WS2812 lights.
- Motor Interface: Each motor is controlled by two signal lines, one signal port outputs high and low level to control the direction of the motor, and the other signal port outputs PWM to control the motor speed. P5 controls the direction of M1, P8 controls the speed of M1, P6 controls the direction of M2, and P16 controls the speed of M2.
- Motor Signal Indicator Light: The on/off state indicates the forward and reverse signal status of the motor, and the light brightness can indicate the control signal PWM speed status.
- VM Indicator Light: Indicates the power status of the motor, the motor power is only provided directly by the Power In interface.
- I2C: Four I2C interfaces, one of which has a voltage of 5V, used to power high-power devices like Huskylens. Note that this interface can only provide 5V voltage when the VIN port or the expansion board Type-C port is powered separately. If the expansion board is not powered separately but is powered from the Unihiker, this interface cannot be used normally.
- USB Adapter Interface: Through the matching HY2.0 to USB adapter cable, the power and USB signals on the expansion board can be transferred to the Type-C port of the Unihiker, enabling both the Unihiker and the expansion board to be powered and communicated with by plugging in only one power source.
- Power Supply Method Explanation:
- 1-From the Unihiker Type-C interface: Plug into the computer USB port, suitable for daily programming and debugging use, the motor and 5V I2C on the expansion board cannot be used, other functions can be used normally.
- 2-From the expansion board Type-C interface: Input 5V power supply, suitable for daily programming and debugging use, the motor on the expansion board cannot be used, other functions can be used normally.
- 3-From the expansion board DC2.1 interface: Input 6-12V power supply, can supply power to all modules on the expansion board. The matching DC2.1 adapter can be used to convert the DC head to a wire column. The matching USB adapter cable can transfer the power on the expansion board to the Unihiker.
- When unplugging the USB adapter cable, make sure to press down the buckle first, then unplug the cable. Do not use brute force to pull the interface.
Tutorial
Programming in Mind+ According to the Getting Started section in the UNIHIKER official documentation, it is recommended for beginners to operate according to the instructions in the Mind+ section. [Click to view]
The main process is: download and install MInd+ on your PC, open Mind+, switch to Python mode and Code page, click on the icon in front of Terminal, open the Connect Remote Terminal menu, and then connect the UNIHIKER. After that, you can create a new py file in the File System, write code and run.
Example 1: Using the On-board RGB LED
Note: The 'UNIHIKER Pin (P13)' block can be found under the 'Pin Operation' category in the 'UNIHIKER' extension.
- Result: The light blinks in the order of red, green, and blue with a one-second interval.
# -*- coding: UTF-8 -*-
# MindPlus
# Python
import time
from pinpong.board import Board,Pin,NeoPixel
from pinpong.extension.unihiker import *
Board().begin()
np1 = NeoPixel(Pin((Pin.P13)),3)
np1.brightness(128)
while True:
np1.range_color(0,2,0xFF0000)
time.sleep(1)
np1.range_color(0,2,0x00FF00)
time.sleep(1)
np1.range_color(0,2,0x0000FF)
time.sleep(1)
Example 2: Using the On-board IR TX/RX
This example uses 2 UNIHIKERs and 2 expansion boards, one of which uses the infrared transmission function, and the other uses the infrared reception and RGB light function, to achieve infrared remote control light switch.
Receiver End:
# -*- coding: UTF-8 -*-
# MindPlus
# Python
import time
from pinpong.board import Board,Pin,IRRecv,NeoPixel
from pinpong.extension.unihiker import *
def event(data):
my_variable = hex(data)
print(my_variable)
if (my_variable == (str("0xfd00ff"))):
print("open")
np1.range_color(0,2,0x0000FF)
if (my_variable == (str("0xfd807f"))):
print("close")
np1.range_color(0,2,0x000000)
Board().begin()
ir1 = IRRecv(Pin((Pin.P14)),event)
np1 = NeoPixel(Pin((Pin.P13)),3)
np1.brightness(128)
while True:
time.sleep(1)
- Transmitter End:
# -*- coding: UTF-8 -*-
# MindPlus
# Python
import time
from pinpong.board import Board,Pin,IRRemote
from pinpong.extension.unihiker import *
Board().begin()
p_p15_irSend=IRRemote(Pin(Pin.P15))
while True:
print("TX:0xfd00ff")
p_p15_irSend.send(0xfd00ff)
time.sleep(2)
print("TX:0xfd807f")
p_p15_irSend.send(0xfd807f)
time.sleep(2)
- Result: The RGB light can be switched on and off using the infrared remote control, and the RGB light can also be controlled using the infrared transmission board. When the infrared is blocked, the RGB light stops.
Example 3: Using the On-board Motor Driver
Note: When driving the motor, you need to connect 6-12V power from the DC port, the VM light is on, otherwise the motor will not rotate.
# -*- coding: UTF-8 -*-
# MindPlus
# Python
import time
from pinpong.board import Board,Pin
from pinpong.extension.unihiker import *
Board().begin()
p_p5_out=Pin(Pin.P5, Pin.OUT)
p_p8_pwm=Pin(Pin.P8, Pin.PWM)
p_p6_out=Pin(Pin.P6, Pin.OUT)
p_p16_pwm=Pin(Pin.P16, Pin.PWM)
while True:
print("Simultaneously forward at 50% speed")
# P5 controls the direction of M1
# P8 controls the speed of M1
# P6 controls the direction of M2
# P16 controls the speed of M2
p_p5_out.write_digital(1)
p_p8_pwm.write_analog(512)
p_p6_out.write_digital(1)
p_p16_pwm.write_analog(512)
time.sleep(3)
print("Simultaneously stop")
# Speed is 0, the motor stops rotating
p_p8_pwm.write_analog(0)
p_p16_pwm.write_analog(0)
time.sleep(3)
print("Simultaneously reverse at 100% speed")
# Low level means the motor reverses
p_p5_out.write_digital(0)
p_p8_pwm.write_analog(1023)
p_p6_out.write_digital(0)
p_p16_pwm.write_analog(1023)
time.sleep(3)
- Result: Both motors rotate forward at the same time, then stop, and then reverse.
Example 4: Use of External 3Pin Sensor-DHT11
# -*- coding: UTF-8 -*-
# MindPlus
# Python
import time
from pinpong.board import Board,Pin,DHT11
from pinpong.extension.unihiker import *
Board().begin()
dht1 = DHT11(Pin((Pin.P2)))
while True:
print((str("temperature:") + str(dht1.temp_c())))
print((str("humidity:") + str(dht1.humidity())))
time.sleep(1)
- Result: Read the temperature and humidity data of the DHT11 temperature and humidity sensor and print it on the terminal.
Example 5: Use of External 3Pin Actuator - Servo
# -*- coding: UTF-8 -*-
# MindPlus
# Python
import time
from pinpong.board import Board,Pin,Servo
from pinpong.extension.unihiker import *
Board().begin()
servo1 = Servo(Pin((Pin.P3)))
while True:
print("90")
servo1.write_angle(90)
time.sleep(1)
print("10")
servo1.write_angle(10)
time.sleep(1)
print("170")
servo1.write_angle(170)
time.sleep(1)
- Result: The servo rotates between 90, 10, and 170 at intervals of one second.
Example 6: Use of External I2C Sensor - Ultrasonic Sensor
# -*- coding: UTF-8 -*-
# MindPlus
# Python
import time
from pinpong.board import Board
from pinpong.libs.dfrobot_urm09 import URM09
Board().begin()
ult1 = URM09(0x11)
ult1.set_mode_range(ult1._MEASURE_MODE_AUTOMATIC, ult1._MEASURE_RANG_500)
while True:
print((str("Distance:") + str(ult1.distance_cm())))
time.sleep(1)
- Result: The distance data of the ultrasonic sensor is printed in the terminal.
FAQ
Q | Can the functions on the expansion board be used normally when the UNIHIKER is directly plugged in with a USB cable and the expansion board is not powered? |
---|---|
A | Except for the motor drive and the 5V I2C port, other functions can be used normally |
Q | Why doesn't the motor rotate? |
---|---|
A | 1, First check the power supply, VIN power supply is required, the VM indicator on the expansion board lights up. 2, Then check if there is a problem with the program, you can remove other programs and only test motor control. |
More questions and cool idea, please visit DFRobot Forum
More Documents
Get 2x3A DC Motor Driver Carrier for UNIHIKER from DFRobot Store or DFRobot Distributor.