Please read the pinned post re 'how to get the most from this forum'. I will tell you using a 9V battery can be a problem, to get started, use USB or a wall wart.
Yes, PIRs are notoriously finicky, I hope you ordered 10. You do understand they measure heat.
If you are a starter , then I would play with some of the examples , turning a led on/off and build from there. As an initial project this is too hard .
If this is a school task , you should know enough to do the project.
I think the PIR is connected wrongly , the battery will not drive a solenoid. The micro will/may not drive the relay ( voltage wrong, too little current capability )
You really ought to show a circuit diagram , your code , and links to important parts (PIR)- as per the previous post
Yes, giving a constant high reading. Place the PIR inside a box and make sure NO heat source is nearby. That likely means the 8266 and you should be as far as possible from the PIR. Also, I do recall there are some settings on the PIR and maybe a jumper? They are a bit hard to understand but just test with pots at extreme settings.
Also, you have not done what you were told in post #2. Code, error logs, wiring diagram. Read the introductory post first, so you know how to do those things.l
Yes, they are a real pain except for very specific use cases which this project is not. As I recall the better sensors had two controla on board that affected sensitivity and what part of the wave was the triger or something like that. What the OP should be looking for is a 'human presence' detector. Often found on the corners of modern cars so we don't run people over.
The last minute engineers didn't seem to need it, but I had success only after some power supply deemphasis.
Here just two sections of small resistor and an electrolytic capacitor. I don't recall the values, I can look later at one of the several that do things around the lab.
It may not be what moved me from frustration to joy; now I use it with the rcwl0516 for luck.
It can "see" through walls and had other characteristics that warrant experimenting. I test sensors like this just by letting them control an LED I can see from wherever I hope to not have it sense anythjng.
Can you explain to me about battery will not drive the solenoid, because I followed a YouTube tutorial. I use the same components as them (except battery type and PIR bcs i have to add one more sensor).
And when I run the code:
const int RELAY_PIN = 4; // Relay connected to D2 (GPIO4)
void setup() {
Serial.begin(115200);
pinMode(RELAY_PIN, OUTPUT);
digitalWrite(RELAY_PIN, LOW); // Start with the relay off (locked)
Serial.println("Solenoid Lock Test Ready.");
}
void loop() {
Serial.println("Unlocking...");
digitalWrite(RELAY_PIN, HIGH); // Turn on the relay to unlock the door
delay(5000); // Keep it unlocked for 5 seconds
Serial.println("Locking...");
digitalWrite(RELAY_PIN, LOW); // Turn off the relay to lock the door
delay(5000); // Keep it locked for 5 seconds
}
The 5V relay did turn on both LED (power n switch i guess). It is just I want it to relay and move the solenoid lock.
Yes, PIR Motion Sensor might be troublesome for this project. But, I have limited sensors because I have to use what is available in the class (the sensor is just add-on, it can be any sensor actually that makes the ‘Smart Door’ better)
Do you have any ideas of common and easy to setup sensor that are suitable for a Smart Door? The only sensor that came to my mind is PIR motion and Camera module, but I will try to find the ‘human presence’ sensor you mentioned.
The 9v batteries have a low capacity and relatively high internal resistance - so cannot drive high current loads and are designed not too . They appear in projects as the “ 9v battery “ is often an easily available icon for a battery , and after all , anyone can post an on line project …
You need use a number of AA type batteries as a starting point .
You could look at home alarm type PIR sensors which are more reliable , but might need 12v (unsure) .
PIR sensors have a multi-lense that concentrates infrared-radiation to multiple parts of the sensor.
If an object with a higher temperatur walks through the sight-field of the sensor the higher radiation falls into different parts of the sensor. This causes a change inside the sensor.
And the circuitry detects these changes.
This is the reason why PIR-sensors work outside from coldest winter to warm summer.
If an object with a different temperature than the background moves through the sight-field of the sensor the sensor-signal-change triggers the PIR-module.
Me personal I have never had any problems with different kinds of PIR-sensors.
Though most of them are more professional than these small and cheap "arduino"-PIR-modules.
Different sensors would be
a light barrier
a radar-sensor
doormat which changes resistance of you step on the doormat
You should really post a hand-drawn schematic.
Sure ! Hand-drawn but following the professional rules how to draw schematics.
Frizzing-picture became very popular but are unprofessional as hell.