text
stringlengths
83
79.5k
H: What's the maximum wattage air conditioner I can run for 8 hours through a 12V-120V inverter from 200Ah batteries? I have an RV with two 100Ah batteries that provide 200Ah of 12V power in total. I would like to have a classic air conditioner (I've looked at swamp ones but they won't work for my needs) and I'd like to be able to run it for about a maximum of 8 hours. How do I work out if this is possible, given that there also needs to be a 12V-120V inverter? I've found AC units as low as 465W (although I don't know what their max pull is). AI: Theoretically, amp-hours times volts gives you watt-hours. Then watt-hours divided by hours gives you watts. In this case, 12V x 200Ah / 8h = 300W. The inverter will use some energy, so multiply that again by the efficiency of the inverter. Say it's 85%, then you can run a (300W x 0.85) = 255W air conditioner for 8 hours. Theoretically. If you can't find an air conditioner with a low enough wattage, you might be able to run a more powerful one at a low power setting, or only run it for part of the time (for example, a 380W air conditioner on for 10 minutes and off for 5 minutes gives a 254W average).
H: How many ohm is the ADC port internal resistance of the atmega8? I am trying to link a digital pin to a pad that's already wired to an ADC. I was wondering how many ohm the ADC port internal resistance is. AI: Page 310 of the datasheet gives you your answer: The analogue ports have an input resistance of \$100\space\mathrm{M}\Omega\$. However, that is not the whole story. As with all ADCs, a sample and hold capacitor is used as part of the ADC in order to hold the sample value during conversion. This circuitry has its own characteristics. From Page 244 the following diagram is taken: Here we see a 14pF sample/hold capacitor with series resistor to half the Vcc rail. As a result of this circuitry, you must use a low impedance source to feed the ADC. The ADC is optimized for analog signals with an output impedance of approximately 10k or less. A \$10\space\mathrm{k}\Omega\$ or less source resistance is recommended, otherwise the low pass filter effect of the capacitor with the source resistance becomes a major issue, requiring a longer sampling time for conversion and as a result limiting the maximum frequency. A unity gain buffer can be used if the source is high impedance in order to negate the effect of the sample capacitor.
H: Recovering Dead Soldering Tip That's Not Tinned Situation Breakdown I've seen multiple posts regarding this certain topic, but, using all of those posts confirmed answer, the results never showed to be significant, long lasting, or even remotely yielding results in the first place. I have a medium duty Wellers soldering iron, and I use the iron primarily for chip boards. Now before you tell me that I should learn how to solder before doing chip boards, I'd rather learn something like electronics production while learning how to solder. With that all set aside, below is the entire soldering kit. Yes I do use aluminum, but aluminum works just fine when it comes to small scale chips. Soldering Kit As you can see, the tip that I use for soldering things such as capacitators, switches, and resistors, on a really small scale. The soldering I use here (if it's important, that is) is a "Fine Eletrical Rosin Core Solder". Now, the real culprit is the soldering tips. The only reason I'm confused on how to fix them is because I want to say that the black stuff you can see on the cone tip, is carbon build up. I also heard that the metal used on soldering irons tips are prone to oxidation. Now what was confusing is that I've only had this iron for a week. While my dad has NEVER tinned his soldering iron, and after almost a decade it still works as if it were brand new. At first I thought I should simply just take a sanding block and just sand off the odd deformation my iron has created, but that didn't work. So now I tried tinning the iron, but the soldering flux wouldn't stick. So I melted a pool of soldering flux, thinking that would make it stick, and submerged my soldering tip into the molten flux pool, but to no avail. Finally I tried wiping it off several times, reapplying flux to it, and it still ended up like it is now. What's worse, is now when I apply the soldering core to the tip of the iron, it doesn't even melt it. Soldering Tips In Question I can return it, but it holds sentimental value to me, particularly because it was the first thing I used to solder with, which in my opinion, is worth holding onto, so I'd rather try and save the cores, and learn something from this, than return it and learn absolutely nothing from it. AI: Soldering iron tips at their core are copper, but are plated in nickel and tinned. If you sand/scrape the tip then you remove this plating and the internal copper becomes exposed and oxidises over time. Since the plating is already removed, you could keep constantly sanding back the oxidised layer, but you will be forever doing so and, like constantly sharpening a pencil, will eventually be left with nothing. I recommend that you get a new tip for now and keep up good maintenance on it. The top answer in this question here has some really good maintenance tips. If you are attached to your old soldering iron tip and have some spare time/feel like experimenting, you could always try to sand your old tip back to the copper layer and electroplate it yourself. I've found a video on youtube that shows how to do it yourself, normally I would say there's no point to taking so much time/cost/effort to plate it yourself but if you want to preserve it as a keepsake you could always try it. Electroplate your own soldering iron tips - Youtube
H: Does the stability of a circuit depend on its feedback topology? I am reading an article entitled "A Comparison of Two Approaches to Feedback Circuit Analysis" here. If I understood the author correctly, we use return ratio instead of two-port loop gain analysis for stability analysis because return ratio doesn't depend on feedback topology. As you can see in figure 4 and figure 5 from the article, there are two feedback topology with the same free-input source: The first one is shunt-shunt feedback and the second one is series-shunt feedback. The return ratio calculated for two cases are exactly the same and equal to 119. However, the two port analysis results in different loop gains. shunt-shunt feedback: loop gain = 28 series-shunt feedback: loop gain = 66 For that reason we use return ratio instead of two port analysis for stability analysis. My question is does the stability of a circuit not depend on its topology? For example, the figure 4 and figure 5 are exactly the same if we set input sources to zero (Iin = 0 and Vin =0). Should the two feeback toplogies have the same stability characteristic? I mean if one is stable then the other also stable. Thank you. AI: anhnha, for my opinion, the author of the paper (referenced by you) has caused more confusion than necessary. I think, he should have started with the simple example as shown in Fig. 4a (also shown in your text) in order to make clear what he wants to show. In Fig. 4a, it is clear that the output voltage at the collector node consists of two portions: (1) an inverted voltage (caused by the classical amplifying property of the BJT) and (2) another non-inverted voltage caused by the input voltage and the corresponding "forward current" through Rf and Rc. As a consequence, we would make an error if we would consider only the inverted portion as given with (1). And this would be the case, if we would apply Blacks classical feedback formula involving the return ratio RR only (forward gain divided by (1+RR). Note that in this paper the term "return ratio RR" is used instead of the term "loop gain" which is in common use today. That is the main purpose of Hurst`s paper: To show that the closed-loop gain as well as input and output impedances of feedback systems must NOT be calculated on the basis of the RR only if the feedback topology allows such a "direct" feedthrough portion of the output signal as described above under (2). In this case, there is a difference between the real existing return ratio RR and the product "af" as defined for the classical model in Fig. 1a. Note that the author performs the following step: He transfers the block diagram of a real existing feedback system (with signal feedthrough) a shown in Fig. 1b into a new simple (ficticious) block diagram with two blocks only (Fig. 1a). His intention is the following: The loop gain "af" of this new simplified system can be used to calculate the closed-loop parameters (gain, input/output impedances) using the well-known formulas involving the expression (1+af). Remember: Due to the very small output resistance of opamps, this feedthrough portion normally is neglected in inverting opamp applications (we set loop gain=RR). However, as an example, this portion (2) is responsible for bad attenuation values of Sallen-Key lowpass stages for rising frequencies in the stop band region (opamp gain goes down and output impedances increases). As a consequence of his considerations, Hurst shows in part IV of his paper that the product "af" and the return ratio RR are identical if there is no extra forward gain in the feedback loop (theoretical case only) and/or if the output impedance of the main amplifier can be neglected. Finally, regarding the title of your contribution: Stability analyses are NOT influenced by all the considerations as mentioned in the text. Stability properties are determined by the return ratio RR only and no two-port analyses are necessary because "forward contributions" (if they do exist) do not influence stability aspects. You will have noticed that the term "stability" is not mentioned in Hurst`s paper. PS: Further explanation. Based on the return ratio RR, the closed loop gain and the input resp. output impedances for opamp circuits with negative feedback can be calculated using the open-loop values devided or multiplied by (1+af). However, this is allowed only when the conditions of part IV of Hurst`s paper are fulfilled (af=RR). In most cases, this is the case for opamp applications: Acl=Aol/(1+af); Zin=Zin(ol)/(1+af) for inverting and Zi=Zi(ol)*(1+af) for non-inv. circuits; Zout=Zout(ol)/(1+af) EDIT (answer to the question): The sentence under question (page 256) concerns Fig. 2 as well as Fig. 5 of Hurst`s paper. It is obvious that after removing the current source Iin (Fig.2) and shorting the voltage source Vin (Fig. 5) both circuits are identical. Hence, the classical definition of the return ratio RR, which does not take into account any forward signal transmission, will be the same. In this case, the opamp internal output voltage (gmRout) is considered as the only existing driving source. Hence, the expression of RR is given simply by the voltage divider rule and the driving voltage gmRout. Of course, the situation is different when the contribution of the forward signal path is taken into account - because we have in the example circuits two diffent sources at two different locations. Therefore, both expressions for the product "af" are different. Hence, the author not only has shown - taking forward feedthrough into account (if it does exist!) - that for one single circuit both expressions ("RR" and "af") can be different but he also has demonstrated that in case of two diffent circuits with EQUAL RR the products "af" can be different. This part constitutes just another example to demnonstrate the possible difference between both expressions (RR and "af", resp.) used by the author.
H: Powering a microcontroller circuit using a differential voltage instead of an absolute voltage So this is a more theoretical question. Imagine I have 2 perfect power supplies that I can set to whatever voltage I feel like (10 000 VDC for example). Now I know that when it comes to voltage it's the potential difference that you actually use (e.g 10 V on GND and 15 V on VCC gives the chip 5 V). As an example, imagine I have a simple microcontroller circuit with the correct track spacing and width. If I put 10 000 V on the VCC pin and 9995 V on the GND pin of the circuit, would it still power up? Would there be some other adverse effects if I was to implement this practically or would it be no different to using 5 V and 0 VDC. Is it the same using negative voltages (-9995 V on VCC and -10 000 V on GND)? My main question is, could you power a circuit using whatever voltage you wanted as long as the difference between the voltages is the same as the component ratings (e.g 5 V)? I know in theory the maths says "Yes" but practically would it be any different? I want to reiterate, I am not actually planning to power a circuit with 10 000 V so no "You're going to die using that voltage" please. AI: Yes you can, in fact, people do it every day. Often a mains powered H-bridge will use an isolated high side gate driver, so running at 340v and 15v above that. What people do is implement the two different voltages by setting one relative to the other, for tolerances and for practicality. Tolerance. Consider that you had a 10kV power supply and a 9995v supply, and that they were both very very good tolerance, say 0.1%. Their difference would be 5v +/- 20v, anything from -15v to +25v. Not a nice environment for your 5v chip! Practicality. Why make two different standalone 10kV power supplies, twice as expensive as a single supply, when most of the time what's needed is a cheap 5v supply 'riding on' the 10kV. For a low current supply, your 10kV supply could use a current leak to ground through a big resistor, and use a 5v zener to regulate the 9995v with respect to the 10kV. For any serious power at 10kV, it would be less wasteful to use an isolation transformer, to supply a rectifier and 5v regulator at 10kV. The mains powered high side driver often uses a charge pump capacitor, as it doesn't need full isolation from the low side, and needs a reasonable amount of power.
H: Can we control our computer's USB port? what i want to do is : I want to connect a USB fan to my laptop and through programming want to turn on and turn off the fan. Is it possible to do so? Please post your valuable suggestions. AI: The easiest way to achieve your goal when you aren't experienced in electronics is to use an Arduino. This tool will do the bridge between your computer and the fan and make everything secure. You need to do the following: Buy an Arduino (or get one) and attach by USB to your computer Attach your fan (assuming it has only 2 pins to connect) to the right pin output 5V and GND of the Arduino. Profit ! You can turn it off by disconnecting the Arduino If your fan does not spin it means that you need more power. But normally a computer fan of 12V will spin with the power that a USB port can deliver. The Arduino is a programming tool, so you can do more complex things with it. Look for "PWM" if you want to control the speed of the fan.
H: May I use CD4066 instead max 232, to convert rs232 UART(USART) level As in the title, Is it possible to use the CD4066 as level driver through RS232 and TTL(USART)? If it's possible how this work. Thanks. AI: The answer, once again, is "it depends". Voltage levels Figure 1. RS232 signal levels can be up to ±25 V. Source: 8051 projects. RS232 signal levels are bi-polar. Generally CMOS devices such as the CD4066 are used on single-ended supplies but the 4066 can be used on dual supplies of up to ±10 V but recommended limit is ±7.5 V and the switched signals would have to stay within that limit. You would be unfortunate to connect to a device that generated more than 7.5 V for switching but it could happen and the 4066 could be destroyed. Switching the CD4066 in this configuration becomes awkward as the switching logic now has to switch between +7.5 and -7.5 V so logic level conversion is required. The 4066 switches for the transmit signal would have to switch between +7.5 V and - 7.5 V to generate the transmitted signals. The received signal would also have to be level shifted and inverted. In short, you will have a very complex circuit requiring: Voltage boost power supply for 'space' signal. Negative voltage power supply for 'mark' signal. Logic level conversion from TTL to RS232. Withstand ±25 V on the RX pins. Threshold discrimination (the ±3 V region in Figure 1). Fortunately all these issues were solved by Maxim in 1987 when they brought out (you've guessed it) the MAX232. It's so good it is silly to consider any other way of doing it for true RS232 communication. Figure 2. MAX232 pinout. Add four small capacitors for the voltage generators, a 5 V supply and you're done! Source: MAXIM
H: Amplifying AC voltage via DC supply voltage at the moment I'm trying to amplify an AUX-Signal with a 12V DC supply voltage. I tried die setup from Here's here as u can see in the sketch below. simulate this circuit – Schematic created using CircuitLab But all I get is just an annoying noise sounding horrible. For the amplifier I used both the CA3240EZ and the OPA134PA. Maybe my grounds are not connected correctly. It would be awesome, if anyone could help me out. EDIT 1: According to your hints, I tried now those variations of power supply bypass capacitors 1st: simulate this circuit 2nd: simulate this circuit EDIT 2: The voltage is pretty stable at 12,18V as far as I can measure it with my voltmeter. I changed now the 22kΩ into a 2,2kΩ resistance, so the gain should be 1. As i decrease my volume the noise also decreases. And if I have volume = 0, one cannot here anything out of the subwoofer. I still get this annoying sound. I recorded it with my handy and you can listen to it here: https://soundcloud.com/pixel_95/subwoofer-noise EDIT 3: I get the via an normal chinch cable going into the receiver of a LG HT44S (www.amazon(dot)de/LG-HT44S-Heimkinosystem-HDMI-schwarz/dp/B003BYQ74A). From there i use the subwoofer output with the orange and black cable as you can see here: i.imgur(dot)com/Aw0hmfr.jpg Then this black and white cables go into my breadboard in here: Other View of the breadboard here: And afterwards the outputs goes to the subwoofer in here: I put AUX IN normally to my receiver and set the volume to 0. then inverted, non inverted and output are ALL at 6,1V to ground. AI: Answer You didn't tell us you were trying to drive the loudspeaker directly from an low-power opamp! Figure 1. Extract from the CA3240 datasheet showing that the most you can get out of the device is 11 mA (since you need it to both source and sink current). The opamp is can supply < 100 mW into a high impedance load. Your speaker shows a 3 Ω load. You need a power amplifier. History of debug But all I get is just an annoying noise sounding horrible. This is not really an adequate technical description of your problem. It could mean anything from a permanent buzz or hum to gross audio distortion when playing music. Step 1: Short out your input terminal to ground. The output should be silent. If the noise persists then it points to a power problem or faulty connection. Is your 12 V supply adequate and is the voltage stable? Step 2: Your original amplifier has a gain of \$ \frac {22k}{2k2} = 10 \$ and if your input signal is large you may be driving the amplifier into clipping. Use a source with adjustable volume control. Turn the volume down to zero, connect up and gradually increase the volume. If this solves the problem then reduce the gain of your amplifier. The sound sample you posted shows that "music" is in fact getting through but that it is heavily distorted with a characteristic clipped sound. (i.e., The output is hitting V+ or GND and being squared off. Step 3: Measure the voltage between non-inverting input and ground. It should be 6 V or so and steady! Step 4: With the input shorted measure the voltage between the opamp output and ground. It should also be 6 V or so. OP's comment: The voltage between the output and the ground is 0 if the input is grounded. This is the cause of the distortion! Step 5: Assuming the opamp is working, for the output to go low it means the voltage on the inverting input must be higher than the 6 V on the non-inverting input. Something is pulling the signal input high. What is the voltage on the inverting input? Is it time to add a photo of the setup to your post?
H: Altium: Using Find similar object to change all designator fonts at once I am trying to use Find similar object in Altium designer to change all designator font in my schematic at once. First I Right-click on any designator on the schematic and select Find similar object and Ok. this makes all designators in the sheet to be highlighted. Sch inspector is opened and I select FontId to change the required font. Later I expect that all designator fonts will immediately be changed but actually nothing is happened, Why?! AI: That is because you must Enable "Select Matching" in Find similar Objects. Then press OK and continue to change FontID. That should work!
H: Difference between 7805 and ref02 module Both of these chips provide a constant supply 5V. My guess is, based on price and datasheets, the ref02 is much more precise and does better under varying temperature characteristics. Watching Peter Oakes video tutorials on modular power system, he uses three different options for adjusting the op-amp input voltage; zener diode, JFET with zener diode, and a ref02 module. He chooses the JFET with zener to give pretty precise control, but says for the best precision to use a ref02 module. I was wondering why a LM7805 (maybe $.50) wouldn't function in the same way? The output stage in the schematic will probably be mosfets or darlingtons or something, this is just representative and my question is related to the input. All credit on the schematic and circuit design goes to Peter Oakes (thebreadboardca). simulate this circuit – Schematic created using CircuitLab AI: I was wondering why a LM7805 (maybe $.50) wouldn't function in the same way? Functionality is the same (apart from the trim feature on the REF02) but not performance.... The REF02 has an output voltage specified at 5V ± 0.2% The 7805 is specified by Fairchild as 5V ± 4% How much accuracy do you need? The output voltage temperature stability of the REF02 is 10ppm / degC. This is equivalent to 50 uV / degC. The 7805 equivalent spec is 5 mV / degC How much stability do you want? The long-term stability of the REF02 is ± 100 ppm (0.5 mV) over the first 1000 hours and gets better for the 2nd 1000 hours. I've not seen this specified for a 78XX regulator so it's not really guaranteed. Horses for courses.
H: Software timers and interrupts on a microcontroller I have few questions on software timers and interrupts on a microcontroller. Just for information, I use a dsPIC33E microcontroller. The final goal is to implement a serial communication protocol: RS485 with Modbus. I managed to transmit and receive a message, and now I have to do a message processing part. Since I need a bunch of timers for all sorts of different tasks (e.g., 3.5 character delay needed for serial communication, some delay needed for buttons debouncing etc.), I plan to implement timers in a software using a single hardware timer. For example, hardware timer period is set to 100 us, and an interrupt is generated on every "overflow", i.e., every 100 us. In the ISR I just update global counters, which are basically software timers with a resolution of 100 us, whereas the hardware timer ISR has the highest priority. Is this a good way to do this, or is there some better way? Each counter (i.e., a software timer) has defined its own period, and once the counter reaches its "period value", I want to call some function. Now it is not a very good idea to call this function from inside the hardware timer ISR, because that function will be processed with the highest priority since the calling routine is the hardware timer ISR. What I want is to define some function, let's say: void Modbus_Protocol(void); and to be able to define it as an interrupt, which will not be of the highest priority. Only the main hardware timer has the highest priority in this concept. In that way, once the counter in the hardware timer ISR reaches its period value, it wouldn't call its function, but it would rather just set a flag to trigger an interrupt (e.g., void Modbus_Protocol(void)), which will be triggered after the main ISR returns, depending on its priority. Can something like this be done, i.e., can I define software interrupts? I know there is a possibility to use hardware interrupts which are not used, and to just set an interrupt flag from within the software. But I don't think this is an elegant way to implement interrupts if user defined software interrupts are possible. AI: You do not need special "software interrupts". Have a look at the following code. I neglected some technical stuff like variable declaration for clarity. Use your ISR to just count some timer (tick). In the main() you are waiting to sync to this timer. Use a dedicated timer for each task you have to process. All these timers are incremented every ISR tick. If the task timer expire, the dedicated task is processed. There are some special features in this kind of implementation. When you subtract the EXPITED-time from your timer instead setting it to be 0, your software is more robust if any of the tasks takes longer thenn 100µs. It's a kind of soft-realtime criteria. You get a pseudo multi-tasking system. isr() //100µs { tick++; } main() { while(true) { while(tick == last_tick); last_tick = tick; modbus_timer++; task1_timer++; task2_timer++; if(modbus_timer >= MODEBUS_TIMER_EXPIRED) { modbus_timer -= MODEBUS_TIMER_EXPIRED; Modbus_Protocol(); } if(task1_timer >= TASK1_TIMER_EXPIRED) { task1_timer -= TASK1_TIMER_EXPIRED; Task1(); } if(task2_timer >= TASK2_TIMER_EXPIRED) { task2_timer -= TASK2_TIMER_EXPIRED; Task2(); } }//forever-loop }// main()
H: Cadsoft Eagle Library: How to create device variant? I'm creating a custom device in Eagle Library. Generally I need two device, let's say they're CONN2.54_1 and CONN2.54_2. These two devices are connectors, they both have 4 pins, thus they have the same symbol. The difference is the package, one is vertical mount and one is horizontal. Now I can create 2 separate device successfully. However I want to know how to group them under one "sub-category" in the Library? For example: when I use the add button in the Schematic Editor, my custom Library should appear like: MY_LIBRARY\ (This is the main library) CONN2.54\ (There's a sub-folder name CONN2.54) CONN2.54_1 (The first device is inside the sub-category) CONN2.54_2 (The second device is also inside the sub-category) Thank you! AI: In the library editor, go to your device and you'll see the traditional screen. Here is the "rcl" library - probably the most popular library there is. On the right side is the package variant section. Here is where you can assign multiple packages to the same device. You simply click on "New," select your new package, give it a useful name, and add it. You can then associate schematic pins to footprint pins with the "Connect" button. You can see in rcl how the resistors use one schematic part but a large number of package variants.
H: Tristate buffer I know that the "third state" of a tristate buffer is a high - impedance output. But my question is what about the input impedance? Will it also change to high - Z? Whatever article I read about a tristate buffer, no one seems to talk about the input impedance, so my second question is that does it even matter if the input impedance is low or extremely high? AI: On regular, CMOS digital chips, the impedance of an input is always high. By definition, the internal implementation of an input should not influence the level of that input. Only the external components should be able to decide on whether the input is high or low. Otherwise, it becomes an output. It is as simple as that. And actually, an output that is high impedance is often exactly configured in the same way as an input, on a MCU. It has exactly the same behavior. To be more explicit, here is how a general-purpose input/output (GPIO) pin is implemented within an MCU: There are only three valid states: OutputH on and OutputL off (the pin is a high-level output), OutputH off and OutputL on (the pin is a low-level output), or both OutputH and OutputL off (the pin is either an high impedance output or an input). The difference between a high impedance output and an input is simply whether the Input value is used or unused from the firmware. As an aside, the state where both OutputH and OutputL are on is invalid, as this would create a short between Vcc and GND. Note that I took the example of MCU GPIO pins here, because they can be configured in any state you want, but the principle is the same for any kind of digital chips (logic chips, etc): an input is always high-impedance.
H: Voltage Drop Across MOSFET in Ground path I have an arrangement in which an NMOS is connected in the ground path to control the power flow as shown below :- When the FET is on , current will flow & there has to be voltage drop across the mosfet. Because it is connected on 0V already, how to analyze the voltage drop across it? AI: an NMOS is connected in the ground path the control the power flow It's worth mentioning that when the FET is "off" current will flow through the diode - is this what you really want? If so then just do as pjc50 says and treat the MOSFET as a resistor equal to its on-resistance. Looking at your circuit a bit more, all it realistically does is protect the load from reverse polarity inputs.
H: Alter boost feature on Guitar Amp from a fixed +6 dB to variable +0 to +16 dB gain I have an Ibanez TSA15H amp head. Here is the schematic for the boost portion of the amp. The Boost SW just goes to an Off(Open)/On(Gnd) switch. Currently the Boost is set at +6 dB. I would like to alter the circuit to allow for variable boost from 0 to +16 dB. I know this is doable from a practical perspective since Robert Keeley (professional who sells pedal/guitar/amp modifications) has done the same with this amp before. So, long story short: Which resistor(s) need to be replaced with a VR? What should the max value of the VR be for a +16 dB boost? I am just an EE student doing this for kicks and to get a little more out of my guitar amp at home. I have the practical skills needed to make modifications, but my design skills aren't quite good enough to trust on this particular project without some kind of check. All help is greatly appreciated. Edit: Here is the portion that uses the boost signal AI: Sorry to disappoint you but this portion of the circuit is purely a switch interface. The audio doesn't go through it at all. Let's see how it works: Input off If the BOOST SW input (on the right) is left floating the base of Q3 is pulled high via the LED and R36. Q3 turns off. This allows R34 and R39 to pass current from the base of Q2 so it turns on. Q2 turning on allows current through R38 so it switches the output high to almost +9V. Input on If the input is connected to ground LED will turn on, Q3 will turn on and Q2 will turn off. R38 will pull the BOOST output to ground. You need to find the next portion of the circuit that uses the BOOST signal. Figure 1. The boost stage is built around a non-inverting amplifier with gain set by the ratio of R23 and R41. Ignoring everything else for the moment, gain, A of the circuit is given by \$ A = 1 + \frac {R23}{R41} = 1 + \frac {22k}{22k} = 2 \$. If Q5 is turned on it pretty well bypasses R23 so the gain drops to \$ A = 1 + \frac {0}{R41} = 1 + \frac {0}{22k} = 1 \$. The ratio between the two settings is 2:1 = 6 dB. To increase the gain to up to 16 dB we need a gain of 6.3. Rearranging our gain formula we get \$ R23 = (A - 1)R41 = (6.3 - 1) 22k = 116~k\Omega \$. 100k is the nearest standard value and when added in series with R23 will be just about right. Lift one end of R23, connect it to one end of the pot and connect the wiper and other end to the empty resistor pad / hole. (Connecting the wiper to the otherwise disconnected end of the pot ensures that the amp will still work if the pot wiper becomes broken / dirty / contaminated.) For online gain to deciBel converter see sengpielaudio.com.
H: Control theory diagram for feedback circuit with compensation An op-amp that drives a secondary gain stage might be given like this: simulate this circuit – Schematic created using CircuitLab Where it is important to note that FB1 is some impedence (unlikely to be purely real) rather than a resistor, and the same for FB2_a and FB2_b. However, I'm unsure how to describe such a circuit using a control theory diagram. The diagram that I naively believe to be correct is here: simulate this circuit However, The node between FB1 and FB2 doesn't seem correct (and I'm not sure how to deal with such a node). I have seen structures where FB1 and FB2 go through a summing block, or where they go through two difference blocks in series between In and G1: simulate this circuit However, this seems to ignore the fact that the voltages after FB1 and FB2 must be the same, they are not added together. How does one properly represent the circuit given above using control theory diagrams? AI: I think this tells the story a little more accurately. It is almost identical to your first diagram, but you can't just connect outputs of blocks together. This creates an impossible condition -- two outputs defining one signal without any kind of defining operator. They need to be summed, and this diagram illustrates that. simulate this circuit – Schematic created using CircuitLab Another way to represent this would be to combine the op amp input summer and the negative input summing node into a (+ - -) summing operator, but circuit lab doesn't seem to have that.
H: Can a capacitor be briefly charged above its voltage rating? Lets assume I have a supercapacitor rated for 5v at 200F. That's 2500 joules of energy. My wall socket outputs 120V at a maximum of 15A, which is 1800 watts (or joules per second). If I hook up my capacitor to 120V DC at 15 amps for 1 second, I would expect my capacitor to be charged up to 1800 joules, or about 4.2 volts. My expectation is that since the voltage across the capacitor is never above 5v, it should be fine. Will this work in practice, or would my capacitor blow up in my face if I tried this? And if not, why? AI: Draw out your circuit and do the analysis. Assuming you mean 120VAC -> rectifier -> resistor -> supercap, and you've got magic hands to unplug the cap when it reaches a certain voltage, it's theoretically possible- the voltage rating of the cap only "cares" about the actual voltage across the cap, and in this case the line voltage is across both the cap and the resistor. However, it's a horrible idea. Please don't hurt yourself.
H: How to calculate voltage after rectifier? Well, my question is: "Is this calculator wrong?" It calculates the voltage after rectifier as Vdc = Vac * 1.41 It seems it forgets the voltage drop on diodes (0.7V + 0.7V). Is the site accurate or we should we take into consideration the voltage drop on diodes? Update: For 12Vac I get 15.9Vdc after the rectifier (4x 1n4007 & 470uF capacitor, no load). AI: Have a look at the following image: That's a rough idea of what the voltage at the capacitor looks like in a full wave bridge rectified system. (Once it reaches an equilibrium state.) The grey curve is supposed to show the rectified DC out of the bridge, but this will actually be about two diode drops lower and there will be a tiny gap around 180 degrees and 360 degrees, and so on. But it's close. The main point here is that the thick black line shows you what the capacitor voltage roughly looks like when there is a real load applied and the capacitor is designed within some range of reason for the load. As the rectified voltage gets past the bridge and is rising, at first it does nothing much since the capacitor voltage is higher. But the capacitor is still supplying current to the load and drooping, so eventually the drooping capacitor voltage and the rising rectified voltage cross over sufficiently to forward bias the diodes in the bridge and the capacitor voltage follows the rising voltage (or what remains of it, this first half of the first half cycle.) For this very short time before the bridge voltage peaks, some few degrees before 90 degrees, the transformer/bridge system is supplying current to the load and the capacitor. As the rectified voltage rapidly declines and falls away from its peak at 90 degrees, it also falls away from the capacitor voltage and the capacitor is then supplying all of the current to the load. It must continue to do this until the next half cycle, usually not much but somewhere before 270 degrees when the transformer/bridge system supplies all the current again. That lowest point in the droop of voltage must still be sufficiently high for the following voltage regulator system (if there is one.) Note that if the load draws more current than before, then the slope of this droop will steepen and it will dip still further down before the rising voltage from the bridge rectifier catches back up. Also, if you use a smaller capacitor even if the load current stays the same, the slope also steepens. So you need to make sure your capacitor and expected worst case load match up with the needs of the minimum input voltage for your following regulator system. As you might guess, by now, there is no simple, linear, one-equation-solves-all-problems here. Some thinking is required.
H: What is a C&I circuit? What is a C&I circuit? I've seen it in a surge arrester catalogue indicating that those kind of surge arresters are to be used in C&I circuits. AI: In this context it most likely means Commercial and Industrial. It is an umbrella term that covers lots of specific surge suppression types, but at least some are rated for Industrial use, the rest are commercial. For industrial that translates to tougher enclosures, with 4x fiberglass and 4x stainless steel being top rated for harsh environments like bottling plants that handle citrus products, so the air is filled with citric acid, very corrosive to plain steel and aluminum. Sewage treatment plants also need special enclosures and conduits for electrical power and control lines. C&I is not a standard in itself as the NEC code book, UL and ISO standards define the details of assembly and assembly standards and documentation. For some surge suppressor options and build and test standards go to: http://www.aptsurge.com/ Yes, I used to work for them for 15 years so maybe my choice is biased, but they are 'married' to UL and ISO standards as much as any surge suppresor manufacture. One could say they are a C&I plant, in that they build both Commercial and Industrial surge suppressors. In terms of everyday use of the words "Commercial and Industrial", commercial was used to describe products for residential use, including street lights. These often are pre-wired with wires a meter long or so and LED's for "Phase OK" indicators, up to 120Ka per phase. Priced under $500 USD if possible. By default anything else was industrial rated, much more bulky with disconnect options, weight as much as 90 pounds, buss-bar connections and lugs for 8awg to 4awg wire. The term "C&I" was seldom used, as we were implicit in conversations, meetings and documents about a products goal. One could install an industrial rated surge suppressor in their home, but they cost thousands of dollars and would be the size of the breaker panel-or larger.
H: Isolation provided by transformers I have a few questions about transformers and isolation. I will describe my understanding (maybe wrong) and questions about them. Transformers provide safe isolation by disconnecting two circuits electrically. So now instead of touching one hot wire on the isolated circuit, you must touch both to get shocked. Why don't my wall outlets work this way? I know there are many transformers used in the power distribution network. Is this because they are referenced to ground (with a center tap or something)? If the power lines are referenced to ground, why? Wouldn't it be safer to keep the power lines floating w.r.t. ground, so that for a shock to occur a person would have to touch two wires? Could I provide this protection at my home by putting a 1:1 isolation transformer between the power grid and my house? AI: Could I provide this protection at my home by putting a 1:1 isolation transformer between the power grid and my house? Consider these scenarios: - If one wire (called neutral) is earthy, then touching the live side will give a shock but, that shock isn't going to push hundreds of mA through you and kill or burn you. If you touch live and neutral together then that is going to push potentially hundreds of mA through you and give burns or worse. Transformers provide safe isolation by disconnecting two circuits electrically. So now instead of touching one hot wire on the isolated circuit, you must touch both to get shocked. Consider the relative benefits of scenario 1 and the advent of the earth leakage circuit breaker. If a current is taken from the live wire through your body to earth that current does not flow down the neutral wire and this can be detected at a low level and trip a circuit breaker. Modern devices use residual current devices (UK) or ground fault circuit interrupters (in the US). All developed countries use something. So, the RCD passes live and neutral through a magnetic core and the resultant flux in that core is zero because, under normal load conditions live current and neutral current are equal and opposite. A detection coil (also on the core) generates a signal to trip the breaker if the difference between live and neutral currents is ~30 mA. It trips fairly quickly so if you touch live in a meaningful way, within a few tens of milliseconds, the circuit is rendered safe: - Without having neutral connected to earth there is no intermediate semi-safe method of preventing full circuit contact and a much higher risk to health.
H: Op amp voltage reference with emitter follower The purpose of this circuit (taken from the Minimoog) is to provide a stable -5V across the 100R load resistor, as accurate as the -10V supply and the ratio of the 5K resistors in the potential divider, and capable of sinking tens of mA. As I understand it, the transistor is configured as an emitter follower, and negative feedback around the op-amp ensures that the remotely sensed load voltage matches the reference voltage. simulate this circuit – Schematic created using CircuitLab I think the circuit would continue to work if either or both of the 4.7k resistors shown were replaced by wires. Why were they included, and what effect do they have on the performance of the circuit? For R5, I would suggest that it helps to match the offset voltage [caused by the op-amp's input bias current] at the two inputs of the op-amp, but I'm puzzled because the potential divider has a Thevenin equivalent circuit that is -5V in series with 2.5k, so a better value for R5 would be (say) 2.2k. AI: Yes the circuit would work without either resistor but there may be benefits from having them. The bias currents into the rusty old 741's inputs is about 100 nA and this will produce an error on top of the 5V produced by R1 and R2 but only about 0.25 mV so trying to balance that current with R5 isn't really a big deal. However, R5 does somewhat protect the 741's input from unknown loading effects on the output. You say that this circuit is used in the minimoog but if that 5V were also available as an output then R5 could offer the 741 some protection from external problems. Ditto R3 - if someone shorted the -5V rail then R3 would limit the current taken from the 741 into the base and give it a level of protection. R3 also limits the current that can be delivered at the emitter of Q1 too. The main problem here is that this circuit doesn't have any context and, that back in the late 60s/early 70s, who knows what went through the mind of the designer. Op-amps were beginning to be used commercially but their reputation wasn't as great as it is now and maybe the designer thought more about protecting the device against unreasonable "what-if" scenarios that we would today.
H: Solving the time constant in this specific circuit I'm having some problems with this circuit from a tutorial website: When the switch is open, the LED is on. When the switch is closed, the LED turns off and the timer begins. After a while, the LED will soon turn on. It changes with depending values of the resistor and capacitor (so i think its an RC circuit with a transistor). Im wondering how you would find like an equation that will determine the time constant of this LED turning on when the switch is closed. Note: the capacitor already has a voltage when the switch is open and it begins to decrease when the switch is closed. When it reaches zero, the voltage goes in the opposite direction (negative), until it hits -0.6V and allows the transistor to turn on and allow the current through. Is the capacitor actually discharging??? Any help appreciated!Thanks! :) AI: The capacitor charges through R1 to +9V - Vbe = 8.3V when the switch is open. When you close the switch the left end of the capacitor becomes 0V, so the right jumps to -8.3V (exceeding the absolute maximum rating of -6V on Q1, by the way). Ideally the transistor does not instantly die from this abuse and the capacitor begins to charge towards 0V - Vbe = -0.6V (putting reverse bias on the polarized capacitor, also frowned upon in some circles). The time constant is \$\tau = R_2 C_1\$. Time Constant has a specific meaning- it is not the same as the time for the transistor to switch because the threshold is not at 63% discharge but more like 50%. The discharge follows an exponential curve. (as pointed out in the comments, the vertical axis is not really right, but the shape is correct). To clarify the actual discharge curve measured at the right-hand side of the capacitor, so relative to ground, (and ignoring the transistor base for now) can be shown to be \$v(t) = 9 - 17.2e^{-t/\tau}\$ where t>=0 is the time since the switch was closed. The transistor will switch (and the curve will deviate from the ideal since the base clamps it) when v(t) is about +0.7 so that is at \$t = \tau\cdot \ln(0.483)\$ or about \$0.73 R_2 C_1\$. In this particular case C1 = 470uF and R2 = 22K, so the time should be ~7.5 seconds. It may vary a bit from that because the transistor needs some current to operate the LED and also because the 470uF capacitor probably has a large tolerance. You can easily simulate this in circuitlab to verify the design- the top curve shows the LED current, and the bottom curve the voltage at the base of Q1. simulate this circuit – Schematic created using CircuitLab
H: Capacitors and simple circuit understanding I'm reading through Make: Learn Electronics and it has the following schematic for charging and discharging a capacitor. (Figure 2-80) I understand that if I close switch A then I'll be creating a complete path for the electrons to flow, so the capacitor will charge. Now, if I release A and press and hold B the book says the capacitor will discharge. I'm unsure how this happens, if the capacitor has now a voltage (9V) and I close B why would the capacitor discharge? Wouldn't the capacitor discharge anyway without closing B? (there's already a complete path?) What is the exact path the electrons will use when B is closed? (visually) AI: simulate this circuit – Schematic created using CircuitLab Figure 1. OP's circuit redrawn more conventionally. I understand that if I close switch A then I'll be creating a complete path for the electrons to flow, so the capacitor will charge. Let's forget about electrons for now and just talk about conventional current. The direction of current flow was agreed as positive to negative before the discovery of the electron (by J.J.Thomson discovered in 1897) and we have stayed with the convention but keep in the back of our mind that it's actually electron flow the other direction. You are correct. If A is pressed then C will charge through R1. After one RC time constant¹ the capacitor will be charged to 63%, after 3RC it will reach 95% and after 5RC it will be 99% of the battery voltage. If A is now released the capacitor will hold its charge (although any internal leakage and the voltmeter's resistance, if connected, will discharge it slowly). If the capacitor has now a voltage (9 V) and I close B why would the capacitor discharge? Because you have connected both sides of the capacitor together through switch B. This means that the potential or voltage on both sides must be the same. If it's not the charge will flow (creating a current) until the voltage is zero. Wouldn't the capacitor discharge anyway without closing B? (There's already a complete path?) No. With the voltmeter out of circuit and both switches open there is no "circuit" or complete path. What is the exact path the electrons will use when B is closed? (visually) (Conventional) current will flow from the top of C1 through B to bottom of C1. The electrons will actually flow the opposite direction. ¹ The RC time constant or \$ \tau \$ is found by multiplying R and C. In your circuit this is $$ \tau = RC = 1k \times 1m = 1~s $$ So the capacitor will be 99% charged in 5 s. Disharge time will be determined by the internal series resistance of C1 and the resistance of switch B when closed. Let's say the sum of these worked out to be 1 Ω then the discharge time constant would be \$ \tau = RC = 1 \times 1m = 1~ms \$. There's a little problem to watch out for though: If C1 is charged to 9 V then the initial current flow will be \$ I = \frac {V}{R} = \frac {9}{1} = 9 ~A \$. If the switch isn't a beefy one the contacts will arc and eventually burn out. A practical circuit would have a resistor in series with B to limit the current to a safe value. e.g., 10 Ω would limit the discharge current to 0.9 A. I'll let you work out the discharge time.
H: Can adding inductive load really reduce mains power consumption? I have recently bought one of the cheap mains power meters (EL85-2042A to be precise) to monitor power consumption. It's really helpful when I need to know where my electricity bill comes from, or when I want to make sure I switched everything off before going out: There's one thing I have noticed which I'm not sure how to explain. I have a few 12V LED spots powered via a transformer, and whenever I switch those on, the current on the meter goes down by 40 mA or so. A similar effect happens when I connect an old tranformer-based adapter powering an old clock radio. As I understand this, most of my appliances ought to have capacitive kind of load, resulting in a leading power factor, so adding an inductive load with a lagging power factor compensates for that. What I would like to know is whether I will be really billed less when adding inductive load and consuming less reactive power, or do power companies take these effects into account and only bill for real power consumed? AI: Power companies just bill you for the real power consumed. In fact, the companies are the real ones interested in compensate these unmatched ends with users. Reactive power is stored in parasitic inductances or capacitances and then returned to the grid, so the reason power companies don't like this to happen is that they are not using effectively all power they produce. Nevertheless, although it is not usual for the power companies to adjust domestic connections, it is more frequent on industrial ones. Therefore and simplifying, you should not worry about matching your connection since you will appreciate no change on your bill.
H: Why does LM317 burnout when output is shorted in this case? LM317 voltage regulator has internal short circuit protection alongside with its thermal overload auto-shutdown, but in the circuit below it will simply burnout when the output is shorted. And its adjust pin gets internally shorted with its output pin. I know that a pass transistor would strip off the regulator's ability to stand a short circuit and limit current but whats wrong here ? I built it more then once on different PCBs and they all end up the same way ( killed about 5 regulators till now as i though that something was wrong with my build) one version of the PCBs i made : AI: When you short the output, Q1 heavily conducts and basically connects pin 1 (ADJ) directly to 0V. Between Vout and ADJ internally is a 6V zener diode and a 50 ohm resistor: - It's very likely that the zener diode will fail short circuit (most of them do on over-current) rendering the device dead. If it can be tolerated a 1k resistor in series with the ADJ pin will probably save it. The 50 uA ADJ pin current (normal operation) will cause a 50 mV error (times the standard R1/R2 feedback ratio) in the output voltage so there is a somewhat fluffy downside potentially.
H: DIY BNC to F-connector or RCA? I've searched for this until I'm starting to get sick. I decided to just ask for help. My friend has a CCTV camera with the typical BNC/Power cable, but he doesn't have a DVR. I have zero interest in buying any adapters or anything for that matter. If possible, I would like to simply chop off the BNC end that goes to the DVR and splice either an F-connector or an RCA connector - allowing the camera to hook directly to a TV. From my Google searches, nobody has appeared to have ever done this. Is this possible without buying any extra junk and if so, how would one go about doing it? I have tons of coax/F-connector cables and RCA cables, but there's only the single BNC cable to work with. Thanks for any help. AI: Assuming it's a normal composite video CCTV camera (most are). You should be able to splice on a RCA connector and plug it into the composite input of your TV. Splicing on a F connector and plugging it into the antenna input is not going to work.
H: Discharging a capacitor to a battery supply [simple circuit] If I have the following circuit... (resistor & capacitors values are made up) ...and I hold down SW3 until the capacitor is charged, then I release SW3 then hold down SW1 why wouldn't the capacitor discharge into the negative terminal of the battery? (according to the comment I posted on this question: Capacitors and simple circuit understanding) I think I've misunderstand some fundamentals here, as in my mind this circuit would be OK. AI: SW3 doesn't charge the capacitor. I assume you mean SW1 to charge. Closing SW3 grounds that part of the circuit but there is no ground connection anywhere else on your circuit so there is nowhere for current to flow. i.e., There is no "circuit" back to the battery through SW3 - just a dead-end branch. Note: When using the built-in schematic editor just hit save rather than taking a screen-grab. That way you or we can edit the schematic or copy and edit in our answers.
H: Recharge AA batteries in device(skips taking batteries out) In principle is it possible to recharge AA/AAA/9v batteries in the device they are currently plugged in? There are numerous smart chargers for AA/AAA and 9V batteries. The process requires taking all batteries out charging then putting back in. When you are potentially dealing with multiple such devices the experience can only be bettered by carefully modding any device to recharge batteries and skip on the in out routine. Specifics to test this in my case is a 3V - 2xAA device(vacuum dust collector) and an "Intelligent" battery charger with 12V input and 4x AA/AAA charging slots. So I am happy with modifications of any sort with the ultimate outcome of : 1)Allowing in device recharge 2)Allowing greater distance between where the device is resting and where the charger unit is. Think of USB charger + cable as a guide 3) Make the principle generic so it can be used on any device and any charger Extras : If possible use a high capacity battery bank(26800mAh for examples sake) to power as many battery slots on the AA/AAA charger. Battery bank used in this example is a 3x USB with output DC 5V/5.5A(max) total and 2.4A individual USB total. Please check photos for more clarity The challenges I am aware of : 1) In the device AA/AAA batteries are connected in series with a simple metal piece spanning over both battery terminals. The 4x AA/AAA charger connects to each batteries +/- poles individually. So this might be a problem as the charger needs to adjust output to each individual battery's condition ... How do you temporarily ( mechanically or electronically ) gain individual access to each battery given they are all connected in parallel inside the device? Modding/Reworking the insides of the device is fine... should be generic solution as most devices use the same Spring to metal plate hardware to raise input voltage from multiple AA/AAA batteries. 2) USB Cable length effect on the AA/AAA charger output. The charger expects batteries to be in the slot and not 1-2m away. Even if the charger might be capable of delivering whatever voltage is needed to offset the length etc. Being an "intelligent" charger means it may interpret the new circumstances wrong ... AI: While there are complex ways of achieving this, a simple method that is good enough for many situations is possible. Chargers that charge 4 x AA or AAA cells usually do so either with All 4 cells with eg negative grounded and separate positive feeds or with 2 x 2 cells in series. Below I use "toy" to refer to the target device to be charged. Could be model car, Pokemon, toothbrush, fan etc. Appliances may have 1 or 2 or 3 or 4 (sometimes more) cells, usually in simple series. Some device use a centre tap for 1+1 or 2+2 etc cells. Examples may be model toys with motors that change direction and a split +/- supply is used rather than using eg H-bridge drivers. In the case of Nt batteries in series in the "toy" (1 or more) and Nc batteries in series in the charger it is not usually feasible to convert the toy to match the charger connection pattern if there is not initially a direct "mapping". This would involve placing isolators between the cells at appropriate points wit switches across them and a wiring 'loom' to the charger. The simplest and not vastly expensive option is to provide X isolated chargers whose outputs float relative to all the other chargers outputs. These would usually be capable of charging 1 or 2 cells in series. Each toy then has a wiring loom that maps either individual cells or pairs of cells onto their own isolated charger. The key is that all outputs are isolated from all other outputs unless connected in some desired manner. Example: If/when this gets hard and/or mind boggling Realise that somehow Sir Isaac Newton could have visualised this without effort. Marvel. Then ... Draw a picture. Provide 4 isolated chargers able to charge 1 or 2 cells in series. Each charger has connects Cxg = Cx ground, Cx1 = charger x 1 cell +ve and Cx2 = charger x 2 cells +ve. The following is "doing it the hard way" for example's sake. In this case IF the chargers can charge two cells we could have used just 2 chargers for a single series string of 4 cells. I've used 4 chargers as if each can only charge 1 cell. A toy with 4 series cells B1 B2 B3 B4 with B1t = B1 top (+ve) and B1b = B1 negative is used with cells arranged. +ve - B4t~B4b B3t~B3b - B2t~B2b - B1t~B1b - -ve. Call the connection points T+ T43 T32 T21 T- You can work out what that means :-). Wires are brought out from the 5 termination points to a universal connection socket. Each toy has a socket wired to suit the charger banks standard patterm. In this case the pattern is Charger | Termination point | | C41 - T+ C4g - T43 C31 - T43 C3g - T32 C21 - T32 C2g - T21 C11 - T21 C1g - T1g Each charger "sees" a single cell. You COULD have used C22 - T+ C2g - T32 C12 - T32 C1g - T1g The wiring to suit each toy is in its socket. The 4 (or more or less) are chargers are wired in a standard manner with each output isolated unless joined by the socket in use. Example only: 4 x floating chargers at left have mutually isolated outputs. Connection to chargers is by a consistently wired "plug" - in this example, 8 pin. At right are two examples of loads. Load 1 middle has 4 series cells and 4 x 1 cell chargers. Wiring from cells to "socket" connect the 4 cells so that they 1:1 "map" onto the chargers. Load 2 far right uses 2-cell chargers. Cells are mapped by wiring so that top two cells connect o one charger and the other two cells connect to the other. simulate this circuit – Schematic created using CircuitLab This principle can be extended to 9v or 12v or ... batteries as desired.
H: Programmable resistor How do I make a programmable resistor for testing purpose? For example, I want the value of the resistor follow a ramp wave: 0ohm --> increase by 10k each 1ms, until reach 1Mohn and restart AI: [ I'm going to ignore the case of connecting 3.3V across 0 Ω. I'm going to assume that there will always be sufficient resistance to prevent components from getting burned. ] Probably, the easiest way to do this is to use a digital potentiometer. If we look at what kinds of digital pots are available, there ones 1 MΩ resistance and 128 taps.
H: Why are most parallel interfaces half-duplex and serial full-duplex? I know what is difference between parallel and serial interface. I know also what does it mean half/full duplex. However, I don't know why most parallel interfaces are half-duplex, and most of serial interfaces are full-duplex. Can anyone explain? AI: For a true full-duplex interface, you really need two wires for each signal - one in each direction. This quickly becomes impractical for a parallel bus. If you have a parallel bus, the bandwidth is often important. If you must add twice the number of wires, you can almost always benefit more by sending twice the amount of data instead of reserving half the wires for one direction and half for the other.
H: What does the 1k resistor do in this schematic? I'm very new to circuit design and have been doing lots of reading and research in order to understand everything going on in this schematic. I think I understand all of it except for the purpose of the 1k ohms resistor going from the control signal to the emitter. Can someone explain what that does? This circuit is part of a bigger project outlined here: http://victorbush.com/2015/01/arduino-rfid-door-strike/ AI: The 1k resistor is a pull-down resistor. Not the weakest one of that, but that's okay. It is meant to pull the base of the transistor to a known state (ground) when the control signal is missing/open/high input. To prevent a floating signal or even leakage current from turning the transistor on, to make sure the strike doesn't open or engage randomly. It does form a small voltage divider, but not enough to really affect the transistor performance. Due to its value, it will waste 0.5mA to ground when the control signal is high, so it's value may need to be changed for battery applications. A 10k to 47k may be a better value.
H: Purpose of copper coils encountered in TV I was recently working on an old TV similar to the one in this video here. I began to open it and encountered a part on the TV which I have never came across, I believe it functions similarly to a cavity magnetron. Do anybody happen to know what part this is called (the enameled copper wires on the end of the tube)? AI: I think you are referring to the horizontal and vertical deflection coils. Check out the following link: http://www.petervis.com/electronics%20guides/Sony%20KV-36FS76U/Deflection%20Coil.html
H: SMP, NUMA, local memory - limits on numer of processors I consider what are limits on number of processor in following models of shared memory: a. each processor has only own local memory. b. SMP c. NUMA I can't see any limits. Am I wrong ? AI: When each processor has its own memory, you end up with separate computers in a network. This is limited by the network speed, because you still need to distribute work packages and collect results. SMP is limited by memory bandwidth. WHen your processor cores compete for memory access, they end up waiting for more and more time, so even if you can add more cores, the total amount of work that can be performed will not rise after some point. In addition, the length of the connection between the cores limits the bus clock. NUMA is just a specialized network that emulates access to non-local memory, so it still has the same limitations as a regular networked approach, and IIRC the protocol requires direct pairwise connections between cores, so this becomes a signal routing problem as well.
H: Magnetron and microwave I took apart a Kenmore microwave in order to salvage the magnetron, transformer, and the HV capacitor. The transformers, HV capacitor, and the magnetron from the microwave are intact. Is it possible to make the magnetron work without the microcomputer panel? AI: Unfortunately, it is possible to make the magnetron work outside the oven, but as the comments have said, this is a really bad idea. Do not fire up a magnetron after removing it from an oven. You recall what a microwave oven is designed to do? Heat food! Do you know what you are? A big bag of food. If you are lucky, you might discover this with your hand. The skin has nerves, and a cooling blood supply, and you'd probably spot it warming long before the proteins begin to denature. If you are unlucky, you might discover this with your eye. The cornea has no nerves and no blood supply, and you'd probably spot it first with your vision going cloudy, as it does exactly what egg white does when you heat it. This would be permanent. In terms of life-changing injuries, it's even more dumb than messing with lasers without goggles. Do not fire up a magnetron after removing it from an oven. It's quite easy to take a magnetron apart with a screwdriver and a pair of cutters to release the two ferrite magnets. These are strong enough to be fun, without the bone-crushing danger of neodymiums, but they can still give a fold of skin a nasty nip, so keep them away from 8 year olds (sorry my daughter!) Before you power up anything removed from the microwave, let me review different, safer, sources of high voltage, and the effects of their limited current or energy on the human body. TV flyback - very limited current, painful shock TV tube, charged - very limited energy, painful shock Auto ignition coil - very limited energy, painful shock Neon sign transformer - fairly limited low current, serious shock, but probably survive Microwave oven transformer - high enough voltage to jump through clothes, currents to one amp, serious shock, probably die
H: Technical question on 16x2 LCD In a 16x2 LCD there are 16 columns and 2 rows of characters, each character is made up of a grid of 40 pixels. My question is, do each of these characters have their own driver that drive every pixel simultaneously or is it a persistence of vision method, where one row of pixels at a time is turned on one after another? A corollary question would be where would I find any kind of documentation on the best way to control each pixel. Its more out of curiosity than anything, and i plan on making my own LED matrix and playing around on my FPGA but obviously I want to use the fewest pins possible. This got me wondering exactly how an actual display does it. Thanks for any info. AI: There are neither individual drivers nor is it a persistence of vision. The displays are typically multiplexed 1/16 with 5x8 dots per character. There is not enough RAM internally to control each dot individually (this is a mid-1980s vintage chip)- the internal character generator ROM generates characters (and there are some custom characters allowed for in RAM). Here is what the hardware connection looks like for an 8x2 display connected to an HD44780 compatible controller: As you can see, only 56 connections allow 640 pixels to be controlled. Complex waveforms switching between 5 voltage levels allow the controller to individually control the state of each pixel above or below a threshold voltage and simultaneously maintain essentially zero DC component between commons and 'segments' (more than 50mV can damage the LCD 'glass' (the bare display, not literally the glass) by causing electrochemical action). The disadvantage of the 1/16 multiplex scheme is that the display is temperature sensitive and tends to have lower contrast and viewing angle because it has to narrowly distinguish between slightly different AC voltages across the pixels. Hence the contrast pot or temperature compensation circuit to shift that threshold around so that the dots that should be black are black and vice versa. There is an LGPL opencores HD44780 compatible HDL (Verilog) if you look for it. LEDs are diodes and don't care about average voltage so driving them is simpler, but not necessarily easier. LCDs have the advantage they take almost no current, so a bunch of analog switches made of on-chip MOSFETs can switch the outputs. For a 8x2 LED matrix you might use a 40 bit power shift register to sink the column lines and source row lines with 16 high side drivers. If you want 1mA average per LED you would have to allow for a 640mA supply current, and the column lines would have to sink up to 16mA at 100% duty cycle and the row drivers source 640mA each at 1/16 duty cycle. Probably the 16mA is not acceptable using the FPGA directly because, while the individual sink current is reasonable, the total current through the ground pins is likely too high. Edit: You asked about 16x2 display- those use an additional driver HD44100-compatible chip to handle the other half of the display. The HD44780 can only handle an 8x2 display by itself (also corrected some numbers above).
H: What do I need to take in account when using a voltage divider as a voltage sensor? I'm trying to make a voltage sensor (battery input[0-12v] ) with an output of 0-5v with a voltage divider. I'm gonna read the voltage through a microcontroller and I'd like to know if there is something else in the process I have to add in the circuit. AI: Most microcontroller inputs are protected by diodes to each rail. These diodes aren't very big, so they can't take a lot of current. You want to be sure that the input pin's protection diodes aren't accidentally subjected to currents that exceed their maximum specification. If you design your divider appropriately and don't make any other mistakes, then this is pretty easy. You just make sure your divider's node voltage doesn't go much lower than GND and doesn't go much higher than \$V_{cc}\$. I tend to prefer to add another resistor, though, going from the divider midpoint node to the input pin on the micro. Just in case one resistor is accidentally shorted for a moment. In the case of the MSP430x2xx family, this absolute maximum diode current value is \$\pm\$2mA. Leakage current of the I/O pin used for an ADC (or comparator, I suppose) needs to also be consulted. In the MSP430x2xx family case, this is often around \$\pm\$50nA, worst case. Here's an example circuit I might try: simulate this circuit – Schematic created using CircuitLab I started out assuming that I wanted the absolute maximum diode current to be well under 2mA -- let's call it 1mA. Assuming the battery voltage might accidentally get up to 14V or so, and assuming that somehow \$R_1\$ is momentarily shorted, I want \$R_3\$ to be more than \$\frac{14V-V_{cc}}{1mA}\$. With \$V_{cc}\$ of 5V, this means perhaps 10k\$\Omega\$. Just as a check, the worst case leakage current through \$R_3\$ leads to a drop of 500\$\mu\$V (which is an acceptable accuracy error, I think.) The leakage of 50nA also suggests that if I want to keep errors under 0.1V or so, that I could tolerate a divider impedance of about 2M\$\Omega\$. So I decided that a 470k\$\Omega\$ is fine for \$R_1\$. What remains is \$R_2\$. I decided that the center node voltage at \$V_x\$ should be about 2.5V when the battery voltage is at that arbitrary over-voltage value of 14V. So this set \$R_2\$ to 100k\$\Omega\$. At 12V, \$V_x\$ will be closer to 2.1V or so. Well within range of many ADCs. You could do more. Or you could do it differently. I used higher resistor values because you asked about current consumption. This divider won't consume much power. But you could also consider a way to disable the divider entirely when it wasn't in use for even less power. Or you could lower the values of \$R_1\$ and \$R_2\$ to provide more load (against static.) Or you could try and use a timed RC constant to make your measurements, instead. You could also add external diodes from either the \$V_x\$ node or the ADC pin to both rails. There are more ideas, I'm sure.
H: Lowering the output of high amp current sensor for low amp use - good or bad? By increasing the value of burden resistor or turning the wire several times around the CT an output can be increased. But is it a good practise to lower the high current non-invasive current sensor for low amp application in terms of harmonics, phase error and etc? AI: As explained in Definition of amperage of non-invasive current transformer: It may help to consider CTs as complimentary to VTs (voltage transformers). Voltage transformers are quite happy with open circuits but dislike short circuits. There is a minimum value of resistance that can be applied as a load before the rating is exceeded. Current transformers are very happy with a short-circuit load as it is very easy to maintain current. As the load resistance (called a "burden") increases the voltage must increase to drive the current. At some point the VA rating will be exceeded. In the case of high-powered CTs an open-circuit can cause flashover as the voltage reaches kilovolts in an attempt to drive the current through. Back to your question: By increasing the value of burden resistor or turning the wire several times around the CT an output can be increased. This is correct and is common practice. The CT has no idea of the number of primary turns so it just sees the total ampere-turns. But is it a good practise to lower the high current non-invasive current sensor for low amp application in terms of harmonics, phase error and etc? Wikipedia's Current transformer article says: Phase shift Ideally, the primary and secondary currents of a current transformer should be in phase. In practice, this is impossible, but, at normal power frequencies, phase shifts of a few tenths of a degree are achievable, while simpler CTs may have phase shifts up to six degrees.[2] For current measurement, phase shift is immaterial as ammeters only display the magnitude of the current. However, in wattmeters, energy meters, and power factor meters, phase shift produces errors. For power and energy measurement, the errors are considered to be negligible at unity power factor but become more significant as the power factor approaches zero. At zero power factor, all the measured power is due to the current transformer's phase error.[2] The introduction of electronic power and energy meters has allowed current phase error to be calibrated out.[3] Increasing A-t is preferable to increasing the burden resistor. Further reading: Figure 1. Linearity of output voltage is controlled by using precision burden resistors and reducing the losses in the secondary coil of the transformer. This characteristic, along with the phase shift, are a measure of quality and design of a current transformer when used in the energy management industry. Source: OpenSourceMeter.com. Current Transformers - An Analysis of Ratio and Phase Angle Error by CR Magnetics. Measurement errors due to phase shift. This also seems to be a topic of interest at OpenEnergyMonitor.org. This site (rather than the forum) is worth a good look as they have tackled many of the problems with energy management and hardware and software are open source.
H: what is the name of this yellow tape around high frequency transformer? [ what is the name of that tape? , what it is the purpose of it?, can I buy it? And if not, what is the alternative? AI: It's an insulating, flame retardent polyester tape normally used within the layers of transformers to enhance the breakdown voltage capability between primary and secondary. 3M describe it as: - Yellow polyester film tape with an acrylic adhesive. This tape is suited to coil wrapping, wire harnesses, fractional horsepower motors any many more uses. Flame retardant to UL 510. 3M link
H: Can the /OE pin of a buffer be left floating? Here is a buffer from OnSemi which has an /OE pin that should be tied high for high impedance mode. For all active modes the pin value is stated as low. Would my buffer still work if I were to leave this pin unconnected or do I explicitly need to ground it? AI: The /OE pin is an input just like a regular input such as INA on the device. The device's data sheet says that the maximum input leakage current is up to +/- 1 uA. This means that it may drag down (to 0V) the unconnected input in trying to draw 1 uA from an open circuit OR it may drag up the input (to Vcc). This means you cannot leave it floating because you CANNOT know what state it will move to.
H: Can a brushless motor controller be used to control a 3 phase Induction Motor? I've been seeing lots of BLDC motor controllers for dirt cheap. From my limited understanding, BLDC motors are almost the same as induction motors, except they use permanent magnets. I was thinking about taking the output and stepping up the voltage to drive an induction motor. Is this possible? AI: BLDC motors are 'almost the same' as induction motors in the same way a gas turbine engine is 'almost the same' as a piston engine. A BLDC motor is a DC motor with electronic commutation. The controller replaces the function of the commutator and brushes in a brushed DC motor, using Hall sensors or back-emf detection to switch power to each winding in exact synchronization with the rotor position. Induction motors work quite differently. The stator induces current into the rotor to produce a magnetic field in it, which then interacts with the stator field to produce torque. Under load the rotor can 'slip behind' the stator field and still produce torque while running at lower rpm, unlike a synchronous motor which must stay in lock step or it will stop rotating. So a BLDC (or brushed DC) motor is like a piston engine which uses a cam shaft and valves to synchronize combustion and exhaust with piston movement, whereas an induction motor is like a gas turbine engine which just burns fuel continuously and lets the turbine spin at whatever speed it can manage. 'Dirt cheap' BLDC controllers are designed to control synchronous permanent magnet brushless motors only. They will not work with induction motors unless you replace the firmware. Open source firmware is available for ATmega based Brushless ESCs. You could try modifying this firmware to produce sine wave PWM, drop the back-emf detection so it runs open loop, and control the frequency directly. Most induction motors are designed to work on mains voltage and frequency. Stepping up the voltage from a low voltage BLDC controller is certainly possible, but the result may no longer be 'dirt cheap'. The simplest way would be to use a 3 phase transformer with appropriate primary and secondary windings. It would probably have to be custom built to match the voltage, power, and desired frequency range of your controller.
H: Micro controller to set 'dial knob' mode on multimeter Can a microcontoller be used to replace the "dial knob" function in a 'off the shelf' multimeter(10A max AC/DC). Is it easy to scale and micro control multiple identical multimeters using one microcontroller? All multimeters operating mode is to be set using one centre dial which the microcontroller reads. The rest of the multimeters simply stack behind the top most device with their shell/case taken off.This will save on the bulk of the device shape and "streamline" whatever blob comes out in the end. DiY x-Channel Multimeter - Hope it's a clear visual :) The dial itself works by simply bridging between many pads on a PCB(check photo). Can the dial(mechanical) be bypassed by micro controller with ability to set the full range of combinations that the dial currently bridges? The microcontoller would have to remember the active settings for each individual multimeter dial position and maintain them independently. Would be good if there is a way to only power the micro controller upon need to change settings and power off immediately after setting the relevant multimeter board IC. Saves battery (1x9v) It is desirable to have everything readable in one glance and therefore all LCD displays are to be lifted off the multimeter PCB and placed to sit all next to one another on the top surface of the combined device.Allows for easy tracking of everything in one place without losing sight of the work area. How far can the LCD be lifted off the PCB? as the photo shows the LCD is a generic type component... Has anyone tried separating the LCD from a PCB? What max distances can be done?Is 10 cm a possibility? can this work ? AI: Can a microcontoller be used to replace the "dial knob" function in a 'off the shelf' multimeter(10A max AC/DC). On some ranges perhaps, depending on how the meter uses the switch contacts. Some contacts may be used to route analog signals that cannot easily be switched with a transistor or analog transmission gate. You need to determine what every contact does, which will be tricky unless you have a complete circuit diagram. If you are not careful the meter's accuracy could be compromised - or worse, something might blow up (if it can't handle the voltage and current being switched). So you may need a combination of transistors, gates, optocouplers and/or relays to get full functionality - quite a mess! I would do it the easy way - mechanically. Attach a small geared stepper motor to each 'dial knob', then you can rotate the knob under MCU control. You may also need a 'home' switch to put the knob in a known position at start up. One of the existing switch contacts may have a signal that can be used for this purpose (eg. power on switch). How far can the LCD be lifted off the PCB? Most meters use a conductive rubber strip to connect the LCD to the board. To extend this you would have to provide another circuit board to clamp the LCD screen and strip onto, then join this to the meter PCB with a ribbon cable. LCD drive signals are relatively low frequency and very low power, so the cable could probably be made quite long.
H: TV screen in still photo: Why are there dark, blackish bands? I was trying to capture the scanning process of a CRT TV screen in a photo. It gave me these dark, broad bands, shown below: Fig. 1 a,b,c I'm trying to understand the cause for this banding. However, I couldn't understand it clearly in very similar questions here, here, or here. All web sources I visited very briefly explained it as a difference between the scan-rate of the TV and the camera, and none provided a diagram. Fig. 2 a,b,c I assume what is going on is in Fig. 2. The blue lines indicate the scan lines where cathode rays hit most recently (phosphorescence occurring), and black lines indicates where the cathode ray has not been in the image, so phosphorescence is all that is left and a dark band appears. I assumed this, because out of 10 photographs I took, I found only the above 3 types of photos, and none of the type shown in Fig. 3 or Fig. 4: Fig. 3. an Fig. 4. I also assumed that the camera is much faster than the TV scan rate, so it could take picture in an instant. My question is, Have I assumed correctly? or is something else going on? Additional information: TV: Videocon 120 W colour CRT, Electricity power supply 50 Hz. Camera: Nikon Coolpix L24 digital camera. (please also explain other possible situations, such as this one in Fig.5. I didn't experience it myself. It is similar to Fig. 4. Fig 5. From this question I'll be grateful if any explanations use diagrams. Update: I've obtained several fig3 conditions, and though they are less frequent, they're not very rare. File properties show exposure time for this still-photo is 1/125 second. I've also took some videos (in PAL and NTSC mode... both gave same result), file properties show frame rate is 30 frame/sec; and run them on slowest motion. I found similar, but much brighter and quite unclear bandings, and it seemed from slow-motion video that the alternating bright and dark band rising on the upward direction. From that videos I screenshoot some frames as-successive-as-possible. . Red small bars added to indicate the margin of each banding AI: Yes, you're basically on the right track. The bands appear because the camera shutter is not synchronized to the vertical scanning of the CRT. A fast shutter speed will only capture part of a scan. A shutter speed exactly equal to the vertical scan period will capture a full scan, but there still might be a narrow band (either dark or light) somewhere in the image if there's any mismatch in the timing. To minimize the banding, use a shutter speed that spans several vertical scans, but this only works if the image on the CRT is static.
H: Protect phototransistor from emitter-collector breakdown I'm using the ADC on the reset pin on an ATTiny85 to detect an IR level. The reset pin is disabled in the fuses but I would like the ability to "recover" the fuses and reprogram the device. The emitter-collector breakdown voltage of the phototransistor is minimum 5V. During programming, 12V will be applied to the emitter. The collector will either be at 0V or 5V depending on the state of another pin during programming. Best case, there will be 7V from emitter to collector. Worst case, there will be 12V from emitter to collector. Both of these will result in the destruction of the transistor. The schematic below shows this in a much clearer way. How can I protect the phototransistor against breakdown? simulate this circuit – Schematic created using CircuitLab AI: You could consider adding a diode as shown below: This approach can be made to work in particular if the IR level sensing you are doing is "digital" in nature. The lower drop of a BAT54 may be desirable. If you are trying to actually measure analogue variation of the IR signal a more complex circuit may be required.
H: Will this MOSFET switch circuit work? I should point out that the LED I'm trying to switch is actually an LED strip with a one meter length and a total of 60 LEDs. Total power consumption is 4.8W at 12V. By the way, 'IC1' is the 7805, which converts the 12V DC into 5V DC. This is the MOSFET I plan on using: http://panda-bg.com/datasheet/860-064009-Transistor-IRF530-ST.pdf (IRF530-ST) I'm new to the field of electronics so I am not quite sure if it will work so any kind of feedback is very much appreciated :) AI: Correction to the schematic: your IRF530 is installed backwards. You don't want the body diode "pointed" in the same direction as your LED string. The N-FET source terminal should be connected to the negative terminal of your 12V supply. While using a LMx24 as a comparator isn't the best, since its input common mode range and its output range includes the negative/ground supply and the threshold voltage of the IRF530 is at most 4V, this circuit (with the corrected FET direction) will mostly work if you use a LM7805 or higher voltage (accounting for dropout, 5 to 9V should be a reasonable choice of 78xx). From the comments: remember that the IRF530 has its on resistance rated at a \$V_{GS}\$ of 10V. Acceptable performance may be found for this application at lower gate voltage, but choosing a different FET with a "logic level" gate drive capability would help if a 7805 is used. However, your op-amp (being used as a comparator) has no hysteresis. This means that at certain light levels, you will have a flickering LED string because your threshold potentiometer and the LDR/resistor divider have almost the same outputs. For some good information on why you want hysteresis and how to implement it, check out TI's TIDU020A document. The difference in their circuits is:
H: FPGA filter - sinusoidal wave at clock frequency observed in filtered signal I am using an FPGA to implement FIR filters, specifically for this question I have implemented a 12 point moving average filter. At the moment I am just using a signal generator as an input to the FPGA and putting in a pure sine wave at various frequencies. Now, my filter works as expected and has the expected frequency and phase response, however, in my output signal I see another sinusoid at around the clock frequency of the FPGA I am using. I have set the clock on the FPGA to be 40MHz and 10MHz and the sinusoid in the filtered signal occurred at around 40MHz and 10MHz respectively in these 2 cases so it is definitely proportional to the clock frequency. I was wondering if someone could explain why this might be and what I could do to remove it? (I could use an analogue low pass filter after my filter to filter it out for example [although I'd prefer to remove it entirely since for my application low noise is ideal and adding more components will add noise]) I have uploaded a couple of youtube videos of what I see on the oscilloscope when I put in a sinusoidal signal generated by a signal generator (shown in yellow in the video) and what I see out of my FPGA filter (shown in blue). Video 1 accompanying question for stackoverflow Another interesting thing I observed, which may help in diagnosing what's going on, was that at certain frequencies this second signal disappears completely, in the following video the FPGA clock is set to 40MHz and I set the signal generator to generate 11MHz, 10Mhz and 9MHz sinusoidal waves. (The approximate frequency of the wave can be seen in the lower right of the screen) At 10MHz you can see that this high frequency signal seems to disappear. (this also coincides with a point of very high attenuation - the filtered signal is very flat) Video 2 accompanying question for stackoverflow If anyone has any suggestions of what might be causing this or how to get rid of it, it would be much appreciated. Additional Info as requested: I'm using a NI 5781 as my ADC and DAC it has a 14 bit Input and 16 bit Output. Data sheet is linked here: ni.com/datasheet/pdf/en/ds-212. I'm putting in a sinusoid that has 1V peak to peak and a 0.5V DC offset - i.e. a sine wave between 0V and 1V. AI: Signals accidentally propagate through adjacent pins and the PCB – that's called leakage, and more or less inevitable in circuits; you can reduce the amount of leakage by good PCB design, shielding and separation. In the RF regions that your clock takes place, a rule of thumb is that if you've got more than 50 dB power suppression between harmonic signals carried on the same FR4 PCB, you're doing relatively well. So, that explains you inevitably seeing the clock in your signal at all. The question why you're not seeing it at 10 MHz is probably simple: consider what a 40MHz clock is: it's ideally a square wave with a period of 40 MHz. I trust you as random physicist know how deal with the Fourier transform, and can easily see that a perfectly periodic square wave signal has a discrete Fourier transform with dirac impulses of decreasing "amplitude" every 40 MHz. The main frequency component you should be seeing is the 40 MHz tone itself. Now, that happens to be a harmonic of the 10 MHz signal, and the leakage of the clock into the ADC itself might lead to a "misobservation" of the input 10MHz as Input 10 MHz + 4. overtone – and your 12-tap filter just cancels out both, so that, if observed randomly at a "sweet phase spot", both are simultaneously cancelled out.
H: Multiple buck converters from same source? I'm trying to build a 18 servomotor hexapod robot (6 legs), running from a 11.1 V Li-Po battery supply. I needed to step down the voltage to 5 V for the servos to operate, but the current requirements are very high (approx 10-14 A). I can't build my own high current buck converter right now because the TI chip I was considering for my use is surface mount. The only buck converter I can get from my area are cheap 5A ones. Can I wire three separate 5A buck converters for a pair of legs each, and connect them to the same battery? If not, is there any other possible solution (different battery source, etc) I could use to power up the servos? AI: You can certainly feed multiple buck converters from a common power source. The problem arises when you want to connect outputs together - one converter will tend to try and supply the full load so, to be safe, use several buck converters and spread the servo motor loads equally on each.
H: Can I use the FFT to recognize musical notes on a piano? I want to create a tool which recognizes a few musical notes (I know this is re-inventing the wheel). So I would play middle C, D, and E on a piano and it should be able to classify those notes. Here's how I think I should approach it: Record a sample of me playing a note Convert the signal to the frequency domain using the fast fourier transform Find the frequency that is most present (basically argmax of the frequency domain data) Assume that frequency comes from the note played and use that to classify the note I haven't tried any of this yet because I don't want to start down the wrong path. So, theoretically, will this work? AI: The concept is good, but you will find it is not so simple in practice. Pitch is not simply the predominant tone, so there's problem number 1. The FFT frequency bins can't hit all (or even multiple) tones of the musical scale simultaneously. I would suggest playing with an audio program (for example, Audacity) that includes an FFT analyser and tone generator to get a feel for what it can (and can't) do before you try to implement a particular task using the FFT. If you need to detect just a few specific tones, you may find the Goertzel algorithm to be easier and faster. Pitch detection is complicated, and there is still research going on in that field. Tone detection is pretty straight forward, but may not get you what you want.
H: Interfacing TLC1543CN adc with 8051 I am confused with the I/O clock input mentioned in this datasheet: http://www.ti.com/lit/ds/symlink/tlc1543.pdf Do I need to output clock from this adc to 8051 or do I need to use an external crystal for both the TLC1543CN and 8051 together? AI: It's not that confusing to read. There is a diagram near the end of the datasheet that shows a nominal arrangement between the a CPU (8051) and the ADC IC. And there is a section called "DETAILED DESCRIPTION" which makes things a lot clearer. In general, the I/O Clock (which is really an input) line is used by your 8051 to "clock out," in serial mode, the prior reading. Your code is supposed to operate this clock (using a pin configured as an output pin) and to operate the chip select line (using another pin, if you have one, also configured as an output pin) and while that is happening also observe the data line (using yet another pin configured this time as an input.) You also may need to operate the address input pin for a part of the time you are also operating the clock line (using yet another 8051 pin configured as an output.) The clock line also triggers other actions along the way, such as charging a capacitor array, or starting the next conversion near or at the end of a short series of clock cycles. The rate at which you clock this line, it says, cannot exceed 2.1MHz. It's not likely you'll need it to be that fast, as the conversion time appears to be about \$\le\$21\$\mu\$s and you'll use perhaps at most some 16 cycles to clock out the data. So there is room. It appears you can run the I/O clock as slow as you want, too. So you can "bit bang" everything in your 8051 code (which makes bit banging really easy at the assembly level.) There are lots of timing diagrams near the end of the datasheet which tell you what to do in each of its modes, in software. Is there something that you don't understand there? Normally, you just bit bang the clock line while also sampling (reading) the data out pin. There's more (as there is addressing involved and a chip select, for example.) But it's just minor details along the way. EDIT: In answer to some of your comments below: The 8051 does need a clock source. Usually, this is provided by applying a crystal between XTAL1 and XTAL2, plus a couple of tiny 30pF capacitors. I don't know which 8051 core you are using (I still have a hundred 80C32's from Intel, but I've used SiLab's [Cygnal's] 8051's too and there are more manufacturers than that), but you may also be able to drive one of those with a separate oscillator. You will have to check the datasheet for the device to find out various options. But you DO have to have a working hardware oscillator that drives the 8051 to make it work. There is no avoiding this requirement of the 8051. It needs a clock source of some kind. You cannot just apply power and expect it to run correctly. Once the 8051 runs correctly, though, it's NOT the case that your ADC IC needs to have its clock line driven by such an oscillator. In fact, few would consider doing that and I don't even want to consider whether or not someone could make it work. (I'd have to read the ADC IC docs more than I want to, right now.) Instead, you just write software to manage the lines. You will have to program things so that the pins are properly configured, first. Then you will have to write lots of other software, some of which will be a subroutine or main-line bit of code that operates in a loop designed to extract a prior reading while initiating the next one. This is just very standard fare. You wire up a clock line, a data line, an address line in this case, probably a chip select (though this is optional, I believe) and perhaps something I've missed writing just now. Your software will operate ALL of them, changing the output pins properly and reading the input pin (data) at appropriate moments. The lucky thing here is that since you are driving all the other lines, you know EXACTLY when to read the data line. So it's really very, very easy to do. None of this deals with the analog input lines. Given the difficulties you are having understanding something this simple and more "software-ish" than hardware-like, then I really, really worry about how you are going to properly design anything to operate the analog input lines -- where there is no question you will need to read other parts of the datasheet that does deal with hardware knowledge you need and will require some design knowledge on your part. Even the most basic analog inputs need some kind of conditioning and probably also protection. Asking, "do you mean by inputting a clock to xtal1 and then outputting it through xtal2 to adc clock input," tells me that you are in for a world of hurt here. It's so completely off where your mind needs to be that I fear much more than just you figuring out how to clock out an address and clock in some data. It's basic stuff that you want to do. But it is basic stuff that does depend on some fundamental knowledge you don't appear to have yet acquired. And if you are worried about a two week shipping delay, then this tells me you are in way too much of a rush for the learning you have ahead. Slow down. Allow yourself time to slowly acquire what you need to learn about. This is a great project in that sense, I think, in order to lift yourself up by your own bootstraps. But it will take time. You need to be prepared for that.
H: Oscillator circuit with TL071 opAmp for amateur very short range AM radio I stumbled upon this nice video and thought I'd try to reproduce the experiment. Basically the video shows how to build an AM transmitter circuit using an opamp, some resistors and a capacitor. This is the circuit schematics for the oscillator that should generate the carrier wave: simulate this circuit – Schematic created using CircuitLab The carrier wave should be at the OUT node right? My problem is that I do not understand how can this circuit oscillate since it is getting constant voltages as input and the video does not say anything about any function generator. My guess is that instead of 9 Volts in the voltage divider I should use a function generator with the carrier wave (possibly a 9V sine wave). Am I right or did I miss some component/key concept? Also by simulating the circuit with the potentiometer set to 0 on LTspice I get no oscillation at the OUT node but just a constant voltage (as expected) of 3.6V. EDIT: the circuit should work in the 300kHz - 1.2MHz range AI: the video shows how to build an AM transmitter circuit using an opamp, some resistors and a capacitor. It's a relaxation oscillator and here's a simplified version using a schmitt trigger: - However, as a carrier wave it's poor because it's basically a square wave and not a sinewave. If you are going to transmit (illegally or not) don't use a square wave as an oscillator because you'll broadcast your transmission at the fundamental frequency of the carrier (say) 1 MHz and every odd harmonic up into hundreds of MHz i.e. you become a polluter. Anyway, back to your question, When the inverter output changes state from zero to one, it charges the capacitor up (via the resistor) until the cap voltage triggers the upper limit in the schmitt trigger. This forces the output to zero and the capacitor discharges via the resistor. Back to square one and the process repeats. If you can follow the above circuit operation then you should be able to figure out that your circuit is identical in nature. Hint: inside my circuit hides R1, R2 and R4 and, because they are hidden internally, there is no need to show the non-inverting input.
H: How to handle Register output in state machine with verilog Assuming I wan't to implement a state machine in verilog, where I have 1 output which is a register So the output must be in sync with the input clock. I know that the transitions between the machine states should be implemented via sequential block, for example: always @ (posedge clock) if (state) state <= 1'b0; else state <= 1'b1; If I want the output to be in sync with the clock, will implementing the output result via combinatorial will do? I mean: always @ (state) if (state) Out_Reg = a; else Out_Reg = b; Does this implementation still valid for Out_Reg to be a positive edge triggered register? Or should I make assignment to Out_Reg in the sequential block for it to be a valid synced output register? AI: You should probably synthesize your design to be sure, but I expect that your example will result in Out_Reg being generated from combinatorial logic. It could more conventionally be expressed as wire Out_Reg; // ... assign Out_Reg = state ? a : b; If you want Out_Reg to be the output of a physical register (flip-flop), you could write reg Out_Reg; // .... always @(posedge clock) begin Out_Reg <= state ? a : b; end But then, of course, the value of Out_Reg is delayed by one clock cycle relative to the state of state. If you need it to be in sync, you would need to duplicate the state logic so that Out_Reg anticipates what the next state of state will be. You could simplify this by using combinatorial logic to create a next_state signal: wire next_state; reg state, Out_Reg; assign next_state = /* logic to determine next value of `state` */ always @(posedge clock) state <= next_state // ... always @(posedge clock) Out_Reg = next_state ? a : b; However, you should also consider whether this is necessary. Does your downstream logic really care whether the output of this module is physically sourced from a register or from a combinatorial gate?
H: Accelerometer sensor inside a car Does an accelerometer sensor measure the distance accurately when it is used inside a car? and what is the misjudge percentage when it is compared with its odometer? AI: An accelerometer requires integration over time to get velocity and integration again for position. But without any motion is subject to thermal bias and/or dc offsets so errors can accumulate in velocity when stopped and even more with position after the 2nd integration. Thus Accelerometers often are not specified to have a DC response but it may be very low such as 0.01Hz. In other words this low frequency period is an indication during 1 cycle where position errors can become significant. An odometer might have a speed error with under or oversized tires, but there is never a position error penalty for time as in the case with accelerometers. One such MEMS system used for short distances was adequate for a robotic application for short durations. It had a 2g range using Kalman Filters to reduce random noise and achieved these results during accelerated motion measured in milli-g's. [mg] Velocity error = 0.589 m/s per mg per min Position error = 17.66 m per mg per min ref: http://link.springer.com/article/10.1023/A:1008113324758
H: Altium/Schematic Port I/O direction It's been awhile since I've worked on editing schematics, and I can't seem to find the answer to a question I'm running into when editing my current schematic. In Altium (or schematic software in general), there's the option to create a Port. The options are Input, Output, Bidirectional, or Unspecified. Normally, I use Bidirectional, but I've reached a point where I'd like to specify a specific direction for clarity. How should I be interpreting the direction? Is it: Input: Input into the Port Or: Input: Output from the Port AI: In Altium, an output port is an output from the sheet. An input is an input to the sheet. That means that within a given sheet, signals will come from some other device and go to an output port so that they can be outputs from this sheet and connect to some other sheet.
H: Use One Solar Panel to Charge Two Small, Identical Batteries I purchased the following solar security light kit a few weeks ago: Harbor Freight #69643 Mounted system, worked great. FYI, the lamp uses a 6V, 900mAh, NiCd battery pack that is recharged with the included solar panel. I'm presuming that the controller is integral to the lamp assy, but I could be wrong (i.e. said controller may be integrated into the solar panel assy). Well, we had a hail storm last week that totally destroyed the solar panel. I have verified that it is NOT possible to purchase the solar panel separately, so I am considering the following scheme: Purchase another security light kit - same model as the original purchase. I'd now have one solar panel assy and two lamp assy's. Next, I'd attach the two lamp assy's to the solar panel assy using a dc power splitter cord. Now, I'd have both lamp assy's wired in parallel. My questions: Would this charge both batteries? I'm presuming that a larger recharging current would be routed to the battery with the lowest open circuit voltage. If the controller is mounted in the lamp, I'll have two controllers downstream of the cable split. If the controller is mounted in the solar panel component, I'll have one controller upstream of the cable split. Does it matter where the controller is mounted (see above)? AI: These things are the dumbest solar charge circuits possible. See a tear down here https://youtu.be/OSR2ofEAJKg Solar cell to reverse protection diode to 6x series AA NiCD battery pack. No charge controller. It depends on the battery pack getting trickled charged, and being stronger than the solar panel. Connecting the same panel to two lights will cut the current to both, and likely tripling the charge time (it won't be exactly half). The built in diodes on the input board will prevent one battery from charging the other, just as they prevent the battery from back feeding the solar panel in normal use. No modification or precautions needed. These lights will already deep discharge the batteries over night as is, which is why NiCD are chosen. Their runtime will be reduced due to less power charging them. FYI you can buy similar panels from overseas online for a few bucks. Probably from the same place HF gets theirs.
H: Arduino Pro Mini newbie question power supply I am extremely fresh with this stuff (just started tinkering with my first project last week and fried one Arduino already) Question 1: I am basically supplying power to the Arduino from the back of my car's rear view mirror. The car's rear view mirror has 12v + ground out. I hooked that up to the Arduino RAW + GND and it fried right away! Reading the docs and MANY other posts before trying this, the RAW pin can take up to 12V and uses the built-in 5V regulator. Apparently, not in my case! What did I do wrong? Question 2 I basically need to power 2 servos and trying to not splice any wires. If I use the car's back view mirror to a 5v regulator then to the Arduino, can I hook up to the RAW still and use the other two VCC pins to supply power to 2 servos? I know the bottom VCC in the picture below does power out, but not sure about the VCC on the right if it outputs power too or is just an intake to power the Arduino itself. If I have regulated 12v to 5v source, can I still connect that to RAW? AI: It fried because of one of three reasons. You miswired it or a solder bridge or short. Your diagram has the red wire going to ground and black to raw. Red is normally positive. That alone suggests a miswire. It's a bad board or clone or bad part. You are pushing the 5V regulator too much. A car 12V system is really up to 14.5V, and sometime spikes higher. And depending on your load, a linear regulator can burn itself out. It's onboard regulator can only do 150mA. Not sure about what your servo specs are. If they run at 5V, that's fine. Both VCC pins are connected together, they are the same net. The onboard 5V regulator can only do 150mA, so the servos would draw too much. Use a Car USB adapter connected to VCC. They are 12V to 5V regulators and most do 600mA and above.
H: 2N7000 level shifter doesn't work under a certain voltage I need to convert a 1.8V UART line to 3.4V. I don't have the 1.8V voltage reference available, but I have the 3.4V reference, so I'm using a voltage divider to get about 1.8V. This is my circuit: However, it doesn't work for Vcc = 3.4V. In fact, it only works for Vcc > ~5V. Why's that? AI: The 2N7000 datasheet I just looked at shows a \$V_{GS(th)}\$ with a minimum of 0.8V and a maximum of 3.0V. When \$V_{TX1.8} = 0V\$, I'd imagine you'd want \$V_{GS} \ge 3.0V\$ so that you can expect the 2N7000 to be ON and pulling down on the 10k\$\Omega\$ output pull-up and presenting about 0V at the \$V_{TX3.4}\$ side of things. Then when \$V_{TX1.8} = 1.8V\$, I'd imagine you'd want \$V_{GS} \le 0.8V\$ so that you can expect the 2N7000 to be OFF and allowing the 10k\$\Omega\$ output pull-up to do its job and present about 3.4V at the \$V_{TX3.4}\$ side of things. Isn't that about it? The problem is that you can't easily have both cases here, if you can only set the gate voltage with a resistor divider. You'd need to have \$V_G \ge 3.0V\$ in one case and \$V_G \le 2.6V\$ in the other case. So if I were stuck with the 2N7000 and planning on shooting for a circuit that will probably work okay, I'd probably give up and set \$V_G \approx 2.5V\$ and just go with that. This brings up another thing. You've got a 10k\$\Omega\$ resistor going from the resistor divider node back to the \$V_{TX1.8}\$ node (source.) Why? This actually moves the gate closer to ground at a time when you'd like it further away, and visa versa. I think I'd dump that. It could just be that I'm ignorant (I'm just a hobbyist and have no formal training at all in electronics.) But it doesn't make any sense to me, right now. It actually seems to push things the wrong way -- to me, anyway. So perhaps try something like this? simulate this circuit – Schematic created using CircuitLab Now: \$V_{TX1.8} = 0V \rightarrow V_{GS} = 2.45V\$, transistor is \$\approx\$ ON \$V_{TX1.8} = 1.8V \rightarrow V_{GS} = 0.65V\$, transistor is \$\approx\$ OFF Which I think should do about what you want.
H: One particular part number not showing up on Eagle board layout I finikshing up the silkscreen for a board about to be sent out for fab, and for some reason, I have two diodes whose part numbers are not showing up on the board layout, while all my other parts numbers are displayed just fine. Here is one of the parts; it is a diode which should have a label "D2": The part is from the SparkFun DiscreteSemi library (SparkFun-DiscreteSemi.lbr), and has a >NAME label defined in the appropriate layer (95 Names): When display the properties for the part on the layout, everything seems ok including the name: Any idea why the label for this one part isn't showing up, while all my others are? AI: It could be that the library PCB footprint is missing the designator. In the footprint editor the designator for silkscreen should appear as >NAME. If you have other footprints of the same type, and none of them have the silkscreen text for designator, that would suggest that it's missing in the footprint library.
H: uncertainty of level measurement variation with frequency response This is a typical extract from a spectrum analyzer data sheet.I want to know the reason behind the increasing uncertainty of level measurement with frequency response specification. AI: The effect of stray reactances, usually shunt C and series L, gets worse as the frequency rises, it becomes an increasingly large fraction of the total impedance. This means that everything has less gain, less stability, more uncertainty, as frequency rises. All instruments these days are processor based, and during manufacture are compared against known standards in a process called calibration, so you might expect that even if the RF hardware in the instrument itself had a frequency dependent slope on it, it would be possible to calibrate out. 'The Standard' 1mW of power is realised at low frequency. Although calorimetry is independent of frequency, in principle you can heat a resistor with DC or with RF to make a substitution measurement of power, in practice the uncertainty of the input match of your resistor will create an uncertainty in power. This means that the laboratory standards themselves are increasingly inaccurate as the frequency rises. The uncertainty of match for the standards, cables, and the instruments being calibrated means the power reference is transferred to the instrument at less precision at high frequencies than low frequencies. The uncertainty of match for the instrument means that the manufacturer has to allow for even more uncertainty when you use it at high frequencies. This all assumes the hardware is perfect, and doesn't drift with time or temperature. At low frequencies, where the processes used to make amplifiers and the like have a lot of gain, ratios can be determined by feedback, based on stable resistors. At high frequencies, the increasing stray reactances reduce the available gain, and the instrument gain is more 'what you get with the process', which is inherently less stable.
H: Is it ok to cut the USB 3.0-specific lines on a USB cable? I have a USB 3.0 micro cable in an assembly (below) where it attaches to a PCB on a sliding tray. Unfortunately, in the physical prototype, the cable is too stiff and causes the tray's stepper motor to struggle and stall. Ultimately I will switch to an FPC-cable solution to address this properly. However, I was wondering if in the short term I could simply strip the PVC housing and shielding, and cut all USB 3.0-specific cables, leaving just the thin D+, D-, and 5V / GND wires. (The connection is to a raspberry pi which doesn't have USB 3.0 anyway). Is it ok to cut the USB 3.0-specific wires and leave them floating? They have their own housing and are still pretty stiff even after the PVC is removed. I'd like to minimize the strain on the stepper as much as possible. AI: Yes. It would be like they were never connected. You do compromise the effectiveness of the shield around the cables by cutting it though, so try to minimize that or ensure you tightly tape it back up. But couldn't you use a 2.0 cable in the first place? The usb 3.0 micro b connector has two parts, a 2.0 micro b five pin part and a newer 3.0 only five pin part. A usb 2.0 micro b cable can plug into the corresponding side of the 3.0 micro b jack for 2.0 and power only access.
H: can i connect two similar antennas to two ends of a cable to to re-transmit the signal received from one end? Scenario: I've set up two wifi hot spots outside of my house at distance lesser than 20 meters as i don't get any ISP signal inside my house. But the problem is now i get very weak signal in my house because of nature of walls. I'm afraid of buying any repeaters as they reduce the speed by two. My Idea: So i've thought of building two simple omni-directional WiFi antennas myself (such as biquad or helical) and connect them to each other by a cable, and put one at outdoor and other at indoor. But i'm not sure if this would work out, so i need your suggestions please.. Additional Infromation: I got this idea from following instructable, but it is not for WiFi, and not simple as i think http://www.instructables.com/id/DIY-2G3G4G-Wireless-Cell-Phone-Signal-Booster/ AI: Yes, a passive repeater such as you describe can work, however it does incur losses due to the cable, connectors and antenna efficiencies. Whether these losses exceed the attenuation you would get with no repeater but a wall in the way is situation dependent.
H: Drag any-angle trace Altium 10 I'm currently routing a schematic with Altium (10), it is very small and I use a lot of 'any-angle' traces. Altium can more or less route them 'fine', but the problems really begin when moving traces. On this schematic I am often dragging and pushing traces, however, whenever I try to drag a traces that connects to an 'any-angle' trace or an 'any-angle' trace itself it will immediately change the 'any-angle' trace to 45 degrees as shown below. "Restrict to 90/45" is not enabled, and as I said routing a new trace at any-angle works 'fine'. AI: I believe I found the answer. In addition to not having "Restrict to 90/45" checked, you also need to have "Preserve Angle When Dragging" unchecked. This is also in the Preferences --> PCB Editor --> Interactive Routing settings.
H: Is it possible to *proportionally* reduce a DC voltage supply? INPUT: I start with a variable DC supply (rated up to 5A) that varies between 0V and 24V. OUTPUT: Let's say I'd like to get a directly proportional output voltage between 0V and 5V (i.e. a re-map of the original range, so that 0V becomes 0V, and 12V becomes 2.5V, and 24V becomes 5V, etc.). CURRENT DRAW AT OUTPUT: Assume this final output voltage (which varies between 0 to 5V) will be used to power a motor that draws a maximum current of approximately 1A. So, the motor's speed would change as the original supply, and thus the reduced supply, changes. Is it possible to do the above? Regulators are out for obvious reasons, and a voltage divider would create a lot of heat and doesn't sound like the ideal solution. EDIT: A few people suggested PWM would be a simple solution, so I researched a bit and found this example of achieving PWM with a 555 timer (further questions below): Is this a suitable implementation for my purpose, or is there a ready-to-use PWM-performing IC that I can try applying within my circuit? Additionally, I looked up LM555's datasheet, and it seems to operate at max. supply of 18V, whereas I need up to 24V. Any suggestions on this front? AI: An open-loop buck converter could be used, preferably with synchronous rectification. The switches should operate with a 21% duty cycle, which will give you about 0-5V. There will be some droop with increasing current, due to the inductor resistance (typically a large contributor) and Rds(on) of the two MOSFETs. Edit: Conceptual diagram:- S1 and S2 can be MOSFETs or S2 could be a Schottky diode. S1 closes with duty cycle D and S2 closes for D' = 1-D where D ~= 0.21 . The period Ts is kept short enough that there is only maybe 15% current ripple in L and C is chosen to keep the output ripple voltage within requirements. For example, if the frequency is 100kHz then Ts = 10usec and S1 would close for 2.1usec and then open, and S2 would close for 7.9usec and open, and repeat forever. Note that if S1 and S2 are closed at the same time, even for a relatively short time, bad things will happen as they would be shorting the supply out. To get better accuracy would require a closed-loop control circuit- measuring the '24V' supply and servoing the output to a fixed fraction of it. That would be a bit more complex.
H: Opamp Vos trimming in a single supply circuit I have a need to trim the Vos of an op-amp (LT1006) running in a single-supply circuit (12.6V). From what I found so far the proper way to do this would be by using some bias voltage connected to both inputs rather than using ground as an input which would only work correctly in a dual supply circuit. Here's the constraint: the op-amp will already be soldered to the final PCB at this point and I can't easily lift the inputs off the ground to perform the trim using an offset voltage. I can however quite easily temporarily provide an external negative supply (-12.6V) to operate the op-amp in bipolar mode during the trimming process (and use grounded inputs). My question is: would my Vos trimming still be correct if I subsequently operate the opamp with a single supply? Any suggestions to perform trimming in a different way? More information: The circuit is simply a low-side current sense amplifier using a single supply. Trimming would be performed by shorting Rs and trimming output to equal GND. simulate this circuit – Schematic created using CircuitLab AI: You can get some idea of the offset voltage change vs. supply voltage from the below figure taken from the datasheet: Adding the negative 12.6V is equivalent to changing the common mode voltage by -12.6V. The change looks like it could be some tens of uV, but probably typically < 100uV. Something like -0.3V might be better than -12.6. Usually it's better to trim with an output voltage enough offset from 0V that the amplifier is working well, yet fairly close to ground so as to minimize iterations if you are doing span/zero calibration.
H: UART effecting "character LCD(I2C)" in stm32f103 I'm using HAL API for programming, I programed if UART got some certain text then display the counter in character LCD, Then increment counter, If again got that sentence repeat these (Increment counter and displaying that).(I'm getting by interrupt) When I send about 200 char, two times, everything are right, But (sending) after this ,LCD(Used with I2C expander) missing it's functionality . & if I sending less character in each time I can send characters more than two time . LCD is based on HD44780 This is schematic: And this is cod:(switch is for detecting that certain code,access indicators are LS and LF) /* Includes ------------------------------------------------------------------*/ #include "stm32f1xx_hal.h" /* USER CODE BEGIN Includes */ #include "hd44780.h" /* USER CODE END Includes */ /* Private variables ---------------------------------------------------------*/ I2C_HandleTypeDef hi2c1; UART_HandleTypeDef huart1; DMA_HandleTypeDef hdma_usart1_tx; DMA_HandleTypeDef hdma_usart1_rx; /* USER CODE BEGIN PV */ /* Private variables ---------------------------------------------------------*/ unsigned short flag_acc=0;/**/uint8_t index_tok[12],index_tag[6]/*buffer localization*/, c=0/*index_tag counter*/ ,rx_index=0/*for locar reception*/,chsumt=0;short err=0/*error occurence*/ ,errtemp=0/*extreme erorr occurence check*/; char /*gl_rx_sz,*/rx_data[1],tx_buf[100],rx_buf[200],chck,test=0,RXNE=-1; short LS/*Last Sentence*/=0,LF=0/*is in Line Feed char??*/,i2cer=0,ii=0; typedef enum{ gsv_off=0, gsv_on, rmc_off, gll_off, gga_off, gsa_off, gla_off }ubx; /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); void Error_Handler(void); static void MX_GPIO_Init(void); static void MX_DMA_Init(void); static void MX_USART1_UART_Init(void); static void MX_I2C1_Init(void); /* USER CODE BEGIN PFP */ /* Private function prototypes -----------------------------------------------*/ void gps_baud(); /************************************************* ******************************************************* ****************************************************/ //#ifdef __GNUC__ // /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf // set to 'Yes') calls __io_putchar() */ // #define PUTCHAR_PROTOTYPE int __io_putchar(int ch) //#else // #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f) //#endif /* __GNUC__ */ ///** // * @brief Retargets the C library printf function to the USART. // * @param None // * @retval None // */ //PUTCHAR_PROTOTYPE //{ // /* Place your implementation of fputc here */ // /* e.g. write a character to the USART */ // HAL_UART_Transmit_DMA(&huart1, (uint8_t *)&ch,1); // HAL_Delay(1); // return ch; //} ///********************************************** //*************************************** //**********************************************/ void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart){// maybe some algorithm needed to declare the error NVIC_SystemReset(); } void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *huart){// maybe some algorithm needed to declare the error NVIC_SystemReset(); } //Interrupt callback routine void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { if (huart->Instance == USART1) //current UART { rx_buf[rx_index++]=rx_data[0]; //receiving process if (rx_data[0]==0x24/*$*/){index_tag[c++]=rx_index-1;LS=1;}//LF indicate end of buffer else { if(rx_data[0]!=0x0D/*LF*/){ switch (LS) { case 1: if (rx_data[0]=='G')LS+=1; break; case 2: if (rx_data[0]=='P')LS++; break; case 3: if (rx_data[0]=='G')LS++;else LS=0; break; case 4: if (rx_data[0]=='S')LS++;else LS=0; break; case 5: if (rx_data[0]=='A')LS=-1;else LS=0;/*last sentense reached*/ break; default: break;} } else LF=1; }//obtain indexes tag HAL_UART_Receive_DMA(&huart1, rx_data, 1); /*write flag. it must implement in main while :)*/ } } /* USER CODE END PFP */ /* USER CODE BEGIN 0 */ void ubx_message(ubx ubx); /* USER CODE END 0 */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration----------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* Configure the system clock */ SystemClock_Config(); /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_DMA_Init(); MX_USART1_UART_Init(); MX_I2C1_Init(); /* USER CODE BEGIN 2 */ // gps_baud(); ubx_message(gsv_off);while(__HAL_UART_GET_FLAG(&huart1,UART_FLAG_TC)==0);HAL_Delay(5); ubx_message(rmc_off);while(__HAL_UART_GET_FLAG(&huart1,UART_FLAG_TC)==0);HAL_Delay(5); ubx_message(gll_off); LCD_PCF8574_HandleTypeDef lcd; lcd.pcf8574.PCF_I2C_ADDRESS = 0x27; lcd.pcf8574.PCF_I2C_TIMEOUT = 50; lcd.pcf8574.i2c.Instance = I2C1; lcd.pcf8574.i2c.Init.ClockSpeed = 40000; lcd.NUMBER_OF_LINES = NUMBER_OF_LINES_2; lcd.type = TYPE0; LCD_Init(&lcd); LCD_SetLocation(&lcd,0,0); LCD_WriteString(&lcd,"/*/*/*/*/*/*/*/*"); HAL_UART_Receive_DMA(&huart1, rx_data, 1); //activate uart every time receive 1 bit __HAL_UART_ENABLE_IT(&huart1,UART_IT_ERR);//error interupt enabled __HAL_UART_ENABLE_IT(&huart1,UART_IT_PE); /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { //error handler *** if(0x01==__HAL_UART_GET_FLAG(&huart1,UART_FLAG_ORE)||0x01==__HAL_UART_GET_FLAG(&huart1,UART_FLAG_PE)||err!=errtemp){ NVIC_SystemReset(); }//error handler end *** if(LS==-1&&LF==1) { // HAL_UART_Transmit_DMA(&huart1, tx_buf,100); LCD_SetLocation(&lcd,0,0); LCD_WriteString(&lcd,"we detecting sth."); LCD_SetLocation(&lcd,0,1); LCD_WriteFloat(&lcd,ii++,2); LS=0; LF=0;/*refresh Line Feed for next recieve*/ rx_index=0; } HAL_UART_Transmit_DMA(&huart1, "|",1); HAL_Delay(50); HAL_GPIO_TogglePin(GPIOA,GPIO_PIN_3); /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ } /** System Clock Configuration */ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct; RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL2; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) { Error_Handler(); } HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000); HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK); /* SysTick_IRQn interrupt configuration */ HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0); } /* I2C1 init function */ static void MX_I2C1_Init(void) { hi2c1.Instance = I2C1; hi2c1.Init.ClockSpeed = 100000; hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2; hi2c1.Init.OwnAddress1 = 0; hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; hi2c1.Init.OwnAddress2 = 0; hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; if (HAL_I2C_Init(&hi2c1) != HAL_OK) { Error_Handler(); } } /* USART1 init function */ static void MX_USART1_UART_Init(void) { huart1.Instance = USART1; huart1.Init.BaudRate = 9600; huart1.Init.WordLength = UART_WORDLENGTH_8B; huart1.Init.StopBits = UART_STOPBITS_1; huart1.Init.Parity = UART_PARITY_NONE; huart1.Init.Mode = UART_MODE_TX_RX; huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; huart1.Init.OverSampling = UART_OVERSAMPLING_16; if (HAL_UART_Init(&huart1) != HAL_OK) { Error_Handler(); } } /** * Enable DMA controller clock */ static void MX_DMA_Init(void) { /* DMA controller clock enable */ __HAL_RCC_DMA1_CLK_ENABLE(); /* DMA interrupt init */ /* DMA1_Channel4_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn); /* DMA1_Channel5_IRQn interrupt configuration */ HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn); } /** Configure pins as * Analog * Input * Output * EVENT_OUT * EXTI */ static void MX_GPIO_Init(void) { GPIO_InitTypeDef GPIO_InitStruct; /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE(); /*Configure GPIO pin Output Level */ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_2|GPIO_PIN_3, GPIO_PIN_RESET); /*Configure GPIO pins : PA2 PA3 */ GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); } /* USER CODE BEGIN 4 */ void ubx_message(ubx ublx) { switch (ublx) { case gsv_off: HAL_UART_Transmit_DMA(&huart1, "\xB5\x62\x06\x01\x03\x00\xF0\x03\x00\xFD\x15",11); break; case rmc_off: HAL_UART_Transmit_DMA(&huart1, "\xB5\x62\x06\x01\x03\x00\xF0\x04\x00\xFE\x17",11); break; case gll_off: HAL_UART_Transmit_DMA(&huart1, "\xB5\x62\x06\x01\x03\x00\xF0\x01\x00\xFB\x11",11); break; case gsv_on: {uint8_t mess[11]={0xB5,0x62,0x06,0x01,0x03,0x00,0xF0,0x03,0x01,0xFE,0x16}; HAL_UART_Transmit_DMA(&huart1, mess,11);} break; default: break; } } void gps_baud() { HAL_UART_Transmit_DMA(&huart1, "$PUBX,41,1,0007,0003,115200,0*18\n\r",35); while(__HAL_UART_GET_FLAG(&huart1,UART_FLAG_TC)==0); huart1.Init.BaudRate =115200; HAL_UART_Init(&huart1) ; } /* USER CODE END 4 */ /** * @brief This function is executed in case of error occurrence. * @param None * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler */ /* User can add his own implementation to report the HAL error return state */ while(1) { } /* USER CODE END Error_Handler */ } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t* file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /** * @} */ /** * @} */ AI: Not sure if it's the cause or not but you have some horrible buffer overflow bugs in there which will crash your code. You have the command index_tag[c++] in your ISR. I can't see anywhere where c is reset to 0 which means after hitting that line 12 times you'll be overflowing the memory allocated to index_tag. (I may have missed this, c is not the easiest variable name to search for.) Similarly your rx buffer index can easily overflow. You reset it if the correct condition is hit but if that condition isn't met you'll overflow the rx buffer and crash.
H: Power supply for robotics project? For my robotics project I am powering the arduino with a 12v 250mA source. I am using a DC motor l298 breakout board by iTead that allows a power supply of 5v to around 46v for DC motors. I am also using a geared DC motor that has operating voltage between 3v and 7.5v. I drew this up (imagine the bulbs are the arduino and breakout, couldnt get them on circuits.io) Can I use a 6v regulator for breakout without any issues? And also I see people use capacitors alongside regulators to reduce spikes or something but I did not know what to implement so could someone explain that as well? cheers. Update: This Is what the circuit is of on circuits.io Also there is no 6v regulator in it so i used a 5v AI: Can I use a 6v regulator for breakout without any issues? Well, with motors, I would reccomend against it. The motors (Especially if under load) will draw loads of current, and that will have to pass through the regulator, which will cause it to get very hot, as the effeciency of linear regulators is quite low. I would only really reccomend regulators in projects that aren't current intensive. And also I see people use capacitors alongside regulators to reduce spikes or something but I did not know what to implement so could someone explain that as well? There are two types of capacitorrs that you may be referring to. Brown-out Capacitors will protect your circuits from brown out from using too much power, typically store enough energy for 1-10ms of operation. Pi capacitors are used to filter out induction spikes, and I would not be surprised to see them on the breakout board already. powering the arduino with a 12v 250mA source Would reccomend against this. The arduino itself uses 45mA of current, which isn't a problem. What will be though, is the motors, which have to run on 205mA total. I would reccomend a 20A or higher suppply to properly power a decent motor, and an extra 5A for each motor thereafter.
H: What's wrong with parallel conductors? Regarding AC systems (like for homes and such), a circular path is called a parallel conductor. It's illegal (according to the NEC section 310) except under certain circumstances. But I have noticed that with DC circuits, circular conductors are also... taboo (for lack of a better word). See the picture below- just for example (there are probably better examples, so if another example is better for illustrating the problem or answer please, show and tell). My question(s) is basically, what's wrong with a circular/parallel conductor? Also, just for clarity, here's a picture of an illegal circuit (per NEC): Edit- as a follow up to some of the comments below, I happen to have seen the LED circuit mentioned above. I currently have one similar PCB (sort of a poor example, pictured below, because the excuse for not connecting the rings could be that there is a conductor in the way) but I have seen another PCB without any excuse for not completing the ring, so I wondered why it was not connected. AI: Both configurations will conduct power to the loads. When trying to figure out what's 'illegal', and why, you need to understand what fault conditions the authorities are trying to prevent. There may be a commentary in the relevant standards if you're lucky. In the UK, such an arrangement of a circular conductor is called a 'Ring Main', and was actively promoted for domestic rewiring from the late 1940s onwards, due to a shortage of copper and high rates of house building following World War II. Having two paths back to the distribution box allows lighter conductors to serve the same area than could be served by spurs. The rules are that a 2.5mm2 conductor serves an area of up to 1000 sq ft, and has both ends returned to the distribution panel, protected by a 30A fuse. Each socket on the wall that is part of the ring has a loop in and loop out of 2.5mm2, connected at the socket terminals. Note that a spur of 2.5mm2 would use a 22A fuse. The problem comes if someone replaces a socket without putting both conductors into the terminals, or a conductor breaks somehow. The loop is now broken, and we now have two 2.5mm2 spurs, needing a 22A fuse for protection, but having a 30A fuse, with no apparent failure to alert anybody. Any paralleling of wires allows this sort of undetectable potential overload error to occur. Some regulatory authorities ban the practice, some permit it.
H: Transfer function of real components In control theory, an accurate transfer function of the components of your system, and some sort of guarantee that they are independent (low output impedance and high input impedances) are important for understanding your system, if you want to model it accurately. Sometimes, this can be simplified -- when the frequencies of interest are far below the GBP of the components used for example, the component can be approximated as a component with a single pole and a large DC gain, both of which can be pulled pretty easily from the datasheet. However, when you are trying to eek out all the performance you can out of a component -- ie using an op amp with a GBP of 3MHz and you want to use all 3MHz -- then an accurate transfer function might be helpful. How do you find such a transfer function? Can I just find all the points of the open loop Bode plot for an op amp and digitize it? It is easier if I understand where the poles and zeros are, are there any tools to take something like this and turn it into a transfer function? Is this done in "real life", or do people just work with approximations (or spice)? As an aside, if this is something that is typically done, why don't manufacturers give the transfer function in the datasheet? AI: using an op amp with a GBP of 3MHz and you want to use all 3MHz Generally this isn't done. To do it might require manually tuning the feedback circuit to optimize the overall circuit performance in some kind of test jig. But usually it's cheaper to just choose a 30-MHz GBW op-amp, than to pay a technician to tune circuits in production. How do you find such a transfer function? Many vendors will provide a SPICE model, which will encompass as much as they are willing to share about the transfer function of the amplifier. It may also account for variations of the transfer function due to changing the power supply voltages, input common mode voltage, output load impedance, etc. Typically it won't include variations due to temperature changes. And of course it will only be a "typical" response. As far as I know there's no vendor that provides statistical models of how the performance varies from part to part.
H: Most efficient way to power a 5 V circuit from a 14.8 V battery I am making a DIY Raspberry Pi laptop. So far I have found a suitable board that will drive my display (M.NT68676.2A). From research I have found out that it will run off of anything from 12 V to 5 V, and that it uses around 3 A (I am not sure if that's at 12 V or at 5 V). I've also found a 14.8 V 6600 mAH Li-ion battery from Tenergy that I'm thinking of using (5 A output max). What's the best way of converting the 14.8 V output from the battery to a suitable 5 V for both the board (5 V 3 A?) and the Raspberry Pi (5 V 2 A) without wasting too much energy or spending too much? AI: There are dozens of small, inexpensive DC-DC converters available on Ebay, Amazon, etc. They are based on industry-standard converter chips and are quite convenient to use. You can find versions with fixed output voltages, as well as those with user-adjustable output voltages. I would probably use TWO of these converters. One for the display (at 12V) and one for the RasPi (at 5V). The very first hit I found on Ebay shows that you can buy 10 of them for less than US$12 with free shipping. They are good for 2A, but will do 3A if you add a heat-sink to the regulator.
H: Connecting AVR running at 3.3V to a 2.8V I2C bus I want to connect an AVR (ATmega48PA) to an I2C bus whose pullups are connected to 2.8V which is the operating voltage for other devices on the bus. The AVR is running at 3.3V. Since SDA and SCL pins are open drain, the AVR, if connected, isn't going to "push" 3.3V on the bus, so other devices on the bus are safe. Also, as per the electrical characteristics section of the datasheet, the threshold for logic high is 0.6*Vcc which comes to 1.98V for when Vcc is 3.3V. The I2C bus voltage is well above this threshold so I guess I can connect the AVR directly to the bus without any level shifting. Is that correct? Datasheet Page 383, Table 33-2 : Common DC Characteristics AI: Open drain outputs from a 3.3V system will share the lines with other devices on party lines pulled up to 2.8V. If you pull things down, the voltage will be near ground. That's okay for everyone. If you don't pull down, then the voltage of the line will be close to 2.8V. As you point out, it's the logic high input question of about 2V for your 3.3V system that makes you wonder. I think it should work fine. If your device pin is acting as an input, and some other device is acting as an output using an open-drain, as well, then if they are outputting a '1' they will be in a high impedance state leaving the entire party line pulled to 2.8V by the pull-up. So long as all of the combined leakage currents of all the devices don't collectively cause that pull-up resistor to drop more than a half-volt or so, you should be fine. And it is hard to imagine that happening. Of course, I don't know the value of the pull-up, how many devices are attached, or what their leakages might be. So... hard to be absolutely sure. But I think it's okay.
H: What is the minimum spacing between inductors to prevent cross talk? I have to put three inductors in a box. The inductors are air core with a diameter of 6in and a height of 4.5in. The value is going to be about 16uH. The inductors will see about 50Arms continuous at about 4kHz. Each inductor is on a leg of a 3 phase output. How far apart should the inductors be to reduce the cross talk to a minimum? Are there any rule of thumb for spacing such inductors? AI: A coil will produce a field (Bx) at some distance along the centre axis like this: - Where n = number of turns, I = current and x and r are dimensions of the coil and spacings. So how much field can you suffer with cross coupling. Clearly you will get some at any distance but, beyond a point (x >> r) the field falls as distance cubed. It's also a reasonable assumption to make that at those sorts of distances, the field received will tend to be constant in the plane of the receiving coil therefore you can calculate total flux entering the coil and, using the frequency of your signals calculate rate of change of flux. E (induced voltage) = N\$\dfrac{d\Phi}{dt}\$ where N = number of turns of receive coil. So, there are formulas and little rules of thumb. How much induced voltage you can suffer is beyond my knowledge.
H: Spark Plug/Ignition Coil: DC Pulse If you have the following circuit with a step up voltage from L1 to L2, then when do you get a spark across the spark plug? I have three scenarios. Scenario 1. You have the switch open, then you close it right away you get a spark. Scenario 2. You have the switch open, then you close the switch. This allows the magnetic lines of flux to expand. A current then is induced for L2. Once a little time passes you reopen the switch, and then you get a spark. Scenario 3. Neither of these, I am dead wrong. simulate this circuit – Schematic created using CircuitLab AI: Scenario #2 is the correct one. Without some type of voltage step up a 12V battery can not create a high enough change in current to create a spark. If instead current is set up through the coil and then the path is broken the change in current is orders of magnitude higher. To make this circuit practical the addition of a capacitor across the switch is needed to make the switch break clean. This would work like a condenser in a point and breaker automotive ignition.
H: Wire sizing when connecting multiple motors I'm connecting two electric motors and an electric heater in parallel together in a circuit, all three phase. Electric motor 1 has a rated current of 20A, motor 2 is rated 2.5A, and the heater is rated 25A. Branch circuit conductor sizing per the NEC is as follows: 125% of highest rated motor full load current (FLC) + 100% of each other motor FLC + 125% of non-motor noncontinuous load FLC. This totals to an FLC of about 59 amps. A conductor carrying 59A should be about 6 AWG THHM wire. My question is this, do I need to be running 6 gauge wire throughout my circuit (contactors, circuit breakers, etc)? This seems to be what the NEC recommends, but shouldn't the small motor receive 2.5A at most, why does it require such a thick wire? AI: The wire gauge required by the NEC is determined by the circuit breaker protecting the branch. In the case of a short, even in a low current branch, the wire conductors need to be able to handle the momentary over-current of the short. If the short is not "perfect", the breaker will happily supply 60 Amps+ into it for an indefinite period of time. Not a good situation if the conductors are sized to carry 2.5 amps (presumably #14 wire, the smallest permissible gauge for branch circuits). For safety all branches of the circuit are assumed in the NEC regs to be able to carry the amperage dictated by the circuit breaker serving that branch. By the way, if you have "long" cable runs to the high amperage motor you may find that the motor is starved for starting current due to the round-trip resistance of the conductors. This resistance may create a voltage drop in the wires sufficient to prevent the motor from starting, or cause it to start slowly or erratically. In your specific case you have that 25 Amp heater complicating matters. If the heater is also on the same long branch of the circuit, it will create its own voltage drop in the wiring which will affect the voltage available to the motor when it starts. In these cases you will need to use a heavier gauge cable than is dictated by the normal ratings of the motor.
H: Missing Connector Pieces There are missing connector pieces in this PCB that I was working on and I swear that there was no connector there in the first place, so I ruled out me going insane.I circled the connectors in gray. Are these connector pieces for something else off the board I have? PCB Details This PCB belongs to a Sharp 1999 TV. Was connected to four other small PCB one the buttons for the TV, the other the jacks on the TV, the speakers, and deflection coil. AI: It may or not be used by your specific tv. But it is not uncommon for a pcb to have a populated but unused internal connector. The same board may be used in multiple model tvs or with different but equal modular parts (power supplies, output boards etc) so they use a general board. Design once and use in modular fashion as needed. It could also be a debug or test interface. Good luck.
H: Do the wattage from connected devices need to add up with the given wattage from a step-down converter? A step-down buck converter converts 36V to 12V 36W. Does it mean that the sum of all the wattage from all connected devices need to be 36W? OR Does it mean that I can connect multiple devices not producing more than 36W power? AI: Does it mean that I can connect multiple devices not producing more than 36W power? It means you can connect multiple devices not demanding more than 36 W of power in total. Some switch-mode converters may behave badly (be more noisy, or allow output voltage to drift up) if the load is much lighter than they are designed for. If your load is less than, say, 25% of the designed capability of the converter, you should check on the performance with light load before selecting that converter.
H: Two amps running through a transistor? (Short disclaimer, I don't know much about electrical engineering other than what I have learned in physics in high school and the little I have learned from working with electrical engineers) Is it common to have 2 amps running through a transistor (than can support it of course) or is there some sort of circuit design or something that would allow you to direct the current to where it needs to go and have a lesser current run through the transistor while still having the transistor in use? I feel like 2 amps running through a single transistor is bad (idk if it is or not) so I just wanted to see if there was another way to do it... also save me money so I don't have to buy more expensive transistors AI: You've practically got all your answers in the comments above. But you also brought up cost. So I thought I'd add a few points and try and wrap it up. Transistors commonly have to handle more than 2A. They may do this for purposes roughly like a switch (turning something ON, like a solenoid) or for purposes not at all like a switch (like the speaker driver stage of an audio amplifier.) But because transistors also drop at least some voltage across them when doing this work, they also have to dissipate power, too, while achieving their primary purpose. So, in any design you need to also keep in mind power dissipation. There are transistors designed for small signals which are generally these days packaged into tiny TO-92 packages or SOT-23-X packages. These are not designed to dissipate much power into ambient air. So you usually have to stay under a quarter watt or so with those. Less is still better. The temp at the surface of the package means that the temp inside the package is still that much higher. So you need to make sure that the actual bit of silicon deep inside doesn't exceed its ratings. The 2 amp number you give pretty much takes it out of this ball-park of small signal devices. However, there are packages that fit squarely into that area of current. These are TO-220 packages. And for many 2A applications, they may be just fine. Again, everything is in the particulars. There are "safe operating areas" and you may have to drop large voltages across the transistor, so you still have to think and read datasheets to make sure. But as a broad rule, the TO-220 package (and similar) probably will handle many 2A situations. There are two basic kinds of transistors: FETs and BJTs. They each have their place, still. So which of them will be better will, again, depend on circumstances. Since you mention cost, I'd say as a broad rule BJTs are cheaper than MOSFETs. I can get BJTs for less than a penny each (I buy PN2222A at about 0.4 cents each.) I can't do that anywhere with any MOSFET, such as a 2N7002, which all have a base that is much higher. However, that's not all there is. They each require drive circuitry and that also costs money as well as having different trade-offs in performance. But a TO-220 packaged BJT can often be found for well under 40 cents. (Assuming you get it shipped for free, I guess.) They really aren't that expensive. And I'm pretty sure similar MOSFETs aren't much different in pricing, when talking about TO-220 packages. So it's not the big deal you suggest there. Handling 2A isn't that bad and isn't that expensive, in many applications. (Of course, for some it would be prohibitively expensive. So no bright lines here, either.) In fact, it's considered pretty normal.
H: Powering 3.3V I2C from Arduino 5V? I need my Arduino to communicate with a fairly sensitive 3.3V I2C device, and am using a Bidirectional Level Converter to step down the voltage. However, I still need a 3.3V source (for the I2C device and Level Converter), and the Arduino shield I am using is blocking the 3.3V pin. My question to you all: what is the best (easiest/cheapest/most efficient) way to get 3.3V to that I2C device? My options as I see them: make a voltage divider from the 5V (pictured), buy a $1 voltage regulator, or do solder-surgery on the ardu-shield so I can use it. Edit: I should clarify this is NOT a small stationary project. The choice needs to be durable and repeatable/manufacturable. Option 1 (looks super inefficient): AI: Using a voltage divider to generate a power rail is most often a bad idea, as you don't know what your current draw is, and you don't know if it will be a constant current draw. Think about how inaccurate your divider will be with a circuit sucking 20 milliamps from it. It's a calculation worth doing. This is what voltage regulators are for. Try http://www.mouser.com/ProductDetail/Microchip/MCP1702-3302E-TO/?qs=jZi1jxfVU95RAHKJCz8stQ%3D%3D&gclid=CMyooOLjss4CFdcZgQodzxQCBw for a 50 cent part - but you need to verify that it can deal with enough current for your purposes. As to whether it's worth your time to dork around with your board/shield, thats up to you.
H: Missing Component Pieces from a PCB This PCB is from a old Sharp 1999 TV I have been reverse engineering lately; also sorry for any bad images. I have noticed that there are some "missing" components in the holes of: D4002, D4003, D4001, D4004, and C4002. Are there certain components that were once in those holes as part of the design? AI: They could be parts that are used for a different TV or some other product, they could be parts that were in the original design, but later deemed unnecessary. It could also be a cost saving measure (two parts in parallel in case two lower value parts were cheaper than a higher value part). The board might work if you add those components back in, or it might stop working if those components are put in. It is difficult to tell without reverse engineering the whole thing.
H: Logic Analyzer shows voltage change in analog but not digital While using a logic analyzer with analog voltage to test Digital Output Pin voltages on an Arduino UNO, I am seeing the expected digital output and analog output (HIGHs and LOWs for digital and 5V to approx. 0V for Analog). I'm using a Saleae logic 4 to test the digital output of an Arduino and an Arduino-compatible (Ruggeduino) for simple digital output. The Arduino seems to run my sketch just fine and the Saleae can read my output pin as both digital and analog. The moment, however, I drop the "Ruggeduino" in with the same sketch, my digital output seems to fail to work, and when I take another sample with the Saleae, my "Analog" voltage shows the highs and low voltages I'm expecting, but the "Digital" output is suspiciously blank. Why would my logic analyzer show the expected digital and analog output when testing the Arduino Uno, but show a consistent "High" for digital output but both high and low voltages on the Analog output when testing the Ruggeduino? Additional Information: Devices used: Ruggeduino Arduino UNO R3 from Arduino.cc Saleae Logic 4 Edit: Not satisfied to just sit and wait for someone to answer, I did some more digging. Here's what I found out: The logic appears "High" despite the change in voltage, looking as if it's stuck High The Analog voltage of "Low" for the output pins appears to be 1.586V, which falls outside the range of TTL "LOW" (and most likely the cause of the "stuck" logic level) This only happens when the pins are connected to the downstream input pins that should only be listening for digital output. Once you remove the downstream pins from the equation, the "LOW" voltage drops back down to just above 0V. I don't currently have a screenshot handy to upload, but I can upload my sketch to show what I'm attempting to do: void writeWiegand(String); int outZeroPin = 6; int outOnePin = 7; int led = 13; void setup() { pinMode(outZeroPin, OUTPUT); digitalWrite(outZeroPin, HIGH); pinMode(outOnePin, OUTPUT); digitalWrite(outOnePin, HIGH); Serial.begin(9600); delay(1000); } void loop() { String code = "0001001001100101100000001011010010"; writeWiegand(code); delay(500); } void writeWiegand(String code) { for (int i = 0; i <= (code.length() - 1); i++) { if (code.charAt(i) == '0') { digitalWrite(outZeroPin, LOW); //delayMicroseconds(100); delay(100); digitalWrite(outZeroPin, HIGH); Serial.print(code.charAt(i)); } else { digitalWrite(outOnePin, LOW); //delayMicroseconds(100); delay(100); digitalWrite(outOnePin, HIGH); Serial.print(code.charAt(i)); } //delayMicroseconds(100); delay(100); } digitalWrite(led, LOW); Serial.println(" Output to Wiegand"); } Edit 2: The downstream device is a proprietary Access Control Panel, and the input pins are pins are for Wiegand communication with a card reader. Since it is proprietary, I'm not sure what I'm legally allowed to share. According to the manufacturer, the two input pins output 5V which the reader is supposed to Pull to ground to send information on either the "Zero" or "One" wire. The UNO R3 works fine for this task with the same code above. When pulling low with the Ruggeduino, there is still 1.586V left over, which I find confusing. AI: Since it is proprietary, I'm not sure what I'm legally allowed to share. According to the manufacturer, the two input pins output 5V which the reader is supposed to Pull to ground to send information on either the "Zero" or "One" wire. I suspect that they have a strong (i.e. low-value) pull-up resistor to +5 V on these "input" pins, and that is enough cause a significant voltage drop across the 220 Ω input protection PTC resistor on the Ruggeduino-SE, when the MCU attempts to pull that I/O pin low. Ruggeduino I/O pin protection components: Source:http://www.rugged-circuits.com/ruggeduino-1 A quick calculation is that a 470 Ω pull-up to +5 V in the device, in conjunction with the 220 Ω input protection PTC resistor on the Ruggeduino-SE, would result in approx. 1.5 V at the actual Ruggeduino-SE "connector terminal" in the above diagram, when the MCU (i.e. "Microcontroller Pin" in the above diagram) tries to pull that pin down to 0 V. To test this hypothesis, temporarily short (i.e. bridge across) the 220 Ω resistor for one of the output pins you are using on the Ruggeduino. That will directly connect the MCU pin, to the output connection terminal. See if the measured voltage at the output connection then drops to approx. 0 V for logic 0 output, when connected to this proprietary Access Control Panel input. According to this Ruggeduino-SE page: "If you do have an application where this built-in 220 ohm resistance is not wanted, you can easily change it. Every I/O pin has through-hole pins surrounding its PTC fuse that can be jumpered with either a wire for 0 resistance or with a standard resistor. Here is a picture showing how to bypass the 220 ohm PTC for pin D7." [Updated to refer to the 220 Ω resistor as a 220 Ω PTC resistor, as described on the Ruggeduino-SE according to the page linked in the original question.] After a quick bit of research, it seems that devices using the Wiegand interface usually have open-collector outputs; have a pull-up resistor to some voltage, typically at the input device (that fits with the earlier hypothesis); the voltage for the pull-up resistors is sometimes +5 V, but sometimes higher. Potential solution More research would be needed (although out-of-scope for this specific answer), but based on what I have read, I would simply add open-collector drivers (either BJT NPN or MOSFET N-channel) to the two Ruggeduino outputs (i.e. the "Connector Terminal" pins) used for the Wiegand interface outputs. In that way, the 220 Ω PTC resistors on the Ruggeduino are not in the external current path, and therefore they would no longer form a potential divider with the pull-up resistor in the external device. Using open-collector drivers in this way would allow the outputs to reach (close to) 0 V, and so would resolve the originally stated problem. Note: Adding open-collector drivers would have the side-effect of inverting the polarity of the MCU output, i.e.: MCU pin high = open-collector driver "on" = open-collector output low (the open-collector output is actively pulled toward 0 V) MCU pin low = open-collector driver "off" = open-collector output effectively high (the output is not actively driven and is pulled-up by the external resistor) This behaviour would need to be considered in the MCU firmware.
H: Replacing IC with similar yet not sure i have a coding machine here and on its pcb it has this IC ULN2003AN. it was burnt because of feedback polarity issue and i want to replace it with ULN2003APG. Is this possible, will it result to another problem. pls help. AI: If the package is the same (14-pin DIP?) then there is little chance of a problem with the substitution. However, if the original fault remains, then it will burn the replacement chip, also.
H: Drill Size Error in Eagle Cad No matter what I do, I still have these errors. I don't know what to do to fix this. Please help!! AI: If you zoom in on your layout, and then double click on any of those violations, it will take you directly to the section of the board where the violation is highlighted, in case you didn't already know that. Either the holes have to be that size and you need to find a manufacturer that supports that drill size, and change your DRCs accordingly, or you need to change the size of the holes to be compliant with the capabilities of your manufacturer. Here is a screen shot of the DRC section that is relevant to your error.
H: How does UART know the difference between data bits and start/stop bits? I understand that it is common for a UART scheme to use 8N1, meaning 1 start bit, 8 data bits, and 1 stop bit. Something like this: 0xxxxxxxx1 Where 0 is the start bit, the x's are the data, and 1 is the stop bit. In the case of multiple frames being sent back to back continuously, you'd have something like this: 0xxxxxxxx10xxxxxxxx10xxxxxxxx1 My question is: how can the receiver tell the difference between the start/stop bits and data bits? To illustrate this point, suppose that the data byte 0xAA is over and over. This would look like: 01010101010101010101010101010101010101010101010101 I made the start/stop bits bold for emphasis, but it seems to me there really is no way to distinguish these from the data bits. Sure, if the receiver has had a solid error-free connection to the transmitter since eternity past, then I can see how this wouldn't be a problem. Or if the bytes are not sent back to back then it wouldn't be a problem. But I've worked with 8N1 circuits that were continuously transmitting bytes one after another, and I could disconnect/reconnect the wires mid-transmission and the receiver would always jump right back into receiving correctly. How is this possible? AI: This sounds like a question coming from someone trying to emulate a UART receiver in software or an FPGA. For RS-232, they use the term mark and space. But these usually correspond, once digitized, into a '1' and '0', respectively. UART receiver often divides up each bit time (must be known, a priori) into at least 4, but often 16 or more, sub-periods. It starts out (upon power up/reset) in a state where expecting the serial receiver line in a mark state. If the line is NOT in a mark at that moment, then it knows that it is in the middle of a transmission frame and must wait until it can synchronize. If the line is in a mark state, then it may or may not be in the middle of something and will have to wait and see. This is a problem with RS-232, if just plugging into another device while serial communications are happening or if part of a tap to monitor the asynch serial communications between two other players and have just been reset. To be absolutely sure, when coming out of reset anyway, the UART would need to observe at least N bit times (where N is the number of bits per word, and often 7 or 8, and assuming no parity option here) worth of mark followed by one bit time of space to re-synchronize up (or else N+1 bit times of space.) Many don't carry that much state around, so they can synchronize up incorrectly, if started in the middle of a stream. You will often get framing errors and occasional data bytes, until it happens to accidentally re-synchronize up correctly again. That's often been an acceptable price, too. Normally, cables are connected and devices are power up in a particular order of operation so that there's rarely any issues. Once synchronized, though, the UART knows what to expect. It always starts with the receiver line going from a mark to a space, the needed start bit that goes for a full bit time, followed by data bits and then followed by at least one bit time worth of mark (or longer) as the stop bit. If it stays synchronized, then it will see that pattern repeated over and over again. Part of the reason for dicing up the bit times, to something like 4X or 16X, is that the clocks used by the transmitter and the receiver aren't necessarily perfectly accurate and they are otherwise simply asynchronous to each other. So part of the synchronization that goes on in the receiver is in lining up its diced up periods to the transmitter's timing. The finer-grained that is done, the better aligned the receiver can become.
H: Timing loop in finite state machine sync I'm creating a FSM in VHDL to implement a serial transmission module. However, whenever I synthesize it, it throws a bunch of the same error about finding a timing loop. [Synth 8-295] found timing loop. However, the line it points to looks like this: sync_proc : process (sys_clk, sys_rst, NS) begin if (sys_rst = '1') then PS <= FSM_RESET; elsif rising_edge(sys_clk) then PS <= NS; end if; end process sync_proc; Specifically, the error points to the "PS <= NS" line. From what I've been taught and read in VHDL standards, this is a standard way to implement the synchronous part of an FSM, but I can't find why its giving me an issue about it now. Any thoughts? AI: The problem is because you included NS in your sensitivity list. The first line shall look like this sync_proc : process (sys_clk, sys_rst)
H: Extra I2C on stm32f I am using stm32f105 to control 5 I2C buses and some other peripheral circuits. The problem is that I used all dedicated I2C pins by other peripheral circuits. Is it possible I change a GPIO (General purpose I/O) pins as I2C. For that purpose, a pin must be output for a while and than change to input (for SDA). i.e. a pin must be output and load the address, then change to input and receive the ACK from slave, then again read or receive data from slave, then finally change back to output. I am wondering is it practical? is there any source code for that any where ? AI: Yes, it's possible. Set both pins to open drain output in GPIOx_CRL or GPIOx_CRH, and you don't have to worry about switching the pin direction. If the port bit is 1, then the wire is pulled up by the external resitor, and you can read back 1 in GPIOx_IDR, or the slave pulls it low, and you'll have 0 in GPIOx_IDR. There is a straightforward software implementation on Wikipedia. Use TIM6 or TIM7 for the delay, or DWT->CYCCNT if there are no timers left available. Leave out the arbitration_lost parts if you are the only master on the bus.
H: Accelerometer - Tilt Detection I'm using the MMA8453Q for tilt detection of 45 degree in any axis. I'm a newbie to embedded devices. I have a few questions. 1) Should I be using Transient detection or Motion detection for my use case? I referred the Application note AN4071. But, I'm unable to understand the use case scenario for both transient detection & motion detection with respect to tilt detection. 2) I'm currently using Transient detection. But, it is detecting only abrupt shakes. When I turn it slowly, it doesn't detect the tilt even if the board is in 90 degree. Is there any specific reason for that? Register configurations are: CTRL_REG1 - 0x1A (100 Hz ODR & F_READ) XYZ_DATA_CFG - 0x00 (2g) HP_FILTER_CUTOFF - 0x01 (2 Hz) TRANSIENT_CFG - 0x1E (Enabling all axes & latch) TRANSIENT_THS - 0x0B (For approx 45 degree tilt) TRANSIENT_COUNT - 0x05 (50 ms debounce count for 100 Hz ODR) Kindly suggest me which registers I should change to detect if I move the board really slowly. Any kind of related suggestions or explanations are much appreciated. EDIT: I tried reducing the cut-off frequency. But, I couldn't reduce it below 2 Hz, as it started detecting interrupts even when it is stationary. AI: It can't be much clearer than this... The transient function (with HPF enabled) is different from the motion detection embedded function in MMA8451, 2, 3Q. Refer to Freescale application note AN4070 for details on the motion detection. The intended use of these functions is different. A. The embedded motion function triggers an interrupt when an y of the enabled axes has exceeded a set acceleration threshold. • Motion detection is useful when the device may be tilted in an orientation and the interest is to know if the acceleration in one axis has crossed a specified threshold amount measured from 0g. The motion detection analyzes change in threshold considering both static and dynamic acceleration. B. The transient detection embedded function compares whether any of the enabled axes has exceeded a set change in acceleration disregarding the static acceleration. The data that is compared to the threshold to be exceeded is high-pass filtered data. • Transient detection is useful when the device may be tilted in an orientation (i.e., there is some non-zero reading on one or more of X, Y and Z) and the interest is more on the dynamic acceleration crossing a specified threshold amount in a short amount of time (frequency being the reciprocal of time) regardless of what the current value is.
H: Why some TRIACs have mouting base connected to the main terminal? Why some TRIACs have mounting base connected to the main terminal (one such example: BT139) and how to deal with it? Does it need to be grounded if the user can touch the heatsink? AI: Why some TRIACs have mounting base connected to the main terminal (one such example: BT139)? The chip is bonded to the metal tab to provide minimum thermal resistance to the heatsink. ... and how to deal with it? Very carefully. Does it need to be grounded if the user can touch the heatsink? You can not ground the tab as it is part of the circuit. You use an insulating layer between the tab and the heatsink and an insulating bush for the shaft of the screw. Figure 1. The mica washer insulates the tab from the heatsink. The plastic bushing insulates the screw from the tab. The tab may be still live. You must prevent user access to the device. You may ground / earth the heatsink itself for additional safety (for trained personnel working on / debugging / repairing the device.
H: Using an audio amplifier with differential outputs with headphones I'm planning to use TPA2012D2 (http://www.ti.com/lit/ds/symlink/tpa2012d2.pdf) audio amplifier from TI from my headphone audio project. This amplifier has a differential outputs for left and right audio channels. My question is, how do I connect this to an headphone jack where I have a common ground for both channels? Is it possible to use just the OUTL- and OUTR-, and ground the OUTL+ and OUTR+? (This is the typical application schematic found in the datasheet) AI: Each channel output is a H bridge therefore you cannot cross connect speaker wires to form a common 0V. You could use a transformer to convert a balanced output (H bridge output) to a single ended output and you'd need one transformer per output. You might be able to use the half-H bridge outputs but distortion and other problems may occur due to imbalanced loading. Read the data sheet to see what it says.
H: Top layer and Top solder layer Altium I want to use a microUSB connector on a board I'm designing. The dimensions of the connector that I'm using is in this Datasheet. To make a lib I'm using Altium, after setting the dimensions here's how the part looks. The problem is that I've checked that my dimensions do match the datasheet, however only on the Top layer (red). When I check the Top Solder layer the pads are connected to each other. How will this board look if I get it manufactured? Is the Top layer (red) the footprint, or is the Top Solder layer (purple) the footprint? AI: Top Solder is the Soldermask (you need to interpret it as a negative layer, violet means no soldermask, empty means soldermask), not your actual pad (that's the Top Layer, positive Layer, red = copper, empty = no copper). Yet, you could get problems with solder quality if you do not have solder mask between your pads as the solder might easier make shorts between to pins. Maybe you could make your pads a bit smaller to increase the distance which would in turn add soldermask between them.
H: UART with PC : Reciving absurd characters in PC I am working on a project using Atmega16 micro-controller of AVR family. I am using UART for my project. I need to send data to my PC AT 9600 baud rate via an USB-TTL converter and view the data using 'putty'. I am getting absurd data in putty. I am not an electronics guy but a computer science guy so need a little bit of help. I guess I might be writing the wrong fuse bits or something else. Please specify the fuse bits if possible The program for the micro-controller is below #include<avr/io.h> #include<util/delay.h> #define UBRR_VALUE 51 //function to initialize UART void uart_init(void) { UBRRH=(UBRR_VALUE>>8);//shift the register right by 8 bits UBRRL=UBRR_VALUE;//set baud rate UCSRB|=(1<<TXEN)|(1<<RXEN);//enable receiver and transmitter UCSRC|=(1<<URSEL)|(1<<UCSZ0)|(1<<UCSZ1);//8 bit data format } //function to transmit data void uart_transmit(unsigned char data) { while(!(UCSRA & (1<<UDRE))); UDR=data; } void transmit_string(char *str_data) { while(*str_data) { uart_transmit(*str_data); str_data++; } } int main(void) { uart_init(); while(1) { //transmit_string("hello"); uart_transmit('h'); } return 0; } The fuse bits specifications are given below Thanks in advance for any type of help AI: Your baud rate divisor seems to select a baud rate of 19200 instead of 9600: baud = (clock speed) / ( 16 * (UBRR + 1) ) Try to set UBRR_VALUE to 103 and see if your communication gets better. A proper way would be to define F_CPU and BAUD, and let the macros from setbaud.h do the calculation: #include <avr/io.h> #define F_CPU 16000000 static void uart_9600(void) { #define BAUD 9600 #include <util/setbaud.h> UBRRH = UBRRH_VALUE; UBRRL = UBRRL_VALUE; #if USE_2X UCSRA |= (1 << U2X); #else UCSRA &= ~(1 << U2X); #endif }
H: Can ADC take discrete signals as input? Generally we give analog signal to ADC as input. As per my understanding, ADC has sample and hold circuit before voltage comparator. This sample and hold circuit samples the analog signal and hold for sometime. Here the signal may resemble like discrete signal. Now my question is that as input to ADC, can we give a discrete signal directly. If we give discrete signal as input, what properties we need to consider for the signal. AI: A discreet signal i.e. one that has potentially near-instantaneous changes in amplitude will contain signal harmonics that may easily be beyond the Nyquist frequency of the ADCs sampling rate. On this basis alone some form of aliasing will occur and your digitized signal will be noisier than had you fed your discreet signal via an anti-alias filter.
H: 12V Signal -> Relay -> Voltage Regulator -> Arduino mega analogue input. Will this work? I have a system that sometimes generates a 12V signal to a DPDT relay coil, which switches on a 12V connection through the relay pins that can be used as a boolean signal to the arduino. I plan to do this by connecting a 5V L7805 regulator, followed by a 1n4007 diode to drop the voltage to approx 4.3V +-10% which should be safe. My question is, should I be concerned about inductance from the relay coil? I know arduinos don't like inductive loads. Also, are any additional resistors necessary in this configuration, i.e. with the arduino i/o pins configured as inputs with pullup resistors? If you can foresee any problems with this setup, please let me know. AI: Don't bother with the 7805 - without input and output capacitors this could prove problematic and, at the very least will be "slow" in responding to the 12V input. Just use a resistor and 4.3V zener diode like this: - simulate this circuit – Schematic created using CircuitLab You don't need to worry about glitches either because the relay coil is isolated from the Arduino by the relay contacts.
H: Kicking RJ11 cash drawer via PC's serial port I have a Star CB2002LC-FN cash drawer. Normally, to kick it, it needs to be connected to the peripheral port of a receipt printer via RJ11/RJ12. The PC can then send a control signal to the receipt printer, which then in turn signals the cash drawer to kick. I believe this protocol is called DKD. My objective is to mimic this behavior, but without the receipt printer and instead controlling it via our own software. The solution I came up with was to use an RJ12 to Serial adapter to connect the drawer to PC and trying to trigger it by activating certain pins. I've tried several pin configurations based on different documents I've found online but have not been successful in getting any kind of response from the drawer. The general idea seems to be that voltage should be provided to two of the pins. By then cutting the voltage to one of the pins the electromagnet (solenoid) should release. I've tried using the serial DTR and RTS pins as I can activate those individually. It might be a simple case of the PC's serial port not providing sufficient voltage. There seem to be commercial products available that can do this, but I would prefer to DIY a solution if possible. Is there any way I can accomplish my goal? AI: It does require more voltage. This PDF gives a schematic, albeit for a different model but also using RJ11: It requires 24V for a few hundred ms, at least 1A. See also this Epson control PDF. That has the solenoid on pins 4/5, which I think is more common than 2/3. You should be able to find the solenoid by identifying the pair of pins with a small non-zero resistance. You don't "apply voltage then cut it", you need to supply a pulse through a transistor or suchlike. You could probably control the transistor through DTR.
H: SMPS dipping periodically when wall voltage is under heavy load I'm going to apologize in advance as I don't have oscilloscope screenshots for the problems I'm about to describe, so words will have to suffice. I've put together a non-isolated SMPS using the LNK304 as seen below (sorry for LTSpice). Perhaps a better laid out schematic of the power supply can be found on page 4 of the LNK302/304/306 datasheet. The problem I'm seeing is that when the universal motor (14A) on the right hand-side of the schematic is triggered a noticeable dip repeating at exactly 60 Hz is seen in the LNK302 output, the dip gets progressively larger as the motor is driven at higher and higher currents. At its peak this dip is around 5V. The dip gets less prominent as more capacitance is added to the output but I'm seeing diminishing returns as I add more capacitance (247uF so far). Additionally, the 5V regulator output sees a dip of the same magnitude on its output. I did look at the drain input of the LNK302 with an oscilloscope and saw a negative ramp wave, the amplitude of which increased as the motor current draw increased. I strongly suspect that this issue is related to the neutral line getting yanked around by the motor but I find the repetitive nature of the issue troubling, especially since it continues at steady state. If this is the problem I'm not at all sure how to solve it other than by limiting the current to the motor or designing a fully isolated power supply, unfortunately, neither of these are an option. AI: First, that is a very nice schematic, especially coming from LTSpice. I don't see any reason for interaction between the motor and the power supply, except possibly because your mains voltage is dropping. However, presumably those LEDs illuminate at higher motor power so the current draw progressively increases with increasing motor speed and there is also the opto drive current. I would suggest testing the power supply at the full circuit current draw from the 12V (add 20% for margin) and input mains at nominal voltage less 20% and see if the output 12V remains in regulation. I don't know how much your pressure sensor draws, but you might be getting close to the maximum capability of the LNK302, even if you are using the recommended inductor etc. Edit: Here is a guide from Tektronix on safely making mains measurements with an oscilloscope. Using a grounded input oscilloscope with reference connected to the neutral can cause inaccurate readings and can damage the oscilloscope as some of the motor current will flow through the scope probe and circuit.
H: Motor works on 9V battery but not 9V power supply I had a motor that was working on a 9 V battery I now want to connect it to a charger that has 9 V output. When I connect the motor to the 9 V charger sparkles poop out. The charger is rated at 1.5A, is this too much for this motor? I cant find the current rating of the 9 V battery. The battery is a 'Krona' brand battery. What can I do to get the motor to work from the 9 V charger? AI: From the Art of Electronics, "A standard 9 volt battery behaves approximately liike a perfect 9 volt voltage source in series with a 3Ω resistor, and it can provide a maximum current (when shorted) of 3 amps (which, however will kill the battery in a few minutes). So no the supplies are not the same, the 9V battery can supply more current. But that is not the problem. The motor would have to be a brushed DC motor for it to operate under a DC current. Unless your motor has an insane internal friction or torque, it should turn at lower RPM even when ran at low current.
H: I know it has small phase margin.. but why is it oscillating not at rails? I came across an issue at my workplace with the following circuit. I did a OL response and saw that the gain margin is 21 db and the phase margin is 14 deg. Clearly not so good. Note that the 680nF cap is a populated capacitor on a board!! I measured the test point (TP) with a scope and saw a small oscillation of 50mV @ 42khz. I thought this was interesting because the last few times I saw an unstable circuit they oscillated rail to rail. The oscillation I'm seeing doesn't appear to be from instability - I think it is from a power up charge on the cap and the feedback of the amp is trying to drive it to the correct voltage, causing a small oscillation when it overshoots. When the network is disturbed (a colleague touches the 1.3k resistor lead) it stops oscillating. A power cycle will sometimes cause it to oscillate again. Anyone have a better explanation or reading material I can bush up on? My inclination is to depopulate the cap from the BOM. But I would like to try to understand the original designer's intent. I tried searching online for circumstances why you would try to put extra capacitance on an output of an op-amp circuit. I find a lot of information about remedies and negation techniques. Does anyone have any interesting stories or reasons where they added a load cap to an op-amp output? UPDATE On power up this is kicked into an oscillation that settles around 400 mV pk-pk. Clearly acts unstable-no surprise with the given phase margin. I'm just not clear on the mechanics that dictate how it settles at 400 mV. AI: The designer might have intended to make a band pass or low pass filter, but neglected to put any impedance/resistance between the capacitor and the op amp. But this is purely speculation and EE.SE has no place for that. One thing to remember is amplifiers and ADC's have input impedance, in this case R1 is 30kΩ (from the datasheet) I can't see a reason to keep the capacitor on the board in its current configuration it's loading the op-amp with capacitance, either convert the circuit into a low pass filter (and cut back on your noise) A good reference is Op Amps for Everyone from TI or any op amp design guide from an analog manufacturer. Learn how to do filter calculations, check the LT1001 datasheet for info on capacitance (fig 1001 G20) for info on overshoot. Design stuff with hand calculations, then maybe do a simulation in LT spice and then implement the changes and test them to see if they improve your situation.
H: low-noise-amplifier datasheet lists negative dB for gain? I'm looking at the RF3858 datasheet and on page 2 it shows the gain of the integrated LNA. There are two modes. The high-gain mode has typically 21dB gain. But the low-gain mode has typically -6dB gain. Now what's up with the low-gain? Does that mean it's actually making the signal weaker? If that's true, what is the purpose? AI: In low gain, the low noise amplifier can deal with much bigger signals so, this allows the designer to deal with a wide dynamic range of potential signal powers coming from the antenna. For instance the input IP3 in low gain mode is typically 17 dBm whereas in high gain mode it's about -1 dBm. This means, that for a big signal (greater than about 0 dBm the low gain mode will progressively become the better option in avoiding non-linearities (harmonics and intermodulation).
H: Equivalent resistance between C and D? I hate to add to the list of equivalent resistance problems, but having browsed through the existing questions here and elsewhere online I am still unable to redraw the following circuit to find the equivalent resistance between points C and D. All the resistors have equal resistance R. Can this be solved by redrawing and applying Kirchoff's laws? Or must other techniques be used? AI: I guess this should be a way to redraw the above schematic: $${{R_4 \cdot R_5} \over {R_4 + R_5} } + { {(R_2 + R_3)\cdot R_1} \over R_1 + R_2 + R_3} = {R^2 \over 2R} + {2R^2 \over 3R} = {7 \over 6} R$$ which goes in parallel with R6, so: $$({7 \over 6}R^2) / ({13 \over 6}R) = {7 \over 13}R$$ should be the equivalent resistance.
H: Power N-Channel Mosfet as a Switch I just want to use a BJT transistor to act as a interface between a microcontroller and a MOSFET. I need to turn on and off an N-Channel MOSFET for controlling a much higher current on high voltage. A power N-channel mosfet, as far as I know, requires at least 10V Gate to Source voltage to achieve the minimum On resistance. I have 12V on my board so I decided to use that 12V for turning the MOSFET on. The schematic is shown below.It seems that this BJT won't switch on that way? How can I use NPN Transistor to turn on and off the MOSFET without inverting the signal? Thanks! AI: Impossible. You have to use one more PNP transistor for that. You cannot turn N-MOSFET only by NPN transistor without inverting input signal. This is modified circuit that should work. simulate this circuit – Schematic created using CircuitLab When the input signal is 0V: Q2 is off, base of Q1 is pulled high, so Q1 is off. And M1 is pulled low, so mosfet is off. When the input signal is 5V: Q2 is on, base of Q1 is pulled low, so Q1 is on. And M1 is pulled high, so mosfet is on. Problem with your original circuit is that Q31 can be on only when emitter has lower voltage than base. But when you send 5V to input, Q31 is open and emitter is pulled to 12V and so turns Q31 off. Your circuit cannot work.
H: Simple circuit with transistor using Raspberry Pi I'm trying to use a Raspberry Pi to control a set of 4 LEDs. I'd like to control the LEDs in software by using a GPIO pin. Here is the schematic I've come up with... (please ignore the wire in the top right corner of the diagram, the transistor should make or break the circuit) I'll be using a 9V battery to power 4 LEDs in series. Each LED has a voltage drop of 2V and a current rating of 20mA. Therefore my resistor should have the value of 50 Ohms (1V / 20 x 10^-3A). The diagram has an incorrect resistor value shown. My problem is that I'm not sure of what will happen when I connect the Pi's pin to the base of the transistor. Will it mean that the pin becomes connected to the 9V circuit and will draw 20mA after I set the pin to high? Or does the pins voltage have its own influence? (the pin operates at 3.3V). There is probably a better way to do this but I'm trying to learn about transistors so I don't want to remove the transistor. AI: This is how you should connect the NPN transistor: R_GPIO must limit base current to about ten times LED current divided by transistor gain. Assuming a gain of 150 at the specified collector current: $$R_{GPIO} = {{3.3 V - 0.7 V} \over {10 \cdot {20 mA \over 150}}} \approx 2 k$$
H: Is it possible to redirect print streams to debugger in Atmel system? Is it possible to configure stderr and/or stdout to make it such that when a printf() is called the string is displayed in the debug console in Atmel Studio? I do know that it is possible to set everything up so that printf() uses the UART or an LCD or something else. I have seen hints of this having been possible with AVR32 chips and JTAGICE2 debuggers, but that was back when it was AVR studio and AVR32 Studio as separate IDE's, toolchains, debugging hardware, etc. For the sake of specificity, I would like to do this with an AVR 8-bit chip and an ATMEL ICE (the successor to the JTAGICE3) debugger. I am working with PDI, but an alternative communication protocol (such as JTAG) would be acceptable also. AI: You can output messages and values to the output window with Atmel Studio 7 (it might work with other versions but I am running version 7.0.1006 and using Atmel ICE) by doing this: Create a normal breakpoint where you want the output. Right-click on the breakpoint and select "Actions". A window will be displayed under the breakpoint line, if the "Actions" checkbox is not already checked, check it by clicking on the checkbox, but it should be because of step 2. There is a textbox labeled "Log a message to Output Window", type in whatever you want to output. This works with plain text if you just want to display something like "entered function a" or just put whatever value you want in brackets. An example of outputting a variable value: "The value of x is {x}", where x is the variable name. If you don't want the execution to stop check "Continue execution" and the program will not actually stop at the breakpoint (like it normally would). Also, watch out for optimization! You might need to completely turn it off for your debug build to see certain values or states.
H: Sending a divided clock through a non-dedicated clock pin? I'm moderately new to FPGA's, and right now I'm working on code to interface with a DAC. I'm using this PMOD DAC , and a Nexys 4 DDR fpga. Right now, I'm connecting them through the JB PMOD header. The DAC requires a clock pulse (I'm sending in a 50MHz one, which I've divided from the FPGAs 100MHz clk), which I'm sending in through pin 4, following the reference manual. However, once I try to synthesize and implement it, I get an error. "Poor placement for routing between an IO pin and BUFG. If this sub-optimal condition is acceptable for this design, you may use the CLOCK_DEDICATED_ROUTE constraint in the .XDC file to demote this message to a warning. However, the use of this override is highly discouraged. These examples can be used directly in the .XDC file to override this clock rule. " There are two possible problems: The fpga doesn't like that I'm outputting a clock signal through this PMOD pin There may be an issue with Mset_enable, but it has nothing to do with a clock (right now it's an input assigned to one of the on-board buttons), and I see no reason why there should be difficulty placing it. My question is: which problem is it, and should I go ahead and use this workaround? Mset code: module tuning_word_set( input [3:0]data_in, input clk, input Mset_enable, output reg sin_LUT_rst, output reg [3:0]data_out ); //if enabled, M will change to data_in, otherwise it will stay the same always @* begin if (Mset_enable) begin data_out <= data_in; sin_LUT_rst <= 1'b1; end else data_out <= data_out; sin_LUT_rst <= 1'b0; end endmodule AI: What you can try, rather than dividing the clock, is just creating a 50 MHz clock in the constraints file, and tying that the output pin. This will get you started on the right track: http://www.xilinx.com/support/answers/62488.html
H: What kind of component lets me measure distance in a small space? I have bought a beautiful old radio, which I'm trying to convert into a DAB radio (there's no future for FM radio in my country). Of course I could just use a DAB receiver, plug it into the old radio's speakers, and be done, but there's no fun in that. Instead, I want to be able to operate the old radio, turning its knobs and pressing its buttons. So that when I turn the tuning knob, I'm switching between DAB stations instead of tuning between FM frequencies. The first step (at which I'm stuck) is to translate the position of the tuning knob (A) into a digital value I can use to control a DAB receiver. I'm a programmer, with only limited experience in electronics, so I'm not sure how to best accomplish this. [] Originally, the radio displays the frequency with a vertical bar (B) that travels over a frequency band (C). My idea is to attach something to that bar (or to the carriage that the bar is attached to), and measure the distance (D) between the bar (B) and the inside wall of the radio. If I could do that with some electronic component, I could get a signal that I could translate into a number that again could be used to select a DAB station. The problem is that space inside the radio is limited. Images This image shows a horisontal, round bar on which the frequency bar moves along. When the radio is fully assembled, the speakers are located on top of this, leaving about 1cm space between the horisontal bar and the speakers. It must also go clear of two lightbulbs (for illuminating the frequency scale). The frequency bar is sandwiched between the glass dial scale, and a metal plate. Here's what it looks like from above. Here's the back of the tuning knob and its shaft. As can be seen, there's not too much space here. The knob is dual shaft - the outer ring is the speaker selector. Here is a birds-eye view of the interiors, when taken out of the enclosing cabinet. And a close-up of the variable capacitor's shaft, as per Transistor's request. Oh, and here's the schematics, if there are any Norwegian speaking radio enthusiasts out there. Here are the options I have investigated/tried so far: An ultrasonic rangefinder (like http://letsmakerobots.com/node/30209) These are too big to fit. Also, I doubt I would get any sensible signal from it, as there are many parts inside the radio that would reflect the ultrasonic waves. The same goes for infrared rangefinders. A slide potentiometer (like these: http://www.potentiometers.com/select_slide.cfm) The ones I have found are difficult to fit, and there are not many that are longer than 10cm. The radio is ~50cm wide, so that would leave most of the band unused. A SoftPot (like https://www.sparkfun.com/products/8681) These works by reacting to mechanical pressure somewhere on the surface. They come with an "actuator", which is basically a screw with a round, plastic tip. This was promising - I attached the actuator to the part moving the bar, and let it travel along the softpot membrane. However, the tuning knob is carefully designed so that when the bar reaches one end of the scale, it stops moving, because the wire (E) that drives it will start slipping on the tuning knob to avoid damage. The pressure needed to activate the softpot was enough to cause too much friction, so that the wire was slipping, and the bar did not move. A string potentiometer (like these: http://www.unimeasure.com/). I could attach the string to the bar, and the stringpot housing to the inside wall. However, most stringpots I have found seem to be meant for heavy industrial use, and are priced and dimensioned accordingly. The added friction could also be an issue. What other options do I have? AI: You could consider making your own linear pot using a piece of nichrome wire and a sliding contact, preferably precious metal (cannibalize it out of something). A straight 40cm piece of AWG 30 Nichrome wire would have a resistance of about 8 or 9 ohms. If you put 100mV across it (use a voltage divider from your ADC reference and an op-amp buffer), that's only about 11mA. Then amplify the wiper voltage with a decent op-amp and you're done. Linearity should be excellent (in the 0.1% class most likely).