I built a trip wire for the post box that I'm connecting. It's however based on a mercury tilt sensor so I'm really not sure whether I think it's a great idea putting it to use (at least not with a sturdy case...). However, I can share my code:
#define DIGITAL_INPUT_SENSOR 2 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!)
#define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
MyMessage msgTripped(CHILD_ID_TRIPPED, V_TRIPPED);
void setup()
{
gw.sendSketchInfo("Postal", "1.0");
gw.present(CHILD_ID_TRIPPED, S_MOTION);
pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input
}
void loop()
{
boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == LOW;
if(tripped) {
gw.send(msgTripped.set("1")); // Send tripped value to gw
}
gw.sleep(INTERRUPT,FALLING, SLEEP_TIME);
}
Hi!
Going through examples and forum topics I've noticed that I'm using the wrong S-type and V-type.
I'm writing a new version of the code with S_LIGHT and V_LIGHT so there is now dimmer functionality (which I don't need).
Let's see if this helps.
@m26872 said in Encapsulated transformers instead of traditional switching power supplies like Hi-Link:
for me the sunny season is too short.
I havn't yet tried to use solar batteries in winter so maybe I have the same problems (despite the fact that I'm living 3 degrees south of you), but I have backup solution for very cloudy winter days - regular battery charger.
@fets So far, I have only built the 5x5 board (but the others should be schematically identical). The only issue I have found so far is that I cannot get the ISP port to work. But I have checked and I have an identical setup on the 1.0 board and that worked, so I suspect the programmer is too weak to drive the net on this one. So it is not a board-issue per se, and might only be an issue on the 5x5 board as routing is the most complex on that one due to the size.
No problem, I am running the nrf24 mqtt gateway on the rpi and it is working with no problem with domoticz. I choose the mqtt client gateway because I wanted to tinker around MQTT, but you could go for the ethernet gateway that is easier to manage.