text
stringlengths
83
79.5k
H: Problem in overflow detection in signed 2's complement 3-bit numbers According to this page, and other similar ones, the rules for detecting overflow when adding signed binary numbers in 2's complement form are the following: If the sum of two positive numbers yields a negative result, the sum has overflowed. If the sum of two negative numbers yields a positive result, the sum has overflowed. Otherwise, the sum has not overflowed. This, however, appears not to work for 3-bit signed numbers. For example consider adding -2 and -2, +2 is 010 and it's 2's complement is then 110. Then -2+-2 = 110+110 = 1100. When we discard the carry, the sign of the number is negative, because -4 can not be represented as a 3-bit signed number. I am trying to optimize a design for a school assignment and currently the best I can do is just handle the case where it gets to 100 (I just turn the overflow flag on if this happens). Any help is much appreciated. AI: I did not go to the website to read the text of the rules you listed, but I think there is a semantic error somewhere. First, your assertion that -4 cannot be represented in 2-s complement is incorrect. The range of 3 bit 2's complement numbers is indeed -4 (100)... 3 (011). Second, the detection of overflow is based on extending the carry bit. For adding numbers with the same sign, as long as the extra/ MSB carry bit is the same as the original MSB, an overflow has not occurred....For example -2 (110) -2 (110) -4 (1100) No overflow -2 (110) -3 (101) -5 (1011) overflow
H: IP Camera IC (PAL to Ethernet) I have a design problem to capture CCIR/PAL video from the camera that is available and send it over ethernet. Need to come up with my own printed circuit board design, having no prior experience in video processing. Looking around for IP cameras over the internet, I saw an IP camera for only 35$. So I thought, there must be cheap ICs readily available that do this job (so no need to dive into FPGA/MCU software solutions for this task). However I cannot find any IC specifically for this. Either I don't know the right terminology to search for it or there is no easy solution without writing my own embedded software that samples and compresses video and sends it through UDP or TCP. If its the second one, then I think 35$ product including the cheap camera is very competitive. I have no big price or competitiveness concern, it is only a thought. RTD1186 and RTD1185 might be solution examples to what I am asking; but I am not sure; since Realtek does not put much info on their website. AI: I have just taken apart a low cost IP camera made by Dahau and it appears to be based on a SoC made by Ambarella, part number S2L-M-A1-RH. Details are here. The SoC includes just about everything you need to make an IP camera: ARM A9 processor camera front end video processor AES cryto engine H.264 video encoder Ethernet MAC Most of these IP cameras run a version of Linux, and a Linux SDK is availabel for this SoC. From past experience of trying to use parts like this, unless you are prepared to place an order for 100,000 the manufacturer probably won't be interested in talking to you.
H: RTC power supply The main task is to power STM32L476 RTC directly from li-po battery (3,7V-4,2V). Unfortunately I don't have enough space for supercap or extra battery. The RTC needs only about 450 nA and has quite wide voltage range from 1,5V to 3,6V. What is the best option to power this thing? The only efficient idea that come to my mind is LDO. Does the LDO has any minimum current? AI: A 3.3 V LDO doesn't sound all that bad. Basically, the 450 nA will be drained directly from the battery, without any advantage gained by the battery having a higher voltage. When the battery is at 4.2 V, then the efficiency is 79%. When the battery is at 3.7 V, the efficiency is 89%. That doesn't sound too bad for something so very low power in the first place.
H: Purpose of a spiral/wound copper wire in a DC motor? I have recently torn down the air blower of a car (for cleaning). I was wondering what is the name (and purpose) of the parts shown on the picture : It looks like a copper wire wrapped around a (magnetic?) cylinder. Is it a solenoid? I don't think it's brushes (which are above head of first arrow). This is not specific to my car, I have googled for other car blower pictures and this seems to be common. Also (another question) is there a reason for most car manufacturers to use brushed motors instead of brushless ones for air blowers? It create tons of black dust (as shown on the picture) and they wear pretty quickly. AI: That looks like a Behr blower motor as used in BMW etc. The coils are inductors (wire wrapped around a ferrite rod core) for EMI filtering so the fan motor won't muck up the AM radio reception etc. Brushed motors are used because they are cheaper (including the controller). Life is not really a big deal in cars- figure if the average speed is 30mph and the car lasts 60,000 miles for the original owner, that's only 2000 hours of operation, and the fan may not be used for all of that. My experience is that they last around 100,000 km (60,000 miles) on average.
H: Earth Grounding an HV Power Supply I'm using a Matsusada HV Power supply up to 20 kV. The manual mentioned that the ground terminal of the chassis should be connected to earth. And I had a few questions What are the best, or at least acceptable, ways to make this connection. Would it be OK to connect it to the earth ground in the power outlet? If so, is there some sort of adapter or tool that makes it safe to access the earth ground from the power outlet? I'm wary of poking around outlets. Is there a reason why the user manual instructs the users to make the earth ground connection? Doesn't the instrument have access to earth ground through the power outlet via the AC power cord? The only reason I can think of is that they don't trust all buildings to be connected properly. Thanks AI: I agree with @ThePhoton overall. The earth pin in the IEC connector should be an extremely low resistance path to the chassis ground stud. Any other arrangement would be irresponsible, dangerous, and probably illegal. How you connect the supplemental earth depends on your lab setup. A permanent, sealed mechanical bond (nut, bolt, and washers) between cleaned surfaces (buffed and cleaned with alcohol) is ideal. That level of rigor is probably not necessary in this application. The scenario @ThePhoton described will happen somewhere eventually, but it's still an unlikely event. If your power supply is sitting on a shelf and not moving, there is about zero probability that the IEC connector will fall out. For short term use, the earth pin of a socket is safe to use because it connects to the dirt outside. (Unless your building is heinously, illegally, dangerously miswired) Just stay away from the live and neutral. Put some insulating tape over those sockets. The screws that hold outlet cover plates on typically screw into the junction box, which is earthed. I'm not convinced that's a highly reliable connection, but you could try using that screw to attach a ring terminal connector to earth via the junction box. If you're going to install the power supply permanently or semi-permanently, you need to know with confidence that that connection is robust.
H: maximum distance between IC power pins and decoupling capacitor Since I introduced decoupling caps to my design, my auto-routing progress has dropped. Currently my PCB track width is set between 0.24mm and 0.26mm (I'm trying to aim for 0.26mm depending on how routing goes). What I want to know is what is the maximum distance allowed between an IC VCC/GND pins and the decoupling cap before performance of the IC degrades? I'm told to keep the capacitor as close to the IC as possible but when doing a single-sided board with the fewest jumper wires possible, keeping it ridiculously close is impossible. AI: Nobody can specify a maximum distance! Even if in the datasheet 2mm is mentioned, doesn't that mean, that the chip won't work with 3mm. You won't even recognize a performance degradation or something like that in most cases. The longer the trace, the more will your supply drop. Currents are often not high, so thicker traces doesn't solve your problem sometimes. A bad design is often not that good in EMI measurements, if you have the possibility for a test. Actually you can guess a little bit... Maybe you have output rise and fall times for your IC, you could calculate the resulting frequency and calculate the impedance of the trace. But again, nobody will tell you a maximum impedance, so do best effort. However, you wrote you are designing a single layer board. Most of this boards i saw had the same mistakes: Everyone places a capacitor directly on a VCC pin, but the current comes back through the GND pin of the IC. So don't look for the nearest space for 100nF, look for the smallest current loop through the VCC AND GND pins. Standard logic devices don't have a very good pinout in my cases, because the supply pins are far from eachother. If you aren't making your PCBs at home, consider to make more layers. More layers aren't soooo expensive this time and you get an much better design.
H: Do BLDC and Induction motors have the same efficiency vs. load relation? In induction motor, the efficiency is maximum for rated load. But for lighter loads, efficiency decreases. I wonder if the same principal applies for BLDC motor also? AI: The efficiency vs. load curves for any types of electric motors will be generally similar. When the motor is turning with no load, there are still some losses, but the output mechanical power is zero. Since zero output divided by any input is zero, the no-load efficiency is always zero. The effect of the no-load losses has some effect at all loads, but the effect varies as the large differences in efficiency below 20% of rated load for different motor ratings in your example curves shows. Since permanent magnet motors have no excitation losses, the no-load losses will probably be less, but not zero. When comparing one type of motor with another, it important to consider the losses in the control system. If the control system is considered, the shape of the curves will be similar, but the overall efficiency will be lower for all types of motor.
H: Changing DB9 Gender: Crossover or Straight? I have a USB-DB9(Male) that needs to communicate with a device that has a DB9(Male) port. Do I connect both DB9(male) ports together using a null modem (crossover) cable or a straight through cable? Pinout of device is here. Pin 2 is Transmit, Pin 3 is Receive. Pinout of USB-RS232 cable, I assume is the same pinout as the one found on computer motherboards. Pin 2 is TX, 3 is RX. AI: The only way to be sure is to measure the voltage on pins 2 and 3 with a multimeter while the device is powered up, but otherwise idle. The pin that is functioning as an output (regardless of whether it is called "Transmit" or "Receive") will have a definite negative bias on it (anywhere from -5V to -12V typically), while the pin that is functioning as an input will be close to 0V. Connect the input pin of the device to pin 2 of the PC (or USB to RS-232 adapter), and connect the output pin to pin 3. After looking at Table 9 in the manual, I think that the description of the two cables strongly hints that the device is DCE, which means that you'll need a straight-through cable.
H: SMT Package Type 30mm x 30mm 80 pin quad flat no-lead package I have an IC that is 30mm x 30mm x 2.9 mm quad flat package with 80 castellated pins. You can read more about it here: http://simcom.ee/modules/wcdma-hspa/sim5320/ I would like to mount on a breadboard for prototyping, but every adapter I have found online (e.g. https://www.amazon.com/SUNKEE-16-80-adapter-Board-plate/dp/B00AX50Y2G) are all too small. Are there any adapters that can fit this size or do I have to get a custom made PCB made? AI: The module has an uncommon shape, which is typical for RF modules like that. Unless the manufacturers of the module provide a breakout board, I doubt that you will be able to find an off-the shelf adapter. Furthermore, this is not simply a case of building a SMT-to-breadboard adapter. This module outputs an RF signal for GSM and GPS. You will not be able to run these signals through a breadboard. Manufacturers of modules like that usually provide development boards. Look for that.
H: Series connected MOSFETs effect on the channel length I understand that connecting two NMOS in series for example increases the transistor channel length in concept. But consider having two series connected NMOS with the same channel length "L", can we say that this configuration is equivalent, in power consumption and resistance, to a single NMOS transistor with channel length of "2L"? And how we can calculate the equivalent channel length of N connected NMOS with the same channel length of "L", is there like a formula or equation to get this? Thanks a lot. AI: For two NMOS transistors in series with the gates tied together one transistor is in saturation the other one in the linear region. Based on the simple square law model it can be derived that the equivalent dimensions are $$ \left(\frac{W}{L}\right)_{eq} = \frac{\left(\frac{W}{L}\right)_{1}\left(\frac{W}{L}\right)_{2}}{\left(\frac{W}{L}\right)_{1}+\left(\frac{W}{L}\right)_{2}} $$ Applying this equation repeatedly it can be used for more than two transistors. For two transistors of length L the equivalent length turns out to be 2L if the widths stay the same.
H: Can Printed Circuit Boards or other electronic devices (Integrated Circuits, transistors) be damaged by water if the electricity is turned off? Is it possible that electric or electronic devices be damaged by exposure to water if the current is turned off during their exposure to water and the electricity is switched back on only after the water is completely dried off ? AI: There should no be any damage occurring to the PCB or integrated circuit if it is completely dried off. One possible error is that the PCB or integrated circuit may be powered back on too early and not everything is completely dried. But it can take days/week for the integrated circuit to completely dry off.
H: Inverting amplifier to measure shunt voltage? I've built a motorhome-type vehicle, and wish to perform coulomb counting for the battery bank. I've placed a 100A/75mV shunt between the battery bank negative, and the negative bus (which is also connected to vehicle chassis to reduce wiring cost for alternator charging etc.) simulate this circuit – Schematic created using CircuitLab How can I most accurately measure the mV across the shunt? The value will typically be 1-10 mV, up to 100 mV peak, and will be either positive or negative, depending on the direction of the current. I understand that I may need an inverting amplifier, since the microcontroller will be grounded at the load level, e.g. unable to measure a negative voltage. Or is it sufficient just to use offsetting? I'm new to amplifiers, and worried that I'll spend countless hours trying to get the wrong components to work, particularly having difficulties accurately reading the 1-5mV level. Typical usage, as measured across the shunt with a multimeter: - Charging at 20-30A = (negative) 15-22mV - Constant loads, ventilation etc., 1-2A = 0.75-1.5mV - Peak charging from alternator 50-80A = (negative) 38-60mV The multimeter reads the values quite well/stable. AI: I'd suggest this as prerequisite reading for you. There are several article parts (see end of page two) that cover most of the fundamentals. TI make excellent High and Low side Current monitors INA138 (you need two of these to do bi-directional, see Figure 15 in datasheet), the automotive INA169 (again you need two) and INA210. Configuring amps for low side detection can be more challenging, so I'd recommend using High side measurements (it makes no difference to your system). If you are committed to using Low side detection them you can use the LM3900 Norton opamps to obviate having to use negative supplies. Again here, you'd have to have separate LM3900's for charge discharge sensing (though only a single sense shunt resistor). I'd recommend use of the INA169, it's really easy to use and there is a small PCB version available from Sparkfun for $9.
H: Old used electronics, can I re-use them for other purposes? I have taken apart and had a look at a small dashboard camera which was broken due to the solders on the button going loose and detaching. Upon inspection, I could turn the camera on without it's casing however the screen would just turn white and nothing would happen. I want to use this as a SD card reader since I don't think I will get the camera to work, the problem is that whenever I try to access the SD card it crashes my explorer due to incorrect drivers. Is there anyway I can make this work or should I just throw this junk away? Idea of what the situation looks like: AI: I think it's possible to make this work, but I would throw it away. Buying a new SD card reader is a simpler, cheaper, faster, easier, more reliable solution. Do you really want to reverse engineer that board and spend hours and hours diagnosing and defining the problem? (I wouldn't, but that's just me. I'm sure some people would love this challenge.) That's not even considering the added complexity of the driver issue. You would certainly learn a lot about this technology and the equipment/computer interfaces if you got it to work. You could also learn a lot about other things in the time that you save not fixing it.
H: Back-to-Back Full Page Burst Reads from SDRAM I am designing a microcontroller-based video system, and I am considering using SDRAM (~100MHz) for external frame buffer memory. (My microcontroller has plenty of I/O for the data and address busses and control lines, and can issue synchronous bus-wide signals at 100 MHz.) My question is this: Is it possible to continuously stream data from one or more SDRAM chips using "back-to-back" full page burst reads? (A single full page burst read is 256 words, and I am using one word per pixel. In order to output an entire scanline without interruption, I would need a longer read to accommodate horizontal resolutions greater than 256 pixels.) For example, consider the Alliance AS4C2M32S 2Mx32bit SDRAM. It has four internal banks of 512K words each. I read through the data sheet (more than once), but it is not clear if I can issue a new bank select just before the end of a full page burst read, followed by a new burst read command, so the output data stream will continue without interruption between the end of the first read to the beginning of the next. If I can chain four of these reads together I should be able to read out 1024 words (pixels) in one go; these will be fed directly to a video DAC. I am aware of the complexity of implementing DRAM controllers, and I am also aware of other RAM types (such as dual-ported or VRAM) which are obsolete. This question is not about that. I also realize that many MCUs also come with built-in GPUs (such as on the Raspberry Pi platform); nevertheless, I intend to do this "from scratch" for personal reasons. I simply want to know if anyone with low-level SDRAM experience knows if it is possible to seamlessly chain back-to-back full page burst reads for a continuous stream of data. (I hope to fit in refresh operations during blanking intervals...) AI: I just read through the datasheet (again), and I found the following paragraph (page 6), which I somehow missed before: ... The SDRAM has four internal banks on the same chip and shares part of the internal circuitry to reduce chip area; therefore it restricts the back-to-back activation of the two banks. tRRD(min.) specifies the minimum time required between activating different banks. ... This would seem to mean the answer to my question is no. However, perhaps I can still achieve "continuous, uninterrupted streaming" by using two or more SDRAM chips on the same bus and interleaving reads.
H: Creating a State Diagram and State Table with known output I've been given a word problem, and I must make a state diagram followed by a state table. The problem reads Design a circuit that has two inputs, clk and X and produces output O. X may change every clock cycle and the change happens at the falling edge. The circuit samples the input at every rising clock. O = 1 if the last values of X over the last three cycles were 101. Here is the diagram I made I lost points on it, and my professor said it is supposed to look like this I don't quite understand this. I get that from S3, if X = 1, it goes back to S1, because when X is 1, we have made progress towards 101. However, why does S2 go to S3 when X is 0 and not 1? And why does S3 cycle back to S2 at 0? AI: The key idea is that input 10101 needs to output 1 twice, since 101 appears twice in the input sequence. Your state machine won't notice the second 101 sequence. In the solution, S1 indicates you have a 1, S2 indicates you have 10, S3 indicates you have 101, and S0 indicates you have 0 without a 1 before it. (To answer your question, S3 goes back to S2 when you get a 0, because you now have 10 and are waiting for a 1.) The solution diagram looks like the arrows from S2 to S3 are wrong; you should move from S2 to S3 when you get a 1 and S2 to S0 when you get a 0.
H: What will the output voltage be of an audio usb converter/dac Lately I've started designing an audio amplifier with usb input. After searching I found about T.I. and their usb audio interface-codecs. I am going to talk specifically about the PCM2900C, even thought all of them seem to have a similar dac. In the datasheet it is stated that the output voltage of this dac is 0.6*Vcccl Vpp with 0.5*Vcccl V center voltage. So how these values affect the outputted ac signal? For example if I were to use 3.3V for Vcccl, then with respect to AGNDC what will the Vout voltage be: If the connected computer is not outputting any audio. The min and max voltages when the computer is outputting audio. Also I am wondering how and if these voltages are affected if I were to add coupling capacitors in series with the Vout pin and the load/speaker/amp. (I am reffering to the "typical circuit connection" design as demonstrated in the datasheet of the PCM2900C) AI: \$0.5\cdot Vccci\$, or \$0.5 \times 3.3\$ or \$1.65V\$ \$0.6\cdot Vccci\$ p-p around 1.65V or \$1.65-1.1\$ to \$1.65+1.1\$ or \$0.55V\$ to \$2.75V\$ Adding capacitors will remove the DC offset of \$1.65V\$ making the output \$\pm 1.1V\$
H: why not use integral for averaging inductor current? I am watching the video lesson on state space representation for dc-dc converter here (at 56:41). I am a bit confused about the average inductor current expression there. Why not using the integral to calculate average instead of the one used in the picture? AI: The current is assumed/approximated to be linear over time, and it's quite convenient to calculate the average this way. Of course you can be the badass using integrals to calculate the average in this simple case, and if the function is not linear, you will definitely use integrals.
H: STM32F072 3.3V on UART with Wi-Fi ESP 8226 I do have STM32F072RB microcontroller which works on 5V but also have output power pins on 3.3V. I do have Wi-Fi module (ESP 8226) that works on 3.3V. I can power it with STM easily but what about UART pins? Will they switch themselves to 3.3V and work properly? When not, how do I connect RX and TX busses so they can work properly? AI: Well, I think this is not a question for stack overflow. But I give my opinion anyway. I think you got it wrong. The STM32F072 does not work on a 5V power supply. The power supply must be below 3.6V. Most of the IOs are 5V tolerant, which means that if you apply 5V on them, it will not break the device. So in your case, power the STM32 with a 3V3 power supply and its solves your issue!
H: DDR3 routing: swapping data wires Is it possible to swap wires in data bus between CPU and DDR3 x16 memory for routing optimization? So, for data lines depends on the correct order? For example connect DQ0 on CPU to DQ1 on memory and DQ1 on CPU to DQ0 on memory. Personally I think that this is possible, but I'm not sure. (About address wires it is clear that they cannot be swapped, because address bus is used also as command) AI: Allowed bit and byte swapping for DDR2 and DDR3: Within a byte, DQ signals can be swapped Bytes can be swapped (all signals DQ, DQS, DM have to be swapped) DQ signal should not be swapped between bytes (e.g. DQ0 going into DQS2 group) Also all command and adress signals must not be swapped. LPDDR2 feature a mode register functionnality but it seems that nobody use this. Nevertheless if you want to be able to use it, first data byte should be routed straight. On DDR3 the mode register function is use through address bus, so you don't have to worry. Finally some memory controller require some pins to be fixed for example with Freescale i.MX6. So read datasheet and application notes of your memory controller to be sure what you are allowed to and don't hesitate to contact the manufacturer. Further reading: https://forums.xilinx.com/t5/Memory-Interfaces/possible-to-swap-pin-at-DDR3-memory-side/td-p/164558
H: Power Amplifier Design using MRF136 Currently, I am designing a Power Amplifier to driver an acousto-optic modulator which will be used in an optical experiment. I want to get a 4W Sinusodial Wave, So I Choose the MA-COM's MRF136 as the last stage Power Amplifier. I refer to the datasheets of MRF136. I found that the figure 1 in MRF136's datasheet provides us with the 150MHz test circuit, but with no accurate Capacitor or Inductor Values. For example, the figure 1 in MRF136's datasheet puts that L1 -- 2Turns, 0.29" ID, #18 AWG, 0.10" LONG. [1]How can I calculate the exact value of the Inductor provided in the official test circuit in the datasheet, and purchase the proper RF inductor in the CoilCraft Corporation? [2]Or Should I just put the official test circuit aside, and JUST simulate the S-parements in the Keysight's ADS software to get the proper Inductor's values? [3]I thought that if I could reproduce the curves of the MRF136's official test circuit in the Keysight's ADS software, I can get an better understanding of the Power Amplifier Design. AI: I found that the figure 1 in MRF136's datasheet provides us with the 150MHz test circuit, but with no accurate Capacitor or Inductor Values. Unless I'm missing something, all the capacitor values seem to be stated below the picture. L1 -- 2Turns, 0.29" ID, #18 AWG, 0.10" LONG This will be an air-cored inductor and there are several calculators on-line for getting the inductance value. For instance this calculator tells me that the inductance of L1 is 0.03649 uH: - Note that the coil diameter should take into account the wire gauge hence the figure it needs is internal diameter plus one wire thickness. I didn't do that in the picture above. THIS calculator also comes up with the same value.
H: How to operate Op-Amp[OP07CP] with 0-5v supply? I don't know why I cannot operate Op-Amps! this is my second circuit and I'm trying to make a non-inverting amplifier by an OP07CP. This is my circuit + an example of measured values: simulate this circuit – Schematic created using CircuitLab And when I applied 0v to the +input, I got -5.47v in the output. and again for 17.9mv, I got 1.78v. when I change the supply to 0-5v, I just get an amount around 4.5v or 1.5v. I'm harassed! I expected to get 3153.969mv in the output when I applied 9.1mv but as you can see, I just got -1.15!(when supply is -12 - +12). Why doesn't it work correctly? Can I operate this Op-Amp with 0-3.3v or 0-5v supply? how? AI: Your schematic is wrong. V2 should either be +11.75V or you should flip it. The circuit (with +/-12V-ish supplies) should work. However, you've got an offset pot- it can adjust the input offset to +/-4mV typically. If you crank it all the way down, the input can appear to be 9mV - 4mV = 5mV. Nominal gain is about 350, so this still appears to be off. You might want to parallel R2 with a small capacitor (10nF ceramic, for example) in case the op-amp is oscillating (if you have an oscilloscope, look at the output directly). Leave out the offset pot to begin with- even the cheap version is within 150uV Vos without the pot. Bypass the supplies too, near the op-amp. The OP-07 is an ancient 'precision' op-amp with a distinguished and storied past, however it's not a rail-to-rail input or output or even a single supply op-amp. It is possible to run it from +/-5V (with some care) but not (reliably) from 0/5V.
H: Audio Jack Sound Signal? I was experimenting with my laptop's audio jack port (the headphones one) and something that blew my mind happened. I took an AUX to AUX cable and connected it my laptop (so I could easily have access to cable's pins (or something like that)) and with some wires I connected the right and the left channel with some self-powered speakers. As expected it worked ok. Then I disconnected the left channel but I realized that if I was holding the one end of the left channel cable cable with my one hand and touching the other end with my other hand the sound would play normally! So the sound could pass through my body. Then I called my sister to repeat this process but instead she was holding one end with her hand and when I was touching her the sound would play again! This is my question: How is this possible? How can the sound signal go through 2 human bodies? AI: It's not going through you. According to your drawing, the reason this works is actually the opposite of what you intuit. The audio signal isn't going through your body. It's going through the wire. The output from the PC audio port is AC-coupled which means that it is pushing and pulling on the mobile charges in the wire with an electric field, not direct conduction. More simply, there is a gap between the wire touching the PC's internal amplifier output and the pin of the audio jack where your wire is connected. In order for the amplifier to receive this pushing and pulling on the charges (the audio signal), everyone (PC and Speaker's amplifier's input) has to agree on what zero means (e.g. no pushing or pulling). In physical terms, this is the point where the speaker's diaphragm is in the center (neither pushing or pulling on the air) -- where it sits without power. To provide this "zero" (we call that the reference potential or just "reference"), the second wire is included in the cable. When you only connect the signal wire and not the reference, the amplifier receiving it doesn't actually perceive that the signal is being pushed or pulled on because the entire amplifier moves up and down. It's like being on a perfectly smooth and flat surface while standing on a skateboard and having someone pull you on a rope. All of you translates. But if someone takes you off the skateboard and then pulls on the rope, your feet are stuck and you fall forward (you feel the rope pulling on you relative to your feet). In your audio case, your body contains a giant mass of mobile charges. When you do not touch the reference contact of the audio connector (the area at the back of the TRS plug closest to the plastic overmoulding) it is in contact with air which has almost no mobile charges and it's like standing on the skateboard. When you touch it, you add (electrically) your entire body worth of mobile charges. This is a stable enough reference to allow the amplifier to see the wire moving as distinct from you moving. This effect is the basis of Capacitive Touch Screens. My explanation is an accessible approach to understanding how capacitance in general works. A similar situation to the one you described explains how capacitive touch screens work (as are found on modern smart-phones, like the iPhone). The screen is transmitting the equivalent of an audio signal all the time and you touching the screen adds your body's mobile charges to the picture and distorts the screen's "audio" signal. It is this distortion introduced by your finger that is detected, not your "touching" of the screen. That's why capacitive touch panels don't work well (or at all) with gloves or when your fingers are wet. These conditions change the way your finger distorts the electric field and confuses the detector.
H: What is an electrode? According to wiki, an electrode is an electrical conductor used to make contact with a nonmetallic part of a circuit (e.g. a semiconductor, an electrolyte or a vacuum). Examples of electrodes are the cathode and anode. Given this definition, does this mean that every electric component that has electrodes (i.e. anode or cathode), is a nonmetallic part? And what exactly is the use of an electrode? Is it just used to indicate polarity? Are there other types besides anode or cathode? Can I use electrode as a synonym for pole? I hope someone can explain this without getting too technical. AI: Given this definition, does this mean that every electric component that has electrodes (i.e. anode or cathode), is a nonmetallic part? Under that definition, in order to have electrodes a component must have nonmetallic parts. But it can't be entirely non-metallic since the electrodes are part of the component and they are metal. For example, a vacuum tube is generally made from metal, glass, and empty space (vacuum). It has both metallic and non-metallic components. And what exactly is the use of an electrode? Is it just used to indicate polarity? The electrodes are typically the path for current to flow in and out of the component. The exact metal used might have an effect on the performance of the part, for example in a Schottky diode. The name of the electrode depends on the polarity: the electrode where current flows in to the component is called the anode and the electrode where current flows out is called the cathode. In the case of zener diodes, these definitions are somewhat abused. Are there other types besides anode or cathode? A device with more than two electrodes (for example a transistor or a triode, tetrode, or pentode vacuum tube) necessarily has electrodes that aren't called the anode or cathode. In vacuum tubes, there's typically an anode, a cathode, and one or more grid electrodes. In a transistor there is no anode or cathode, just base, emitter, and collector for BJTs, or gate, drain, and source for MOSFETs. Can I use electrode as a synonym for pole? I'm not aware of any case where that would make sense. We normally talk about magnets having poles, and electronic devices having electrodes, terminals, pins, pads, contacts, leads, etc. if the electrode is dependent on the path for current to flow in and out of the component, then does that mean the cathode could switch terminals of a component if the current is reversed? In principle, this is true. In practice, we choose one terminal of a device to call the cathode and one to call the anode, based on the "normal" use conditions, and we don't change the names when the current direction changes. In the case of zener diodes, we even name the cathode and anode according to what they would be if the part were a rectifier diode, but we normally use a zener with current flowing in to the terminal we call the "cathode".
H: Frequency vs. Amplitude modulation in a circuit? I'm trying to create two circuits that will eventually be added to a larger circuit in a custom PCB. A basic radio transmitter needs to hook into my computer via USB, and transmit data to a rudimentary radio receiver, which connects to the UART of a micro-controller. (As far as I understand, I should be able to send, receive, and translate serial data this way.) I've done quite a bit of research, and even discovered a post on this site asking a similar question here... How exactly are radio waves produced from a current in a circuit itself? I would LIKE to know exactly how RF propagation works, but I'll settle for at least knowing how to build the circuit. I found a site here that was the most helpful... http://www.intuitor.com/resonance/circuits.html But, it leaves some things to be desired. As far as I understand, a capacitor is charged, and used to store and release energy into an inductor. The inductor then builds up its electromagnetic field gradually until all the current is out of the capacitor, then releases the energy stored in the field back to the capacitor in the opposite polarity, forming one wave. Unfortunately, the capacitor and the inductor MUST have a resistance value, so the current will gradually diminish with each wave. Is amplitude of the waves modulated by the amount of current? Frequency is modulated by the frequency of the capacitor release of energy, correct? That would mean that using a capacitor with a lower farad rating should produce a higher frequency? How would one go about keeping a sustained current to the inductor since it's constantly losing current without messing up the cycle? AI: Is amplitude of the waves modulated by the amount of current? The amplitude of the current signal is half of the difference between the maximum and minimum of the current in each cycle of the oscillation. For example, if the current over time is described by the equation $$i(t) = A \sin(\omega{}t+\phi)$$ then A is the amplitude of signal because the current oscillates between +A and -A (and A has units of amps). In the circuit shown, there is nothing modulating the current. Modulation happens when some other signal (like an audio waveform) changes the amplitude (for example) of the current waveform. This would require a more complex circuit than what is shown in your example. Frequency is modulated by the frequency of the capacitor release of energy, correct? Again, your circuit shows no mechanism for modulating the frequency. If you used a variable capacitor and the capacitance was controlled by another signal, that would cause frequency modulation. But it would probably also cause some undesirable parasitic amplitude modulation. To see some typical frequency modulator circuits, you can do a google image search for "frequency modulator" and look at the schematics that are found. That would mean that using a capacitor with a lower farad rating should produce a higher frequency? Generally the resonance of an LC tank circuit like in your example is given by $$\omega_0=\frac{1}{\sqrt{LC}}$$ So the oscillation frequency can be increased by reducing either the capacitance or inductance value. How would one go about keeping a sustained current to the inductor since it's constantly losing current without messing up the cycle? You can use an oscillator circuit. Generally this means adding some kind of amplifier to the circuit to add energy to the waveform as quickly as it is lost to parasitic resistance and to feeding the load.
H: Clock doesn't seem to tick I have been working on a program for class which acts as a stopwatch, but I've been having troubles where it doesn't work. (Only one digit, the first that would be shown on the four digit display is ever used, and it is always at 0.) After putting the whole program through a simulation, and seeing it work correctly there, I can only come to the conclusion that the clock is never changing. As I see it, these are the relevant parts of my code, but feel free to ask for more. From the top module: module stopwatch( [...] input clk, [...] ); From the User Constraint File: ## Clock signal NET "clk" LOC = "E3" | IOSTANDARD = "LVCMOS33"; #Bank = 35, Pin name = IO_L12P_T1_MRCC_35, Sch name = CLK100MHZ #NET "clk" TNM_NET = sys_clk_pin; #TIMESPEC TS_sys_clk_pin = PERIOD sys_clk_pin 100 MHz HIGH 50%; I have four synthesis warnings. WARNING:HDLCompiler:413 - "C:\<REDACTED>\counter2bit.v" Line 31: Result of 3-bit expression is truncated to fit in 2-bit target. WARNING:HDLCompiler:462 - "C:\<REDACTED>\clock_divider_true.v" Line 42: if-condition does not match any sensitivity list edge WARNING:HDLCompiler:413 - "C:\<REDACTED>\count_10.v" Line 37: Result of 5-bit expression is truncated to fit in 4-bit target. WARNING:Xst:2677 - Node <decimal_counter/count3/En_next> of sequential type is unconnected in block <stopwatch>. In counter2bit.v, the truncation is intentional, so long as it's shaving off the MSB; I don't want the third bit anyway. The if condition doesn't match any sensitivity list edge by design; I don't want it updating when that variable does. The truncated 5-bit expression should never happen because it resets when it updates and the value is 4'd9. count3 is the last block in the counter, and I am not planning on using the En_next to enable another counter. AI: What you should do is make a bit of really simple test code to blink an LED at around 1 Hz. If that works, then the clock is working. This code can be incredibly simple: module test(input wire clk, output led) reg [31:0] cnt = 50000000; reg led = 0; always @(posedge clk) begin if (cnt > 0) begin cnt <= cnt - 1; end else begin cnt <= 50000000; led <= ~led; end end endmodule If you can get that to blink and LED, then there must be some other issue with your code. Also, you should really make sure to specify the clock frequency in the UCF file to make sure that the tools will optimize your design correctly for the required clock frequency.
H: What needs or works better with DC than with AC electric? Solar power is becoming more popular, and it seems a lot of people who have solar panels have a DC to AC inverter. It seems ironic to convert DC electric to AC, and then the the AC gets converted back to DC to run a computer. I believe all digital hardware runs on DC power. Do LED light bulbs, LED TVs, LCD TVs, have to convert AC to DC? How about motors. What are the trade offs between AC and DC motors? AI: TVs, PCs and LED bulbs all run off varying DC voltage, although you'll find interestingly enough that the most efficient DC->DC converters are actually DC->AC->DC converters. (See resonant converter) I'll expand a bit more on the motor front. AC induction motors (that run directly off AC mains) have been the standard industrial power source for many many years. They are cheap and very reliable. A large portion of the electricity generated (see below) is used to drive a AC induction motor in one form or another (as a water pump, air pump, conveyor belt and so on). Newer more efficient AC synchronous motors (being used in some electric cars, washing machines and more), have variable-frequency inverters inside them anyway, and so can be fed with AC (which is rectified) or DC with minimal loss in efficiency. DC motors are usually much smaller than both these types by comparison, and even then, they are often used with pulse-width modulated (PWM) drives which would rectify any AC before adjusting the voltage. Induction motor usage stats: 30% of total energy (according to http://www.mpoweruk.com/motorsac.htm) 80% of total mechanical energy (according to http://electrical4u.com/construction-of-three-phase-induction-motor). No actual studies provided by these sites though. I found some similar questions Why is high voltage AC more common than high voltage DC? Why are the power transmission/distribution systems AC and not DC? Neophyte question about AC vs. DC (especially for powering a home)
H: Terminal size to connector size This may be a stupid question, so please bear with me. I have a fuse block with #8-32 and #10-32 screw terminals. What size loop connectors would I order for those, for proper fit? The loop connectors are usually listed in fractions of inch. How do you convert #8 and #10 to loop connector sizes? AI: The search term you need is "tap drill sizes". Look for clearance drill sizes in a table. There will usually be close fit and free fit sizes, which will give you a range of sizes for the ID of your ring terminal. #8 might be 0.1695/0.1770" #10 might be 0.1960/0.2010"
H: What is needed to power a netgear switch with an ATX style PSU? I'm hoping to power a couple 8 port netgear switches from an ATX style PSU. The netgear switches require 12v 1amp DC power. I'm hoping to create a few cables which convert the 2.5mm coaxial power connector from the netgear switch to a molex style connector for the PSU's 12v power. In theory, this sounds relatively easy but I want to be sure I don't need some type of protection for the switches, such as a fuse. Reading about the netgear power adapters it sounds like they have over voltage protection and short circuit protection. Is this something I need to worry about? AI: Let's look at the general case, where you want to apply any kind of power to any kind of device, and the answer, intuitively, is yes, you want to have protection. Overvoltage protection is installed so that, in the event of a failure, if the AC side decides to come visit the DC side, nobody gets hurt, and hopefully nothing else down the line gets destroyed. Short circuits can leverage a massive flow of current, leading to various faults up to and including fires - so we use fuses, PTC resistors, current limiters and various other tricks to prevent adventurous persons with paperclips from losing their eyebrows. The good news is that if you are using a ATX power supply that meets or exceeds the actual specifications for a typical ATX power supply, and hasn't particularly been modified, you almost certainly already have most of the protection you would reasonably need to power said switch. Now, I don't know that I would personally sacrifice all the space an ATX PSU takes up to do this kind of thing for two switches, but I get the feeling you might just be trying to make it work with what you have. In any case, as long as you remember to unplug the thing while you're working on it, this should work just fine, so long as the 12 volt rail can actually support all the load you're adding to it. Without posting numbers, you're the only person who can gauge that.
H: Alternative to AM and FM transmitting for data transmission? So, I need to communicate wirelessly between a micro-controller and my computer. I'm building a radio receiver circuit, and a radio transmitter circuit that works on FM transmission. However, I had an idea. I'm just transmitting binary. The receiver will go into the micro-controller's UART lane. If I'm transmitting serial data, wouldn't it be easier to simply transmit a specific un-modulated frequency that represents a one, then design the circuit to accept no radio transmission as a zero? Then the micro-controller program could simply seek out combinations of one's and zeros that it recognized as bytes? Is there a downside to this that I'm not thinking about? Is there already a name for this kind of rf data transmission? AI: What you describe is called On-Off Keying. It is an extreme version of Amplitude Shift Keying where the carrier is completely off for one value. This is the technical name for what happens when morse code is sent by a radio operator. Wikipedia has more information on the pros and cons: OOK is more spectrally efficient than frequency-shift keying, but more sensitive to noise when using a regenerative receiver
H: Powering a device by USB? I would like to power a device via the 5V USB port on a computer, because I will also be communicating with the computer via the USB data cables. I know that USB ports provide 5V, but from what I've read here. USB 1.0, 2.0, and 3.0 all give variable amperage outputs. The device is supposed to negotiate with to computer to ask for more amperage, and the default is set at 100 mA. I would like my circuit to run on 10 mA. I understand the relationship between amperage and voltage. (I.E. Ohm's Law) Using: $$ R = \frac{5V}{0.01A} = 500\Omega. $$ Perhaps I'm having difficulty understanding the concept, but does this mean I will receive 10 mA regardless of how much is flowing out of the USB port? AI: The power supply doesn't always output its maximum current (unless needed), instead it outputs a particular voltage (in your case 5v) and the load presented by the device determines how much current will be drawn. If there is nothing connected to the output, the current will be zero. However if the load attempts to draw too much current (i.e. more than 100 mA for a USB port that is rated for only 100 mA), then depending on the power supply, the voltage may sink below 5v, or the supply may stop working altogether due to a over-current shut-down mechanism. As you stated, the current is determined ohms law, i.e. the voltage divided by the equivalent resistance of the load. As you already calculated, for a 10 mA current, the equivalent resistance of your load is 500 Ω. So if you replaced your device by a 500 Ω resistor, it would draw 10 mA. Obviously your device is much more complicated than a simple resistor, but that's what it looks like to the power supply. In many cases, the load will not be a fixed amount. A trivial case is two LED's, each drawing 20 mA. One is on steady, and the other is blinking on and off. So the load varies between 20 mA and 40 mA. The supply will automatically adjust for this varying current.
H: Dual output/dual input canceling 12v trigger I have a video projector with two 12V trigger outputs (output impedance: 4.7 kilohms). It is attached to two separate motorized screens. Unfortunately the projector software makes the second trigger additive to the first, but I need them to operate exclusively. So, I think need to construct a gate according to the following truth table: | i1 | i2 | o1 | o2 | |----|----|----|----| | F | F | F | F | | T | F | T | F | | F | T | F | T | | T | T | F | T | I don't remember any of my high school EE, but I can solder, so I would like a recommendation for a simple circuit to accomplish this. Thanks in advance. AI: Take a look at your O2 signal. It is identical to i2, so there is no need to do anything with it. The O1 signal can be realized using a simple inverter and an AND gate. simulate this circuit – Schematic created using CircuitLab If you want to build something like this, you'll probably not want to buy two chips for such a simple job. You can implement the same using NAND gates. A NAND gate with it's inputs connected works as an inverter. We use one of them to replace the inverter, and another to turn the NAND gate back into an AND gate: simulate this circuit If you want to build the circuit you'll find chips with four NAND gates in it as TL7400 (a classic, works with 5V, so you need voltage translation) or the CD4011 which will work fine from a 12V supply.
H: Most efficient generator for charging 12 V batteries I have a Honda GX25 mini 4-stroke engine that I want to built a battery charging generator for 12 V lead acid batteries. My first idea was to use an old car alternator as the generator part, but now I am not so sure. How would I go about selecting the most efficient (and hopefully compact) generator for this motor? Also as a side note, I will need to make an automatic starter for this motor. Would it be possible to combine the starter motor with the generator somehow? AI: As an alternative, in keeping with the light weight, look at model aircraft BLDC motors - specifically outrunners, with a relatively low Kv (RPM/volt). For example if you turn it at 6000rpm and want 12V, you would be looking for 500rpm/volt. This refers to the open-circuit voltage, and you will lose some voltage across the motor's resistance. So if you want a slightly higher open-circuit voltage, pick a motor with slightly less than 500 RPM/volt. There's a huge variety available and it shouldn't be difficult to find a few that match your required power and voltage levels. For reasonable efficiency at the expense of slightly more weight, pick one that's rated for higher current than you expect - it will have a lower winding resistance, and lose less voltage internally. For example, at 1hp (0.746 kw) you might expect 746/12 = 62A, so a motor rated for 70A or more would be worthwhile. Note however that these motors may not be rated for continuous operation, or may have much lower ratings for continuous operation, or the ratings may assume air cooling from a propellor! Again, picking a motor with higher ratings will only help, though you may need to arrange air cooling via a fan fitted to the coupling shaft. Output from such a motor will be 3-phase AC, which you must rectify to DC with a 3-phase rectifier, made from suitable diodes. Power levels and Kv I'm finding for such motors so far don't quite meet your requirements (Kv around 1000, currents up to 40A), but they are fairly close. I'll update with links if I find a suitable motor. EDIT : this motor is the closest so far, with Kv=380 (so producing 12V at 4600rpm) and with a (presumably short term) rating of 90Amps and power output of 2600W. Continuous power rating is not stated, but given the margin, likely to meet your requirements given adequate cooling. Or this motor with specs: RPM: 290kv Max current: 78A Internal resistance: 0.022 ohm comes even closer to the ideal specs. And finally - though it's more expensive - this motor claims continuous power ratings higher than your requirements. It's also interesting that the continuous current is 75% of the short term peak rating, so these motors may need less de-rating than I thought.
H: The Gain reduce due to the input, Why? I'm working with ICL7650S(online datasheet). Today, when I was working with the Op-Amp, I came across to an odd thing. this is my circuit: simulate this circuit – Schematic created using CircuitLab Note that 22uF is for reducing the supply osilation(this question might help you that why I put this cap. also at first I used 100nF and it was getting better and when I changed it to 22uF, the output just 10mv increased(a bit better than earlier)). The problem is that the Gain isn't correct and especially when I reduce the input, the Gain is going to be reduced(due to the input). for example look at this table: This table is an example of my measurements(from above circuit). the gain for this circuit should be (357/1.033)+1=346.59 The question is Why the Gain is reducing due to the input? P.S. A not-completely relevant question. How can I smooth the output of my switching supply as possible as? AI: You're trying to operate this amplifier very close to its negative supply rail, and it really isn't optimized for that. If you want accurate results near 0V input and output, you need to connect the -V supply pin to a source of -5V.
H: Using a regulator or not? We have designed a board for mass production . This board has a few components on it, that works with 3v3 , such as MCU, Wi-Fi, and a few more sensors. We used to have a battery, 3.7v to power the board directly, and later on, we have decided that we must use a regulator, because its more safe . the regulator is AMS1117 After some research, we found out that this regulator(and others) must have 1V more in its input,relative to its output . So, using a battery pack of 3.7v lithium, will not work properly for such regulators(3.3v) , even when its charged with 4.2v . We found out that logically ,connecting the battery directly (no regulator) to the board is much clever, because you can "enjoy" the battery power as long as it is > 3.3v . Our only concern is that we are not using a regulator, and its not healthy . Is that a good thing to do- "professional" ? do you think of more options,such a zener diode instead of a regulator ? AI: If you're asking questions like this, you're not ready for "mass production", whether you wish to be professional or not. You need to look at the supply voltage range of everything, and then see if the range of your battery's voltage from full to flat will work. If not, then you will likely need either a very-low-dropout linear regulator (hint: the AMS1117 isn't), or a type of buck-boost switch-mode regulator that can provide a stable 3.3V supply from a source that can be either above or below the output (i.e. as the battery goes from full to flat). For a linear regulator option, even if the battery voltage drops below the regulator's drop-out voltage (for a 3.3v LDO regulator's output, lets say it's 3.5V, 200mV above output), then you might be able to get away with that - the regulator won't really be in regulation, but depending on your load profile that may or may not matter much. When you say a "3.7 lithium" battery, its range between full to flat will be ~4.2V full, to no less than 3.0V flat. And you don't charge lithium with a constant voltage source. Well, at least not at first - lithium battery charging is at least a 2-stage process, first constant-current, then constant-voltage, using a charge management chip specific to Lithium chemistry. You are not ready for mass production, not even close.
H: PIC - Accessing udata through pointer in another file So I have a list of clockings in my udata in, let's say, clock.c. I have read that udata has to be accessed through a pointer, well okay, fair enough. Above defines.h //Warning! This has to be conform the linkerscript, you can not just increase it. #define CLOCKINGLISTLENGTH 50 #define KEYLENGTH 6 //A clocking consists out of a key, time and in/out (and status) //All the clockings together are the "clockings" list. //These clockings will await to be transmitted. typedef struct { unsigned isActive:1; unsigned needsTransmit:1; unsigned inOut:1; unsigned val1:1; unsigned val2:1; unsigned val3:1; unsigned val4:1; unsigned val5:1; } byte; typedef struct { byte bits; unsigned char key[KEYLENGTH]; unsigned char time[6]; } Clocking; Above clock.c file. #include "defines.h" #pragma udata large_udata Clocking clocking_queue[CLOCKINGLISTLENGTH]; #pragma udata Clocking *clockings = clocking_queue;//Access udata through pointer! In eeprom.c file. #include "defines.h" extern Clocking *clockings; void writeClockingToEEPROM(char clockingIndex){ int eepromIndex = 0; Write_b_eep(eepromIndex,clockings[clockingIndex].key[0]); } So my question is: "How to access udata from another file through a pointer". I simply want to use my clockings_queue (which should be accessed through *clockings pointer) in my EEPROM.c, so that I can store clockings in EEPROM. AI: The compiler doesn't know where clockings is in eeprom.c. There's nothing to tell the compiler that clockings is in clock.c. In order to fix this, move extern Clocking *clocking; from eeprom.c into defines.h. This way, clock.c and eeprom.c know that clockings exists. The declaration of clockings should be in the header. The definition should be in clock.c (as it currently is). Here's a link for an explanation on extern: http://www.geeksforgeeks.org/understanding-extern-keyword-in-c/
H: Why isn't maximum current forced upon a circuit by a power source? I asked a similar question here about this, but I still don't quite understand. Say I grab onto two wires from a standard 120V 20A wall socket. I would fry. I would have 20A at 120 forced on my body. But, when speaking in terms of circuits, as in my linked question, if I have a power supply outputting 100mA maximum at 5v, for some reason my device only gets exactly what it needs? Why is this? Most things flow from an area of high concentration to low concentration, taking the path of least resistence. If you connect two wires to a power supply, why don't the maximum number of electrons want to go through your circuit? If current behaves this way...why do you have to regulate voltage? AI: The "120 V 20 A" rating of a wall outlet means it will supply 120 V and up to 20 A. What is implicit in this spec, and most power supply specs, is that the power supply is considered a voltage source. That means it will try to keep its output voltage constant. It only has this single degree of freedom. The load then decides how much current to draw at that voltage. For example, let's say your overall resistance (mostly due to relatively dry skin where the current enters and leaves your body) is 10 kΩ. You grab the two wires from the 120 V outlet and (120 V)/(10 kΩ) = 12 mA will flow thru you. That's way way less than 20 A, but still enough to kill you. There are power supplies that regulate the current. These are unusual, and will be clearly labeled as such. A constant current supply might be labeled 1 A 50 V. That means it will put out 1 A of current, but can only go up to 50 V. If it would take more than 50 V to get 1 A of current thru the load, the output will sit at 50 V and the current will be below 1 A.
H: Input RC filter design for analog pin of ADC I am implementing ADC filter for AD7705 ( Sigma Delta ADC - Analog Devices Chip ). Input to ADC is constant DC voltage. So, what will be cut-off frequency I should consider to implement RC filter at analog input. If we are designing RC filter, then by assuming C value ( typ 0.1uF ) and cut-off frequency above which we are trying to block signals (ripples) , we can calculate R value. Is this a approach which we consider for filter design? Am I correct in my consideration. So for DC input at ADC pin, what should be ideal or practical cut-off frequency I should consider for designing RC filter. Thank you in advance. AI: No matter how hard you try and convince yourself you have a dc input you'll be incorrect. If it were truly a dc input with no ac content then measuring the value once will be the same value as it is in 100 years time. So, you have to consider how long it might take the signal to settle to "constant" when it is activated. If it is 1 second (say) then you need to consider that an RC filter having a time constant of 1 second is inappropriate. Most people assume the an RC filter settles to 99% in 5 time constants so in reality you might be looking at an RC filter with a cut-off of 5Hz: - Maybe even ten time constants is more appropriate for your desired accuracy - this makes the filter a 10Hz low pass filter.
H: Digital Low-Pass Filter When Oversampling Audio The human ear can hear sounds up to ~ 20KHz. Some ADC's oversample. For example, to capture frequencies up to 20KHz, an ADC converter might sample at 160KHz. The steps are: 1. Filter the audio with an analog low-pass filter. 2. Sample at 160KHz. 3. Digitally filter the audio with a low-pass filter. 4. Downsample to a lower sample rate. I understand that it's difficult to implement low-pass analog filters with sharp cutoffs: required to maximize the available bandwidth without exceeding the Nyquist limit, which would otherwise result in aliasing from folded frequencies. Therefore, I might choose to oversample at 160KHz, with an low-pass analog filter at 20KHz that can rolloff in 30KHz and still be below the Nyquist limit at 80Khz. However, once I've sampled at 160KHz, why would I want to apply a digital low-pass filter before decimation? What are the advantages of this? AI: However, once I've sampled at 160KHz, why would I want to apply a digital low-pass filter before decimation? What are the advantages of this? Aliasing, as a problem is not reserved purely for the analogue world - you also need to low-pass-filter it in the digital domain when decimating. The same rules apply - you need to restrict your bandwidth whenever you sample something in order to avoid aliasing or you will get exactly the same problems of folded spectrums.
H: How to detect remaining capacity in a Lithium-ion battery? I need my device to have multiple power sources, and connect to different power supplies depending on power availability. Each power source is a different rechargeable, Lithium-ion battery like this one. I am wondering what sensors/techniques/devices/etc. exist so I can determine "Battery #1 has 43% charge remaining, while Battery #2 is at 7%. Use Battery #1." Clearly this is possible since all of our 'smart phones' predict with decent accuracy how much charge/capacity remains. Thoughts? AI: The term you're looking for is "gas gauging." This is usually done with dedicated ICs, measuring voltage and current. TI and Linear Tech are couple of the big players.
H: What is the ground-source voltage of this current mirror? In Neamen's microelectronic book, there's a problem using this current mirror There is a 5V DC voltage source above the current source. The reference current is 250 microAmp. The threshold voltage is 1V. The transistors are matching (W/L is 3 for both). The Kn' is 80 microAmp/volts squared. Also, Instead of ground, there's a -5V DC voltage. What is the VGS of the two transistors? from the figure, it seems that the Vgs should be 10V. Since assuming there's no voltage drop acroos the current source, V+ - V- = Vgs. However, getting the Vgs from the drain current equation yields a 2.44V. Which one is corrent and why? EDIT: And no this is not a homework question. AI: To figure out \$V_{GS}\$, all you need is the MOSFET current equation. You have all the parameters you need for that, and you did the calculation correctly: $$I_D = \frac12 k' \frac WL (V_{GS} - V_t)^2$$ $$250 \mathrm{\mu A} = \frac12 \left(80 \mathrm{\frac{\mu A}{V^2}}\right)(3)(V_{GS} - 1 \mathrm V)^2$$ $$V_{GS} \approx 2.44 \mathrm V$$ Now, if you want, you can use KVL to figure out the other voltages in the left branch of the circuit: simulate this circuit – Schematic created using CircuitLab $$5\mathrm{V} - V_{C} - V_{GS} - -5\mathrm{V} = 0$$ where \$V_C\$ is the voltage across the current source. You can plug in your \$V_{GS}\$ to get: $$5\mathrm{V} - V_C - 2.44\mathrm{V} - -5\mathrm{V} = 0$$ $$V_C \approx 7.56\mathrm{V}$$ Normally you don't need to figure out the voltage across the current source for a homework problem. (In real life, you need to make sure you have enough voltage, especially for more complex circuits like a Wilson current mirror.) You might have to find the voltage across the output transistor, since that will let you take channel length modulation into account and determine the error of the mirror.
H: AVR Timer1 OCR1A controls TIMER1_COMPB_vect interrupt! I was struggling with timer interrupts in my project. I couldn't make it work properly. So I decided writing a simple code and I saw a very interesting case. ISR(TIMER1_COMPB_vect) { PORTB ^= (1 << PORTB5); } int main(void) { cli(); // disable global interrupts TCCR1A = 0; // set entire TCCR1A register to 0 TCCR1B = 0; // same for TCCR1B OCR1A = 10000; OCR1B = 100; TCCR1B |= (1 << WGM12); TCCR1B |= (1 << CS10); TCCR1B |= (1 << CS12); TIMSK1 |= (1 << OCIE1A); TIMSK1 |= (1 << OCIE1B); DDRB= 0xFF; #define F_CPU 16000000 sei(); while (1) { } } Here is my code. When I change OCR1B value, nothing happens, but if I change OCR1A value then blinking gets faster. Is there a logical explanation for this? AI: By setting TCCR1B |= (1 << WGM12); you operate the timer in CTC mode counting from 0 up to the value assigned to OCR1A and back to zero again. With the given value of OCR1A = 10000; the timer counts 0-10000, 0-10000... For each 0-10000 count you get a Compare B Match Interrupt when the counter reaches the value of 100 (because you have set OCR1B = 100). By changing OCR1A you essentially change the upper count limit of the timer which means that you also change the duration of each count cycle, so the Compare B Match Interrupt occurs faster. As an example, if you set OCR1A = 5000; the Compare B Match Interrupt occurs twice as fast compared to when OCR1A = 10000; because the timer restarts the count when it reaches 5000 instead of 10000 so the counter period shortens. As a side-note, make sure that you include in your code the interrupt handler functions for all the enabled interrupts (ISR(TIMER1_COMPA_vect) seems to be missing) or resets may occur.
H: Possible to convert dead 18v battery into wall-plug? Not sure how better to title this... But basically, I want to try to convert one of my old ryobi 18v batteries into a wall plug. I want to strip the guts of the battery, attach some components and a heavy duty cable to be able to plug the "battery" into the wall so I can have continuous power to a "cordless" tool. In other words, I want to make a plug-in cord to make any of my cordless tools into a corded tool. I know Ryobi has tools that have both battery and cord hookups. I'm wondering if I could just take the guts from one of those and put it into the old battery casing, so everything plugs in just fine. Question: Is it possible, and is it as simple as creating an AC/DC converter AI: Get a 18 V power supply that is rated at least for the current that the batteries were able to put out (a couple amps minimum, probably). Gut the battery module you have and connect the 18 V wires from the power supply to the battery connector internally. Be really careful to make sure the +18 V goes to where the battery + went, and the power supply return goes to where the battery - went. There is a off chance that it still won't work if this was a "smart" battery module. In that case, there will be some communication going on between the drill and the module. However, this is unlikely in a volume product like this where consumers largely buy on price.
H: SLEEP_MODE_ADC interfering with USART (and beep) On an AVR ATmega328P, once per second I am doing 3 AD conversions immediately following each other with 16x oversampling using SLEEP_MODE_ADC like this: EMPTY_INTERRUPT(ADC_vect); uint16_t getVoltage(uint8_t pin) { ADMUX = (0b11110000 & ADMUX) | pin; uint32_t overValue = 0; for (uint8_t i = 0; i < 16; i++) { sleep_mode(); overValue += ADC; } int16_t mV = (((overValue >> 2) * AREF_MV) >> 12); return mV; } It works fine. At the same time, I am generating a 4 kHz beep with a timer toggling an output pin, and I am reading and writing data over USART. The beep has a short click once per second which looks like this: And every now and then a character sent over USART gets garbled. While I'd expect that the beep timer is put to sleep during AD conversion in order reduce internal noise, I didn't quite expect USART tx/rx to be disturbed. When I don't use sleep mode and do AD conversions like this: // sleep_mode(); ADCSRA |= (1 << ADSC); loop_until_bit_is_clear(ADCSRA, ADSC); the beep is "clean", there are no more USART tx/rx issues, and after some extensive measuring, I am pretty sure the AD conversion results are just as accurate as they are with sleep mode. So I am wondering about two things: Is it expected that USART tx/rx gets disturbed by SLEEP_MODE_ADC? Does sleep mode actually make sense in combination with oversampling? Does some noise maybe not even help to increase accuracy (dithering) or does that apply only to noise coming from the sensors? AI: Is it expected that USART tx/rx gets disturbed by SLEEP_MODE_ADC? Absolutely. Both the USART and timers use clkIO for operation, and this is disabled in ADC Noise Reduction mode. Does sleep mode actually make sense in combination with oversampling? Does some noise maybe not even help to increase accuracy (dithering) or does that apply only to noise coming from the sensors? You actually do want some noise when performing oversampling and decimation as you are, so I don't feel that ANR mode would make sense here; restrict your self to Idle mode (SLEEP_MODE_IDLE) in order to keep the USART and timers alive.
H: How to calculate resistors and capacitors values for analog RC filters? How to calculate resistors and capacitors values for band-pass RC filters based on LM348 operational amplifier? In this example, 3.2KHz, 4.3KHz are standard center frequencies, that are individually adjustable down to 1.2KHz and 1.8KHz. I need calculate values of R40, R38, R54, R52, C29, C28, C27, C26 values for my custom center frequencies, for example 1.8KHz, 2.4KHz Below is Filter frequency response Full schematic: AI: Each of the filters in the examples you posted are awkwardly drawn Multiple Feedback topology band pass filters. When designing a filter, you need to decide on: Type (bandpass, high pass, low pass) Center frequency Order (how quickly the filter rolls off) Shape (butterworth, Chebyshev, Bessel, etc) Topology (how the filter is physically implemented) If you're comfortable with the math of scaling and transforming via the prototype filter, you're good to go now. Otherwise, you can use a filter design tool. One that I've used in the past is from Analog devices: the Analog Filter Wizard. This tool will let you design a filter using all of the above considerations.
H: OK to put board on ESD bag? I keep PCBA's in an ESD bag. When I want to use them, I put them on the bag to avoid crushing any components on the bottom side. Is this any better or worse than a table? AI: I doubt that components that won't get crushed when placed on the bag will get crushed when placed on a table. From the component crushing perspective, either one will be fine. Presumably you're worried about the ESD bag shorting out components on the underside. This is likely not an issue, you can get more information from a related question.
H: Is it reasonable for a potentiometer to have a minimum of 1.3Ω? I purchased a 25Ω linear potentiometer, and found that the minimum resistance is 1.3Ω 0.9Ω. I expected that the minimum would be closer to 0Ω. Is this typical? Should I return the potentiometer as faulty? Is there a spec for this? EDIT: I originally said 1.3Ω, but several people correctly guessed that I did not account for the meter's resistance of 0.4Ω. AI: It's not that unreasonable, but be sure that you're actually measuring the resistance through the rheostat. Short the meter probes and subtract that reading from the minimum resistance reading. The parameter is called "end resistance" or ER, which includes wiper resistance. For example, this Indian made pot has a maximum ER of the greater of 0.1% or 2\$\Omega\$, so it would meet spec. In the distant past, pots sold by Radio Shack were made by a major Taiwan-based company and were actually pretty decent quality-- you might be able to find more detailed specs online.
H: How to regulate 29VAC down to 24VAC? I have a power supply that says it is 24VAC output, but in reality is is giving a steady 29VAC of output. Is this normal? I am powering sprinkler solenoids that say 24VAC. So my question is how can I drop the voltage so I can supply 24VAC. I found some buck converters, but they seem to be DC only or AC input and output DC. I am assuming resistors might work, but an unsure of how to calculate for AC, and wondering if there is maybe a specific device that is made for this purpose? I have done some work in DC, but AC is kinda new territory, so any help/explaination is much appreciated! AI: For a "power supply" that consists of a merely stepdown transformer, and with only a light load attached, that's pretty normal (16% high). When a load is attached (when it is driving the solenoids) the voltage will drop a bit. Even if it was actually 16% high under load, it should not be a problem for the solenoids unless the ambient temperature is extremely high- close to the maximum for the solenoids. It will cause about 1/3 more heating, so if the coils heated to 50°C at room temperature they would heat to closer to 58°C.
H: Variable Timer Circuit w/ Digital Display for Counting Down I would like to make a timer. The timer will have a 7 segment digital display and will work with a microcontroller of some sort. I would like to be able to put in a time (e.g. anywhere between 0 - 10 minutes) and have it countdown from the input time to zero. I would like to display down to the millisecond resolution as well, but this is not crucial. I want the timer to be relatively accurate (up to +- 1 second in ~20 minutes). What kind of circuitry do I need? Will a 555 timer circuit be able to handle this? Need some direction to get started! Please let me know what other information is required! Thank you. So I got: Arduino HS420361K-32 x2 MAX7219 backing thingy 16-Key Keypad I am assuming all of this will work together well. Am I missing anything here? I will be fiddling with the Arduino software for a while until I figure out how I can/want to do this. Any tips would be most welcome =) AI: There are so many possible ways to accomplish this task. You can build from discrete logic chips. Because you want a down-counter, this generally requires two chips per digit for the counting / display section. In addition, you will need several other chips to divide your timebase oscillator down to the count frequency that you want as well as the start - stop circuit. It can be done - it's not hard. It's not even all that tedious. Do note that using discrete logic chips means that you would most likely want to use LED 7-segment displays. You could drive bare LCD glass but that requires lots of logic gates to get the AC drive to the display segments. You can also to this task using a small microcontroller. This type of project would normally require only the microcontroller (one chip) plus whatever timebase oscillator you want to use. Using a small microcontroller allows you to choose whether you want to use LED displays or a small character-based LCD display. The downside of using a microcontroller is that you have to write the firmware that does the application that you want. Also note that this is an upside - you can easily add features that would not be easy (or even possible) with a discrete-logic design. Decide which way you want to go and modify your question accordingly. We'll help you get to the end of the project.
H: measure capacity of a battery after charged I have two AAA rechargeable batteries that claim to have 550Mha capacity. My first question is, how can I measure the Mha and make sure the battery is fully charged? Second question and related somehow to the previous one: I have a charger that reads DC 1.4V -- 80 -100Ma x2 (AAA) so I think it provides 100Mah (my batteries would take about 6 hours to complete charge if I'm not mistaken. Thank you, Matias. AI: You can ensure that the battery receives a full charge by charging it for significantly longer than is (theoretically) required. If your charger puts out 80mA then in 6 hours it will have delivered 480mAh - which may not be enough. You should charge it for around 8 hours to be sure. Another way to tell when the battery has reached full charge is to measure its temperature. While charging, most of the electrical energy is stored chemically (though the chemical reaction when charging NiMH is exothermic, so so some heating will occur with this type of battery). Once the battery reaches full charge it can no longer store energy, so it must dissipate it all as heat. So check the temperature every few minutes, and when it starts to heat up rapidly you know it is charged. To accurately measure the capacity you must discharge the battery until it is 'flat' (0.9V per cell) at a known current. Then multiply the current (in mA) by the time (in hours) to get the capacity in mAh. If you use a resistor the current will gradually decline as the voltage drops. You need to account for this or else the capacity measurement will be inaccurate. So periodically measure the current (or measure voltage across the resistor and calculate the current draw), calculate the capacity for each time segment, then add them all up to get the total. Alternatively you could just use a charger which does it all for you.
H: How to choose suitable battery that will supply enough current? I'm looking for a light-weight 12v battery that will drive 4 DC motors for few seconds burst at stall current (1.4 Amp each; according to datasheet). How do I know which battery will supply enough current? AI: As far as I know, there isn't a battery out there that's directly 12V on its output (not counting chaining together lots of AAs and such). You might want to look into a battery like this 11.1V 2100mAh LiPo. The maximum continuous current draw is the C rating * capacity. In this case, 2C * 2100mAh = 42 Amps, well above what your requirement is. EDIT: Also keep in mind that charging LiPos requires a special charger. Don't use a charger that isn't specifically for LiPos, you could cause an explosion and fire!
H: To what are transistor's "E, B, C" voltages relative to? I've seen \$V_{CE}\$ and \$V_{BE}\$ in context of transistors, where they clearly denote a voltage between two points. But then I also see things such as: From a table in Wikipedia: Applied voltages | B-E junction bias (NPN) | B-C junction bias (NPN) | Mode (NPN) E < B > C | Forward | Forward | Saturation Where do those voltages comes from in a circuit? "\$V_{E-to-what}\$ < \$V_{B-to-what}\$ > \$V_{C-to-what}\$". To my understanding a voltage has to be relative to another point in a circuit, so what are these E, B and C relative to? I've been told I'm missing something. Any ideas? AI: If you are just comparing the voltages it actually doesn't matter what reference potential you are using, as long as you use the same for each of the 3 voltages. Using another reference potential would add a constant offset to all 3 voltages. That woudln't affect the inequaltities.
H: Copper bond wires on a Component We must move from WM8731SEFL to WM8731CSEFL, as the original part is obsolete. I am advised the only difference is the "introduction of copper bond wires". Order Code WM8731LSEFL and WM8731LSELF/R changed to WM8731CLSEFL and WM8731CLSEFL/R to reflect change to copper wire bonding. What is a copper bond wire? Does it refer to the interconnects, the solder pads or something else? Could the change affect RF emissions? AI: Bond wires connect the external pads to the chip die itself. Traditionally they're gold. Presumably some new manufacturing technique allows the use of cheaper copper. I doubt this will be externally detectable; maybe it makes some difference to the expected lifetime and corrosion resistance of the chip.
H: How to use a single supply with an opamp to create a DC amplifier I have a single positive power supply, and I want to amplify a DC input signal. All sources I have seen decouple the input voltage with a capacitor because the input voltage is biased at VCC/2, however this would filter out the DC voltage that I want to amplify. How do I do this? AI: If your input signal ranges from 0V (or less) to some positive value then you should generate a negative supply. This will then set the OPAMP's power rails at suitable voltages for bipolar input and output operation. You can find chips that do this. If the input voltage is purely positive in nature (and can get close to 0V) then use an OPAMP that is "rail-to-rail" on inputs and outputs. If your input signal is from (say) +2V to some higher voltage then virtually any op-amp will do but check the data sheet.
H: Is it safe to clean contacts with an eraser? Today, while I was cleaning a RAM module, I was thinking about this. An eraser is really a easy way to clean gold/copper contacts in such modules. And it is really tempting to do so. I did it a few times with RAMs, network cards, graphic cards and other components. But, my question is: is it safe at all to clean contacts with an eraser? It at least works, since the module was perfectly working fine this time. AI: It all depends on what you mean with safe. To cut it short: if what you are doing is some sort of professional work, the answer is not at all. As @Jodes said in a comment, the right thing to do is to use some specialty chemical made for the job. If, however, you are doing some hobbyist work and you are going to take some risks then your approach may work, but keep in mind that the results may not be very repeatable. There are at least two things that may go wrong with your approach: Electrostatic discharge (ESD) issues Mechanical stress Anytime you rub two objects against each other you have the chance of generating static electric charges on them. This phenomenon is called triboelectric effect. A problem with ESD is that it may not kill your chips rightaway (many chips today have protection circuitry that will handle a small amount of ESD), but it may degrade the performance of your devices (e.g. leakage currents or offset voltages may become permanently worse because of microscopic damages inside the semiconductor device). Therefore a RAM module, to take your example, may still work, but with intermittent failures or glitches (e.g. it may exhibit a higher error rate or it may work reliably only well below its rated maximum speed). Whether your approach will work consistently in this respect will depend, besides sheer luck, on many parameters like ambient humidity, eraser and PCB materials, operator grounding, etc. Mechanical stress is maybe a lesser concern, but it should be taken into account: if the eraser is hard, if you press too much while erasing, if the PCB tracks or pads are too thin, you may risk detaching one of these latter from the PCB and this will ruin your day most likely (repairing a multilayer PCB is not easy, is often expensive and sometimes is not even possible).
H: Applying load when testing battery voltage Why do we need to apply a load to a battery when testing its voltage? I've been testing battery capacity so far using a multimeter and just connecting the probes to the positive and negative side of the battery, which seems not to be correct. Why is this? Why do we need to test batteries with a load and why can't we just simply check voltage with no load? AI: You need to put a load on the battery to see if it has any charge left. Without a load, it may show an acceptable voltage, but when you actually try to use it the voltage drops because the battery is nearly dead. So to see if a battery is really usable you must measure the voltage when the battery is connected to a load. Like this: Dead Battery, no load, 1.4 Volts Dead Battery, load of 100 Ohms, 1.0 Volts Good Battery no load, 1.5 Volts Good Battery, load of 100 Ohms, 1.4 Volts Those numbers are just representative - do NOT use them to actually measure your batteries. Check the unloaded voltage of a good battery, then check the voltage of a good battery under a typical load. Use that typical load to test other batteries. That is to say, figure out the equivalent resistance for the load and use a resistor of that value in your test.
H: Replace 5-pin push button in my laptop I have a 5 pin push button in my laptop, that doesn't work. I have to replace that button, but in my town I don't have any in stock and I can't wait for the delivery from China. How can I replace this button by wiring the pins? I just need to boot the laptop once. I will unsolder this button now. This is a video with the same issue There is a photo of the button: Thank you. AI: The switch is probably a SPST-NO tact switch with an earth connection to the metal top (for ESD protection reasons). The earth connection would be the center connection on the right. If you want to simulate the switch closure you can short either of the two left to either of the two right (top/bottom) connections via a switch. There is no necessity to remove the existing switch unless it is shorted (unlikely). Here is a datasheet from a similar product. Schematic (in the same orientation as your photo):
H: Is hardware handshaking not available when using a USB to RS232 adapter? As far as I understood there is two type of hand shaking. Hardware and software. For hardware handshaking other pins of RS232 connectors used. Does that mean of we us a USB converter we cannot employ hardware flow control? AI: You can if the converter supports the additional RS-232 signals. Whether a converter supports them is at the discretion of the designer of the converter.
H: Unexpected drill hole behind voltage regulator in EAGLE I am designing a PCB in EAGLE and I want to use an 7815 TO-220 voltage regulator. When I check the top or bottom layer mask of my PCB I can see that there is a hole (with no copper I think) behind the voltage regulator. Is this normal or I am using the wrong model? AI: It's hard to tell from the spacing but that hole is likely there so you can screw the regulator to the board, or more likely mechanically attach a heatsink. You can see an example: If there was copper you'd run the risk of connecting the tab to a trace or an internal plane. This wouldn't work so well if your internal layer contained a power plane. You should be able to find a vertical part in Eagle if you prefer the voltage regulator to remain upright.
H: Opto interface with LPC controller I am using heater circuit for bio-medical application ( to achieve 37 degree Celsius for blood samples ). I am using opto-isolator P781F to isolate control circuit ( Micro-controller I/O pins - H1G shown in schematic) and heater. Link for opto datasheet: http://www.farnell.com/datasheets/90914.pdf My schematic is as shown below: H1G= I/O pin from LPC2138 controller Heater = 12V,23 Ohms Silicon Heater But, I am little worried as I have connected controller I/O pin directly to cathode of LED of opto. So, is there any loading issue I can face, what parameter will come in picture to check I/O pin source/sink capacity with OPTO pin. Will this cause any loading or impedance problem? Do I need any buffer circuitry from controller I/O to opto circuit. Thank you in advance. AI: Assuming you're using a 5V-tolerant output in 3-state mode, and that the 5V is only present when 3.3V is, then the voltage should be okay. Current will be about 7mA, which is almost twice the current at which the output voltage is guaranteed to be 400mV. Chances are very good that it will work okay, but a very conservative approach would be to buffer the output with something like a transistor. Given the implied supply sequencing requirement, it would simplify your life and eliminate a worry if you just put the transistor in there (to drive the opto). An MMBT4401 with a few K base resistor would work fine. The 1K resistor is not necessary- but if you wanted to protect the MOSFET gate (against nasties on the 12V bus) by adding a zener it would be useful. Your margin on CTR looks appropriate. Here's a schematic showing Q1/R1 to buffer the output and an optional 2-BJT MOSFET gate driver. Note that the transistor inverts the logic (GPIO high = ON) compared to your original circuit. simulate this circuit – Schematic created using CircuitLab Outside the scope of this question, but you may need to add a driver circuit on the MOSFET side of the opto to make it switch faster. A couple BJTs would do it.
H: How long can 0-10V wires for valve control be? I'm thinking about controlling a valve for fan coil coolant from a distance of approximately 10 meters. The control signal is 0-10V, and the impedance of the regulator is stated to be 100k ohm. Let's say I provide 5V in at one end of this wire. In a typical residential environment, what will be the observed voltage at the other end when loaded with 100k ohm? Will I see ripple of 10s of mV, 100s? Even volts? Let's say the cable goes parallell with 230V wires for many meters, and someone is opeating a household mixer nearby the cable, for example. AI: If you use twisted-pair cable, you should have no problems. I would even go so far as to use shielded twisted-pair cable but I'm an audio guy, so I naturally think that way. If the person who designed the electronics in the valve was even remotely competent, induced AC mains pickup in the control signal should be either filtered or integrated out and would normally not cause any problems. To figure out what the voltage at the end of the wire would be, you need to know the DC resistance of the cable as well as the terminating impedance / resistance. Because you say that the valve controller presents a load of 100k Ohms and you are using copper wire, you can safely assume that the voltage drop in the cable is not measurable and you will see whatever voltage you apply at both ends of the cable. If you are running the control cable parallel to a high-voltage AC Mains cable, using shielded twisted-pair cable should eliminate any possible induced pickup.
H: Interrupt on the XMEGA I have 3 buttons connected to PIN1, PIN3, PIN5 of PORTA of an XMEGA. If pushed they deliver a falling edge. I'm try to generate interrupt using those buttons, I started with one, here is what I have done: void buttonINT(){ // PORTA PORTA.PIN1CTRL = PORT_OPC_PULLUP_gc | PORT_ISC_FALLING_gc; PORTA.INT0MASK = PIN1_bm; PORTA.INTCTRL = PORT_INT0LVL0_bm; PMIC.CTRL = PMIC_LOLVLEN_bm; sei(); } ISR(PORTA_INT0_vect){ printf(" INTERRUPT \n"); } in the main I call buttonINT() once , but I get the message all time printed? Any idea what I'm doing wrong here? AI: You need to clear the interrupt flag in ISR(), something like: PORTA.INT0FLAGS = PIN1_bm; (I have not looked up the exact labels.)
H: In a power supply, the current is a constant or gives whats the component/circuit need ? I everybody, sorry for my english :D . i'm a begginer of electronic and i'm learning a lot of electronic component, voltages, current and so on. My question is about a charger (phone charger for example) or a power supply (if it's comparable). I know that if i use a battery for the motor, this only take the current that need (for example, 200mAh). If i have a 5v and a 500mA phone charger and i use to power a motor. The motor it's going to receive 5V and 500mA (and maybe, blow up (?)) or 5V and the current that they need ? If the 2° answer is the correct, can i suppose that the 500mA is the MAX current output that the phone charger can give? Thank you very much ! AI: Every system that is connected to a power supply draws respective current. 5V and 500mA means that "this power supply provides maximum 500mA and 5V", but it does not mean that your motor will always get 500mA. Long story short, you can say (as you said) "it receives what it needs" in terms of current. On the other hand that does not mean "you don't blow up" your device when a relatively more powerful supply is connected. There must be upper limits on the motor specs, but this generally applies to voltage, because voltage is the only thing that needs to be same in both ouput of the power supply and input of the device (in your case, motor). I tried to explain in a non-scientific terms, since you said you are not very familiar with it.
H: How to change analog sensor signal to appropriate levels for microcontrollers? I have a FUTEK CSG110 amplifier, conditioning a signal provided from a load cell, providing a -3V to 3V signal. I can change this range to my liking, however I will be stuck with a +- voltage representing the compression and tension of the load cell. I want to use the ADC of the Teensy 3.1 to measure this voltage, by modulate the sensor signal accordingly to provide 0 - 3.3V, the operating range of the ADC. I was wondering how I can do this? I am sure there is a clever resistor configuration that will enable this. Thanks, Daniel AI: Yes, you can do this with a resistor divider. We usually think of a resistor divider as multiplying a voltage by some value less than 1, meaning scaling relative to ground. However, a resistor divider can be set up to scale relative to any particular voltage. In your case, you can scale the voltage about the 3.3 V supply instead of about ground. Overall, you want to scale a 6 V range down to a 3 V range, so the divider scale factor needs to be 1/2, meaning the two resistors must be equal. For example, one 10 kΩ resistor to the 3.3 V supply, another to the ±3 V signal, and the two other ends connected to the A/D input. That will load the signal by the sum of the resistors (20 kΩ) and provide a output impedance for driving the A/D by the parallel combinations of the two resistors (5 kΩ). If 5 kΩ is not low enough to drive your A/D, then lower the two resistor values so that each is twice the required impedance. Note that this method requires that the 3.3 V supply is well regulated. That would be the case, for example, if it is driven by a linear regulator from a higher voltage.
H: Schmitt Trigger Oscillator - How does it work? I have seen countless times the following diagram for a Schmitt trigger oscillator. As shown in the picture, the slow-rise wave-form generated by the charging and discharging capacitor is translated to a square wave-form at the output, as a result of the Schmitt trigger. However, I have no idea how the capacitor even charges up in the first place. I don't see any "input voltage" other than the upper and lower bounds on the actual Schmitt trigger. How is the capacitor charging up in the first place? I'm sorry if this is a very dumb question. AI: The schmitt trigger inverter is what generates the signal that charges and discharges the capacitor. Assume the input on the left starts at 0V; the schmitt inverter will therefore output +5V. This +5V will charge Ct via Rt until the voltage crosses the schmitt trigger's rising voltage threshold. At that point, the output will change to low, and start discharging the same capacitor until the schmitt trigger's falling voltage threshold is crossed, starting the cycle over again. Power for the schmitt trigger's output voltage comes from its power supply - marked +5V in the diagram.
H: How to Design Arduino Voltage and Current Sensing Shield I am trying to design an Arduino shield that measures raw voltage and current of a small refrigerator (115V, 60W). I have an Arduino Mega board. To one of the ADC inputs I have connected a (non-split) AC current transformer sensor with an 1M resistor in parallel. The value of the resistor, I have chosen such that voltage range is within approx 0 - 3 V. so I can maximize the ADC precision. This works fine and I manage to sample at 200Hz and although the current is not a sine (not surprising as the load is an AC motor), it seems similar to what I see with a scope. My question is how to also get the voltage. I was thinking of some kind of a voltage divider, but I am reluctant to do it for the 115 V. I am learning how to design these things, so any pointers would be welcome. Also is there a better way to get current readings? I was thinking of using a small resistor and measure the voltage drop, but then I would get into a electrical safety problems and the accuracy doesn't seem to be much better than when using a transformer. AI: You could use a voltage divider, but it will probably be simpler and safer to use a step down transformer to scale the mains voltage down to something the Arduino ADC can read. Make sure that you use an actual bare transformer that outputs an AC waveform and not a switching or rectifying power supply that outputs DC. You can use any transformer that brings the voltage down to a safe level (12 VAC is common for door bells) and then use one voltage divider to scale down to the Arduino's 5 volt peak-to-peak range and another voltage divider to center the output voltage in the middle of the Arduino's 0-5 Volt range. Great info here.. http://openenergymonitor.org/emon/buildingblocks/measuring-voltage-with-an-acac-power-adapter As for measuring current, the typical strategies include... Measuring the output of a current transformer like you are doing. Measuring the voltage across a very low resistance (and high power) shunt resistor. These are typically just a piece of metal with a known resistance. You also often amplify the voltage across the shunt because you you want the smallest resistance (and thus voltage) possible otherwise the shunt will get hot. Using a hall effect sensor to detect the magnetic field generated by the current in the wire. These are all used in practice, although current transformers are probably best for projects like yours because they are simple and do not require actually touching the high voltage wires.
H: Logic level conversion for servos I'm trying to spy on the state of servo communications with a RC receiver and optionally change the output. Unfortunately my controller is 3.3v while the servo logic is ~5v. I'm trying to figure out what the easiest way of doing this is. The circuit I've come up with is as follows: reciever -> translator -> mux (translator/controller) -> translator -> servo Does this make sense and will it maintain a reasonable level of signal integrity? I know the Ardupilot does something similar but as far as I can tell, the whole device operates on 5v so no logic level shifting is needed AI: I would start off by converting your 3.3V signal to 5V. This can be fairly easy, depending on the input impedance of the servo's control line. If you have several lines to convert from 3.3V to 5V, I would look for a single-chip solution. For example, the 74HCT244 is an 8-channel buffer with TTL input thresholds. A logic zero is an input voltage less than 0.8V and a logic one is an input voltage greater than 2.1V. This fits nicely with your 3.3V signals. Note that the level translator chip is powered from the 5V rail. If you have only a few channels (or only one), one simple method is to use a small N-channel MOSFET and pullup resistor as a non-inverting level shifter. You do this by connecting to MOSFET gate to the 3.3V rail, the source goes to your 3.3V signal, the drain goes to a pullup resistor from the 5V rail. Obviously, the 5V signal comes from the drain. simulate this circuit – Schematic created using CircuitLab This is inexpensive and can be very tiny - only two components per channel.
H: Are there any standard testing methods for bare metal code I want to know if bare metal code, especially things like device/peripheral initialization code has any testing methods since there is little to nothing that can go wrong when writing to registers (once you know that all the addresses are mapped correctly). Also this kind of code usually has very few branches/paths when the device is being configured for one single function only, so what kinds of testing would be necessary or applicable here? AI: The first thing I verify on a new board, whether it is using an internal oscillator or an external crystal, is that I have the clock frequency set up correctly. This is important because many of the peripherals, such as UART, SPI, I2C and timers depend on it. The way I verify it is to write a program with a short loop, either in assembly language where I can count the cycles manually, or C as long as you can get a disassembly listing and do the same thing -- and turn an LED on and off. I set up a loop so it executes once a second. I run the code, and check that the LED blinks 60 times in a minute. As far as peripherals go, the best way to check them is to use an oscilloscope if you have one, and look at the RX line for UART, the CLK, MOSI, and chip select lines for SPI, and the SDA and SCL lines for I2C, and check that the lines are toggling and the timing looks correct. If you don't have an oscilloscope, you can put LEDs on these lines, and then enable or disable the peripherals, When disabled, most of the lines will be low (LED off), but some will be high, like the RX lead of the UART (LED on). When the peripheral is enabled, most the LEDs should dim, since the lines will be toggling. By running in a loop (disabled/enabled) it is easier to see the difference between on or dim. For the UART, you can connect the TX line to the RX line as a loop around. You can also connect then to a UART to USB cable, and on the PC real a terminal a program like RealTerm. Besides testing out the interface, this will come in handy for other debugging later. For other pieces of code, I use multiple LEDs as necessary to show that various paths in the code are being executed. If you have the UART working and connected to a PC, you can sprinkle your code with calls to a subroutine to output a message to show what points the program has reached (or use printf if you have the standard C libraries available). But as Vladimir Cravero points out in a comment below, this can slow your code down some (at 115,200 baud, not too much, since one character time is < 10 µs). But in ISRs and other time critical code, just use LEDs. As Al Bundy points out in a comment below, in-circuit debuggers can be useful also, particularly if one can set multiple breakpoints, and even more useful if you can breakpoint on a memory location being changed. Not all debuggers have that feature. However I don't use debuggers a lot unless I have to, for example to look at bits in a peripheral register; or to track down a bug which I can't find by inspection; or to rudimentary code coverage analysis. But in general I like to run programs at their "normal" speed since a lot of issues will usually show up which may not when the program is single-stepped. Most of my programs use interrupts a lot, which interferes with using a debugger.
H: 74HCT244 UART level translator, how would the circuit look? I am building a UART 3.3V to 5V Level translator between a Raspberry Pi and a ATMega328. The 74HCT244 is my choice of translator but I can't find a good example of of hooking it up. Am I right that I should power it with 3.3V(VCC)? Output enabled(Grounded) 3.3v TX on Input 1.This should Output 1 at 3.3V to the ATMega328 that can work with 3.3V logic. 5v RX on Input 2 with Output Enabled. Connecting Output 2 at 3.3V to the RPI. Number 4 to me is the bit I am not certain about. If I run the VCC at 3.3V will the input pins accept voltages above VCC. AI: Instead of the 74HCT744, you could use a chip specially made for this, such as the TI TXB0104. SparkFun makes a convenient breakout board for this chip, priced at only $4, so you don't have to deal with as SMT part. From the SparkFun description: This 4-bit noninverting translator uses two separate configurable power-supply rails. The A port is designed to track VCCA. VCCA accepts any supply voltage from 1.2V to 3.6V. The B port is designed to track VCCB. VCCB accepts any supply voltage from 1.65V to 5.5V. This allows for universal low-voltage bidirectional translation between any of the 1.2-V, 1.5-V, 1.8-V, 2.5-V, 3.3-V, and 5-V voltage nodes. VCCA should not exceed VCCB. We have broken out each pin on this module for you to easily access both the A and B ports. So you want to supply VCCA with 3.3v and VCCB with 5v.
H: Writing to and reading data from Flash using IAP Here you can see functions I'm using to store data into Flash, but I'm getting data erased after power reset, so it's still in RAM not in Flash. #define OFFSET_ADDRESS 0x00030000 #define OFFSET_VERSION 0x00030002 #define OFFSET_SERIAL 0x00030004 void read_from_flash (void) { BYTE i, *pok_add, *pok_ver, *pok_serial_no; pok_add = (BYTE *)OFFSET_ADDRESS; display_address = *pok_add; delay_1_ms(); if ((display_address > MAX_OUTDOOR_DISPLAY_ADDRESS) || (display_address < MIN_OUTDOOR_DISPLAY_ADDRESS)) display_address = UNI_ADDRESS; pok_ver = (BYTE *)OFFSET_VERSION; version = *pok_ver; delay_1_ms(); if (version > MAX_FW_VERSION) version = 0; for (i=0;i<8;i++) { pok_serial_no = (BYTE *)OFFSET_ADDRESS; serial_no[i] = *pok_serial_no++; delay_1_ms(); } for (i=0;i<8;i++) if (serial_no[i] > 9) serial_no[i] = 0; } void write_to_flash (void) { BYTE i; iap_copy_to_flash(&display_address, OFFSET_ADDRESS, 1); delay_1_ms(); iap_copy_to_flash(&version, OFFSET_VERSION, 1); delay_1_ms(); for (i=0;i<8;i++) { iap_copy_to_flash(&serial_no[i], OFFSET_VERSION+i, 1); delay_1_ms(); } } Question is where I'm wrong? Sectors in a LPC178x/177x device http://www.nxp.com/documents/user_manual/UM10470.pdf on page 883. Maybe I don't write and read data properly so it's still located in RAM. AI: Have you seen the IAP flow mentioned in section 37.8 of the data sheet? Make sure you follow all the steps mentioned there. Also your flash can be written to only if the address does not contain any data currently. If it was previously written you need to erase the entire sector and then program it again.Read this application note for an example on IAP for LPC17xx series. You may have a certail level of write protection/security enabled by default.
H: Non-manufacturer microcontroller selection site? I'm looking for a site which I can input my desired micro-controller characteristics. I have found the manufacturer websites...but those will only show their micro-controllers. I.E. there's a site for PICS and a site for AVR, etc. but I'm looking for one that will select possibilities from ALL manufacturers, other than that it's just running around in the dark... AI: Digi-Key has a broad search tool where you can select parts across 30 microcontroller manufacturers. It has ARMs, AVRs, PICs, 8051 derivatives etc. -- over 48,500 individual parts. (Click for a larger view) You can search for core size (8, 16, 32), speed, peripherals, program size, RAM size, EEPROM size, # of I/O pins, and package across all parts.
H: Mechanically damaged capacitor leaked liquid - is it toxic? I have mechanically damaged a capacitor on an old motherboard and it made a PFFFT sound like some gas went out of it and then some liquid leaked. What is that? Is it toxic? I hope that it was not mercury! The capacitor is of a cylindric shape with two wires at bottom, about 7mm in diameter. AI: Yes it's toxic; No it's not mercury; Yes you'll live :) If it was a "wet" capacitor type, then most likely that was sulfuric acid or some organic or inorganic solvent. If it was a solid, then perhaps manganese dioxide. Whatever it was it isn't good for you so don't breath it, take a bath in it, or move to a planet full of it. But... one capacitor one time in your life will not make a difference in your overall health.
H: XC8 Interrupt function qualifier Referring to the XC8 user manual, DS50002053E, section 2.5.10.3 the following is stated: For 8-bit compilers, change any occurrence of the interrupt qualifier e.g., from: void interrupt low_priority myLoIsr (void) to the following: void __interrupt(low_priority) myLoIsr(void) Here's a simple piece of code I wrote: void __interrupt(high_priority) isr_high (void) { // IFC if(INTCON3bits.INT2IF) { TMR0 = TMR1 = timerZero; // Reset the IFA and IFB counts ++ifc; ifa = ifb = 0; LATEbits.LATE0 ^= 1; INTCON3bits.INT2IF = 0; } } And here is a piece of sample code that the XC8 manual offers in section 2.5.10.1: __interrupt(low_priority) void getData (void){ if(TMR0IE && TMR0IF) { TMR0IF = 0; ++tick_count; } } Unfortunately I cannot get the code to compile. Here are some relevant compiler errors: (908) exit status = 1 Minion.c:215: error: (285) no identifier in declaration make2: [build/default/production/Minion.p1] Error 1 make1: * [.build-conf] Error 2 Minion.c:215: error: (1275) only functions may be qualified "interrupt" make: *** [.build-impl] Error 2 Minion.c:215: error: (372) "," expected Minion.c:216: error: (314) ";" expected* Now, the manual is a little bit ambiguous because the section example in 2.5.10.1 shows the interrupt function identifier 'void' immediately prior to the function name, where as section 2.5.10.3 shows the void identifier immediately prior to __interrupt. However, I have tried it both ways with no joy. Someone else asked the same question here, but it was never answered to the OPs satisfaction or mine. If someone has worked out the proper syntax for this, I would appreciate a share! If nobody is able to answer I will go back to the method I know works, which is shown in section 5.9.1 of the manual. AI: You need to make sure you have checked the Use CCI Syntax option and you have #include <xc.h> in all source files. All noted in section 2.3 of the same manual.
H: Using NPN BJT with a P Channel MOSFET to switch 3.3V to 24V simulate this circuit – Schematic created using CircuitLab I have some 3.3V I/O on a PC Board. When an output is switched on, I need to switch the 3.3V output voltage with a +24VDC and provide by a nice screw terminal with a 24V output. On all of my previous PCB plans I have used an N-Type semiconductor and switched the ground - However due to the use case of this output, that isn't an option here. I have drawn the above circuit based on things I've read - and, with simulations in CircuitLab, I believe it works. The problem is, I'm not really sure how it works. Could someone explain to me, what, why, and how, this is working - and suggest if there is a more desirable way to draw this circuit? AI: You have two switches here. Q1 and M1. When your control signal is 0, Q1 is off. This means there is no current flowing through the collector of Q which means there is no current flowing through that entire branch (R3, and D1). This means that the voltage at the gate of M1 is the same voltage as your 24V rail. A PMOS switches when VGS < Vgs(threshold). For the IRF9530, it begins to turn on at -2V. So M1 is off since, Vgs = 0. (Gate is 24V, and Source is 24V). When your control signal goes to 3.3V, it turns Q1 on, and now you have current flowing through R3 and D1. D1 being a zener, will clamp the voltage at the gate to 5.1V. So now you have your source voltage at 24V, and your gate voltage at 5.1. Vgs = 5.1 - 24 = -18.9V. This is enough to turn M1 on, now you have 24V passing through the mosfet and to your load. The datasheet for M1 says that the absolute max voltage at the gate is +/-20V, so you are within spec, but awfully close. If you increase your zener, such that Vgs is not so near your lower threshold it will keep you away from being so close to the -20V limit. You need to be between -4V and -20, so maybe if you aim for -10 and -15 instead, it will put you into a safer region. Some additional notes. The datasheet for the zener, looks to have a Izt of about 50mA. The current through the zener when Q1 switches is 4mA. I can't see what the zener knee current is, but this may not be enough for the zener, or it puts right at the boundary between zener breakdown and reverse bias. So you would need to decrease your resistor. For 50mA, the resistance would be about 378ohms. This also means that the power dissipation through the resisor will be much greater, so you need at least a 1W resistor. Alternatively, you swap the position of the resistor and zener, so that is less heat generated from the resistor, and increase your zener voltage to compensate. Or you can rearrange your circuit slightly like this simulate this circuit – Schematic created using CircuitLab Q1 is arranged as a voltage follower and now you have a constant current source. $$ R = \frac{V_{control}-0.7}{I_{desired}} $$ Since we want 25mA, we plug that into I, and we get R being 104. The power dissipation through the resistor is now $$ P = I^2R = 65mW $$ Vgs when on, is about -14V.
H: LM2623 Regulator I'm implementing a DC/DC regulator and you can find the datasheet in this link. What I'm trying to do it's basically reproduce the application note in order to have Vin = 12V and Vout = 5V 1Amp but I'm not understanding how do I choose the inductor. They are saying the value for the inductor is 4,7uH but it seems very subjective. My very first problem is how do I choose the inductor if I don't know which frequency should I select. It seems I can choose something between (300 kHz to 2 MHz) but how do I know which frequency is the best for my case? Not only that, for the typical application circuit they have put in the datasheet (pag.1) they have a 2 cells for the Vin which I thinks it's something around 7,4V. Can someone help me on this? AI: Here is a great load of TI's buck converters. You can consider this one for example. Input voltage range of 3V to 20V Output voltage range of 0.8V to 17V Output current up to 1A and the best part for you is the Featured tools and software tab where you can define your parameters and this tool calculates the rest for you. In your case with LMR12010: I did not do a great search, you may find a more suitable converter. It is just a demonstration of the WEBENCH tool which can help you creating your design (not available for all component).
H: Function generator as a DC power supply I'm wanting to start my own lab at home so that I can learn things faster than uni teaches (we're not allowed into labs unless we're in our own lab). A friend said that I'd be better off getting a power supply than a function generator, since I'm a first/second year elec student because he thought they'd be cheaper, but there's only about $50 difference between the two. I'm actually wondering whether it would be a good idea to get the Rigol DG-1022, and to supply a dc source, I set the frequency as close to zero as possible. Of course, electricity is dangerous; while I'm cool with blowing an LED or op-amp, I'm not at all happy to assume that a mock dc supply is actually direct current, without first checking if this is safe. Wondering what you think? I'm not just asking about safety, if you've got other comments, I'm happy to hear them. AI: No, that won't work. You could use fixed voltage supplies (AC adapters, wall warts) for most power supply purposes - just understand that your circuits are living dangerously if the supplies aren't current limited, so be careful and double-check your connections - until you can afford an adjustable PSU. One option is to make one of your first projects an adjustable PSU with current limiting (using an LM317 and a heatsink) powered by an AC adaptor, perhaps a 19V one from an old laptop. It'll teach you about proper heatsinking! So I'd still go for the function generator as a first purchase (assuming you already have a multimeter!) but use other arrangements to supply power.
H: Why Do The Wires Inside a Headphone Cable Touch? Can't Wires Not Touch? If you cut open the wire of a pair of headphones, say Apple Earbuds, there are a whole bunch of different cables inside that look (more or less) uninsulated. My understanding of Electronics is that if two uninsulated wires touch, then the circuit will not work. So how come my headphones work fine? AI: ONE of the conductors can be uninsulated. It takes TWO uninsulated wires touching to make a short. In some cases the ground wire is uninsulated to save cost, bulk, and keep the cable as flexible as possible. Some insulation is very thin and looks like the color of bare copper. Your "right headphone" example is most likely one of those. You can check this easily with a ohmmeter or continuity tester. Hold the probes a few mm apart on the wire. If it is insulated, there will be no connection (infinite resistance).
H: Making a Distortion Pedal I was breadboarding a pedal for my guitar using LM386. I read that as long as the gain is too large, the output signal is clipped to produce a distortion effect. So I simply tune up gain pot between pin 1 and 8. But the output is as dirty as a cheap amp with overamplification. What did I do wrong? AI: The "distortion" the LM386 is producing is "clipped" distortion, and probably looks something like this if the output were viewed: That is a "hard" clipping at the tops and bottoms, and we perceive that as a "metal" type of tone. When you overdrive a vacuum-tube amplifier, it also distorts the waveform, but the edges are much more rounded, and thus, pleasant to listen to. Here is some more information on musical distortion, including a blurb about the legendary Ibanez TS9 "tube screamer." The bottom line is, hard clipping will always sound "metal", and soft clipping will sound more pleasant. It is possible to achieve soft-clipping with solid-state electronics, but it's a little more involved than simply overdriving an input. DIYstomboxes have many schematics available for various types of distortions and other effects.
H: Power Supply Router implementation I am looking for the general approach (technique/strategy, componentry used, etc.) to implement what I am calling a power supply router, although perhaps there is a more precise/accurate term for it. By "power supply router" (PSR), what I mean is this: A device, say some PCB (doesn't really matter) will connect to this PSR and expect it to be its power supply, but... The PSR itself is not an actual power supply; it is simply a circuit/component/thing that uses a simple routing algorithm to draw power from one of several actual power supplies at any given time In other words, the router will strive to always provide power (if the device is toggled to be "on" via power button, etc.) from one of many power supplies, and can switch the actual power supply it is using at any point in time (only during operation of course) according to this algorithm And a diagram for illustration: In that diagram Power Supply #1 (PS1), #2, #3, #4 and #n are the actual power supplies (batteries, solar panels, whatever). The device connects to the router, expecting it to supply it with power, but the router will only be connected to one PS at any given time. The algorithm I am looking to implement is very simple: For all the power supplies in the system, find the first supply that isn't "nearly dead" and set it as the current supply Once the current supply is nearly dead, obtain the next non-nearly dead supply and set that as the current supply Only when all power supplies are dead/nerly dead is the system officially out of power I'm sure the "nearly dead" part requires better explanation. Here, the router simply needs to be able to determine whether the given supply is almost dead, perhaps based on the amount of volts or amps its currently outputting, or based on some gas gauging component like what cell phones use to show you that your smart phone is at "2%". I'm wondering if this type of "routing multiple power supplies" need is a well known pattern in EE, with well known solutions? Either way, what are my options here for implementing such a router & routing algorithm as a circuit? What components could be used? AI: Something like this. Of course, I am assuming that all of your supplies are the same voltage; all 12V, or 5V, or something. And this obviously won't work for AC. The way to select precedence, is to make your primary supply the highest voltage (not by much), and then step down a tenth or quarter volt for every other supply. Take into account the diode forward drop. simulate this circuit – Schematic created using CircuitLab
H: Understanding Dividing Voltage I am attempting to get an ESP8266 to read temp from an analog temp sensor (TMP36). The ESP is on the Adafruit HUZZAH ESP8266 breakout. The board has a single analog pin that I believe will allow me to do this. The description of the board says the analog input has a 1.8v max voltage. I will be supplying the TMP36 with 3.3v. Do I need to divide the output of the TMP36 to get a proper reading? How should this division be done? Once it is done, do I also then multiply the reading from the TMP36 by they same amount it was divided? AI: "To use, connect pin 1 (left) to power (between 2.7 and 5.5V), pin 3 (right) to ground, and pin 2 to analog in on your microcontroller. The voltage out is 0V at -50°C and 1.75V at 125°C. The supply voltage can vary but the output stays in the range 0 - 1.75V (very close to your 1.8V max input) so no need for a divider.
H: Distortion in ADC output I am working on Intel Galileo board and using its one ADC pin (A5) and one digital GPIO pin (pin 8). I am switching a relay from GPIO pin and using ULN2003A for isolation and LM60 temperature sensor attached to ADC.I have given power to ULN2003A IC from board only. Now the problem is when GPIO pin is logic 0 (relay is open) ADC output at room temperature is 125 but when GPIO is logic 1 (relay is closed) ADC output increases to 127. To debug it I have done below permutations: -I disconnected relay from isolation IC (ULN2003A) then there is no change in the ourput of ADC (it remains constant). -I have used electro-mechanical relay and solid state relay but having the same problem. -I measured voltage with relay connected when GPIO is logic 0 (relay is open) is 4.95V but it drops down to 4.93 when GPIO is logic 1 (relay is closed). -When a separate power is given to isolation IC (ULN2003A) (from another power source) it works perfectly (ADC output remains constant). Schematic is below: I am unable to understand why ADC output is changing with switching of relay. AI: It looks like the Galileo uses the 5 V power supply as the reference voltage for its ADC (see p. 18 of the schematic). When you close your relay, the extra current draw is causing your 5 V supply voltage to droop by 0.4% according to your measurement. 1 count of an 8-bit ADC is 0.39%. (The ADC is actually a 10-bit part, but maybe the software interface is throwing away two LSBs to give you an 8-bit reading) It looks like the voltage droop is also affecting the ADC reference, and causing 0.4% error in all ADC measurements. To fix this, figure out where the power droop is coming from and improve that part. It could mean getting a new wall wart, or it could just mean using thicker (or shorter) wires somewhere in your system. Or it could mean using separate power supplies for the Galileo board and the relays.
H: I2C SoC explicitly not multimaster While reading the guide of a chip I'm about to take in use (Intel Edison), I noticed the SoC is specifically not supporting multi-master. The SoC is always I2C master, it does not support multimaster mode. However, as far as I know I2C is designed as a multi-master bus. Does this SoC violate the specification or is my understanding of I2C incomplete? Why is it out-of-the-question for this SoC to be multi-master anyway? AI: While multi-master I2C may seem like a superset of single-master I2C, it's perhaps most useful to think of them as though they were separate, since a lone master is allowed to act in ways that would be illegitimate for a bus-sharing master, and such actions can recover easily from failure modes which would be harder to deal with in a bus-sharing system. For an I2C master to coexist with other masters on the same bus, it must include support in hardware and software for such coexistence; this support must, among other things, to include time-out logic to handle the scenario of another master starting communication and then getting reset while SDA and SCK were released (or getting reset while SDA was released and releasing SCK as a consequence of the reset). In that scenario, neither master would be allowed to communicate until both had seen SDA and SCK high for sufficiently long as to conclude that anyone who had held the bus must have "died". Lone-master I2C would not have such an issue, since there will never be any transactions pending it doesn't know about, and time it doesn't want a transaction to be pending it can reset the bus by releasing SCK and SDA (if already asserted), waiting for SCK to go high, and if SDA is low at that time, asserting SCK and restarting the procedure (which may be necessary at most nine times); once SDA and SCK are both high, it can begin the next transaction by asserting SDA. Because of the differences in design between shared-bus and lone-master firmware, most lone-bus applications would require substantial rework to coexist with other bus masters. Since multi-master hardware would be useless without corresponding firmware, I don't see any need for a device which will be used as a lone master to include the hardware necessary for multi-master arbitration. BTW, one thing I've not seen supported in hardware, but which would IMHO be useful, would be a means of performing shared-address multi-slave arbitration. The signalling protocol would make it easy for a I2C device to support a "prepare to read device IDs" write address and a "get next device ID" read addresses. The former command would "activate" the read-ID mode of all devices receiving it; the latter would cause any device whose read-ID mode was active to try to output its ID (dropping out if it lost arbitration to any other device); any device which successfully output its ID would deactivate its read-ID mode. Under such a scheme, a master which output a "prepare to read device IDs" and then issued multiple "read device ID" requests would receive back the IDs of all connected devices in a fashion much smoother and easier than that used by one-wire protocol.
H: PIC18 IO polling I just recently decided to migrate an existing design which was based on Interrupt on change pins to standard IO polling due to some constraints in the part that I was using. I am trying to figure out the worst case time required to poll a GPIO for an event, process the event and exit the loop. I have seen the word "non-blocking" code thrown around various literature and my guess is that is what I would like to implement here. Any pointers or Pseudo-code would be very helpful. The part I am using is PIC18F85K22 and I am running the internal clock at 64MHz(Max). AI: A non blocking call to a portion of code usually implies the request for a resource, such as a printer, or an event in your case. If the printer is busy, or the event has not happened, there are two possibilities: wait for the resource to become available carry on and check after a while the first option is blocking: the code execution is halted in what is called busy waiting, or spooling. The processor can't do anything and that is a waste of power and time. the second way is non blocking: the code executions continues, the processor can do something else, possibly servicing other events, then check back later. The problem is that if your event expires in some way code execution may well not come back in time. Some pseudo c to illustrate an example of busy wait: while(event_1_has_happened == 0); //do nothing int result_1 = service_event_1(); while(event_2_has_happened == 0); //do nothing int result_2 = service_event_2(); //... and so on Non blocking wait: int keep_servicing = 1; while(keep_servicing == 1) { if(event_1_has_happened == 1) { int result_1 = service_event_1(); } if(event_2_has_happened == 1) { int result_2 = service_event_2(); } //... and so on keep_servicing = somefunctionofresults(result_1, result2, ..); } Please note: the above samples assume that the functions event_n_has_happened return immediately whether the event has happened or not. They might be something like checking if an input pin is high or low, or whatever.
H: Transmit an internet connection over wireless My target is to transmit an internet connection (8 Mbit/s) over long range wireless RF (7.7 km) with LOS (Line Of Sight). I live in a country where there is no rules for RF transmission, so i can use anything I want. 3G is not suitable due to price, speed, and reliability concerns.Also i can't use any repeaters in between, nor can i use directional antenna.However, i can use other communication protocols such as xbee.I also would like suggestions on what equipment and protocols to use. I'm looking for suggestions of where to start in putting together such a link. AI: In principle, this is very simple - use wifi with a pair of directional antennas. 10s of kilometers are possible. The details matter. Instead of a wifi card with a built-in antenna, you need a card with a cable connector, followed (possibly) by a booster amplifier, terminating in an antenna. Google on wifi range extenders and similar phrases. While this site does not provide detailed buying recommendations, radiolabs.com is a good place to start for overall ideas.
H: explanation of the LED circuit I just brought a LED board with 220V AC from here http://www.amazon.co.uk/Enjoydeal-Hydroponic-Plant-Light-Panel/dp/B00V5Y2FWG I looked inside the board, and am curious about how so many LED are connected together, from my observation there are total 4 Parallel connections, for each parallel connections, there are 4* 14 = 56 led serial connected. 1. Is the circuit designed like that 2.and if one LED light is dead, then the whole parallel connection will be dead ? 3.is this circuit based on constant voltage or constant current? 4. the led light is about 9 w, so how much light lumen it could draw for these low power consumption led light? AI: Is the circuit designed like that It is reasonable to design a LED lighting circuit like that. and if one LED light is dead, then the whole parallel connection will be dead? The entire series strand would be dead. Which could then lead to cascade failure of the other strands. is this circuit based on constant voltage or constant current? It looks like it uses a capacitive drop power supply. These use the impedance of a capacitor to limit the amount of current into the circuit, so it is CC. the led light is about 9 w, so how much light lumen it could draw for these low power consumption led light? It's not possible to know without a datasheet.
H: Initializing the ESC through microcontroller I have an esc and a brush less dc motor. the connections are given in the pictures. i have written the program for the micrcontroller such that it send 1ms high 19ms low pulses to esc for 5 seconds. then i change the high duration to 2ms and low to 18ms. but nothing happens at the esc not the motor. the motor doesnt rotates. i tried 1.5ms high too, but nothing happens. is there any initialization of esc, so that then pwm is sent to it for rotating the motor. i mean that is there any serial communication involved in it? if yes then what are the instruction? AI: I have used 2 ESCs in a hovercraft project I built. Brushless ESCs expect a calibration at power up. Usually this is achieved by sending the high value pulse (2ms) first, waiting for around 2-3 seconds for the beep, then sending the low value (1ms) pulse, and waiting for another beep (another 2-3 seconds). ESC then identifies these are the values you will send for max and zero speed. After that you are free to speed up from zero. Usually, for most ESCs, the low pulse duration doesn't matter as long as it is around 20ms.
H: How to interface this circuit with a 0-10v Theatrical Lighting Dimmer I'm trying to build a circuit which allows an Arduino to control 6 channels of lighting from an old Strand Act 6 Dimmer. These dimmers have 8-pin DIN connector on them like this specification. Pin 7 is +10V, Pin 8 is GND, and Pins 1-6 control the dimmers on channels 1-6. This is so that a variable resistor can be connected from GND to +10V, with its output going to one of the channels (so no powered controller is needed). However, I'd like to control 6 "variable resistors" from my Arduino using PWM. I'm following this guide. My Arduino outputs PWM on 6 pins, each of which goes through its own filter circuit: which produces a voltage between 0 and 10v at OUT. My question is: this 0-10V is relative to the Arduino's GND and +12V input power. Will simply connecting the OUT of each filter circuit and GND to the corresponding pin on the DIN connector work, or do I have to somehow make the 0-10V OUT correspond to the +10V/GND coming from the dimmer? AI: You should be fine connecting the signals directly, with GND tied to the DIN GND pin. You do not need to connect at all to the +10V coming from the dimmer. The 12V supply (if regulated) should be okay to power the LM324.
H: Simplify using Boolean Algebra I can simplify this using Kmaps, but can't figure out how to using boolean algebra. If anyone could show me the steps I'd really appreciate it. \$F = \bar{x}\bar{y}\bar{z} + xy + x\bar{z}\$ should simplify to: \$F= xy + y\bar{z}\$ AI: Use the identities: \$a+\bar{a} = 1\$ and \$a+1 = 1\$ \$\bar{x}\bar{y}\bar{z}+x\bar{z}+xy\$ \$\bar{x}\bar{y}\bar{z}+x\bar{z}(y+\bar{y})+xy\$ \$\bar{x}\bar{y}\bar{z}+x\bar{z}y+x\bar{z}\bar{y}+xy\$ \$\bar{x}\bar{y}\bar{z}+x\bar{z}\bar{y}+x\bar{z}y+xy\$ \$(\bar{x}+x)\bar{y}\bar{z}+(\bar{z}+1)xy\$ \$\bar{y}\bar{z}+xy\$
H: Will the PIC18F14K50 perform well as a CNC machine micro-processor? The data sheet can be found here. I'm trying to select a micro-controller which will eventually run a Wireless 2D Laser Engraver/3D Printer/CNC Machine. I have very little experience in selecting micro-controllers, and only a rudimentary understanding of the terminology. The micro-controller would need to fit the following requirements: Run on 5V Have at Least One Digital Input (I understand that this is called a UART port.)which will be used to interpret the output signal from a FM wireless receiver outputting digital data. Have at Least 13 I/O pins. 1 to run the object on/off (I.E. CNC bit, Plastic Extruder, Laser.) And 4 pins for each h-bridge which will run stepper motors running the x-y-z axis. Be able to house an approx. 16KB C++ program for interpreting the digital data sent by the radio receiver, and the ability to edit the on-board program. Occupy the smallest amount of board-space by having only the required pins. I believe that the PIC18F14K50 meets these requirements because the datasheet shows (in the order above): Runs on 1.8V to 5.5V. Has an Enhanced Universal Synchronous Asynchronous Receiver Transmitter pin. Has 14 I/O Pins. Can house a 16KB program which is flash memory, I.E. I can rewrite code at will. (I'm not worried about RAM, as I don't store many variables. The program is almost real-time.) Has the minimum amount of pins/board-space to fulfill my needs. (20 Pins.) I believe I have all the terminology correctly assessed, but I'm not sure enough to order the part without some more experienced input. A few things I noted were included on the data-sheet and I'm unclear on how to assess my needs for: CPU Speed EEPROM (I believe this is the precurssor to flash memory...why would I need both?) Comperators 8-Bit Architecture EDIT It's also worth mentioning that I will need to be sending output to all 13 of those parallel ports every 500ms or so, if that effects the specs I would need I would love an explanation as to how it does. AI: This is a broad question, but yes, it seems you found a minimum micro that still does what you specified. However, that may not be a good idea unless this is a volume product. Stuff happens, and unforseen things come up. You may very well wish you had a few more pins or a little more processing power as you get into the project. I'll assume this is a personal one-off project (I told you in your meta question that this sort of thing is important context). I'd get a 33F with lots of ROM and RAM for the main controller, and separate micros for each of the stepper motors. It takes more than a single H bridge to control a stepper. For firmware simplicity, get the same PIC for all four roles. These things are cheap, but having to handle only one motor per PIC will make things easier. The three motor driver PICs would run the same code. They can receive commands from the main controller via a on-board IIC or CAN or something. The 33F series runs on 3.3 V, but the newer ones also have a lot of 5V-tolerant inputs. The things you control inside your own hardware will be fine with 3.3 V. The few things you need to control externally may be OK with 0 to 3.3 V levels. Lots of things use "TTL compatible" input thresholds. If not, add a 3.3 V to 5 V converter chip for the few signals that really require 4 V for a logic high. 500 ms makes no sense for stepper motor control. You will probably re-evaluate the PWM outputs driving the stepper at 10 kHz or more, with PWM frequency at least 25 kHz. That may sound fast, but 100 µs (1/10 kHz) is actually a long time for such a micro to compute what duty cycle to emit next. I'd probably aim for re-computing what to do to a stepper each PWM pulse running at 100 kHz or so.
H: Dual passive low-pass filter I am building a class D amplifier and need to design passive low-pass filters for H-bridge with cut off frequencies at about 400 Hz. However, I am unsure about few things, this is the simplified equivalent circuit: simulate this circuit – Schematic created using CircuitLab Speaker values were measured using an RLC meter set to 100 Hz. Lets say that the signal is coming into the L1 coil. Should I calculate the cut-off frequency only for L1, C1 pair? If L2 is grounded, do L2 and C2 have a noticeable effect on L1, C1 filter? How can I calculate it then? I often see a capacitor in parallel with speaker what exactly is its purpose? I am thinking it is to lower reactive power of the speaker, right? To what \$cos\phi\$ should I lower it, and should I use middle range values for voltage and current? AI: Imagine the speaker coil had a centre tap. If you measured the voltage at the centre-tap relative to 0V it would be 0V with a balanced drive. Therefore you can split the problem in half and imagine a grounded speaker with an impedance of 3.3 ohms and self inductance of 3.86mH. Instead of C1 and C2 where they are, imagine just C1 connected across the half-speaker I have just described. Now proceed to calculate L1. One word of warning - the 7.72mH self inductance of the speaker seems too high for my liking - I'm thinking that your RLC bridge has told you the effective parallel impedance (or maybe you meant 7.72uH)
H: How to test for Bioelecetrical impedance in an body fat analysier I have an interesting project for school. I want to test these body fat machines for consistency between different brands. Ultimately to see if a cheaper brand is as good as an expensive one. http://www.drgrab.com.au/products/handheld-body-fat-analyzer?utm_medium=cpc&utm_source=googlepla&variant=1089145592&gclid=CjwKEAjw96aqBRDNhM6MtJfE-wYSJADiMfgg3iLGVTTN6ccbhbLI3NiCKU8lRDG5K_zzmfkFIP6XshoCU9Lw_wcB http://www.amazon.com/Omron-Monitor-model-HBF-306C-Black/dp/B000FYZMYK These machines look to use Bioelecetrical impedance (http://en.wikipedia.org/wiki/Bioelectrical_impedance_analysis). Is there some way that I can simulate a person holding the handles? e.g. with a resistor between wires connected to handles. I want to compare different machines between different companies to see if they give the same results but to do that I think I need a standard testing rig. I could hold the handles myself on different devices but it seems to change during the day. e.g. the morning is lower and the afternoon higher. Any thoughts? AI: Per the Wikipedia article: The impedance of cellular tissue can be modeled as a resistor (representing the extracellular path) in parallel with a resistor and capacitor in series (representing the intracellular path). Therefore such a network ought to make a reasonable model for your purposes too. You'll need a way to get some ballpark values for these components; one option would be to use your own impedance analyser on some volunteers to figure out what's reasonable. The literature on this sort of measurement probably has plenty of examples too, however.
H: adding parallel Impedance 1 A homework problem tells me to find the equivalent impedance, so I added the series and parallel impedances just like I would a resistor; however, I don't understand how does one go from \$100/(12-16j)\$ to \$3+4j \Omega\$. My book just jumps to that conclusion. Can anyone please explain? AI: To divide by a complex number, use the conjugate of the denominator. like so: $$ \begin{align} {100\over (12 - 16j)} & = {100\over (12 - 16j)} {(12 + 16j)\over (12 + 16j)} \\ \\ & = {(1200 + 1600j)\over (144 + 256)} \\ \\ & = {(1200 + 1600j)\over 400} \\ \\ & = {(3 + 4j)\over 1} \\ \\ \end{align} $$
H: What does "mod 2" mean in these multi-level inverter switching equations? I am working through a paper that discusses the design of a multi-level inverter to connect photovoltaic arrays to the grid. It uses 4 PV modules (only two are shown in the design image below, but it is expandable) along with an H-bridge to produce 31 voltage levels. These are used to produce a modified sine wave with low THD: The scheme for switching Q1 - Q4 uses a reference voltage: V_ref(t) = V_max*sin(wt + delta_ref) The authors given equations for calculating the switch signals, which include "mod 2": I am aware of the usual meaning of "m mod n" as "the remainder left over when m is divided by n". This doesn't seem to work here at all! Can anybody tell me how the given equations are able to generate the switching signals?: AI: It's the modulus of the value with 2. It's used to isolate the individual quantization bits in the digital representation of the wave.
H: How to view SchDoc files online? I have a file witch was designed with "Altium Designer". How could i view this file without needing to install "Altium Designer"? it is preferred to do this with an online app. AI: There isn't any. If you are just viewing a file, you could install Altium Design Viewer.
H: How to reset all flags in 8085 without an arithmetic or logic operation? How can I reset all flags in 8085 without an arithmetic or logic operation? AI: You could use the old hacker/DYI debugger trick of mismatched stack push/pop operations, to directly set the flags register. ; terrible hack loads A and Flags ; regs D and E are used as temporary MVI D, #___ ; move immediate value for A MVI E, #___ ; move immediate value for Flags SZIH-P-C PUSH DE ; temporary POP PSW ; pop A and Flags Similar technique can be used in DIY debugger code, to read the flags: ; read the flags from processor status word ; regs D and E are used as temporary PUSH PSW POP DE ; now E = value of Flags SZIH-P-C It's usually simpler and more direct to just use arithmetic or logic instructions -- such as ANI #FF boolean AND immediate with all ones to re-evaluate Sign, Zero, Parity, Carry flags. This is much better programming practice, since it avoids using up valuable register resources, and is what programmers are accustomed to seeing. Readability is very important in programming and debugging.
H: Use of RFID or suitable alternative to remotely communicate change in system state I have a physical system which is dispersed over about 20-30 metres cubed and at random points within this space there are electronic nodes which have single binary outputs. I want to monitor every time any of these outputs goes high from a central location accepting occational losses. The essential criteria in the solution is that each node communicates wirelessly and utilises the minimum amount of power possible. My question: 1) Is there a way to leverage (hack) RFID technology for this purpose, perhaps powering an active RFID tag for a transmission and reading this transmission from the central location? 2) If this is not possible, what would be the most common solution in such a scenario where power is highly constrained and fault tolerance (acknowledgement / confirmation) is important but not paramount? Would Bluetooth LE be my best bet or a different solution? AI: You can get small FM or AM transmitters that can transmit a message when the output changes state. These can transmit to a central receiver and if the number of transmitters is small and the occurrences of the signals changing state is low you can probably "collect" this information but with the occasional data collision. A more sophisticated regime can be engineered where each transmitter transmits on a certain time frame and therefore collisions (if they happen) will not happen on the next time frame. You would need a small MCU with each transmitter to encode an address and set up a transmit preamble and possibly append a CRC byte. This sort of system works an I developed one for a bunch of food freezers in a warehouse. If the freezer got a little too warm it would transmit that fact to a central receiver and this would alert staff to take some corrective action. Uing RFID is not going to work because the distance the tag has to be from the "reader" is quite small i.e. a few centimetres.
H: Noise on TL074 / TL084 but not on LM324 I made a circuit that modifies a signal so it can be safely read by an ADC. I'm using an op amp to shift the signal +2.5V so I can measure AC. When I do this shift another signal appears. About 40mV amplitude, 8kHz freq. But only if the op amp is TL074 or TL084. If using LM324 I don't get that. I also don't get that signal if I'm not using the +2.5V offset. What could be causing that? Link to schematic AI: The few tens of mV noise is almost surely caused by the 7660, which has an operating frequency of around 10kHz. The PSRR of the TL084 is much worse (14dB) than the LM324.. Have a look at the actual ripple on the negative supply and related layout.
H: How did I manage to not be hurt after accidentally making an electric contact between mains wires? Warning: mains is dangerous, often fatal and should not be messed with. I accidentally touched both live and neutral of a 230 AC mains via dupont wires after a shower (still wet feet). However I merely felt a muscle-interrupting itch rather than any deadly consequence. This shall need luck and I strongly discourage anyone to try this. However, what is the underlying cause that saved me from a deadly shock? AI: HUGE WARNING Toying with mains can cause electrocution, injuries, impairment, fires, damage to property. Protect yourself. Don't work on live mains unless you're qualified to do so and follow all the required safety practices Your mileage may vary greatly depending on a lot of factors which together determine whether you have low enough resistance in the circuit formed by phase wire, your body and either neutral or ground. Your body resistance may vary within some range and that sometimes can make a difference. In this specific case the most likely factor is that the DuPont wires you used were rather thin and also the contact surface between them and the mains was also rather small and that together gave you a rather high resistance circuit so the current was rather low and not enough to cause serious damage. I have a neat story of what once happened in a lower resistance scenario. Long ago I accidentally touched with the same finger both phase and neutral terminals of an electric outlet with cover off and live wires connected. The voltage was 220 volts AC. 10 amperes automatic breaker tripped immediately and I've got a two millimeters deep and about five millimeters wide burn to carbon color on my finger. Automatic breakers take dozens of minutes to trip if current is only slightly higher than cut-off value (20% if I recall correctly - so it'd be 12 amperes for about an hour in this example) and tripping immediately only happens when current is much, much higher than the cut-off value. This time it only went through part of a single finger and burnt skin to carbon color. Should it go through body it would most certainly be fatal and you would not get this answer from me.
H: most basic laser diode driver? Is a simple LM317-based laser diode driver safe for powering a laser diode? https://www.youtube.com/watch?v=iuMngik0GR8 (the diagram is at 1:37) I've been told the the proprietary drivers offer some extra protection from very short spikes (on power up and shutdown) in the current which laser diodes are very sensitive to and might be damaged from. But isn't the LM317 regulator taking care of that itself already? I've been told this from people who actually sell commercial laser diodes so I'm thinking they might be showing some bias. AI: If you have a regulated power supply, a simple resistor will do to take the laser above its threshold point. More complexity can involve a thermistor to lower resistance as temperature rises keeping the laser current at a slightly higher value at higher temperatures. Here is a typical laser characteristic for a device supplied by Hamamatsu: - A more complex circuit would be needed if the laser were to be used as a datacomms device but this would involve only one extra inductor and a capacitor. Going further, to higher powers and several manufacturers make chips that monitor the inbuilt photodiode inside a lot of lasers. They do this to protect the device from excessive currents. Using an LM317 current limiting supply seems reasonable to me but the devil is in the detail and a circuit would be needed to be looked at for greater confidence (plus the data sheet of the laser).
H: BLDC motor without electronic speed control I have an ESC and a brushless DC motor. I am interfacing the ESC to the motor, but I am not getting what I want. Can I directly connect the motor to the battery without taking the ESC into account? AI: No, you can't. A brushless DC motor is very similar to a three phase AC induction motor. You need to use a brushless DC motor controller (ESC) designed to generate the rotating field. A DC motor with brushes can indeed be run directly off of a battery (if it has a permanent magnet field,) as the rotating armature has a commutator to keep the armature developing torque against the fixed motor field. A brushless DC motor is, as I say, more like a three phase AC induction motor, except that the rotor doesn't turn by developing an induced current and magnetic field, rather the rotor has a permanent magnet which is driven by the rotating field. If you just apply DC to one of the 3 windings, all you would do is (possibly) move the rotor to align up with the magnetic field from that one winding, and then the winding would (most likely) burn up since it would appear as a dead short to the battery. Also, most brushless DC motor controllers (ESC) are 'choppers' that limit the current sent to the motor, preventing thermal failure. So if you have a '12V' BLDC motor and connect it directly to a 12V battery (no ESC) not only won't it spin (as mentioned above,) but I'd expect to permanently damage the windings. Since a stationary DC motor generates no back-EMF, the full battery voltage will be continuously passed over one resistive winding, generating lots of problematic heat.
H: "Position measurement diode" identification We have a component laying around our lab that we have been using to take some measurements. Supposedly it reads the position (x/y coordinates) of a laser beam (standard 5 mW red laser pointer) on the central black area. It has worked well enough for us so far, but we would like to use it to test some flight hardware, so we need a datasheet that will give us figures for linearity and bandwith. Here is what we know about it: TP7 is a -15 V supply, TP5 is a +15 V supply, and TP6 is ground. Outputs are TP1-TP4. Two of them output positive and negative intensity, the other two output x and y position. We seem to get better linearity by dividing the x/y channels by the intensity channel. The two chips are quad opamps. The board is about 1 1/8" by 1 5/8". Here is what we would like to know about it: Bandwith (not so important, just needs to be above ~1 kHz) Linearity (very important, we need 1% or better) What do TP8 and TP9 do? Why did whoever set this up leave these unconnected? AI: I think you have an evaluation board from First Sensor. There are links to the chips and information about the eval boards at that link. Yours most resembles the DL100-7. The DL100-7 has 1% accuracy. The layout of the eval boards is very similar, but not identical. I think you may have an older version of the board. If TP8 and TP9 are disconnected, then your module isn't wired like the current eval boards. Maybe you can ask for info on old boards (or find them in an archive on the site) or maybe you should just purchase a new device with known characteristics - it is also entirely possible that First Sensor is a competitor of the company that built your module. A quick look around doesn't find any one else building PSD eval boards in that form factor, though, so it ought to be First Sensor.