-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible to swap LDR sensor module? #13
Comments
That is a really interesting idea... I like it. The hardware you link to should work. Same as with the 801s in my photographs, you'll want to use the DO pin and ignore the AO pin. You're correct that the 801s gives a binary true/false output, although it turns on and then off with every wiggle. Because of that, some minor changes to the python script would be needed. I think it would be easy for me to modify the script so it would work with either a vibration sensor or a light sensor. Here's the current logic:
The python script should be able to handle both vibration and light sensors if the logic were changed to:
If you let me know that you've ordered that part, I'll revise the script for you. Deal? Shmoopty |
Deal! I ordered a 4-pack of the sensors last night. Figured worst case I would try my hand at actually learning python (and by learning I mean hacking up your script). The logic is exactly what I was thinking too, figured it was close enough to your original script to attempt modification. |
Update - I've modified the script. It still works with sensors that turn on and off frequently during an appliance cycle, but it should also work if the sensor stays on, like an operational light sensor would. Do me a favor, please? Let me know if this script works for your light sensor project? Good luck! |
Will do! I ordered the sensors from China ($2 for 4 including shipping) and expect them around the 20th. I'll update with some pics. Thanks again for the modification |
Good news, the LDR sensor works perfectly for triggering light from an led! I didn't even need sugru to create a light shroud, simpy used 1mm thick 3m double sided tape. My settings: |
I'll take a look at the code and see if something smells funny. Thanks for getting back. |
Thanks Shmoopty, I really appreciate you looking into this. Over the past few days I've been trying on my own to add Pushover support to your script, but my python skills are proving to be quite insufficient. I've tried the below additions but it's still not firing. I hate to ask for any more of your time but I'm hoping there's something obvious that you can see and I'm missing. Added to vibration.py:
Added to vibration_settings.ini:
|
Regarding "endless stream of notifications", which notifications are they? Start, end or both? Are they really endless, or do they stop eventually? Fork this project with your pushover mods and I think I'll have time to take a look. Then you'll get credit in the project too. |
Project forked and modified script uploaded. I never really tested if the end-notifications ever stopped on their own. I could try to run it in a terminal without sending the notification if an answer isn't apparent from the uploaded script. |
@tstack77 Were you able to get past the endless notifications? My washer is giving me a similar level of difficulty so I'm considering the LDR switch. |
I was, but it took a bit of a rewrite and I can't remember exactly the solve (two years ago and such). The LDR sensor approach has been rock solid and it's been run since without issue. If you have a light on your machines I definitely recommend it. Edit: I did end up making a sugru cover over the sensor to stop any random light source triggering a notification. Give it a go and I'll respond if you run into issues |
Thanks for this! I have this built and it definitely works, but I'm still getting false alarms after lots of adjustments to both the ini and the board sensitivity. My washer has a bunch of different modes (autosoak etc) that makes measuring the vibration a bit hit or miss. I would love to use an LDR sensor module and sugru the sensor over the power led on my machines. It seems that I wouldn't need to do anything hardware wise, but I'm a bit unsure about the differences to the python script. I'm not finding a lot of documentation on the 801s, does it simply give a true/false digital reading to the rpi, or is the output not binary?
Thanks again
The text was updated successfully, but these errors were encountered: