Trying to activate a notification when my PIR sensor reads a certain value (raw analog value of 680 or more).
Any way when using eventor I am able to turn on a virtual LED using virtual pins
So in my code, I do manual virtualwrites from A5 to V4. So when analog value is sent V4 and is greater than 680, its turns on V8 (1023 value sent) which is the virtual LED and vice versa when less than 680.
Now, when V8 is 1023 (LED is ON) i want a notification saying âmotion detectedâ.
and to idle when not ON (or less than 1023).
This doesnt seem to work without me manually plugging in code. And then when i do that, the damn notification wont shut up! even when LED is already high or A5 is above 680.
Any suggustions to make this notification come once and only come back when it dips back below to 0??
From my understanding and experience most PIR send out a simple ON (motion) OFF (no motion) digital signal⌠not analog. But it can still trigger rapidly as motion moves across the lens.
This sensor must suck, because when I use the 5V from arduino, it goes to analog value of around 680, but once I start turning on relays to turn on AC lights I see the value go up and up to 720ish. It actually very different when I used a seperate 5V supply.
How can I determine its HI or LO. 5v or 0V?
it definielty is not outputting 5V
Doesnt really answer my question about why notification wont send with just widgets and send consstantly when I throw Blynk.notify directly into code.
Eventor works for simple tasks, but will respond to repeated triggers accordingly as per the NOTE: at the end of it documentation - http://docs.blynk.cc/#widgets-other-eventor
More âComplexâ solutions, like NOT rapidly responding to repeated PIR triggers within a span of time, requires code. Something you will need to learn in order to make full use of Blynk.
Determining simple HIGH/LOW means reading the state of a triggered Digital Pin, not an Analog pin which is⌠analogâish.
EDIT - Use the example provide in the adafruit link, with a Digital Pin! Then work on adding Widget notification in place of print statements.
As for any other âwhyâ questions⌠well we donât know as we havenât seen your code
To start off, im constructing a small-scale loadbox to simulate a small home control and monitoring system. Concerning my photoletic sensor, I want certain lights to come on when photoletic sensor senses a raw analog value of 1000 or so (dark outside). Now when I send a value of â1â to Digital pin, light will turn ON. BUT I am having trouble turning OFF the light. Even when sending a â0â to turn OFF light after morning (raw analog value of around 200), The light will either stay ON OR it will turn ON if not already ON.
Note: in Eventor, I can only seem to use âset pin toâŚâ to turn On light, BUT NOT the âturn ON pinâŚâ option. Seems weird to me.
Any suggestions. Heres my codeâŚAs of right now, i got my analog data from photoletic sensor going to V5. In eventor setting up following events:
When v5 is higher than 1000 send notification: ânight time!â also set D7 to 1
When v5 is lower than 250 send notification: âmorning!â also set D7 to 0
Notifications work. but not the turning OFF of the load.
/******************************************************************
* This example shows how to use Seeed Ethernet Shield V2.0 (W5200)
* to connect your project to Blynk.
*
* More about the shield (and library download):
* http://www.seeedstudio.com/wiki/Ethernet_Shield_V2.0
* (It looks like this library for W5200 works only on Arduino IDE 1.0.*)
*
**************************************************************/
//hastags are there. in actual code.
define BLYNK_PRINT Serial // Comment this out to disable pri nts and save space
include <SPI.h>
include <EthernetV2_0.h>
include <BlynkSimpleEthernetV2_0.h>
define W5200_CS 10
define SDCARD_CS 4
include <SimpleTimer.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = " 879147d1aa7946b2a0339c3faf3dcf12";
// select the input pin for the potentiometer
int sensorPin1 = 9;
int sensorPin2 = A5;
SimpleTimer timer;
boolean flag = true;
void sendFlagToServer() {
if (flag) {
Blynk.virtualWrite(V0, 1);
} else {
Blynk.virtualWrite(V0, 0);
}
flag = !flag;
}
BLYNK_READ(V4) //Blynk app has something on V4
{
int sensorData1 = digitalRead(9); // reading the sensor on A5
Blynk.virtualWrite(V4, sensorData1); // sending to Blynk
}
BLYNK_READ(V5)
{
int sensorData2 = analogRead(5);
Blynk.virtualWrite(V5, sensorData2);
}
void setup()
{
Serial.begin(9600);
pinMode(SDCARD_CS, OUTPUT);
digitalWrite(SDCARD_CS, HIGH); // Deselect the SD card
Blynk.begin(auth);
// You can also specify server.
// For more options, see Boards_Ethernet/Arduino_Ethernet_Manual example
//Blynk.begin(auth, "blynk-cloud.com", 8442);
//Blynk.begin(auth, IPAddress(192,168,1,100), 8888);89
timer.setInterval(1000L, sendFlagToServer);
}
void loop()
{
Blynk.run();
timer.run();
}
So far everything is working accordingly now THANKFULLY. Blynk is just delightful when everything goes your way. Although this ACS712 i got is a b****! LOTS OF WORK TO DO.