Skip to content
Snippets Groups Projects
Commit d7fc2af7 authored by Eunchae Lee's avatar Eunchae Lee
Browse files

Update README.md

parent 2e40d811
No related branches found
No related tags found
No related merge requests found
......@@ -67,33 +67,36 @@ Use GCC to compile the source code on each Raspberry Pi:
gcc -o server server.c -lwiringPi -lpthread -lm
```
2. client1.c
2. client1 (DHT1.c)
```bash
gcc -o client1 client1.c -lwiringPi -lpthread
gcc -o client1 DHT1.c -lwiringPi -lpthread -lm
```
3. client2.c
3. client2 (light.c)
```bash
gcc -o client2 client2.c -lwiringPi -lpthread -lm
gcc -o client2 light.c -lwiringPi -lpthread
```
4. client3.c
4. client3 (pir.c)
```bash
gcc -o client3 client3.c -lpthread
gcc -o client3 pir.c -lpthread -lwiringPi
```
## Usage
1. Connect the Sensors and Actuators
- Rpi 1
- DHT11 Sensor:
Connect the VCC pin of the DHT11 sensor to the 5V pin on the Raspberry Pi.
Connect the GND pin of the DHT11 sensor to the GND pin on the Raspberry Pi.
Connect the DATA pin of the DHT11 sensor to the GPIO pin(2) on the Raspberry Pi.
- RPi2
- Photoresistor:
Connect one leg of the photoresistor to a 3.3V pin on the Raspberry Pi.
Connect the other leg of the photoresistor to a GPIO pin(18) through a pull-down resistor.
- RPi3
- PIR Sensor:
Connect the VCC pin to the 5V pin on the Raspberry Pi.
Connect the GND pin to the GND pin on the Raspberry Pi.'
......@@ -101,14 +104,20 @@ gcc -o client3 client3.c -lpthread
- LED:
Connect one leg to the GPIO pin(18) and the other to the GND pin.
- Servo Motor:
Connect the power pins to the 5V and GND pins, and the control pin to a GPIO pin(18).
- RPi4
- Piezo Buzzer:
Connect the VCC pin to the 5V pin on the Raspberry Pi.
Connect the GND pin to the GND pin on the Raspberry Pi.'
Connect the OUTPUT pin to the GPIO pin(20) on the Raspberry Pi.
- Servo Motor:
Connect the power pins to the 5V and GND pins, and the control pin to a GPIO pin(18).
- LED:
Connect one leg to the GPIO pin(18) and the other to the GND pin.
2. Run the Program
......@@ -120,9 +129,9 @@ gcc -o client3 client3.c -lpthread
And then, execute each client program.
```bash
./client1.c
./client2.c
./client3.c
./client1
./client2
./client3
```
Each Raspberry Pi will perform its designated function, and the data will be sent to the remote server for monitoring.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment