Skip to content

My Project

Show off and share your great projects here! We love pictures!
964 Topics 13.5k Posts
  • Any mass produced prototyping shields for the pro mini?

    6
    0 Votes
    6 Posts
    3k Views
    SparkmanS
    @NeverDie Not exactly mass produced, but here are some other options: https://oshpark.com/shared_projects/uXIff7XO https://oshpark.com/shared_projects/pRJiKWxV https://oshpark.com/shared_projects/nJ8HNuZj Cheers Al
  • Binary Control Modules , Switches, or Outlets on a Vera Edge

    sensor
    33
    0 Votes
    33 Posts
    15k Views
    mntlvrM
    @BulldogLowell said: @mntlvr said: And if all six switches are set to gnd the total current would only be 1.5 ma (5volts /20k)x6=.0015 amps I believe. the internal pullup resistors are 20k-50k according to arduino spec. yeah, I know, but if you are underpowered already (the radio....) the extra draw may create an issue... who the heck knows. I'll try on one of mine when I get the chance... your code works, and that's a treat, but now I need to understand why the simpler execution of the same code doesn't seem to cooperate with your rig. weird... you code with pinMode(buttonPin[i], INPUT); exactly same board and USB power supply and same transceiver, here are the results Sending device info...sensor started, id 32 send: 32-32-0-0 s=255,c=0,t=17,pt=0,l=5,st=ok:1.4.1 send: 32-32-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0 read: 0-0-32 s=255,c=3,t=6,pt=0,l=1:I send: 32-32-0-0 s=255,c=3,t=11,pt=0,l=13,st=ok:RemoteControl send: 32-32-0-0 s=255,c=3,t=12,pt=0,l=4,st=ok:1.15 Setting up Pin0 send: 32-32-0-0 s=0,c=0,t=0,pt=0,l=0,st=ok: Setting up Pin1 send: 32-32-0-0 s=1,c=0,t=0,pt=0,l=0,st=ok: Setting up Pin2 send: 32-32-0-0 s=2,c=0,t=0,pt=0,l=0,st=ok: Setting up Pin3 send: 32-32-0-0 s=3,c=0,t=0,pt=0,l=0,st=ok: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: read: 32-32-0 s=3,c=0,t=0,pt=0,l=0: Setting up Pin4 send: 32-32-0-0 s=4,c=0,t=0,pt=0,l=0,st=ok: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: read: 32-32-0 s=4,c=0,t=0,pt=0,l=0: Setting up Pin5 send: 0-0-0-0 s=5,c=0,t=0,pt=0,l=0,st=ok: read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch read: 36-81-0 s=0,c=5,t=0,pt=0,l=0: version mismatch Sensor presentation complete send: 0-0-0-0 s=3,c=1,t=16,pt=2,l=2,st=ok:1 Pin 3 changed state... New State: Tripped send: 0-0-0-0 s=0,c=1,t=16,pt=2,l=2,st=ok:1 Pin 0 changed state... New State: Tripped send: 0-0-0-0 s=1,c=1,t=16,pt=2,l=2,st=ok:1 Pin 1 changed state... New State: Tripped send: 0-0-0-0 s=2,c=1,t=16,pt=2,l=2,st=ok:1 Pin 2 changed state... New State: Tripped send: 0-0-0-0 s=3,c=1,t=16,pt=2,l=2,st=ok:0 Pin 3 changed state... New State: Not Tripped
  • Leaf Wetness

    45
    0 Votes
    45 Posts
    34k Views
    epierreE
    Hello, I guess it is the same as Vinduino : [image: 1438411787359-4533105.jpg] with their test code: // This program tests 3 soil sensor inputs and prints bias caused by galvanic effects // Copyright (C) 2015, Reinier van der Lee // www.vanderleevineyard.com // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. #include <math.h> // Conversion equation from resistance to % // Setting up format for reading 3 soil sensors #define NUM_READS 10 // Number of sensor reads for filtering long buffer[NUM_READS]; int index; typedef struct { // Structure to be used in percentage and resistance values matrix to be filtered (have to be in pairs) int moisture; long resistance; } values; const long knownResistor = 1500; // Constant value of known resistor in Ohms int supplyVoltage; // Measured supply voltage int sensorVoltage; // Measured sensor voltage values valueOf[NUM_READS]; // Calculated moisture percentages and resistances to be sorted and filtered int i; // Simple index variable void setup() { // initialize serial communications at 9600 bps: Serial.begin(115200); // initialize the digital pins as an output. // Pin 6,7 is for sensor 1 pinMode(6, OUTPUT); pinMode(7, OUTPUT); } void loop() { measure(1,6,7,1); Serial.print ("\t"); Serial.println (average()); long read1 = average(); measure(1,7,6,0); Serial.print ("\t"); Serial.println (average()); long read2= average(); long sensor1 = (read1 + read2)/2; Serial.print ("resistance bias =" ); Serial.println (read1-read2); Serial.print ("sensor bias compensated value = "); Serial.println (sensor1); Serial.println (); delay (3000); } void measure (int sensor, int phase_b, int phase_a, int analog_input) { // read sensor, filter, and calculate resistance value // Noise filter: median filter for (i=0; i<NUM_READS; i++) { // Read 1 pair of voltage values digitalWrite(phase_a, HIGH); // set the voltage supply on delayMicroseconds(25); supplyVoltage = analogRead(analog_input); // read the supply voltage delayMicroseconds(25); digitalWrite(phase_a, LOW); // set the voltage supply off delay(1); digitalWrite(phase_b, HIGH); // set the voltage supply on delayMicroseconds(25); sensorVoltage = analogRead(analog_input); // read the sensor voltage delayMicroseconds(25); digitalWrite(phase_b, LOW); // set the voltage supply off // Calculate resistance // the 0.5 add-term is used to round to the nearest integer // Tip: no need to transform 0-1023 voltage value to 0-5 range, due to following fraction long resistance = (knownResistor * (supplyVoltage - sensorVoltage ) / sensorVoltage)-457 ; delay(1); addReading(resistance); Serial.print (resistance); Serial.print ("\t"); } } // Averaging algorithm void addReading(long resistance){ buffer[index] = resistance; index++; if (index >= NUM_READS) index = 0; } long average(){ long sum = 0; for (int i = 0; i < NUM_READS; i++){ sum += buffer[i]; } return (long)(sum / NUM_READS); } and my hall of fame and shame of sensors I've tried : [image: 1438411911101-img_20150801_083113.jpg]
  • Air Conditioning state monitoring sensor

    16
    5 Votes
    16 Posts
    6k Views
    Ivan ZI
    Good idea. Append IR control
  • Combine Relay Actuator (with button) and BinarySwitch examples?

    7
    0 Votes
    7 Posts
    5k Views
    Sander StolkS
    Well well well... I've got it working with 2 relays and 2 door sensors. See my sketch below! The problem is the relays which are configured by counting and adding up numbers and the child_id's for 1 button and the debouncer missing config in the skecth. With this sketch you can monitor 2 doors and 2 relays // Example sketch showing how to control physical relays. // This example will remember relay state even after power failure. #include <MySensor.h> #include <SPI.h> #include <Bounce2.h> #define RELAY_1 4 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define NUMBER_OF_RELAYS 2 // Total number of attached relays #define RELAY_ON 0 // GPIO value to write to turn on attached relay #define RELAY_OFF 1 // GPIO value to write to turn off attached relay #define BUTTON_PIN_1 3 // Arduino Digital I/O pin for button/reed switch #define BUTTON_PIN_2 8 // Arduino Digital I/O pin for button/reed switch MySensor gw; Bounce debouncer_1 = Bounce(); Bounce debouncer_2 = Bounce(); int oldValue_1=-1; int oldValue_2=-1; MyMessage msgGK(BUTTON_PIN_1,V_TRIPPED); MyMessage msgGD(BUTTON_PIN_2,V_TRIPPED); void setup() { // Initialize library and add callback for incoming messages gw.begin(incomingMessage, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Garagebox", "1.0"); // Fetch relay status for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) gw.present(sensor, S_LIGHT); // Then set relay pins in output mode pinMode(pin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(pin, gw.loadState(sensor)?RELAY_ON:RELAY_OFF); } // Setup the doorsensor //pinMode(BUTTON_PIN,INPUT); // Activate internal pull-up //digitalWrite(BUTTON_PIN,HIGH); pinMode(BUTTON_PIN_1,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN_1,HIGH); pinMode(BUTTON_PIN_2,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN_2,HIGH); // After setting up the button, setup debouncer //debouncer.attach(BUTTON_PIN); //debouncer.interval(5); debouncer_1.attach(BUTTON_PIN_1); debouncer_1.interval(5); debouncer_2.attach(BUTTON_PIN_2); debouncer_2.interval(5); // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. gw.present(BUTTON_PIN_1, S_DOOR); gw.present(BUTTON_PIN_2, S_DOOR); } // Check if digital input has changed and send in new value void loop() { // Alway process incoming messages whenever possible gw.process(); debouncer_1.update(); // Get the update value int value_1 = debouncer_1.read(); if (value_1 != oldValue_1) { // Send in the new value gw.send(msgGK.set(value_1==HIGH ? 1 : 0)); oldValue_1 = value_1; } debouncer_2.update(); // Get the update value int value_2 = debouncer_2.read(); if (value_2 != oldValue_2) { // Send in the new value gw.send(msgGD.set(value_2==HIGH ? 1 : 0)); oldValue_2 = value_2; } } void incomingMessage(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_LIGHT) { // Change relay state digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom gw.saveState(message.sensor, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } }
  • Is this enough to get me started?

    12
    0 Votes
    12 Posts
    4k Views
    Moshe LivneM
    @Daniel-Lindberg go wire wrap! Its the future! :smile:
  • PhoneyTV for Vera is Here!

    34
    1 Votes
    34 Posts
    28k Views
    BulldogLowellB
    @5546dug said: Just a question, when in your code 3.1.1 you have a few scattered lines through out the declaration code with only // on these lines does it mean anything in particular ? Adding the "//" is only a personal preference of mine to use the comment marks rather than leaving a blank line. for me, with a certain text editor that I use, it is easier to edit and not inadvertently delete some curly brace and screw up my code! @5546dug said: your code worked 100% THANKS. happy to hear you are going now, sorry about the mixup.
  • Door, Motion and Temperature Sensor

    63
    0 Votes
    63 Posts
    44k Views
    CaptainZapC
    @ThomasDecock No I wasn't, I was able to get the standard dallas temperature working(because I thought the sensors no longer work), but unfortunately my time on this is pretty limited. I hoped I got it working until I go on vacation, but probably will look into it after. I would appreciate if someone could help with it, I think everyone would.
  • Two button light and fan switch

    2
    0 Votes
    2 Posts
    2k Views
    J
    here which power adapter you used?
  • Air conditioning/HVAC control - work in progress

    2
    2 Votes
    2 Posts
    2k Views
    hekH
    Nice hack. Incredible to get a LCD remote for $3 .
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • newby start his project

    4
    0 Votes
    4 Posts
    2k Views
    sundberg84S
    I made that some weeks aga. :) this is my sensor and maybe it can give you some inspiration. Good Lucy @csnij
  • Power strip with 4 sockets

    10
    2 Votes
    10 Posts
    5k Views
    Mohsin HassanM
    Hey Man! any progress on the buttons? Really looking forward to that so that i can start making one for myself as well. Cheers.
  • Voice controlled IR/RF blaster MySensors node

    2
    1 Votes
    2 Posts
    1k Views
    D
    We updated the code and now it possible not only to save learned raw codes on the sd card, but also to read and send Pronto codes that are stored on the sd card. :)
  • Battery Powered Emergency Sump

    3
    3 Votes
    3 Posts
    3k Views
    sowardS
    @ServiceXp I'm not sure. I looked around for similar devices almost a year ago, and didn't find any consumer grade chargers or monitors which had such, though there were a few commercial devices for the larger flooded cells which appeared to monitor the fluid level somehow. Some even monitored the specific gravity of the electrolyte, but I'm sure those cost more than several 'basement watchdogs. I suppose I could try to decode the simpler-looking circuit on the 'emergency' model and try to figure out what it was doing, but I think I've forgotten what little I actually learned in Circuits class back in college.
  • My generic room-senser (Sensebender with Motion and Light)

    16
    5 Votes
    16 Posts
    16k Views
    Moshe LivneM
    @mvader These are perfect for 2aa powered sensors although slightly ominous http://www.aliexpress.com/item/Dummy-Security-Camera-CCTV-Home-Dome-Camera-With-Red-Flashing-Light-Woshida/32317143038.html?spm=2114.32010308.4.11.8z1AAX they are basically empty. for 2.5$ you get a case, a battery holder and a clear dome.... Even a switch!!!! Best deal in the world.
  • Mysensored Garageport

    23
    2 Votes
    23 Posts
    15k Views
    tbowmoT
    Hmm.. firmware updates in the field are not that easy, when you have to stand on a ladder to do the update. Luckily I can place my laptop on the top of the wall, just under the roof in the barn. Maybe I should do something about OTA firmware updates.. On the other hand, then I wouldn't see that the controller went haywire, and tried to close an already closed port, which almost broke the chain drive for the port.. http://youtu.be/BSewn_sLYP8
  • Sprinkler Controller

    5
    4 Votes
    5 Posts
    6k Views
    SparkmanS
    @ServiceXp said: @Sparkman Well Done!! Thanks!
  • Door Bell usage detection / AirFlow usage detection/cutting

    9
    0 Votes
    9 Posts
    7k Views
    bjornhallbergB
    @epierre I'm afraid I haven't gotten around to it yet. Partly because I have my CCTV that automatically feeds me images of whoever has the misfortune of stepping on the porch and triggering the motion detection so I haven't been in any great hurry exactly. I have all the components around here somewhere though. Don't know if the ACS712 + logic level conversion is still the easiest approach or if we're over-complicating things here.
  • PC Power Switch

    14
    1 Votes
    14 Posts
    9k Views
    S
    pictures of the real thing [image: 1435509276281-img_20150628_172334.jpg] [image: 1435509281967-img_20150628_172512.jpg]

20

Online

11.8k

Users

11.2k

Topics

113.2k

Posts