this kind of optic fiber is probably only plastic so for a full DIY , you can use also fishing wire with a big power led or an old chistmass tree optic fiber lighted.....
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);
}
I think the comment in the routine
void measureBattery() {
// R1 = 1MOhm, R2 = 220 kOhm
Should be
void measureBattery() {
// R3 = 1MOhm, R2 = 220 kOhm
(R3)
Is it possible to add (comment out) some lines how to calculate the battery percentage and send this via gw.sendBatteryLevel (batteryPcnt)
Great sketch!
@chbla said in Multiple uses battery RFM69 node:
Can anyone suggest a source for the parts? Are there any sources that you can upload the files by any chance?
If you mean can you upload a BOM to a company and then it generates a basket of the items, then i know that farnell and maybe digikey do this. But i only use this feature that is built into EAGLE pcb designer, so i'm not sure if they support it directly on their websites, might be worth a look.
http://www.farnell.com/
http://www.digikey.co.uk
Thanks for the reply. I am not looking to use an LCD, although that may be the best solution. For now, I plan on creating a simple set of LEDs and buttons.
I have looked over the code, and was wondering which part of the code is retrieving the status of a sensor? What if I have multiple motion sensors, how would I retrieve each unique value?