I am building a circuit consisting of a voltage divider (with a fixed resistor and a LDR or photoresistor) outputting voltage to an ADC.   I want to measure the voltage going to the ADC using an MSP-EXP432 ; however, the MSP-EXP432 "Analog In" pin is taking voltage from the circuit (i.e. the voltage going into the ADC drops when the "Analog In" pin is connected).   I set the pin as an input in the code shown below in Energia.  const int bitsOfADC = 14; // 14-bit ADC Launchpad //int maxVal = 2^N -1;  // 2^14-1 int maxVal = 16383; float FSV = 5.0; // Supply to 0804ADC float LaunchPadResolution = FSV/maxVal; int D7 = A13; int D6 = A14; int ADCInput = A6; boolean D7_State = LOW; boolean D6_State = LOW; void setup() {   delay(1000);   Serial.begin(9600);   pinMode(D7, INPUT);   pinMode(D6, INPUT);   analogReadResolution(bitsOfADC);   pinMode(ADCInput, INPUT); }   Is there any way to fix this?
120655
In the circuit below, I want to measure the voltage going to the ADC (output from the voltage divider consisting of a fixed resistor and photoresistor) using an MSP-EXP432; however, the MSP-EXP432 "Analog In" pin is lowering the output voltage (i.e. the voltage going into the ADC from the voltage divider drops when the "Analog In" pin is connected).  I set the analog pin as an input in the code shown below in Energia.  Is there any way to fix this?    const int bitsOfADC = 14; // 14-bit ADC Launchpad //int maxVal = 2^N -1;  // 2^14-1 int maxVal = 16383; float FSV = 5.0; // Supply to 0804ADC float LaunchPadResolution = FSV/maxVal; int D7 = A13; int D6 = A14; int ADCInput = A6; boolean D7_State = LOW; boolean D6_State = LOW; void setup() {   delay(1000);   Serial.begin(9600);   pinMode(D7, INPUT);   pinMode(D6, INPUT);   analogReadResolution(bitsOfADC);   pinMode(ADCInput, INPUT); }
101022
Sinking and sourcing current refers to current going into and out of the MCU (respectively), right? If you configure a GPIO pin as an output, why would current ever go into the pin (since it's configured as an OUTPUT)? I suppose it depends what the output circuit looks like, if it's tied to the voltage supply rail or ground... maybe I just answered my own question...?
89307
I'd like to estimate the remaining battery life of a battery that powers a microcontroller. Could I accomplish this by simply leading the battery into the MCU's built-in ADC?  My idea is that I could plot the voltage over time to figure out how much battery life remains. But would the change in voltage be noticeable? And would it be a problem that the same battery powers the MCU (and ADC)?
52658
I'm wondering why pull up resistors in text books are told such that they pull up the voltage to \$V_{CC}\$. Here is a diagram:    When the button is open what will be the input voltage to the micro controller? \$V_{CC}\$? No voltage drop at \$R_1\$?
112307
Are pull-up/down resistors (whether internal or external) only needed for MCU INPUT pins? In contrast, an MCU pin configured as an OUTPUT "knows what level it's at" because it does the driving - a "floating" MCU OUTPUT pin tied to some input of another circuit doesn't make sense, because the state of the MCU pin can only be high or low... do I have this right? Now, upon MCU bootup or failure, it may be beneficial to have a pull-up/down tied to this "MCU output to IC input" line to ensure that the input to some IC is never floating.  Maybe I just answered my own question here... pull-up/down resistors can be used on both input and output pins, depending on application?
11237
Currently I have start working on MSP430 Controller and found that there are 4 pins for the supply voltage viz. AVcc, DVcc, AVss, DVss. These are used as analog supply voltage and Digital supply voltage. What are the purpose of providing these twins pins? How can I use these pins during designing of supply section.
52674
Before I ask my question, I should say that I am very new to working with electronics and I may not quite know how to describe my problem.  I am trying to use a pin on my msp430 microcontroller I have as a replacement for a pushbutton on a device. The msp430 is 3.3v and the device I am switching is 5 volts. I was under the impression I could use a 2n3904 transistor in place of the button by applying current by turning on the pin on the msp430 which would let current go from the collector to the emmiter, and hopefully "push" the button.  This is my current setup    However, turning the pin on does not activate the circuit. When I connect the jumper for the onboard LED, I can verify the pin is working. also, when I connect the 5v from the collector to the base using a wire, I can activate the transistor.  What other information am I missing to solve this? Thanks in advance  EDIT: After reading the comments, adding a 4.6k resistor between the base and IO pin and connecting my 3v ground and 5v ground allowed me to control the transistor without any noticeable problems. Thank you!
21351
I modified my Sega Master System to have a pause button on the actual controller. To process the signal, I soldered a quad NOR gate to the I/O and CPU circuits in the console. The idea is that the controller pause button sends a combined UP/DOWN signal, and the gate processes it and sends an NMI to the CPU, which is what the Pause button on the actual console does. This is the procedure recommended at the SMSPower forum, and I followed their diagrams.  Here's the thing: I installed the gate upside down, so that the packaging is resting on the circuit board, and the pins are sticking up in the air. I did this so it would be easier to solder the pins to the console, reasoning that the package is non-conductive anyway. When I tested it out, it didn't work correctly. As I was troubleshooting with my logic probe, I accidentally dislodged the Vcc connection, which I had soldered to a +5 Vcc solder point on the board. All of a sudden, it works correctly! I've checked the pin assignments over and over, and I'm positive that the Vcc pin isn't connected to anything; yet, the chip has power, and works as it is supposed to.  So, what is going on here? Was it a bad idea to install the chip package so that it touches the board? And why is the chip working when the Vcc pin is disconnected?  (edited to add requested information)  The gate is a CD4001AE Quad NOR; the datasheet is here:    The schematic is here, at the bottom of the page:
105310
I came into Electronics through Arduino, so pardon me if my knowledge about non-Arduino circuits is somewhat silly. I am preparing a small electronics project for my school with LDRs to detect light levels. With, an Arduino I could easily detect light levels and when they go down a threshold, I turn on a relay.   But, I wanted to make this without an Arduino, so I though of using an LM339 Comparator. I connected pin 3 of IC to Vcc and pin 12 to Ground. Pin 4 has an input lower than the input on pin 5 which receives input from Vcc. Lastly, I had the output 1 from pin 2 connected to an LED.  This circuit is only to test the comparator. If it works I am going to change the reference voltage and in place of the LED place a transistor. Here is a quick circuit Diagram I created:  But, the LED does not glow. Even if I switch the inupts, the LED does not glow. I tested this in circuits.io, the online simulator. It works perfect there. But, the problem persists on the breadboard.  How do I get the LED to glow in my circuit on the bench?  UPDATE: I just got the LED glowing with the help of Raj, but how can I connect the base of a transistor in place of the LED.
11897
This is similar to other questions, but I feel it is different because of the reuse of the "power" button.   I want a "latching" Momentary Power button.  Behavior:   User Pushes momentary button, holds down as long as necessary and the device powers up. Between Power On and Off the same button will be re-used for other functions  When it is held down for 5 +/- seconds the MicroController will turn itself off.    Design Constraints:   Battery provides between 3.7V to 2.9V during it's usable life The Voltage regulator requires Vin +/- 0.3V on the Enable Pin, 3.1V output. MicroController operates at 3.1V MicroController Output Pin High state is 2.7V Max   Debouncing: In this case I'm not concerned about debouncing the switch, if the user doesn't hold it down long enough for the MicroController to set it's Digital Output pin  High the device doesn't power on.  I've worked up the following schematic, which kind of works.    It assumes 3.7V from the battery. Uses an Analog Input for the Power button, which then uses the variation in voltage to determine if the button has been pressed. In the current design the difference is 0.12 V (from 3.4 to 3.52), but the MicroController has a 12 bit ADC so that shouldn't be a problem, in addition I can adjust the sensitivity range of the ADC.   Questions:  What is the difference between reality and the simulator?  Is there a better way?  How can I get a greater voltage difference on the button input? I've tried many different combinations but they increase the voltage range above the 3.6V Input High Maximum specified in the datasheet.  I'm not excited about the "Leakage current" when the uC Controlled Power Pin is Low, any suggestions?   Thank you for any ideas/suggestions/answers.
27898
Say you were wanting to measure a signal with a higher voltage than the ADC could handle. Is there some best practice or commonly used circuitry that goes beyond a simple voltage divider to protect the ADC?   Or is it common for professional designs to simply rely on a voltage divider?
15791
I have an analog signal which ranges between 0V and 10V.  I want to linearly scale it down to 0 to 2.5V for my ADC.     I'm concerned that using a resistive voltage divider will affect signal quality.  Is this true?  If it's not true, what value resistor should I use for voltage divider?
89416
I'd like to be able to protect my ADC from input voltages higher than 5V. What's the simplest protection circuit I could build to have an output like shown below?
111313
I am looking for an explanation what that component does inside of that circuit.  It can be found on page 3 of the Datasheet of ADP5091:   It would help me out a lot. Thank you in advance!
48372
&ndash; Schematic created using   Will this work as a four-bit shift register? (And by extension a shift register of any size?) Each vertical PMOS / NMOS transistor pair acts as a multiplexer, and the PMOS transistor to its left amplifies the voltage back up to close to V_high. I'd be interested in hearing people's feedback on this. Right now I have only three transistors (and a resistor) per bit. Can I really get it that small a ratio, or are there reasons why I need more transistors per bit?  It's probably worth noting that I don't have master/slave here, so I can only assert (Shift) long enough to move one bit toward the right and no more.  Furthermore, I'm not trying to say that I need a resistor with 100 ohms. That appeared to be the only resistor I could use to make this schematic! What I want is a resistor that has significantly less resistance than the PMOS it's next to when it's at high impedance, but enough resistance to prevent a short circuit from V_high to ground when that transistor is conducting.  Okay, now I've changed each of the BJT's to MOSFET's, and reduced the resistance of each resistor from 100 ohms to 10 ohms. I'm still going on the assumption that (shift) will only be asserted long enough for the gate delays of M4 and M5, and then of M6, so the value of (dataIn) will only make it to M6's output, and won't move to M8 until the next time (shift) is asserted. Is this enough to get this circuit behaving like a four-bit shift register?
105250
I know there is quite few discussions already on this topic, but since English isn't my first language, I though it better to get some more information about this.  I have used oscilloscopes to troubleshoot electronics problems and measure AC engine current spikes at startup, but I have no experience using them to measure high voltage levels and my experience is with old analog scopes.  So now I have this new DSO and the input rating is 400V peak to peak AC, so it can handle about 140V AC RMS? Not that I'm going to input that much there.  Since I live in Europe the mains here are 230 V @ 50 Hz I can't measure them directly.  If I set the attenuation from the scope and probe to 10X, the voltage is 23 RMS and it is safe to measure? And yes the probes are rated for 1kV.  If that is true, it's also safe to measure voltage between two main lines (400V RMS), since the peak-to-peak would be about 112 volts?  SAFETY: When I am measuring AC, I will be using the scope from its internal battery or with a isolating transformer (1:1) so that it is floating, meaning that there is no connection to earth ground. Are there any other safety issues I have not realized?
60172
While working on my project, I got to a point where I don't know the answer. I have a 10-bit ADC (the one incorporated in the ATMEGA328P) and it returns values up to 1023 (210 - 1).   The official documentation states that the equation to convert the values from the ADC to the corresponding voltage is:   $$ V = \frac{V_{in} \cdot ADC}{2^{10}} $$  But, if the values go up to 1023, then wouldn't it be better to replace the 210 by 210&nbsp;-&nbsp;1?  Thanks.