Chapter 36 Soldering Circuit Board
Project 36.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 |
Active buzzer x1 |
|
|
|
LED x1 |
Push button x1 |
AA Battery Holder x1 |
|
|
|
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: |
|
|
Soldering the Circuit
Insert the components on the main board and solder the circuit on its back.
rendering after soldering:
Front |
Back |
|---|---|
|
|
Testing circuit
Connect the circuit board to power supply (3~5V). You can use ESP32 board or battery box as the power supply.
Press the push button after connecting the power, and then the buzzer will make a sound.
Project 36.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
|
Resistor 220Ω x8
|
LED x1
|
74HC595 x1
|
Circuit
Solder the following circuit on the main board.
Schematic diagram |
Hardware connection |
|---|---|
|
|
Soldering the Circuit
Insert the components on the main board and solder the circuit on its back.
Rendering after soldering:
Front |
Back |
|---|---|
|
|
Connecting the Circuit
Connect the board to ESP32 with jumper wire in the following way.
Sketch
The following is the program code:
1/**********************************************************************
2 Filename : FlowingLight02
3 Description : Use 74HC575 to drive the ledbar to display the flowing light.
4 Auther : www.freenove.com
5 Modification: 2024/06/19
6**********************************************************************/
7
8int latchPin = 12; // Pin connected to ST_CP of 74HC595(Pin12)
9int clockPin = 13; // Pin connected to SH_CP of 74HC595(Pin11)
10int dataPin = 14; // Pin connected to DS of 74HC595(Pin14)
11
12void setup() {
13 // set pins to output
14 pinMode(latchPin, OUTPUT);
15 pinMode(clockPin, OUTPUT);
16 pinMode(dataPin, OUTPUT);
17}
18
19void loop() {
20 // Define a one-byte variable to use the 8 bits to represent the state of 8 LEDs of LED bar graph.
21 // This variable is assigned to 0x01, that is binary 00000001, which indicates only one LED light on.
22 byte x = 0x01; // 0b 0000 0001
23 for (int j = 0; j < 8; j++) { // Let led light up from right to left
24 writeTo595(LSBFIRST, x);
25 x <<= 1; // make the variable move one bit to left once, then the bright LED move one step to the left once.
26 delay(50);
27 }
28 delay(100);
29 x = 0x80; //0b 1000 0000
30 for (int j = 0; j < 8; j++) { // Let led light up from left to right
31 writeTo595(LSBFIRST, x);
32 x >>= 1;
33 delay(50);
34 }
35 delay(100);
36}
37void writeTo595(int order, byte _data ) {
38 // Output low level to latchPin
39 digitalWrite(latchPin, LOW);
40 // Send serial data to 74HC595
41 shiftOut(dataPin, clockPin, order, _data);
42 // Output high level to latchPin, and 74HC595 will update the data to the parallel output port.
43 digitalWrite(latchPin, HIGH);
44}
In fact, this code is copied from chapter 15. If you have any questions for the code, please click “Chapter 15 74HC595 & LED Bar Graph” to return to Chapter 15 to study again.















