Project 07:Astern Indicating Device

Img

1. Introduction

With the development of science and technology, cars boast the ability of intelligent environment perception, which can automatically analyze the safety and danger when driving.

For example, we can observe the specific situation behind the car if we turn on the astern indicating device when backing up, which can avoid the car being knocked. Let’s make an astern indicating device together!

The following are the tools we need.

2. Components

Img

Img

Img

Img

Kidsuno Mainboard×1

Ultrasonic Adapter Board×1

Ultrasonic Sensor×1

Astern Indicating Device×1

Img

Img

Img

8×8 Dot Matrix Display×1

Connection Wire×2

USB Cable×1

Img

3. Assembly Steps

Download the PDF follow the link:Astern Indicating Device Assembly

Or you can Watch the assemble video :

4. Function: 8*8 Dot Matrix Displays Expression Patterns

Img

5. Wiring Diagram

Connect the kidsuno mainboard and computer via a USB cable. Then connect the 8×8 dot matrix module to the No.8 interface of the mainboard and the ultrasonic adapter board to the No.9 interface of the mainboard. The Vcc, Trig, Echo, and Gnd of the ultrasonic sensor correspond to the same port of the ultrasonic adapter board.

Img

6. Add the Instruction Library of the 8*8 Dot Matrix

To use the 8×8 dot matrix , we need to call the “Display” module in the “Extension” function. Click “Matrix 8*8 IIC” then tap Img to return to the programming interface.

Img

Extension Instruction

Img

Add Matrix 8*8 IIC Display

Img

7. Write the Program

① Drag the instruction blockImg in the Events module to the script area.

Img

② Click the Matrix HT16K33 module on the left of the instruction area, then all the 8*8 dot matrix instruction blocks will be displayed.

Img

Img

③ Drag the instruction blockImg and Img in the Matrix HT16K33 module to the script area.

Img

④ Drag the instruction block Img in the Control module to the script area.

Img

⑤ Drag the instruction blockImg ,Img and Img in the Matrix HT16K33 module to the script area.

Img

⑥ Drag the instruction block Img in the Control module to the script area and change the number 1 to 2.

Img

⑦ Copy the instruction blockImg10 times and put them into the block Img respectively, then change the expression pattern Img toImg.

Img

⑧ Complete Program

Img

8. Test Result

ClickImg to upload the complete program to the kidsuno mainboard and power up, then the the 8*8 dot matrix will display colorful expression patterns.

Img

9. Function:Ultrasonic Sensor Detects Distance

Img

10. Add the Instruction Library of the Ultrasonic Sensor

To use the ultrasonic sensor , we need to call the Sensor module in the Extension function. Click Ultrasonic then tap Img to return to the programming interface.

Img

Extension Instruction

Img

Add Ultrasonic Sensor

Img

11. Description of the the Building Blocks

Img

This is the ultrasonic sensor instruction block used to measure the distance for the specified pin. The distance unit can be selected as cm or inch.

12. Write the Program

① Drag the instruction block in the Events module to the script area.

Img

② Drag the instruction block in the Serial module to the script area and take the baud rate 9600 as an example.

Img

③ Drag the instruction block Img in the Pins module to the script area and copy once. Since the ultrasonic sensor is connected to port 9 on the mainboard(Trig corresponds to pin D10 and Echo corresponds to pin D11), then change the number 0 to 10 and 11, and change the input behind number 10 to output.

Img

④ Drag the instruction block Img in the Control module to the script area.

Img

⑤ Drag the instruction block Img in the Serial module to the script area.

Img

⑥ Drag the instruction block Img in the Ultrasonic module to the script area and put it into the blockImg, then change the number 2 to 10, 6 to 11, and take the distance unit cm as an example.

Img

⑦ Drag the instruction block Img in the Control module to the script area and change the number 1 to 0.3.

Img

⑧ Complete Program

Img

13. Test Result

ClickImg to upload the complete program to the kidsuno mainboard and power up, then clickImg in the serial monitor area to set the baud rate to 9600.

Moving your hand in front of the ultrasonic sensor, the distance displayed becomes smaller when we are close to the sensor and larger when we are far away from it.

Img

Img

14. Function: Ultrasonic Sensor Controls the 8*8 Dot Matrix

Img

15. Flow Chart

Initialize the 88 dot matrix and read the distance value of the ultrasonic sensor. If the distance is greater than 0 and less than 10cm, the 88 dot matrix shows a “stop” pattern, otherwise, it displays a “backward” pattern.

Img

16. Write the Program

① Find the instruction blocks

(1)Img

(2)Img

(3)Img

(4)Img

(5)Img

(6)Img

(7)Img

(8)Img

(9)Img

② Complete Program

Img

17. Test Result

ClickImg to upload the complete program to the kidsuno mainboard and power up. When the ultrasonic sensor detects the object within a range of 0cm to 10cm, the 8*8 dot matrix shows a “Stop” pattern, otherwise, it displays a “backward” pattern.

Img

18. Extended Project

Img

The sample code is below:

Img