[/
I have four HC-SR501 Passive Infrared sensors located at our camp along a small dirt country road connected to a microcontroller to detect how many and in what direction vehicles have been traveling North and South. Microcontroller used is an Arduino R3 with a data logging shield and will write time, date, and which sensor is activated at that particular time to the second to a SD card. Trouble is that the sensors random false trigger lots of times due to light, heat, or whatever? I want to set the system up and let it run for a month or two and then analyze the data using excel spread sheet. The four sensors are labeled N,N2,S2,S in that order from North to South and spaced about 18 feet apart. My code will allow a signal from all pir sensors then not allow any additional signals for the time variable (now set to 5 seconds) using the millis function.
If N,N2,S2,andS come in within a time variable, say 5 seconds, I can be sure it was one vehicle traveling South. Even if three or two sensors come in within the short time variable odds are that it would be viable. But if only one sensor comes in and the time variable expires it would be considered a false trigger and the program should ignore all those. Even if one particular sensor fires multiple times within the time variable it should not be taken as a good signal.
I would prefer to have the Arduino code determine the direction of travel rather than putting the data from the sd card into a excel file if possible.
I can get the data from the sd card, put it into an excel file, print to paper and with pencil in hand scan down looking at the seconds “column C” and the direction abbreviation “column D” and easily pick out the good data and direction of travel from the false hits.
The country road is one lane and probably does not have more than two dozen vehicles pass by in a 24-hour period.
Thanks, Terry
Here is my code so far:
code]