How to use the RISC-V development board to achieve automatic car patrol line driving?

0 51676 Medium

Recently DFRobot has developed an exhibit of a patrol trolley that uses a RISC-V main control development board equipped with a StarFive JH7100 chip running the Fedora Linux operating system.


With the support of the PinPong library (a Python library) , the line patrol trolley uses Mind+ (a graphical programming software) for GPIO control and HUSKYLENS (an artificial intelligence vision sensor) for intelligent route identification to achieve the function of automatic line patrol driving.



1、StarFive JH7100


The JH7100 is equipped with dual-core U74, sharing 2MB L2 cache, operating at up to 1.2GHz and supporting Linux OS. StarFive's self-developed ISP is adapted to the most popular sensors, and the built-in image video processing subsystem supports H265/H264/JPEG codec. The integrated high-performance, low-power Vision DSP and NNE make application development more intelligent and efficient. The JH7100 is capable of performing various complex video image processing and intelligent vision calculations to meet various visual real-time processing needs at the edge.


2、PinPong Library


PinPong Library is a set of Python libraries to control open source hardware main control board, based on Firmata protocol and compatible with MicroPython syntax, you can start to use Python to control open-source hardware in 5 minutes. With the PinPong Library, you can directly use Python code to a variety of common open-source hardware programming. The PinPong Library is designed to allow developers to develop without being tied to complicated hardware models, and to shift the focus to the business implementation of the software. Even if the program is developed with Arduino at the beginning of the development, once it is deployed, it can run normally by modifying the parameters of the hardware, realizing "once written, everywhere running."


With the joint efforts of DFRobot's and StarFive's engineers, the PinPong Library has been fully adapted to StarFive's RISC-V main control board, and the PinPong Library can be used to read and operate various sensors and actuators directly.



Mind+ is a DFRobot self-developed graphical programming software that integrates various main control boards and hundreds of open-source hardware, supporting artificial intelligence (AI) and the Internet of Things (IoT). Mind+ not only supports graphical programming but also supports advanced programming languages such as Python/C/C++, allowing users to achieve a series of tasks such as environment configuration by simplifying a state where work can be performed just by opening the software. At present, DFRobot has completed the adaptation of the StarFive JH7100 SoC, which allows the development of the StarFive RISC-V main control board in a low-code way, further reducing the development difficulty of the StarFive VisionFive single-board computer.

4、HUSKYLENS artificial intelligence vision sensor


This patrol cart uses HUSKYLENS as the vision sensor. HUSKYLENS is an easy-to-use artificial intelligence camera (vision sensor) with 6 built-in functions: face recognition, object tracking, object recognition, patrol tracking, colour recognition, label recognition, object classification, 2D code recognition, and barcode recognition. HUSKYLENS has an on-board UART/I2C interface, which can be connected to mainstream development boards such as Arduino, Raspberry Pi, LattePanda, micro: bit and so on to realize hardware Seamless docking, direct output recognition results to the controller, without tossing complex algorithms, you can do very creative projects. The exhibit realizes the adaptation of HUSKYLENS and StarFive RISC-V main control development board.


HUSKYLENS is very easy to use. Toggle the function button to switch algorithms; press the learning button and HUSKYLENS learns new things. Since HUSKYLENS comes with a 2.0" IPS display, no computer assistance is needed when tuning parameters, the debugging process and recognition results are displayed directly on the screen, what you see is what you get. And the built-in machine learning technology makes HUSKYLENS has the ability of face recognition and object recognition, long-press the learning button, it will be able to learn from different angles and ranges, the more it learns the more accurate.



a) PinPong is used to drive the trolley into action, and HUSKYLENS is used for line patrol.


b) HUSKYLENS communicates with the StarFive JH7100 using the I2C bus.


c) Using 2 IO ports to control the motor direction.


d) Using 2 PWM ports to control the motor speed.


e) Automatic operation at power-on.



a) Automatic operation.


b) expandable development.



a) When the motherboard is powered on and enters the system, it will automatically execute /root/linefollower.py immediately.


b) The learning of line identification needs to be controlled by a human, click the button in the upper right corner of HUSKYLENS to learn the black line that needs to be identified, and the white line with arrow turns into the blue line when the learning is completed.


c) Once the learning is completed, the machine can be placed on the patrol track and start patrolling.

This case demonstrates the great potential of StarFive's RISC-V development board in robotics and its ability to be well adapted to various sensors for IoT control. In the next stage, StarFive will cooperate with DFRobot to develop more IoT industrial control applications based on StarFive's VisionFive single-board computer and the new generation JH7110 chip to promote the application landing in the IoT field.

About StarFive


Founded in 2018, StarFive is a local Chinese high-tech enterprise with independent intellectual property rights, providing the world's leading RISC-V-based CPU IP, SoC, development boards and other series products, and is the leader of RISC-V software and hardware ecology in China.


Since its establishment, StarFive has successively launched RISC-V-based products: the world's first intelligent vision processing platform, the world's most fully supported instruction high-performance microprocessor core and the world's first AI single-board computer. StarFive has set up branches in Shanghai, Shunde, Beijing, Chengdu, Shenzhen, Malaysia and Singapore to provide comprehensive marketing, technical support and after-sales services.


StarFive has its roots in China but eyes on the world, aiming to become a global promoter and leader of RISC-V technology and ecology. In the future, StarFive will cooperate with domestic and international eco-partners from the kernel layer, system service layer, framework layer and application layer to drive industry innovation by leading the development of RISC-V technology, thus enabling RISC-V to enter more high-end application areas and create more value for global developers and customers.

About DFRobot


Founded in November 2008, DFRobot is a leading global open-source hardware technology company. Its products are mainly used in the fields of robotics, smart products and science and innovation education. Through more than a decade of unremitting efforts, the company's brands Mushroom Cloud Makerspace, Mushroom Cloud Maker Education, Maker Carnival, and DF MakerCommunity have served millions of creators, educators/students and business developers worldwide. DFRobot believes that innovation is one of the main drivers of human evolution, so DFRobot is always innovating and constantly helping its customers innovate. By providing innovation space, tools and content make it easier for creators around the world to turn their ideas into reality. Empower Creation is the core mission of DFRobot, and helping the present and future creators of human society to create better is the greatest value of DFRobot.

All Rights