+21622886281
I2C LCD 1602 Display LED Micro:bit

Traffic light with LCD display controlled by Micro:bit

Objective of this project:

The objective of this project is to realize a traffic light following these steps:

– The red led lights for 3 seconds by displaying on the LCD display «Stop».

– After 3 seconds the red led goes out and lights another green, also for 3 seconds, displaying “Cross”

– Once the green led goes out, lights a third, orange, for 2 seconds by displaying “Cross fast”.

Then the program resumes in loop .

Required Components

  • Micro:bit
  • 3 Resistor Board 220Ω
  • 1 Green LED
  • 1 Yellow LED
  • 1 Red LED
  • Connecting Wires
  • LCD Display

Mounting

To make the assembly you can connect: LEDs:

  • the green LED to pin P0 of the micro:bit board
  • the yellow LED to pin P1 of the micro:bit board
  • the red LED to pin P2 of the micro:bit board

For the LCD display:

  • the SCL pin from the LCD display to pin 19 from the micro:bit adapter
  • the SDA pin from the LCD display to pin 20 from the micro:bit adapter
  • the VCC pin from the LCD display to an energy of 5v to 9V
  • GND pin from LCD display to micro:bit GND pin

The mounting methods are numerous and here are some examples:

Montage (1)

Montage (2)

Makecode program

Here is the traffic light makecode program.

Note: you have to go to Extensions and import the I2C_LCD1602 extension.




0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top