Hi3861

An OpenHarmony-based Hi3861 embedded project covering traffic light, colorful light, environment monitoring, and AT command modules.

01

Traffic Light Board

RGB style traffic LEDs plus S3 button control.

02

Colorful Light Board

Buzzer and RGB synchronization with sensor fusion.

03

Environment Monitor Board

MQ 2, AHT20, OLED and alarm pipeline.

04

AT Command Module

Custom AT command and serial communication flow.

At a glance

This project organises OpenHarmony embedded exercises on the Hi3861 into four tracks: a traffic-light state machine, lighting with buzzer coordination, environmental data acquisition, and custom AT commands. Each track first implements control of a single peripheral, then combines it with other modules. Together the four scenarios cover input, processing and output.

About this project

What it addresses

A common situation in embedded learning is knowing each peripheral individually but lacking experience in organising them into a complete system. This project arranges GPIO, PWM, sensors and serial communication into a learning path of four independently runnable scenarios, ordered by difficulty.

What the four tracks contain

The traffic light uses a state machine to switch between signals and detect illegal horn use; the lighting track generates light effects through PWM and coordinates them with a buzzer; environmental monitoring samples temperature, humidity and light over ADC and I²C and displays them on an OLED; the AT command track extends the serial port into a customisable command interface.

What it uses

A Hi3861 development board with OpenHarmony LiteOS-M, developed in C, covering GPIO, PWM, ADC, I²C and an OLED display, as well as UART serial communication.

How to read it

Choose a board following the module order on this page, check the pin assignments and peripherals, then open the corresponding README for the source layout and build steps. A full README reading page is also provided; reproducing the physical results requires the matching board and components.

Project Structure

Modular directories for independent activation and testing.

Hi3861
rayawa
hello
traffic_light
colorful_light
environment
at_command
demolink
iothardware
samgr
startup
01

Module 1 | Traffic Light Board

GPIO output and button input collaboration.

Hardware

  • Three color LEDs and S3 button

Projects

  1. light.c
  2. traffic.c
  3. ability.c
  4. button.c
  5. control.c

Learning Order

light.c → traffic.c → ability.c → button.c → control.c

02

Module 2 | Colorful Light Board

Audio, lighting, and sensing integration.

Hardware

  • RGB LED, buzzer, PIR sensor, photoresistor

Projects

  1. beep.c
  2. music.c
  3. led.c
  4. human_sensor.c
  5. photosensitive.c
  6. human_sensor_light.c

Learning Order

beep.c → music.c → led.c → human_sensor.c → photosensitive.c → human_sensor_light.c

03

Module 3 | Environment Monitor Board

Sensor collection, OLED display, threshold alarm.

Hardware

  • MQ 2, AHT20, OLED, flame sensor, buzzer

Projects

  1. mq2_demo.c
  2. aht20.c/.h
  3. aht20_demo.c
  4. oled_ssd1306.c/.h
  5. oled_demo.c
  6. enrionment_demo.c

Technical Features

  • I2C shared bus
  • ADC acquisition
  • Realtime OLED display
  • Threshold alarm
04

Module 4 | AT Command Development

Custom command registration and serial response.

Project

  1. cal.c with AT+CALC command

Example

AT+CALC=12,3

Build Flow

  1. Select module in rayawa/BUILD.gn
  2. Select source in module BUILD.gn
  3. Run hb build
  4. Flash with HiBurn
  5. Check UART output

Tech Stack

  • GPIO PWM I2C ADC
  • OpenHarmony CMSIS RTOS2 HiAT
  • GN Ninja hb
  • HiBurn UART tools
Back to projects