Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Lesson35- use SMS control relay and read temperature sensor
#1
send SMS text:

1. turn on/off one relay:

relay1-on    turn ON relay1
relay1-off    turn OFF relay1
relay2-on    turn ON relay2
relay2-off    turn OFF relay2
relay3-on    turn ON relay3
relay3-off    turn OFF relay3
relay4-on    turn ON relay4
relay4-off    turn OFF relay4
relay5-on    turn ON relay5
relay5-off    turn OFF relay5
relay6-on    turn ON relay6
relay6-off    turn OFF relay6
relay7-on    turn ON relay7
relay7-off    turn OFF relay7
relay8-on    turn ON relay8
relay8-off    turn OFF relay8

2. turn on/off all relay:

all-on  turn ON relay1-8
all-off  turn OFF relay1-8

3. read current temperature value:

temper      read DS18B20 temperature sensor data

4. digital input for sensor trigger output

a. if input1 trigger, (siren) relay1 ON -> 3 seconds -> relay1 OFF -> send SMS: door sensor is triggered,someone in the room!
b. if input2 trigger, (siren) relay1 ON -> 3 seconds -> relay1 OFF -> send SMS: window sensor is triggered,someone in the room!
c. if input3 trigger, send SMS: sensor3 is triggered,someone in the room!
d. if input4 trigger, send SMS: sensor4 is triggered,someone in the room!
e. if input5 trigger, send SMS: sensor5 is triggered,someone in the room!
f.  if input6 trigger, send SMS: sensor6 is triggered,someone in the room!
g. if input7 trigger, send SMS: sensor7 is triggered,someone in the room!
h. if input8 trigger, send SMS: sensor8 is triggered,someone in the room!


here is arduino IDE source code: 
.zip   sms-relay.zip (Size: 1.71 KB / Downloads: 340)
Reply
#2
(06-26-2022, 12:22 AM)admin Wrote: send SMS text:

1. turn on/off one relay:

relay1-on    turn ON relay1
relay1-off    turn OFF relay1
relay2-on    turn ON relay2
relay2-off    turn OFF relay2
relay3-on    turn ON relay3
relay3-off    turn OFF relay3
relay4-on    turn ON relay4
relay4-off    turn OFF relay4
relay5-on    turn ON relay5
relay5-off    turn OFF relay5
relay6-on    turn ON relay6
relay6-off    turn OFF relay6
relay7-on    turn ON relay7
relay7-off    turn OFF relay7
relay8-on    turn ON relay8
relay8-off    turn OFF relay8

2. turn on/off all relay:

all-on  turn ON relay1-8
all-off  turn OFF relay1-8

3. read current temperature value:

temper      read DS18B20 temperature sensor data

4. digital input for sensor trigger output

a. if input1 trigger, (siren) relay1 ON -> 3 seconds -> relay1 OFF -> send SMS: door sensor is triggered,someone in the room!
b. if input2 trigger, (siren) relay1 ON -> 3 seconds -> relay1 OFF -> send SMS: window sensor is triggered,someone in the room!
c. if input3 trigger, send SMS: sensor3 is triggered,someone in the room!
d. if input4 trigger, send SMS: sensor4 is triggered,someone in the room!
e. if input5 trigger, send SMS: sensor5 is triggered,someone in the room!
f.  if input6 trigger, send SMS: sensor6 is triggered,someone in the room!
g. if input7 trigger, send SMS: sensor7 is triggered,someone in the room!
h. if input8 trigger, send SMS: sensor8 is triggered,someone in the room!


here is arduino IDE source code: 

I tried to upload this "sms-relay.ino" file to my KC868-A8S esp 32 module. But i keep getting the same error message call PCF8574.h: no such file or directory.
Can you please explain how to install this pcf8574 file first.
Reply
#3
because you have not installed PCF8574 arduino library. you can download this library zip file, unzip, copy the folder to your arduino library path.

.zip   PCF8574_library.zip (Size: 23.8 MB / Downloads: 194)
Reply
#4
I did exactly as you mentioned. But still no luck. Some where some thing is missing. I will whatsapp you a short video.

its giving me this error now. "Compilation error: DS18B20.h: No such file or directory"
Reply
#5
so you also need to install ds18b20 arduino library.
Reply
#6
this is ds18b20 library.

.zip   DS18B20.zip (Size: 913.87 KB / Downloads: 181)
Reply
#7
Now its giving me the following error\

In file included from C:\Users\saund\Documents\Arduino\libraries\sms-relay\sms-relay.ino:7:0:
c:\Users\saund\Documents\Arduino\libraries\DS18B20\src/DS18B20.h:5:21: fatal error: OneWire.h: No such file or directory
compilation terminated.

exit status 1

Compilation error: exit status 1
Reply
#8
you can install this  "OneWire" library in your arduino.

.zip   OneWire.zip (Size: 20.79 KB / Downloads: 201)
Reply
#9
looks like its uploaded now. Is there any way to get the wiring schematics for this A8S module please? Thank you.
Reply
#10
here is schematics for KC868-A8S: https://www.kincony.com/download/KC868-A8-PCBV1.4.pdf
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)