Chapter 31 Soldering Circuit Board

Project 31.1 Soldering a Buzzer

We have tried to use a buzzer in a previous chapter, and now we will solder a circuit that when the button is pressed, the buzzer sounds.

This circuit does not need programming and can work when it is powered on. And when the button is not pressed, there is no power consumption.

You can install it on your bike, bedroom door or any other places where it is needed.

Component List

Pin header x2

Resistor 220Ω x1

Chapter36_00

Chapter01_04

Active buzzer x1

Push button x1

Chapter07_01

Chapter02_02

LED x1

AA Battery Holder x1

Chapter36_01

Chapter36_02

Circuit

We will solder the following circuit on the main board.

Schematic diagram

Hardware connection

If you need any support, please feel free to contact us via:

support@freenove.com

Chapter36_03

Chapter36_04

Soldering the Circuit

Insert the components on the main board and solder the circuit on its back.

../../../_images/Chapter36_05.png

rendering after soldering:

Front

Back

Chapter36_06

Chapter36_07

Testing circuit

Connect the circuit board to power supply (3~5V). You can use ESP32 board or battery box as the power supply.

../../../_images/Chapter36_08.png

Press the push button after connecting the power, and then the buzzer will make a sound.

Project 31.2 Soldering a Flowing Water Light

From previous chapter, we have learned to make a flowing water light with LED. Now, we will solder a circuit board, and use the improved code to make a more interesting flowing water light.

Component List

Pin header x5

Chapter36_00

Resistor 220Ω x8

Chapter01_04

LED x1

Chapter01_03

74HC595 x1

Chapter15_00

Circuit

Solder the following circuit on the main board.

Schematic diagram

Hardware connection

Chapter36_09

Chapter36_10

Soldering the Circuit

Insert the components on the main board and solder the circuit on its back.

../../../_images/Chapter36_11.png

Rendering after soldering:

Front

Back

Chapter36_12

Chapter36_13

Connecting the Circuit

Connect the board to ESP32 with jumper wire in the following way.

../../../_images/Chapter36_14.png

Code

The following is the program code:

 1import time
 2from my74HC595 import Chip74HC595
 3
 4chip = Chip74HC595(14,12,13)
 5# ESP32-14: 74HC595-DS(14)
 6# ESP32-12: 74HC595-STCP(12)
 7# ESP32-13: 74HC595-SHCP(11)
 8
 9while True:
10    x=0x01
11    for count in range(8):
12        chip.shiftOut(1,x)  #High bit is sent first
13        x=x<<1
14        time.sleep_ms(300)
15    x=0x01
16    for count in range(8):
17        chip.shiftOut(0,x)  #Low bit is sent first
18        x=x<<1
19        time.sleep_ms(300)