How to wire an Arduino parking sensor

An Arduino parking sensor wires an HC-SR04 distance sensor, a buzzer and a 16x2 I2C LCD to an Arduino UNO R3, powered by a 9 V supply. The sensor takes two digital pins, the LCD uses the I2C pair, and the buzzer switches through a transistor on one more pin. Two terminal strips share 5 V and ground.
Wire it
DC Wall Adapter 9V 1A (PS1)
PS1 +toU1 VIN9VDC (+)PS1 -toU1 GND10VDC (-)
Ultrasonic Distance Sensor (B1)
TB1 1toB1 VCC5VDC (+)TB2 1toB1 GND0VDC (-)U1 D9toB1 TRIGDigital I/O (5V)B1 ECHOtoU1 D10Digital I/O (5V)
LCD 16x2 with I2C Backpack (LCD1)
TB1 2toLCD1 VCC5VDC (+)TB2 2toLCD1 GND0VDC (-)U1 SDAtoLCD1 SDAI2CMost I2C backpacks have pull-ups. If yours has none, add 4.7 kΩ from SDA and SCL to 5 V.U1 SCLtoLCD1 SCLI2CMost I2C backpacks have pull-ups. If yours has none, add 4.7 kΩ from SDA and SCL to 5 V.
NPN Transistor PN2222A (Q1)
U1 GND3toQ1 E0VDC (-)
Resistor 1 kΩ 1/4 W (R1)
U1 D8toR1 1Digital I/O (5V)Beeps faster as the car gets closer.R1 2toQ1 BDigital I/O (5V)1 kΩ base resistor
Terminal strips
U1 5VtoTB1 15VDC (+)U1 GND2toTB2 10VDC (-)
Active Buzzer 5V (BZ1)
BZ1 -toQ1 CDigital I/O (5V)The transistor switches the buzzer's low sideTB1 3toBZ1 +5VDC (+)
Parts on the Codex
- DC Wall Adapter 9V 1A
- Arduino UNO R3
- Ultrasonic Distance Sensor
- LCD 16x2 with I2C Backpack
- Active Buzzer 5V
- NPN Transistor PN2222A
- Resistor 1 kΩ 1/4 W
Check ratings against the datasheet for the parts you buy before wiring.