Ah, this explains many things. Thank you, now its working:)!
artipi
@artipi
Best posts made by artipi
-
RE: 💬 Power Meter Pulse Sensor
-
RE: Raspberry PI + MQTT Gateway + Domoticz -> Connection refused
Thanks very much! Mosquitto was the solution!:)
Latest posts made by artipi
-
RE: 💬 Power Meter Pulse Sensor
@alowhum: Its the original code. Nothing changed. I've only made some tests with my version...
-
RE: 💬 Power Meter Pulse Sensor
Ah, this explains many things. Thank you, now its working:)!
-
RE: 💬 Power Meter Pulse Sensor
Hello, i'm stuck with this sensor, because no Interrupt is really working. I've cut down the code to this:
/** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik Ekblad * * DESCRIPTION * This sketch provides an example how to implement a LM393 PCB * Use this sensor to measure kWh and Watt of your house meter * You need to set the correct pulsefactor of your meter (blinks per kWh). * The sensor starts by fetching current kWh value from gateway. * Reports both kWh and Watt back to gateway. * * Unfortunately millis() won't increment when the Arduino is in * sleepmode. So we cannot make this sensor sleep if we also want * to calculate/report watt value. * http://www.mysensors.org/build/pulse_power */ // Enable debug prints #define MY_DEBUG // Enable and select radio type attached //#define MY_RADIO_NRF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 //#include <MySensors.h> #define DIGITAL_INPUT_SENSOR 2 // The digital input you attached your light sensor. (Only 2 and 3 generates interrupt!) #define PULSE_FACTOR 500 // Number of blinks per of your meter #define SLEEP_MODE false // Watt value can only be reported when sleep mode is false. #define MAX_WATT 1000000 // Max watt value to report. This filters outliers. #define CHILD_ID 10 // Id of the sensor child uint32_t SEND_FREQUENCY = 15000; // Minimum time between send (in milliseconds). We don't want to spam the gateway. double ppwh = ((double)PULSE_FACTOR)/1000; // Pulses per watt hour bool pcReceived = true; volatile uint32_t pulseCount = 0; volatile uint32_t lastBlink = 0; volatile uint32_t watt = 0; uint32_t oldPulseCount = 0; uint32_t oldWatt = 0; double oldkWh; uint32_t lastSend; //MyMessage wattMsg(CHILD_ID,V_WATT); //MyMessage kWhMsg(CHILD_ID,V_KWH); //MyMessage pcMsg(CHILD_ID,V_VAR1); void setup() { Serial.begin(9600); Serial.println("Start setup"); // Fetch last known pulse count value from gw //request(CHILD_ID, V_VAR1); // Use the internal pullup to be able to hook up this sketch directly to an energy meter with S0 output // If no pullup is used, the reported usage will be too high because of the floating pin pinMode(DIGITAL_INPUT_SENSOR,INPUT_PULLUP); attachInterrupt(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), onPulse, RISING); lastSend=millis(); Serial.println("Start setup: last sent: "); pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); } void presentation() { // Send the sketch version information to the gateway and Controller //sendSketchInfo("Energy Meter", "1.3"); // Register this device as power sensor //present(CHILD_ID, S_POWER); } void loop() { } void onPulse() { Serial.println("onPulse:"); digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW delay(1000); pulseCount++; Serial.println("pulseCount:"); }
The Problem ist, that only on Start the interrupt ist working once, but no LED blinks.
Can someone help?
Thanks.
-
RE: 💬 Roller Shutter Node
Hello, nice Node! How to order a NRF Version? If i click buy, i have no choice.
-
RE: Securing Windows
@Yveaux Thanks, sounds logic and easy!:) Will try it.
-
RE: Securing Windows
@gohan Ok, you think of adding code on the node side? (pro mini) But it should only start the buzzer, if the message failed to send. Otherwise the message would go to the controller(domoticz) an then i can decide to start the buzzer or not on the node (depending on armed or not). -> is that possible?
-
Securing Windows
Hello,
i am planning to secure the windows in our planned House. I've found some Window sensors here in forum and on openhardware.io, but the most of them do not have a buzzer. -> Why? Are their only for seeing the status of the window?
I need a reliable sensor. So if some part (nrf, gateway, ...) is not working there should still be the buzzer fallback that will start screeming.
Do someone have suggestions? Or maybe a combination with a glass break sensor or something else?
I would be happy about some suggestions.
Thanks,
Arthur
-
RE: 💬 Door/Window Sensor
Hello @Takero,
thanks for your nice work!
How long does the battery hold? is the consumption still at 19uA?
-
RE: 💬 Door/Windows AAA
Hi,
thank you for your nice work!
What/how would be the simplest way to add a speaker/buzzer to your board? -> For the case then no message could be sent to the gateway to buzzer should start.