Being a noob I've been studying simple circuits and whatnot to try and learn to build my own. I'm attempting to build a board that will carry an array of 7 relays which in turn will control some higher voltage solenoid valves. I came across a relay circuit that had a 10kOhm resister connected to ground before the (1kOhm in my case) resister on the digital out pin like this:
Arduino Digital Pin----|----\/\1kOhm/\/----To base of 2N2222 (relay etc)
|
\/\10kOhm/\/
|
-----
---
-
What makes the inclusion of the 10k resistor beneficial? My noob senses believe this to be a kind of pull down resistor to keep the relay from being accidentally triggered, please correct or clarify that assumption if you can. I know when I mocked the circuit up on my proto shield, sometimes I wouldn't even have to press the button to trigger the relay. Just being in close proximity to the button would trigger it.
Eventually, my ATMEGA168 will be on the same circuit board as the relays and in fairly close proximity, about an inch away, if that matters.
I'm using an 1N4004 diode to protect the Transistor and digital pin from back voltage when the relay is de-energized. Not sure what the correct terminology is for that. Anyway, any input is appreciated and if you need more info to give a proper answer, please don't hesitate to ask.
Thanks,
Sam