Electric Vehicles Smart Meter System Design

RT-Thread IoT OS
2 min readJan 12, 2022

--

Intro:
This project was built with AB32VG1 microcontroller as the main controller, and the open-source RT-Thread IoT OS is adopted. This system design implements the data display via LCD screen OLED12864.

Code Open on: https://gitee.com/lk3/project/tree/master/

The project has been completed:

(1) Cruise control (speed limit is 25Km/h);

(2) OLED screen to display speed (0–36km/h);

(3) Support to display Year, Hour, Minute & Second, convenient for viewing the data;

(4) LED simulation alarm when the speed is too fast;

(5) Adjustable resistance as the electric vehicle throttle for speed control.

Hardware Specification

Kernel Part: Multithreading, multitasking scheduling, semaphores, mutexes, etc.

Component Part: Hardware ADC, analog IIC, RTC, etc.

Pin Distribution

VCC 5V;

GND

SCL: PE6

SDA: PE7

Sliding Varistor:

100K: (ADC function) (Both sides of the Tap connects 3.3~5V)

IO: PE5(adc0)

Acquisition voltage 0–3.3V, (acquisition accuracy: 10 bits)

LED:

PA1: (Blue)

Button:

F1: (Mark: S2)

Software Specification

  • The whole project was developed under RT-Thread Studio IDE
  • C programming language
  • The code adopts some part of semaphores and mutexes to ensure thread synchronization, and seamless switching is achieved through multithreading task scheduling.
  • OLED display execution function in display.c
  • OLED underlying driver function in oled.c
  • Key execution function in button.c
  • ADC function in adc_val.c

Presentation

Video Presentation: https://youtu.be/H16ijhzXyPA

Follow us on:
Twitter | Facebook | YouTube | Linkedin

--

--

RT-Thread IoT OS
RT-Thread IoT OS

Written by RT-Thread IoT OS

An Open-Source Community-Powered Real-Time Operating System (RTOS) Project! Let’s develop, DIY, create, share, and explore this new IoT World together!

No responses yet