Hi Forum, David (newbie) here from Saskatchewan, Canada. Doing my first project, but hitting a wall.
I seen a simple project on You Tube and wanted to do it, but got problems when taking it further. I have the Uno and wav shield. Temp sensor and CO2 sensor. I’ve got the temp sensor and CO2 sensor fine to play audible alarm through wav shield using SD card. I’m now trying to add replay. I have searched the forum as didn’t want to waste peoples time and still got problems. So rather than give up and throw away everything away, I’m asking for help and hopefully it will encourage me to do further project I like the look of.
All I want is to do is switch my relay from a NO state to a NC state when my alarm plays. It sound simple, but driving me up the wall. A friend looked at it and he programmed pin 12. Now I have a 4 pack relay and to switch the relay state, I need a pin to ground. Now pin 12 and 13 are to ground at all times on my Uno. Pin 12 is ground, but when alarm actually plays the speech, it’s actually chattering the relay, and once speech stops, even though alarm is active it’s back to a solid ground, then when speech is playing again (delay 2000), the relay is chattering again. Once speech stops, it’s back to solid ground and alarm can stop and it’s status remains the same. I have experimented tapping other pins etc, but experienced a loud squeal after tapping VCC and I lost my SD card. The Uno, 2 laptops, camera & camcorder can’t see the SD card. Plus I used an AC adaptor ( by mistake) on CO2 sensor and it didn’t last long, split second, project was over, so bought another and would like to see this through.
So how would I go about changing a pin status to ground, to switch relay state only when alarm plays. I’ve copy and pasted a clean code as I was getting in a mess assigning pins for a high state and then a low state, reading and then writing. So the code I’ve uploaded, hasn’t got the relay info in at all. Could somebody add the code for me please as it’s driving me bonkers.
Thanks forum members and looking forward to getting to know you.
Code.txt (6.91 KB)