This is my first schematic and I'm mainly curious if I understand (and if I'm using correctly) using the voltage divider with R5 and R7. This is interfacing a gas sensor, photo cell, SHT15 digital humidity/temp sensor module (from sparkfun), 7 tactile switches, and a 20x4 LCD. V+ is a 9V 650mA DC supply. SV1, SV2, and SV3 are interfacing to an arduino mega. The gas sensor's heater requires 200mA. I'm also curious if I should have an opto-isolated relay that the MCU can use to turn on the heater n minutes before taking a reading - or if it is normal to just leave a gas sensor's heater on for extended periods (when you're only taking a reading every 30 minutes, for example). IC1 is an LM317T which I happen to have two of laying around so I thought I would work it in for training purposes. My idea was to use it to maintain a regulated 6V for the heaters and use the divider to get a 5V rail for my buttons, photo cell, and the SHT15 breakout. The LM324 is amplifying the gas sensor's output (30-50mV) by 100. I appreciate any tips/suggestions you might be able to offer as I am very new at this.
I'm mainly curious if I understand (and if I'm using correctly) using the voltage divider with R5 and R7.
Yes and no. It will convert the 6vdc down to 5vdc for a valid logic high when a switch(s) is pushed. The problem is what the digital input pins will see when you don't push a switch(s), they will 'float' and not read as a valid low. You need to either wire pull-down resistors from the pins to ground or change the logic and wire the switches to ground and enable the input pin's internal software enabled pull-up resistors.
That way a pushed switch will read a valid low and a unpushed switch will read a valid high via it's internal pull up.
That make sense?
Also, by powering the "SHT15 digital humidity/temp sensor module" from the same voltage divider resistors are bound to upset the voltage division. It should have it's own series resistor or regulator, depending on it's current draw specification. Also powering the variable resistor for the LCD contrast should not be drawing current from the voltage divider as it's current draw must be known and considered.
Lefty
Thanks Lefty - had I only read one of the thousand button tutorials! Sorry about that. I am still a bit confused about the voltage divider issue. For instance, the SHT15 has a maximum current of 1mA at between 2.4V and 5.5V. With a 1k ohm resistor in between the 6V output of the regulator and the SHT15 I get 5V. I just calculated R = 1V/.001A to get the 1k. Is that good enough to separate it from the voltage divider I have? Then, knowing the LCD current requirements I would just do the same thing there...I think. Thanks again.
Is that good enough to separate it from the voltage divider I have?
Sounds like you are on the right path
Lefty
A voltage divider isn't really a good substitute for a regulator. It's okay for constant-draw situations, but the more current your load draws the more the output of the voltage divider will drop (V=IR, as current in the resistor to V+ increases so does the voltage drop across it). You can reduce this effect somewhat by using lower value resistors, but then you waste more power through the divider even under no load.
A plain old linear regulator (ie 78xx) could very well be more efficient than a voltage divider, and more accurate to boot. And at any rate, why aren't you just using whatever your arduino's AVR is running on for the pushbuttons, SHT15, and LCD?