@alowhum: Its the original code. Nothing changed. I've only made some tests with my version...
artipi
Posts
-
💬 Power Meter Pulse Sensor -
💬 Power Meter Pulse SensorAh, this explains many things. Thank you, now its working:)!
-
💬 Power Meter Pulse SensorHello, 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.
-
💬 Roller Shutter NodeHello, nice Node! How to order a NRF Version? If i click buy, i have no choice.
-
Securing Windows@Yveaux Thanks, sounds logic and easy!:) Will try it.
-
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 WindowsHello,
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
-
💬 Door/Window SensorHello @Takero,
thanks for your nice work!
How long does the battery hold? is the consumption still at 19uA?
-
💬 Door/Windows AAAHi,
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.
-
💬 MDMSNode "Lighting" Rev 1.1Ok, thanks!
-
💬 MDMSNode "Lighting" Rev 1.1Nice Work! When you plan to publish the PCB design?
-
An Esp8266 Nextion Scene controller??Thanks,
i try to make a small Wall scene controller that sends the commands to Domoticz over mqtt.
I ordered now the Nextion Display an thinking now to buy a WeMos D1 Mini Pro. Is that the right way? -
An Esp8266 Nextion Scene controller??As i see, i can also take some of this ESP-Boards right?
https://www.aliexpress.com/item/1pcs-lot-NodeMcu-Lua-WIFI-Internet-of-Things-development-board-based-ESP8266-esp-12e-for-arduino/32775934156.html?spm=2114.01010208.8.10.eix0zH -
An Esp8266 Nextion Scene controller??Hi @alexsh1 ,
did you finished your Enhanced Version? As i understood correctly the ESP8266 Board is used to send messages/touch commands over wifi - mqtt to a controller right? How it is programmed to send over mqtt?
So if i have this ESP - Board i do not need a arduino right?
Another question: Is it possible to run this board with a arduino pro mini or uno and nrf radio to send messages to my controller?
Thanks
-
Scene controller?That looks very interesting! Can i connect a arduino pro mini or uno? Found only examples with mega.
And will it run on a battery? -> Probably not really. -
💬 Touch Display Scene ControllerHello,
how long will the battery hold? Any tests?
-
Scene controller?Hi,
i am also interested in a Wall LCD TouchController, but smaller (max. 2"). Do you found/ implemented something like that?
-
In wall LCD Switch/Scene controller for MySensorsHi @sundberg84,
thanks for your nice work! I'm currently searching for a similar project but with a touchscreen implementation:).
Do you plan this in the near future?
Or do you know similar touch projects from other sources? -
Another simple (No SMT) relay actuatorHi, dpressle. Thanks for your work?
One Question. Can i connect a normal light switch to it? So that i can turn on the lights with the switch and this node? -
In wall light switch node - Custom PCBNice, will be waiting for your relay node! :)