text
stringlengths
83
79.5k
H: Circuit component What is this circular component with two parallel lines in it? I've never seen this before AI: It is a symbol for DC Voltage.
H: Contiki: Serial Line IP via SPI I am working on Contiki's cc2530 port (customizing for my custom radio). I do not unserstand how can i make SLIP work with SPI? I understand that SLIP is similar to UART (it is UART without parity, what does this mean?), but how can i use it with SPI? AI: SLIP is a protocol for conveying IP traffic over a serial line; it sits one layer above UART, SPI, etc, in the OSI network stack. SLIP over SPI should be largely the same as SLIP over UART, except for the need to specify who is sending and who is receiving, and potentially a way for the slave to signal when data is available. Your part's datasheet should specify how to do this. Edit: However, it looks like you might be talking about something called 'slip-radio', in which case you're not sending SLIP over SPI: slip-radio talks the cc2530's native protocol over SPI and converts it to SLIP to communicate with your host PC.
H: V/I uppercase/lowercase convention? Is there any standard in industry for using uppercase or lowercase for V and I in circuit diagrams? I ask this because my book seems to switch back and forth between the two without any rhyme or reason and I can't figure out any pattern for why it will choose one way over the other. It also switches back and forth for subscripts. AI: I agree with you that it is important to know the meaning of the different ways for using such symbols. And the same applies also to the voltage-to-current ratios (resitances, impedances). For my opinion the standard is (or should be) as follows: Uppercase (V,I) for DC and rms values Uppercase for ohmic resistors R=V/I Lowercase (v,i) for signals as a function of time: v(t), i(t) Lowercase (v,i) for (small) differential signals available for a certain DC bias point only. Lowercase (r) for differential (dynamic) small-signal resistances r=v/i. As a negative example, in small-signal equivalent circuits, sometimes the inverse transconductance gm of a BJT is used as Re=1/gm. This is very confusing because this does not represent any (ohmic) resistor and, more than that, can be mixed-up with an external emitter resistor RE. EDIT/UPDATE: Regarding impedances: For reactive elements (L, C) the voltage-to-current ratios are called "impedance". Because this applies to rms values of sinusoidal signals only the symbol for impedances also is written in uppercase letters Z=V/I.
H: Why do we use 32.768 kHz crystals in most circuits? Why do we use 32.768 kHz crystals in most circuits, for example in RTC circuits? What will happen if I use a 35 or 25 kHz crystal? I assume because the IC internal Xin, Xout pin circuitry should be in CMOS/TTL/NMOS technology. Is it that true? AI: The frequency of a real time clock varies with the application. The frequency 32768 Hz (32.768 KHz) is commonly used, because it is a power of 2 (215) value. And, you can get a precise 1 second period (1 Hz frequency) by using a 15 stage binary counter. Practically, in majority of the applications, particularly digital, the current consumption has to be as low as possible to preserve battery life. So, this frequency is selected as a best compromise between low frequency and convenient manufacture with market availability and real estate in term of physical dimensions while designing board, where low frequency generally means the quartz is physically bigger.
H: Ethernet Magnetic coil ground In Ethernet Magnetic part why we using chassis ground and separated choke primary side form common ground? AI: Ethernet Magnetics are used for providing the isolation between the interface. The reason behind that is the safety and the different potential of linked system. Since the system can be on different ground level so we donot connect the primary and secondary side with the same ground. The other reason behind that is if the cable gets short with a high voltage, PCB will be saved from getting damaged. So basically the reason for providing the two separate ground is to isolate the two system. If we connect the both end with the same GND as shown below, the system will not be isolated. If we want to provide the isolation between the two system we should connect the system as shown below.
H: quick question about AC SPST rocker switch I'm replacing the motor control switch in this toaster and wanted to be certain about how it should be installed. It's a normal SPST neon rocker switch with A, B and C for terminals, and B-C being for the neon. It would simply be 1-A, 2-B, 3-C, correct? Hopefully I wasn't too vague and I can provide more details if needed. Thank you for your help! AI: To the schematic: JEEZ! Way to make a maintenance schematic that invites making stupid errors. To your assumption/question/check: Yup. (after what felt like a year tracing hoppy black lines) The top, 1, comes from mains White through the relay. The middle, 2, goes to the motors to turn them on. The bottom, 3, is connected to the mains Black. Since your motors are also directly connected to mains black, it's not a reversal switch. So you only need SPDT if you need to hard-brake them, which seems unlikely to me in the case of butter and bread transport (low inertia). So the bottom pole is most likely for the Neon light, which turns on then A and B (1 and 2) are connected by the switch itself.
H: transformer has continuity but no voltage output? I have two old transformers that appear to be fine, however no DC voltage was measured on the secondary coil. I have measured: The input voltage: 229 AC the input coil ohms: 0.015 kOhms the two parallel output coil ohms: 0.008 kOhms each the multimeter base resistance when i touch the probes = 0.006 kOhms resistance between AC and DC coils - no continuity. The other transformer is similar, continuity between the primary and secondary, AC 230 in, DC 0 out. What kind of problem affects both these transformers? AI: If they are transfomers rather than DC power supplies, then you would measure zero volts DC at the output even though the transformer is working correctly. A DC voltmeter will show zero volts when measuring AC. Switch the multimeter to AC volts to measure the transformer output.
H: Understanding the the setup of a Timer on an STM32F10x I'm trying to understand how to correctly setup the timer on an STM32F10x. The board is running with an external crystal of 16 MHz, and I'm using the PLL: /* PLLCLK = 16MHz / 2 * 9 = 72 MHz */ RCC_PLLConfig(RCC_PLLSource_HSE_Div2, RCC_PLLMul_9); so the board is running at 72Mhz. I'm configuring the timer as follows: RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3,ENABLE); TIM_TimeBaseInitTypeDef timerInitstructure; timerInitstructure.TIM_Prescaler =72000-1; timerInitstructure.TIM_CounterMode = TIM_CounterMode_Up; timerInitstructure.TIM_Period=1; timerInitstructure.TIM_ClockDivision = TIM_CKD_DIV1; timerInitstructure.TIM_RepetitionCounter=0; TIM_TimeBaseInit(TIM3,&timerInitstructure); TIM_ITConfig(TIM3, TIM_IT_Update, ENABLE); TIM_Cmd(TIM3,ENABLE); To make sure that I set the correct frequency I am toggling a pin using the interrupt, but when I measure with the scope I get 2.784 kHz. Can anyone tell me why I get this frequency? AI: I wrote up a longer answer, before I realized the simple solution. I'm including the full answer in case it's helpful. The quick answer: The values passed into the TIM_TimeBaseInit() function are only 16-bit, so 69999 is an invalid value. You'll need to choose the period and prescaler such that they are both below 65536. There is a second problem, however, so please continue reading :) The detailed answer: It looks like you're targeting a 1kHz (1ms) clock? Here is the basic equation, where PSC is the prescaler and ARR is the period ("Auto Reload Register"): (PSC+1)(ARR+1) = (EventTime)(ClkFreq) For 1ms: (PSC+1)(ARR+1) = (1ms)(72MHz) = 72000 Now, you can choose any set of values to make this true, as long as they don't exceed 16 bits each. I chose: (PSC+1) = 2 and (ARR+1) = 36000, which gives PSC = 1 and ARR = 35999. Then finish setting up the clock as you have. In your case, you choose ARR=1 and PSC=71999. Turning the equations around: EventTime = (PSC+1)(ARR+1)/ClkFreq EventTime = (1+1)(71999+1)/72MHz = 2ms, which isn't what you're looking for. Of course, this isn't actually what you're getting either, because of the earlier-mentioned problem with the size of the prescaler. Incidentally, as @ScottSeidman points out, often the timer is set up correctly but the clock itself isn't. The clock trees are surprisingly complicated! One way to verify the clocks is to use the RCC_MCOConfig() function (or see the RCC_CFGR register). They can be used to output the internal clocks directly onto the MCO pin. Good luck!
H: What's the usage of two NPN transistors with their bases and collectors tied together? I'm thinking to know what is the usage of these parts of this circuit. Source It's the schematic of UT70C Digital multimeter. AI: The way they are connected they'll act as a bipolar 8~9V "zener". They would be for over-voltage protection, is my guess. Edit: This is because of the reverse breakdown of the emitter-base junction, more at this Wiki reference (thanks to @Leo). The ~7V breakdown of the E-B junction is in series with the forward voltage of the other transistors E-B junction, adding up to around 8V, depending on the current. The transistors they are using are very inexpensive in China, and probably used elsewhere in their products, so they may be more attractive than conventional MELF zener diodes connected back-to-back.
H: What do I need to put my code onto a microcontroller? I learned about coding a controller, but never actually put the code on the physical device. I am trying to figure out what I need to order to start developing a basic embedded system. For example, if I have a PIC18F1330, I have MPLAB IDE and XC8 compiler. Great, so I have the code compiled, and I'm ready to put this on the controller. What do I need to have to have to transfer my compiled code on my PC, onto the controller? I've seen things like an in-circuit debugger, and a PIC kit. I'm just lost at this point. AI: There are several ways to flash your code to a microcontroller. On the web, you will find quite a lot of self-made programmers, but they usually also have self-made software and are not (well) integrated in the MPLAB IDE. The cheapest solution from Microchip is a PicKit for ~40€ which is just connected to the PC via USB. Though the PicKit has some debugging options, there is also the more powerful 'In Circuit Debugger' ICD for ~180€, which has more debugging features, but of course can also flash the chips. I always felt the PicKit is sufficient for me. There are third-party versions out there, as microchip publishes firmware and schematics for the PicKit, but if you buy them, be sure you really get what you think what you get. I once saw an offer for PicKit 3, but I was not sure if it isn't a PicKit 2. Just as comment: There are Microchip MCUs, which can flash themselves. For example, we used the PIC18F2450/2550/4450/4550 family with embedded USB and put a boot loader on it. When a jumper is closed, the MCU enteres the boot loader mode on startup, and you can flash your MCU with your code. That stuff is all available from Microchip. To use this, you need a few modifications to your code. And of course, you need a regular programmer to initially flash the boot loader on the MCU. So, this feature does not make sense if you have a programmer. But it's nice if you want firmware updates to your customers.
H: VHDL delayed assignment problem I want output to equal "11111111" on the first rising edge of the clock but it only happens on the second rising edge when I test the code with ModelSim. The code might look weird as a simplification of a more complex design where I have the same kind of problem. code: library ieee; use ieee.std_logic_1164.all; entity delay is port( clock : in STD_LOGIC; output : out STD_LOGIC_VECTOR(7 downto 0) := "00000000" ); end delay; architecture behavioral of delay is signal debug : STD_LOGIC_VECTOR(3 downto 0); begin process(clock) begin if rising_edge(clock) then debug <= "0000"; case debug is when "0000" => output <= "11111111"; when others => output <= "00000000"; end case; end if; end process; end behavioral; testbench: library ieee; use ieee.std_logic_1164.all; entity eentestbench is end eentestbench; architecture behavioral of eentestbench is signal clock : STD_LOGIC := '0'; signal result: STD_LOGIC_VECTOR(7 downto 0) := "00000000"; component delay port( clock : in STD_LOGIC; output : out STD_LOGIC_VECTOR(7 downto 0) ); end component; begin uut : delay port map( clock => clock, output => result ); stim_process: process begin clock <= '0'; wait for 1 ns; clock <= '1'; wait for 1 ns; end process; end behavioral; AI: Move the debug assignment outside the if statement with the condition rising_edge(clock). In the following waveform you can see it's not assigned until the first clock edge and the output assignment is dependent on debug. (clickable) The debug assignment could just as easily be a concurrent statement or have initial value supplied by a generic.
H: Replacing wires with threads? Is it a good idea to replace wires that get bent a lot (e.g., around a hinge) with conductive threads? It's a 5V device using up to 1A. Thanks AI: Conductive thread is simply thread with wire woven through it, so it won't necessarily be any more robust. The critical thing for reducing fatigue in wires that are flexed a lot is to maximize the radius of curvature. Instead of bending it directly around the hinge, use a generous loop of wire, so that the maximum curvature is very gentle. You may also consider looking for cable that is specifically rated to withstand a lot of flexing.
H: Explantation for fried charger with Multimeter I have a 9v AC to DC wall adapter that I use to power my Arduino boards. The label says it gives 9v at 1000ma but I wanted to test the validity of the label to troubleshoot. When I connected my probes to the terminals however it said 0 amps and then the green power light on the adapter turned off. After that the adapter would not power anything. I opened it and could not identify any blown or otherwise damaged pieces. So, before I fry something else like the USB port on my computer :(, does anyone know what I was doing wrong? The multimeter still works and gives valid readings on other things and I have measured chargers before without issues. I have this multimeter from radioshack. AI: As others have said, connecting a multimeter set to measure Amps directly across a power supply effectively puts a short circuit on the supply, due to the very low resistance of the multimeter when set to measure current. The short-circuit current you measure this way will probably be far above the supply's rated output, unless the supply has overcurrent protection. I don't think it is practical to try to verify the rated output current of a power supply by a direct measurement - you just have to trust the maker's claim. You could, however, connect a load of the correct resistance to draw the rated current to the supply, and monitor the output voltage and power supply temperature over an hour or two to see if the supply survives, and continues to output the advertised voltage, and doesn't get too hot.
H: Driving highly inductive loads destroys mosfet driver Background I am attempting to generate some relatively high voltages (>200KV) using a system of ignition coils. This question deals with a single stage of this system which we are attempting to make generate somewhere around 40-50KV. Originally the function generator was used to directly drive the MOSFETs, but the turn-off time was quite slow (RC curve with the function generator). Next, a nice totem-pole BJT driver was built which worked ok, but still had some issues with fall times (the rise time was great). So, we decided to buy a bunch of MCP1402 gate drivers. Here is the schematic (C1 is the decoupling cap for the MCP1402 and is physically located close to the MCP1402): simulate this circuit – Schematic created using CircuitLab The purpose of the transistors at the beginning is to prevent the negative voltages coming out of our function generator (it's hard to configure and easy to screw up) from reaching the MCP1402. Our fall times being sent into the MCP1402 are quite long (1-2uS) due to this crude arrangement, but there seems to be an internal hysteresis or something preventing this from causing problems. If there isn't and I'm actually destroying the driver, let me know. The datasheet doesn't have any input rise/fall time parameters. Here is the physical layout: The blue wire goes to the ignition coil and the black wire goes to the ground strip on the table. The top TO92 is the PNP and the bottom TO92 is the NPN. The TO220 is the MOSFET. Experiment The problem that has just been plaguing this design has been a combination of ringing on the gate line and slow switch times. We've destroyed more MOSFETs and totem pole BJTs than I care to remember. The MCP1402 seemed to have fixed some of the issues: no ringing, fast fall times; it looked perfect. Here is the gate line without the ignition coil attached (measured on the bottom of the gate pin of the MOSFET, where the green&white wire is plugged in above): I thought that looked great and so I plugged in the ignition coil. That spat out this garbage: This isn't the first time I've seen this junk on my gate line, but it is the first time I got a nice picture of it. Those voltage transients are exceeding the maximum Vgs of the IRF840. Question After capturing the above waveform, I quickly shut everything down. The ignition coil didn't produce any sparks, telling me that the MOSFET was having a hard time turning off in a timely fashion. My thought is that the gate was self-triggering from the ringing and cutting off our di/dt spike. The MOSFET was incredibly warm, but after cooling down a bit it checked out with the multimeter (high impedance between gate-source & gate-drain, low impedance between drain-source after charnging gate, high impedance between drain-source after discharging gate). The driver, however, didn't fare nearly as well. I removed the MOSFET and just stuck a cap on the output. The driver didn't switch anymore and just heated up, so I believe it to be destroyed. For reference, the inductance of the ignition coil has been measured at 9.8mH. The series resistance is about \$2\Omega\$ at DC. What in the world destroyed the driver? My thought is that the large gate transients found their way back into the gate and somehow exceeded the maximum reverse-current of 500mA. How can I suppress this ringing and keep it clean when driving the inductive load? My gate length is about 5cm. I have a selection of ferrites that I could use, but I honestly don't want to blow up another gate driver until someone can explain to me why this happened. Why doesn't it occur until I connect a highly inductive load to it? There is no reverse diode over the ignition coil primary. This was a conscious decision to avoid capping our voltage spikes, but could be misinformed. Would capping the primary voltage spike with the diode cap the secondary voltage spike at all? If not, I would gladly put one over it to avoid needing the more expensive 1200V MOSFETs. We have measured the drain-to-source voltage peaking at about 350V (~100nS resolution), but that was with a slower gate driver, so there was less di/dt. We have a selection of 1200V IGBTs that could be used (they're just sitting here on my desk). Would these have as much trouble as the MOSFETs driving this sort of load? Fairchild seems to suggest using these. Edit: I just did an LTSpice simulation of putting the diode over the primary to protect my MOSFET. Turns out, it defeats the purpose of the circuit. Here is the simulated secondary voltage before (left) and after (right) putting the diode across the primary: So, I can't use a protection diode it seems. AI: Holy Carp! You're trying to do 10's of nsec switching on a solderless breadboard? And you don't have a flyback diode on your transformer? If you're going to do this stuff, you've got to learn to respect fast switching and inductive parasitics. Go to a ground plane and make all your switching paths as short as possible. Also, put a 100 uF cap (tantalum for choice) across your MCP1402 to give the flyback diode something to drive besides the long leads to the battery. You see those regular bumps on your no-load waveform? They are ~40 MHz oscillations and they are not a good sign.
H: Checking when a car horn is pressed? I want to detect when a car horn is pressed. The only way I can detect it currently is using the voltage on its line. When the car is turned on, there is always 12V being supplied to the horn through the battery i.e. When the horn is NOT being used the voltage to it is 12V. When the horn is being used the line voltage drops between 2V-1V due to the consumption by the horn. I was thinking of using the High/Low voltage detect module of the pic 18f4520 to detect this voltage drop when the horn is pressed. But the module seems to be more for detecting a drop in operational voltage. Is there a downside to using the HLDV in such a manner, also is there a better/other way to do this? Any code snippets to HLVD or other methods are greatly appreciated. Thank you for your time and have a great day. AI: I'm assuming that you're measuring the voltage with respect to ground, not across the horn terminals. If so, what you are describing sounds like this: Except that the switch is likely a relay, MOSFET, SSR, or some other device that has a non-zero resistance even when "closed". In this case, both wires across the horn will be at the battery voltage when the horn is off. When the switch closes the bottom wire will drop towards ground and current will start to flow. The reason it doesn't actually reach zero volts is because of the resistance of the switch. It is important to realize that the top wire won't vary (much) from the battery voltage whether the horn is active or not. You'll need to monitor the line between the horn and the switch. To interface this to a PIC (or other microcontroller), you will need to scale the voltage so that it doesn't exceed the PIC's Vdd (probably 3.3V or 5V in your circuit). You would do this by using a voltage divider: Say that your Vdd is 5V. Assume that the horn voltage swings from 15V to 2V. If you divide the voltage by 3, the output swings from 5V to 0.66V. This is within spec of the PIC. If Vdd = 3.3V, you will need to scale appropriately. As far as the interface method, you have a few options: The HLVD module. This would work just fine, and has the benefit of "set-and-forget". Once it is configured, you just wait for an interrupt. An analog input. This also works, but you'll need to regularly sample the input. If the scaling works out, you may be able to simply use the horn signal as a digital input! Make sure that when the signal goes low that it is below the \$V_{IL}\$ of the PIC, found on page 335 of the datasheet. However, you'll need to add some extra protections. The power systems of automobiles are very noisy and hard to deal with. You can get false triggers, and large voltage spikes when starting the engine that can damage your microcontroller. By the time you account for these things the circuit can become considerably more complicated. See some of the other answers. @tcrosley even shows how to create a safe, filtered Vdd for the PIC! Good luck :)
H: About the leakage reactance of transformer As known the transformer's equivalent circuit can be developed as below: Assume the \$V_{1}\$ is the voltage applied to primary side, and \$V_{2}\$ is the voltage developed at the secondary load. Now, let the primary side open circuit, and apply a voltage to the secondary. My colleague argued that, because the primary side current is zero, the leakage reactance at the secondary will not exist, that is, the \$X_{i2}\$ will be zero! But I think it will be still there, because there is always some flux that does not flow through the transformer core. Which one of the above points is right? AI: Leakage inductance always exists. It is present on the primary winding and the secondary winding. It represents the small percentage of inductance that doesn't magnetically couple to the other coil. Think about a transformer that has 1:1 turns ratio - which is primary and which is secondary. Of course it doesn't matter so things can't magically be different on one winding compared to the other.
H: Transformer Efficiency Issue Trying to improve on the transformer efficiency, I changed the configuration of the rectifier from half wave to full-wave. Below shows the configurations I used Transformer turn ratio is enough so that the input side on the LDO is maintained well above drop-voltage + output voltage. The load on the LDO consumes about 130mA. I was expecting twice the efficiency improvement, but the result is not what I expected. With secondary side current consumption remaining the same, I only saw 10mA improvements on the primary side. With half wave rectification, the primary was consuming 110mA, and with full wave rectification, the primary was consuming about 100mA. The transformer is very hot, and the hotter it gets, the current consumption grows more on the primary side. Is there anything I am missing? Addition : I add the component value as following The single diode is MRA4007, which has about 0.7V forward voltage The bridge diode is MB6S which has 1V voltage drop per bridge. Transistor is simple PZT2222 which is simple BJT. The pulse I am using is 18V when high, and 0 V when low. The frequency driving is about 31KHz. I changed the frequency to 45KHz, but the current consumption rather increased. I think there is some kind of loss when switching. The resistor value, I tried using 3.3K to 10K Ohm, but i saw little improvements. The capacitors are 10uF plus 0.1uF in parallel before the LDO. I will try to measure inductance of the transformer and let you know AI: You haven't mentioned the load current, in addition to Kevin's list of missing information. The problem could be : primary inductance too low (not enough turns on the primary), core saturation (too many turns on the primary) or both at the same time. Since you can't simultaneously increase and decrease the primary turns, the last of these requires either a higher switching frequency, a bigger core, a different core material, or a combination of all these. I'm suspecting core saturation because of your comment that heating worsens the problem (you'll probably find core permeability reduces with increasing temperature, reducing the primary inductance thus increasing the current, causing thermal runaway). Does freezer spray reduce the current? Once the basics are right you can further improve efficiency by (for example) increasing wire diameter if I^2*R losses are important, or interleaving primary and secondary windings if leakage inductance is too high, but you're not at that stage yet. Better information as Kevin asked will help improve the answers. At least, tell us the switching frequency, the primary inductance (measure across both legs of primary with secondary OPEN circuit) the leakage inductance (measure across both legs of primary with secondary SHORT circuit) and anything you can about the core.
H: Build PIC development board on bread board I have PIC24FJ128GA202 IC only. Since development boards cost too much, I would like to build a development board on a bread board and try some sample programs on it. Like the image below: Is it possible to build it this way? Thanks AI: It is possible if your PIC part is in a SPDIP package. If you have parts in the SOIC or SSOP package then it would not be possible to mount the parts on a standard breadboard. Be aware that there can be issues with proto boards that can make the learning experience a painful one. The main issues that you could see include: Intermittent connections. Not compatible for high frequency operation. Poor power and ground distribution and bypassing. Capacitive coupling between adjacent circuit nodes. Shorts between component leads that are inserted without cutting them.
H: If op-amp offset trims are provided, but not needed, what is the best practise for connecting them? I'm using op-amps with offset trims available, but not needed as they already have very low offset voltage. What is the best practise for the PCB pad connections - should they simply be left floating? (I'm beginning to realise how much my degree left out) AI: If nothing is said about it in the data sheet and application notes (as does occur sometimes), leave them floating. If there is direction in the data sheet or application notes, follow it precisely, as @IC_designer_Rimpelbekkie says. I can't recall any exceptions, but that doesn't mean that there are not one or two types of op-amps somewhere that require you to do something different. In any case, keep the traces (if any) to the offset null pins short and symmetrical- the offset pins are generally connected directly to the long tailed pair and have the potential to pick up noise. A general comment inspired by the terminology you used - it is not a good idea to use the offset null adjustment for "trimming" offset to a non-zero value. Any adjustment so made will tend to degrade the temperature coefficient of the amplifier (usually something like PTAT (proportional to absolute temperature)). If you need (say) a 2mV offset it's usually best to create it with a stable reference voltage rather than deliberately unbalancing a balanced circuit.
H: 24 VAC source unable to drive servo motor Here's my power supply (schematic except without the transformer since my source is already at 24 V AC and using a 100 uF electrolytic as my smoothing capacitor): 24 VAC rectifier -> 100 uF smoothing cap -> LM317 linear regulator (typical application on page 10 of LM317, running at 3.3V) And my servo motor is an MG90S. I am feeding it 5V from a boost converter using an AAT1217. With the servo motor disconnected, I see the servo motor source voltage at 5V and the signal line is giving the pulses required to drive the servo motor. With the servo motor connected, there is a periodic voltage drop to ~1V, causing my MCU to brownout. I hear the servo motor twitching, so it seems like the circuit is trying. Other stuff I've tried: Bypassing the 24 VAC and using a 3.3V DC power supply, the servo rotates fine, drawing about 200 mA from the power supply. Using a 24 VDC source, the servo rotates fine Using a larger smoothing capacitor (1mF) with 24 VAC, the servo still doesn't work. The voltage drop still occurs and the LM317 gets really hot. I was thinking that the smoothing capacitance was not large enough so there wasn't enough current going into the servo but (3) disproves that. In addition, using smoothing capacitance calculations (C = (I * t) / dV), it seems like I should not need more than 100 uF. Any ideas what else could be wrong? So, just to defend the LM317 choice a little, The servo motor is on no more than 10s per day and not more than a few hundred ms each time. With that, I was hoping that using a simple linear voltage regulator would be ok in terms of both cost and complexity. AI: 24V AC when rectified and smoothed produces a DC level of about 32V. You are using the LM317 to produce 3.3V and then it seems that you are stepping this up to produce 5V for the motor. The regulator you are using is capable of producing over 1A. You say your stepper motor consumes 200mA and this will require the LM317 to supply about 300mA into the booster. 300mA thru the LM317 whilst dropping about 29V gives a heat power dissipation of about 8.6 watts and you'll need a heatsink or the LM317 will just shut-down. With a 24V DC supply the problem will be less but still the power dissipated by the LM317 could be as high as 6 watts.
H: VHDL: value isn't assigned immediately I asked a similar question here. I thought that that answer would be applicable to this code but I have the same problem. I have a ROM that runs at twice the speed of my CPU (left out all the commands except 'OUT' to make it easier to understand). The reason it runs at twice the speed is because the ROM has a pipeline. The first value in my ROM is '0xF100' which would execute the 'OUT' instruction. For debugging purposes I let my 'OUT' instruction set 'output' to "11111111". When I simulate the design with ModelSim I find that 'output' doesn't get set to "11111111" immediately but instead needs another rising edge of 'ClockDivided' to set its value. I want 'output' to get it's value immediately, how do I do this? code: library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; use ieee.std_logic_unsigned.all; entity first is port( input : in STD_LOGIC_VECTOR(7 downto 0) := "00000000"; output : out STD_LOGIC_VECTOR(7 downto 0) := "00000000"; PCout : out STD_LOGIC_VECTOR(15 downto 0) := "0000000000000000"; clock : in STD_LOGIC ); end first; architecture behavioral of first is signal PC : STD_LOGIC_VECTOR(7 downto 0) := "00000000"; signal data : STD_LOGIC_VECTOR(15 downto 0) := "0000000000000000"; signal regC : STD_LOGIC_VECTOR(3 downto 0) := "0000"; signal regA : STD_LOGIC_VECTOR(3 downto 0) := "0000"; signal regB : STD_LOGIC_VECTOR(3 downto 0) := "0000"; signal opcode : STD_LOGIC_VECTOR(3 downto 0) := "0000"; type registerFile is array(15 downto 0) of std_logic_vector(7 downto 0); signal registers : registerFile := (others => "00000000"); signal clockDivided : STD_LOGIC := '1'; component rom is port( address : in STD_LOGIC_VECTOR(7 downto 0); q : out STD_LOGIC_VECTOR(15 downto 0); clock : in STD_LOGIC := '1' ); end component; begin rom_inst : rom PORT MAP ( address => PC, clock => clock, q => data ); PCout <= data; process(clock) begin if rising_edge(clock) then clockDivided <= not(clockDivided); --dividing the clock because the ROM runs twice as fast end if; end process; process(clockDivided) begin opcode <= data(15 downto 12); regC <= data(11 downto 8); regA <= data(7 downto 4); regB <= data(3 downto 0); if rising_edge(clockDivided) then registers(0) <= "00000000"; case opcode is when "1111" => output <= "11111111"; --output doesn't get set to "11111111" immediately PC <= PC + 1; --OUT when others => PC <= PC + 1; end case; end if; end process; end behavioral; testbench: library ieee; use ieee.std_logic_1164.all; entity testbench is end testbench; architecture behavioral of testbench is signal inputX : STD_LOGIC_VECTOR(7 downto 0) := "00000000"; signal outputX : STD_LOGIC_VECTOR(7 downto 0) := "00000000"; signal PCX : STD_LOGIC_VECTOR(15 downto 0); signal clockX : STD_LOGIC := '0'; component first port( input : in STD_LOGIC_VECTOR(7 downto 0); output : out STD_LOGIC_VECTOR(7 downto 0); PCout : out STD_LOGIC_VECTOR(15 downto 0); clock : in STD_LOGIC ); end component; begin uut: first port map( input => inputX, output => outputX, PCout => PCX, clock => clockX ); stim_proc: process begin clockX <= '0'; wait for 1 ns; clockX <= '1'; wait for 1 ns; end process; end behavioral; AI: Looking at the following code: process(clockDivided) begin opcode <= data(15 downto 12); regC <= data(11 downto 8); regA <= data(7 downto 4); regB <= data(3 downto 0); if rising_edge(clockDivided) then -- end if; end process; The process sensitivity list only has clockDivided present. When data changes as part of the ROM being read, the process is not run; only when the next event on clockDivided occurs does this happen, so your opcode won't change until that point either. This is what causes your delay. The easiest thing is to move the concurrent assignments like opcode <= data(15 downto 12); outside of the process. you could equally add data to the sensitivity list, but there is really no need for those statements to be in the process in the first place. Additionally, from my experience, it is a good idea to move the extraction of various program word fields from a std_logic_vector into a function. The function accepts the program word as a parameter, and returns a record type that contains your 'decoded' instruction. Something like: type INSTRUCTION_type is record ( opcode : std_logic_vector(3 downto 0); regA : std_logic_vector (3 downto 0); regB : std_logic_vector (3 downto 0); regC : std_logic_vector (3 downto 0); end record; function from_slv(v : std_logic_vector) return INSTRUCTION_type is variable rv : INSTRUCTION_type; begin rv.opcode := v(15 downto 0); rv.regA := v(7 downto 4); rv.regB := v(3 downto 0); rv.regC := v(11 downto 8); return rv; end function; Then in your entity: program_word <= from_slv(data_out); ... case (program_word.opcode) is etc This allows you to have the interpretation of the program word in one easily changeable place in a package. The record allows the various program word elements to be easily connected between entities, pipelined, etc. this technique also makes it very easy to add more elements to the program word, without having to change entity port declarations and instantiations.
H: Altium de-highlighting nets after using 'Find Similar Objects...' command I can't work out why Altium is doing this, or how to undo it, or how to make it stop doing it. It happens when I use the 'Find Similar Objects... ' option; all of objects that it hasn't found are faded out and I can no longer select them. Anyone know how to fix this? Additionally, if anyone knows how to change, en masse, the components' footprint library to 'Any' through the SCH inspector, that'd be really helpful too. AI: To clear the selection of the Find Similar Objects use the SHIFT + C hotkey. After performing the edit, you will probably find that all the other objects on the schematic are faded out, or masked. While something is masked it cannot be edited, to remove the mask click the Clear button at the bottom right of the workspace [shortcut: SHIFT + C]. Page 4 And as for the footprint changes, I think the Footprint Manager is what you need. Altium Designer's schematic editor includes a powerful Footprint Manager. Launched from the Schematic Editor's Tools menu (Tools » Footprint Manager), the Footprint Manager lets you review all the footprints associated with every component in the entire project. Multi-select support makes it easy to edit the footprint assignment for multiple components, change how the footprint is linked, or change the Current footprint assignment for components that have multiple footprints assigned. Design changes are applied through Altium Designer's standard ECO system, updating both the schematic and the PCB if required. Page 12
H: Is this diagram correct? I have created the below mentioned circuit diagram: I just wanted to know that have I drawn a good/correct diagram or should I make any changes to this diagram? I have not added the resistors in diagram to make this diagram look simple. Here is the use of this circuit: Rotating a motor according to calculated output AI: As a block diagram for the idea in this question, that is a start. It is, however, only a block diagram to show the concept. As mentioned in the other question, you will (probably) need more than just a photodiode on your inputs. I would suggest you setup a single photodiode on a single input and see how it responds before you go connecting a bunch of them. Your H-Bridge drawing is very strange. There are usually four transistors driven by two control signals and just one motor. Your diagram seems to show four motors, each driven by a single control signal. A single line isn't enough to reverse the motor as you said you wanted to do in the other question. Also remember that you will need resistors for the LEDs, and that putting LEDs in parallel as you have them is a bad idea. Also note, you must use the correct Arduino. An Arduino Uno, for example, doesn't have enough IO pins. You should mark on your diagram which Arduino you are going to use.
H: Breaking a 16-bit long int to write into eeprom? I am writing data to eeprom AT24C16 using PIC microcontroller pic18f4520. Every address of this eeprom can hold 8-bits while I am using long int's to store data that are 16-bit in size. How to break long int into 2 8-bit parts to write them and how to get them back together after reading from eeprom?? AI: In C, you can use bit-shift and masking to extract each byte of a longer number: lower_8bits = value & 0xff; upper_8bits = (value >> 8) & 0xff; And you can 'reassemble' the number from bytes by doing the reverse: value = (upper_8bits << 8) | lower_8bits;
H: Charging cellphone from dynamo - safety risks I want to make a dynamo charger to charge multiple smartphones at once. I have figured out the schematics, but before I put a smartphone in it I want to be sure it will not destroy it. Schematics: simulate this circuit – Schematic created using CircuitLab So my biggest concerns are: voltage - I hope the converter and capacitors will keep it stable current - I think that smartphones control their charging current by themselves, or not? what will happen, if I stop turning the dynamo? The capacitors will hold the charge for a very small moment, and then what? Will the buck converter just shut down? what will happen, if I will be turning the dynamo too slow/too fast? Thanks for your advice. I tried searching google, but I haven't found anything useful. AI: What happens when the generator rotates too slow or too fast depends on your buck converter. If in all cases the maximum voltage out of the generator (only you know/can-test that) is below the maximum voltage of the buck converter: that's okay. If you go too slow the buck converter may drop its output voltage and get hot, or just shut down, that's up to the buck converter, again, only you know that. When you stop the voltage will fall gradually, for a short time the buck converter will be operating outside of its specs, but if you make sure that is a short enough time (less than a second or three) most likely the converter and any attached phones will survive. Most standard buck converter designs can handle a short while outside of their comfort zone, with respect to minimum voltage and most, if not all, phones will know to stop charging when the voltage goes below 4.4V, because of their regulation internally. With respect to charging current: Yes, all phones must handle that themselves, else they are not allowed to be USB spec. If you want your phones to charge fast, in fact, you may need to short the two data pins of the USB plugs together to let them know it's okay to ask for 1A or more. Some brands also do something with resistors (Apple for anything above 350mA, Samsung for anything above 1A, etc). You may want to look up "{BRAND_NAME} DIY Charger Schematic 2A" (or 1A, or whatever you want to offer, or no current in the search, as most DIY's are 1A+) for advice about tactics for your specific brands that you want to support. Whether your voltages stay in range with the components you choose is not up to us to answer. You know what you are using and how much total power the phones are allowed to take in your design, so we cannot possibly comment without any information about exact specifics about what you use and what you want. You can add an "under voltage lockout" that turns off the buck converter, if the converter itself doesn't have that, just before your 12V generator drops to its absolute minimum voltage. How to do that depends a lot on the specifics mentioned earlier and should be asked, with the relevant details, type numbers and datasheets, in a new question just about that part of it.
H: Do AC voltages on datasheets refer to peak voltage or Vrms? I'm attempting to find a relay to switch UK mains voltage (230Vrms); this gives a peak range of approximately 325V, -325V. Consider something such as the datasheet for this relay. It has a rated voltage of 250VAC and a max switching voltage of 277VAC, are these referring to peak voltage or rms voltages, and perhaps more generally is it a safe assumption that all AC voltages specifed on datasheets are always Vrms? AI: If a value doesn't specify peak or p-p, an AC level is presumed to be RMS. 277VAC is an RMS value - that is how it should be interpreted.
H: Why is it so hard to find component footprints? When designing PCB's, I find myself very often having to make footprints for a significant portion of the components on my board. This tends to be very time-consuming, as (in Altium at least), dimensioning out land patterns for strange connectors or chips (those that can't be created from a wizard) isn't very easy. It seems like anyone that uses these chips or connectors would need a footprint, so I can't understand why these aren't more commonly provided. For example, right now I'm trying to put a USB 3.0 Micro-B connector on a board, but the top 5 connectors on Digikey don't seem to provide footprints. I have access to the Altium Live design content, but even that seems often pretty out-of-date. I feel like there's something obvious that I'm missing - or else this system seems very inefficient (which usually isn't the case). Can someone enlighten me? AI: You've discovered the dirty little secret of the EDA industry: Thousands of engineers everywhere reinvent the wheel every day - they all create many of their sch symbols & pcb footprints from scratch. It is quite ridiculous. However there are reasons for it, in particular no universal (or even common) file format (nor for the schematics & PCB designs either), and that's in large part the fault of the various EDA software developers, who rely on this lack of file format compatibility to keep customers locked in. Until recently there's also never been a way to have confidence in 'random' other people's sch/PCB-footprint designs, so E.E.s err on the side of caution and make most of them themselves. But now there are some options, like snapeda.com and circuithub.com.
H: What are the recommended trace width and clearance on homemade PCB's? I know that there are multiple processes and lots of variables regarding homemade PCB manufacturing. Using the right tools it is possible to achieve professional levels. I'm concerned for students their make themselves their first board. What could be a safe recommendation to reduce problems? Edit: On regarding the process they'll probably use termal transfer (laser printing) and ferric chloride on the etching process. AI: I'll turn my comment(s) into an answer then. Numbers I mention are mil, where 1 mil = 25.4 μm, of course. Trace to clearance is expressed in this message (and many indications elsewhere) as #/# where the first number is trace width and the second is clearance. So 15/20 would be 15mil (0.381mm) trace with 20mil (0.508mm) clearance. As @LeonHeller I have gone down to 6/6 mil, even 3/5 mil with thermal transfer, but afterwards never thought "gee this investment in time and attention was worth it rather than paying a Chinese proto-fab $35 to do it in 5days and send it with DHL express". For "learning the tricks of the trade" start with at the very least 10/20 mil, preferably, to get students to not give up at first try start with 15/30. A common problem is flowing out of toner on over-heating, so a good clearance to start the practise with is not unwise. 10 to 20 mil traces will stick nicely to the copper, so damage should in most cases be small enough for the trace to survive and the tacks will be "fat enough" to repair with a run-of-the-mill Steadtler or Edding fineliner. You can progress down to 10/10 if you have the time, but for an introductory course I would only decrease further if there happens to be a talented student that wants to push the limits, or the less talented ones will become frustrated easily with shorts and missing traces. For the thermal transfer I advise you to get some soft, unwoven linen or cotton cloths or whipes to use between the source of the heat and the PCB+transfer foil, as this is one of the best ways to equalise pressure and heat. Woven fabrics will put the pressure onto the strands, so that's no good. And cotton and linen can take a lot of heat before they start smelling or browning, so the thickness can be compensated by increasing or decreasing the heat. If you first do a little experiment to find approximate settings and application time, given a certain thickness of cloth, this will also make it a lot easier for the students to replicate your process. I use standard unwoven cotton wipes of no-brand, they are approximately 0.1mm thick and I fold them over once or twice to get 2 or 4 layers. Works a treat for nice and even sticking of the toner. I also use them below the PCB, by the way, which seemed pointless, but still appears to help a teensy tiny amount, but if you have a rolling heat source in stead of my heat-bed that may be fiddly work and might not be worth it.
H: About induced current This is a homework question that I have stuck for a while and couldn't able to come up with the correct answer. So here is the question, My thoughts towards this question When I move the rod PQ with a constant velocity ,the area of triangle RPQ inside the magnetic field increases . Once the area inside the magnetic field increases E.M.F induces also increases. Since induce E.M.F get increased the induced current should also be increased. So according to my arguments I choose the answer as the third one. But the answer in marking scheme is the first one. What I have done wrong. Please explain this question with details. AI: The question asks for the current, not the voltage. The voltage (emf) generated would follow a straight line (not a curve) as the rate at which the area grows is proportional to the length of the wire - and the length of the wire grows linearly. The current that flows as a result of this depends on the resistance of the loop. The circumference of the loop grows linearly with the horizontal position of the wire (similar triangles - when the wire has moved twice as far to the right, all the sides are twice as big). The current is voltage divided by resistance. Both grow linearly; their ratio is constant.
H: make a device for USB ejection I want to make a device for USB which is connected through usb to PC and offers an usb port. The device should have a button which ejects (in Windows) the device plugged at the port of the device. After some research... First I wanted to solve this problem through a C# program- but I really have no idea how to access through C# on "my button". (the project's code isn't available anymore-if you know where I could get it-I would be really really happy.) So I did some more research... now I plan to use the WinAPI in combination with some C to accomplish this...(writing a device driver using the KMPF(Kernel module of windows). →But: I'm completly new to this. How should I start? Any suggestions/links which microcontroller would be good for this? Is it possible to use the WinAPI (KMPF) to access on hardware input/my device's button? AI: A MCU with USB interface can be chosen. The button will be a interrupt to the MCU. The MCU will be connected to the PC as a slave. Whenever the user presses the button (which is interfaced to the MCU) the associated firmware can raise a request to the application running on PC. The application later can handle the USB safe removal process. This involves both hardware and software design and hence might not be efficient for quick prototype.
H: Why do characteristic impedances matter only when traces are longer than half a wavelength? Why are characteristic impedances of traces not considered when the traces are shorter than half a wavelength? I've had the same issue with light diffraction, which happens when pinholes are smaller than half a wavelength - it sort of makes sense somehow, but I can't "see" it, I don't understand how wavelengths are related to reflections (which I assume are the only reasons why we care about impedance matching). I'm trying to make the ocean wave analogy work but... Well, the fact that I'm asking this says it all. AI: Some unscrupulous self promotion: Online Transmission Line Simulation Adjusting the transmission line length vs. the signal frequency is equivalent to adjusting time delay (tDelay) vs. rise time (tRise). Some interesting parameters: set tDelay=tRise/10. This is the case where the wavelength is much longer than the transmission line. Notice that the red trace will reflect from the far end multiple times before reaching the peak "on" level of 1V. However, each reflection is relatively small because the the voltage at the left of the red trace isn't significantly different form the drive level (blue trace). The signal was able to propagate to the target fast enough that the separation distance never became too significant. Now repeat with a case of say tDelay=tRise/2. Notice that the driving source voltage separation from the red mismatched termination voltage significantly more. When the signal finally reaches the end of the transmission line, the reflection is quite severe. This mismatch between what the receiver thinks the drive voltage is and the true drive voltage dictates the magnitude of any reflections. Repeated reflections come because the reflection causes the line level to over-shoot the source level, but is smaller than the first reflection. The signal reflects repeatedly until the level settles to near the source voltage.
H: Mounting battery terminal contacts in an aluminium case I'm trying to mount AA terminal contacts in an anodised aluminium case. Given that the aluminium is anodised, does that mean it's not conductive and the contacts could directly make contact with it? If not, what's a good way to mount contacts on an anodised aluminium case? Thanks AI: Coat the insides with scratch resistant isolation or fix the contacts such that they cannot touch the metal. Best option. Anodisation in aluminium needs to be sealed to be reliable enough for real electric isolation. The anodisation layer can be punctured by sharp edges or worse: The chemicals inside a battery! Some electrolytes have a high or low enough pH or contain sufficient reactive Ions to take away the oxide layer, forming in some cases actually conducting wet-mass for a while. Since I assume you have no crystal ball to see if the batteries will ever leak, it's a decent risk. Anodisation may help retain the coating (due to surface roughness and/or porousness) and/or reduce the layer thickness requirement, depending on the chemical process used. Many cheap-ish polymer coatings can handle these chemicals and light mechanical pressure, epoxy coatings would be good to a degree I'd expect. (<-- I'd expect... certainties come from spec- and/or datasheets.) Of course in caps and such the anodisation works, because it's a thoroughly conditioned environment and the anodisation is done under very strictly controlled circumstances until all has been sealed in oil or plastic to prevent thermal cracking or mechanical damage. This is also one of many reasons a cap should not dry out. Dry cap != protected any more.
H: Bizarre Behavior in a Phototransducer Amplifier THE GOAL: I'm trying to measure light levels with a Hamamatsu S6428-01 photodiode (Blue). THE CIRCUIT: Below is the circuit that I have: an Arduino Uno, powered by USB, which is itself powering a ADA 4528-2 op amp. I have marked points p q and r for future reference: RESULTS: I ran a general light-responsiveness test with a Tenma 72-7765 multimeter: I waved a blue LED in front of the diode, and saw how certain voltage differences reacted. Here were my observations: V(q)-V(r) ranged from 0mV to -300mV (saturation), and was negatively correlated with the intensity of the blue light reaching the diode. V(q)-V(p) was 1.2-1.3mV, and was completely independent of the intensity of the blue light reaching the diode (even with the LED touching the photosensitive area!). QUESTION: The first result is perfect, and in line with theory. but for some reason the second result is puzzling: the input pins of an op amp should have the same voltage, and my ADA 4528 has an input offset of <2uV. However, I am getting 1.2mV. What's going on? AI: You need a negative supply on the op-amp (say +/-2.5V) for this to work. The op-amp output has to swing negative to supply current to equal the PD current. It cannot possibly swing below ground without a negative supply, in fact it may only be able to get within some tens of mV of ground depending on load connection etc. Optionally (and probably better for this application) you could flip the PD around, but you still may get a bit of a dead zone near zero because the output can't get quite to zero. If you intend eventually on connecting it to an ADC input on the Arduino you will want to swap the PD around and perhaps to bias it above ground a bit, then you can stay with the 5V supply and within the range of the Arduino ADC. If you don't need to go right to zero for very low light levels, just flip the PD.
H: how to convert digital signal(PWM) into analog signal analog signal can b easily made by using PWM in micrcontroller but it is not a real analog signal. please tell me how can i convert PWM into real analog signal AI: Did you actually attempt to search, at all?: On StackExchange (possibly the most complete answer to any PWM to V question to be conceived and top of the search list) OR On instructables if you want it simpler and less broadly explained. OR On Google Images even The options are limitless for getting this exact information.
H: DATA_ALIGN Pragma - Tiva What is the purpose of a pragma Data_Align in TI emb. compiler. The datasheet explanation: http://www.ti.com/lit/ug/spnu151j/spnu151j.pdf "The DATA_ALIGN pragma aligns the symbol in C, or the next symbol declared in C++, to an alignment boundary. The alignment boundary is the maximum of the symbol's default alignment value or the value of the constant in bytes. The constant must be a power of 2. The maximum alignment is 32768. The DATA_ALIGN pragma cannot be used to reduce an object's natural alignment." Can someone re-explain it in a different method? I really don't understand the purpose of this pre-compile directive. AI: DATA_ALIGN will cause the symbol to be located at an address that satisfies the specified alignment requirement. For example: The following code will locate mybyte at an even address. #pragma DATA_ALIGN(mybyte, 2) char mybyte; The following code will locate mybuffer at an address that is evenly divisible by 1024. #pragma DATA_ALIGN(mybuffer, 1024) char mybuffer[256]; Most symbols don't require any special alignment beyond the data type's default alignment so you won't need to use DATA_ALIGN often. But occasionally you'll want a symbol to be located on a special address boundary and that's when DATA_ALIGN is useful. For example, sometimes buffers used with a DMA controller should be aligned on a special boundary.
H: Can I use a line multiplexer as a level shifter as well? I have 40 x 5V inputs that I want to read using 3V GPIO pins on the beaglebone black. I am planning on using 5 multiplexers (such as the 74HC151 or 74HC251) that will be sharing the 3 select lines. I'm not sure what the best strategy for level shifting would be: Power the multiplexer with 3V VCC and hope it'll work with 5V inputs Throw in a level shifter / buffer before each multiplexer, something like 74LV245. Use a series resistor to limit current on each of the inputs since I just need unidirectional 5V->3V shifting (Yes, I know this won't change the voltage but perhaps it'll protect the multiplexer from the 5V signal by reducing current?) Is there a different multiplexer I should be looking at that will be tolerant of the different voltages? I'm really hoping I can do (1). The datasheet says input voltage should be between GND and VCC. How bad will it be to power it with 3V and leave the inputs 5V? Thanks! AI: Why not just use an open collector multiplexer powered by 5V and pulled up to 3, like the 74LS156?
H: What are "slash sheets", and how do they relate to PCB substrates? I am trying to specify the stackup for a PCB. Previously I have used whatever the board house considered to be their "standard" stackup. This time I am looking at using FR-408 (pdf) because of its (relatively) low cost and (relatively) favorable high-frequency characteristics. The manufacturer's product page lists three slash sheets for FR-408: /24, /121, and /124. I see that these are individual specifications found in the IPC-4101 document. I am assuming that FR-408 meets all three of these specs. I'm further assuming that any one of these specs may encompass multiple substrates. Is this correct? Are cores and pre-pregs always called out by their name ("FR-408"), or can they be specified by simply selecting the appropriate slash sheet? AI: The slash-sheet is an appendage to the standard that specifies what a system of resin and fibre material has to comply to for it to be allowed to claim conformance to that slash-sheet. It is specified for both pre-preg and base material in that slash-sheet. This is also why a system can be /24 /121 /124, it just means that the requirements given in all those sheets fit what the system offers. For exact specifications you must always use the product name and manufacturer to identify the material, since many different systems by different manufacturers can conform to /24 or /41, and specifying /41 might mean you get one that is "better", but has different constants. Since you are selecting a material for HF and/or controlled impedance, you want to know the constants for sure, so you need to know which datasheet to look at. You can use a slash-sheet specification to ask a Fab for all the material systems they offer that conform to that or those sheets and then compare the specifics of those. In that sense you can use a slash-sheet to pre-select a group of materials that will hold up in your intended environment or that are likely to be close to the constants you'd prefer. For example /101 states a loss tangent, MAXIMUM at section 7 at 1 MHz of 0.035 for both <0.5mm and >0.5mm thickness. But that's not to say that a specific manufacturer can't make a /28 material with a maximum loss tangent of 0.03 for >0.5mm thickness and say it's also /101 compatible, because it is. To note: I just picked two numbers and found the first difference I saw, it's possible /101 and /28 do have some other conflicting exclusionary properties that I didn't notice in 30 seconds, it only serves as an example. Not to mention your manufacturer might specify another loss tangent at a much higher frequency that differs slightly, but their loss tangent adheres to the 1MHz specification. They can then be /101, but you'll be assuming the wrong number! EDIT: For reference, my limited amount of numbers comes from the voting preview of IPC-4101-B edition, released 2006, because I find it nonsense to constantly pay big consortia of companies for their releases, even if it's "only $140" per release. The participating companies can easily foot the bill and should, to get more people to use those specs in their designs.
H: How to solder micro stepper motor pins? I have a hobby project where I would like to use micro stepper motors as shown in the picture below. However, as you might be able to see, the spacing between the pins is incredibly tiny and each pin is much narrower than the 24 AWG wire I was planning on using. In addition, each pin seems to have a single strand of copper wire attached to it presumably attached to the stepper windings. So my question to us all ... what technique might one use to attach wires to these pins? Assume poor/average soldering skills and "normal" mans hands with normal steadyness (and by that I mean (what I hope are) the normal amount of shakes). Here is a photo I took myself which shows the scale against a rule. AI: I would probably use a small amount of tacky flux and pre-tin both the wire and the pins. If you can secure the motor in a clamp with pins facing horizontally, that would be ideal for me (an average solderer). I would feed the wire with my non dominant hand while resting my palm on the bench top and soldering with my dominant hand. Hope that makes sense. Pre-tinning will make it relatively easy.
H: What constitutes a Via-in-Pad? Would any of the via's in the picture be considered a via-in-pad? or is it only if it's dead center of the pad? AI: I would think about it this way, why would you care if a via was "via in pad"? Because you want to treat it a special way, and perhaps because that treatment will cost you more at fabrication. So why treat a via that's in a pad any different? For me with a through hole via in pad I'm worried about solder wicking through the barrel of the via and possibly to the back of the board. Either way it's the ultimate mechanical, electrical, and possibly thermal connectivity of my joint that I'm worried about. To fix that we usually fill the vias with either conductive or non-conductive fill and then plate them flat (I've been using non-conductive lately because it saves a step). Now to your question, when would I treat a via specially and call it via in pad in these cases? I would say it's anytime I think solder might flow into that hole. So perhaps even your first example if there is not enough clearance for solder mask between the hole and the pad so that no solder will flow in the worst case. Even your second case might warrant it if there's not enough room for solder mask, that's something I would expect to get flagged at DFM. On an interesting side note at our fabs once you do one via in pad it costs no more for us to do everything via in pad. So if you find yourself having to make that decision for one case maybe you can do it everywhere.
H: True GPS Location - At the Antenna or Receiver Chip? Suppose I have a GPS unit attached to an antenna through a 50 meter coax cable. How would the location as calculated by the GPS unit be affected by the cable length? As a bonus question, how would the time accuracy of the GPS be affected by the cable? AI: The exact position is the phase center of the antenna independent of the length of the cable and location of the chip. The time delay has to be calibrated by measuring the delay of the cable for the band. (L1 band). Many GPS receivers provide option to key in the delay parameter.
H: About "leakage inductance" I'm a little confused about the transformer "leakage inductance" for days. Per this text book, it gives a schematic view of fluxes flow in the transformer: It's apparent that the two leakage flux will create separate inductance on each side. And it give s equivalent circuit: You see, there are two separate inductance on each side, that is, the primary leakage inductance and the secondary leakage inductance. And we reflect all the load at secondary to the primary side, then get All are easy to understand, there are two "leakage inductance", though you can reflect them to the same side, but in physics, there indeed are two "leakage inductanes". But in the app note from a leakage inductance tester, it says Leakage inductance is an inductive component present in a transformer that results from the imperfect magnetic linking of one winding to another. Any magnetic flux that does not link the primary winding to the secondary winding acts as inductive impedance in series with the primary, therefore this “leakage inductance” is shown on a schematic diagram as an additional inductance before the primary of an ideal transformer. And it gives, Apparently, there is only one "leakage inductance" at one side in the figure above. Which one this inductance conrrespond to in the text book above? The primary one only or the primary one add the reflected secondary one? When it measure the "leakage inductance", it short the secondary. I wonder if it can short the secondary leakage out as below (Note: The R2 can't be shorted, it should always exist at the left side of the red line). If it can, then the measured leakage inductance from primary side will contain only the primary leakage; if it can NOT, then it will get the primary inductance added with the reflected secondary leakage, right? AI: Apparently, there is only one "leakage inductance" at one side in the figure above. No, that is incorrect. Every winding in a transformer does not couple 100% to each other winding and that is a fact. If some piece of text suggests that the leakage inductance is only attributable to one winding then that piece of text is at best misleading and, at worst blatantly wrong. However, from the perspective of someone wishing to know how well two windings may couple then a single entity of leakage (a composite of both leakages) can be used to express that. As for your 2nd question, you CANNOT short the secondary at the point you wish. This IS impossible - you can't take the equivalent circuit of the transformer and hack at it like that. The leakage measured is the composite leakage and this can be broken down into two components by using the turns ratio squared but even that is only an approximation; the magnetization inductance will alter the accuracy of this method slightly but, for all practical purposes, this method yields fairly accurate results.
H: How to make Current to Voltage converter I am working on level sensor which give output of 4-20 mA. I have to feed output of level sensor to an ADC of a micro-controller, to do so I have to convert it from current to voltage.Voltage range needed is 0-1.8 Volts. So I have gone through some circuits below: I want to know which would be much more suitable to be used with ADC of micro-controller. AI: They both work but the simple resistor is less prone to inaccuracy because the op-amp will introduce voltage offset errors and possibly leakage current errors. Bandwidth of the op-amp may cause other problems if the signal is high frequency compared to the gain-bandwidth-product of the op-amp. On the other hand, the thing that produces the 4/20 mA signal may prefer to see a short circuit as an input and the op-amp offers this by virtue of it being a virtual earth at the inverting input.
H: What do we need the op amp for in this current-to-voltage converter? I'm still very new to electrical engineering and at the moment trying to get my head around the concept of the ideal op amp. In Fundamentals of Electric Circuits by Alexander and Sadiku the following diagram is given as a "current-to-voltage converter". simulate this circuit – Schematic created using CircuitLab The reader is asked to prove $$v=-IR,$$ which I think I did. But what do we need the op amp for? Wouldn't the following diagram be exactly the same? simulate this circuit AI: Your op-amp is a vital clog in the wheel in this circuit. Since the op-amp has infinite resistance, the current I entirely flows to the alternate path through the resistor R. Note that since the + end of the op-amp is at ground and because of the infinite gain of the op-amp, the - end is also held to ground. So the drop across the resistor is V = IR. So effectively, the output of the op-amp will be held at V = IR as the output is connected between the point V which is the other end of the resistor and ground. So, it is the characteristics of the op-amp which are enabling the functionality of a current to voltage converter here.
H: Why is there such a huge price range for BNC terminators? I wanted to buy some standard BNC 50 Ohm terminators and was surprised when I saw multiple offers with prices well above 20€ per piece. I found others for around 2€ (same online shop) and now I am intrigued on why the expensive ones are more expensive. Are they in some way better? Longer lasting? AI: For BNC terminators there are usually the following factors that contribute to the price: Accuracy of the specified values (i.e. impedance is matching for the whole assembly) Wattage of the resistor Bandwidth of the whole assembly Linearity of attenuation of the whole assembly Contact quality Some of these have similar influences to all kind of other BNC equipment too
H: How is NAND Flash memory array organized? Could you please explain how memory array organization calculated? Here I have attached snapshot of 2Gb NAND flash memory array organization. I can't understand the calculation of 1 Plane (marked in yellow color), but I do understand the calculation of 1 block. AI: The image of the part number you have shared implies that its a 2-Plane NAND Flash chip. A Page is 2,048 + 64 Bytes long, 64 such pages forms one Block. So, size of 1 Block = size of 64 Pages = 2,112 x 64 Bytes = 1,35,168 Bytes = 10,81,344 bits = 1056 Kb Now, 1 Plane consists of 1024 such Blocks. So, size of 1 Plane = 1024 x 2112 x 64 Bytes = 1024 x 1056 Kb = 13,84,12,032 Bytes = 1,10,72,96,256 bits = 1,056 Mb Since the device has two such planes, Memory size of 1 Device = 1,056 x 2 = 2,112 Mb. Kindly note that 2112 Bytes each for Cache Register and Data Register are not being counted in the sum of total memory, since it is not a non-volatile memory. Additionally, the advantage of having two blocks is: Memory can be divided into two physical planes, odd/even blocks Users have the ability to: <•> Concurrently access two pages for read <•> Erase two blocks concurrently <•> Program two pages concurrently Provided that, the page addresses of blocks from both planes must be the same during two-plane Read/Program/Erase operations.
H: how long charge li- ion battery I have \$3.7V\$ Li-ion battery \$3800mAh\$ and Solar panel \$U=5.5V, I_{max}=290mA\$. Battery will supply arduino with sensors taking \$100mA\$ current. How long will it take to charge the battery from the solar panel? AI: It will depend on how you're charging the battery (i.e. how your charging circuit will take the input power and use it to charge the battery) and how much sun light you actually get. In general, the rule is to divide the battery capacity by your charging current to get the time (in hours) to fully charge the battery. Assuming your solar panel is able to maintain a constant 290mA output current and your charging circuit uses a linear constant current regulator to charge the battery, you should expect the charging time to be at least $$\frac{3.8Ah}{0.29A - 0.1A} = 20\text{ hours}$$ However, the above calculation makes a few assumptions which may not likely hold up in reality. It is probably best to test and measure in a realistic environment. Lastly, as indicated by several people in the comments and answers, ensure you're using proper charging and safety circuitry for your li-ion batteries. Li-ions should almost never be charged directly by a power source.
H: What's the requirement to DIY PD aware USB connector? According to some research, I should be able to pull +12v from a USB power source assuming my device is some how telling the power source that it is ready to receive +12v? I've seen a YouTube clip (can't find it conveniently enough tho) of a kid putting a resistor across two wires on a stripped USB cable to achieve something along these lines. So my question is, how do you instruct the power source to send +12v (1.5A is fine) or is this even possible? AI: As PlasmaHH says, the needed info is indeed in the USB3.1 specifications. A quick scan of USB_PD_R2_0 V1.1 - 20150507.pdf seems to indicate that getting 12Volts requires an intelligent charger. The specifications call for only allowing 12V after negotiation over the data bus. To get that PDF, you have to down load a 54MB zip file from here Once you unpack it, you get a big pile of PDFs, including USB_PD_R2_0 V1.1 Section 3.4 describes the various ways the cable can identify itself, and section 6.4.2 mentions the messages needed to request 12V.
H: Choice of bypass capacitors for PIC18F4455 Does anyone know how many and what values of bypass capacitors I need for a PIC18F4455? The datasheet does not provide any information on this and I don't want to use more than what I strictly need, given that I don't have much real state available on my PCB. Also, if anyone has good guidelines for choosing number/values of bypass caps for MCUs in general, I'd also appreciate that. Thank you, Chris. AI: 0.1uF is probably the most common, though I have seen 0.01uF used as well. Larger values (6.8uF, 10uF, etc) are used to filter out lower frequencies. It all depends on your exact circuit, where it will be used, what you are using for a power supply, and so on. I generally just use a 0.1uF capacitor directly across the power pins of the microcontroller and don't have a problem. Just make sure you put the cap as close as you possibly can to the power pins when laying out your board. Here is a tutorial on bypass capacitors: http://www.electro-labs.com/bypass-capacitors-why-and-how-to-use-them/ There they discuss different types, why they're needed, how they're used, and how their values are calculated. Hopefully this helps =) EDIT: Intersil also created a document to help determine which capacitors to use. I found this while reading through the previous link: http://www.intersil.com/content/dam/Intersil/documents/an13/an1325.pdf
H: Shunt capacitor as discontinuity in transmission line As in the following circuit simulate this circuit – Schematic created using CircuitLab suppose that an infinite transmission line (with characteristic impedance \$ Z_0 \$) ends upon a capacitor \$ C \$, then another infinite transmission line (with the same characteristic impedance \$ Z_0 \$) begins. Suppose that a step signal of amplitude \$ V^+ \$ is going from left to right: it will charge the capacitor. The charge process can be described by the following equation $$V_C (t) = V^+(1 - \exp{(-t/\tau_C)})$$ where \$ \tau_C = CZ_0 / 2 \$. So there is a delay before \$ V_C(t) \$ can reach the value \$ V^+ \$: this expression is exactly the same as an RC circuit. These are all the informations I have. My considerations are the following: The key fact in the charge of a capacitor in a normal RC circuit is the equation $$V_g - V_C (t) = R I(t)$$ But here it can't be written, because there's not a resistance! The only constraint imposed by the transmission line is that $$\frac{V^+}{I^+} = Z_0$$ The right line can be represented by an impedance \$ Z_0 \$ in parallel with \$ C \$ (considering that it generates no reflections): this could be the load of the left line. But I don't know how to represent the left line with the incoming \$ V^+ \$. So, how is \$ V_C (t) = V^+(1 - \exp{(-t/\tau_c)}) \$ obtained? And why is \$ \tau_c = CZ_0 / 2 \$ and not \$ \tau_c = CZ_0 \$? The circuit should be simulate this circuit but I don't know why and if a transmission line (the left one) can be represented by a Thèvenin equivalent circuit. AI: So, how is \$ V_C (t) = V^+(1 - \exp{(-t/\tau_c)}) \$ obtained? Your schematic model is correct. The left transmission line can be modeled with a Thevenin equivalent as you showed and the right transmission line can be modeled with just a resistor equivalent to its characteristic impedance. You seem to understand why the right-hand model works, so I'll focus on the left one. First, why \$Z_0\$ in series? Imagine that there was actually a wave propagating from the right. Then the model of the left-side transmission line would have to look (to that wave) just like you've done for the model on the right (by superposition, you can ignore any sources on the left when working out how the circuit responds to this hypothetical signal arriving from the right). So you'd have an equivalent input impedance (looking in from the right) of \$Z_0\$. The \$Z_0\$ in your schematic represents this. Second, why the source? Imagine there was no capacitor and you were just looking for the signals (\$V\$ and \$I\$) at an arbitrary point in an infinite transmission line. You'd be able to work out the behavior of the waveforms. To make your Thevenin equivalent, you just need to choose a voltage source that would give the same behavior. You can continue to use this same model after adding the capacitor, because the presence of the capacitor doesn't change the model of the portion of the transmission line to the left of it. Note: you should actually have \$ V_C (t) = \frac{V^+}{2}(1 - \exp{(-t/\tau_c)}) \$ And why is \$ \tau_c = CZ_0 / 2 \$ and not \$ \tau_c = CZ_0 \$? You have \$Z_0/2\$ instead of just \$Z_0\$ because your schematic model is correct and both "resistors" (actually equivalent circuits of transmission lines) are in parallel with the capacitor.
H: MSP430FR4133 is missing PxSEL1 register? Hi there fellow MSP430 programmers! I'm new at this so maybe you can help. I'm running into trouble configuring the MSP430FR4133 PxSEL registers. In the MSP430FR4xx Family User's Guide, it is stated that the pin function select is controlled by TWO 8-bit registers, PxSEL0 and PxSEL1, to control primary/secondary/tertiary functions: The problem is: I can only find and access PxSEL0 on all ports, and PxSEL1 seems to be totally absent in both the msp430fr4133.h header definitions as well as in CCS's register browser: I'm confused as to why the FR4133 version of the device doesn't show the PxSEL1 registers in both the main header definitions or the register browser. This poses a problem if I wish to configure pin 5.1 for the UCB0SCL function, because I can only set one bit in P5SEL0 and the other bit in P5SEL1 is ... either nowhere to be found, or I've got a case of the misunderstandings. Any clue as to what is going on? Thanks! AI: As you can see in the Input/Output Schematics section (6.9.13) of the datasheet, this chip has no pins that actually have a secondary or tertiary module function. Therefore, the PxSEL1 bit would always be zero, so TI did not bother to define its register symbol.
H: Can a voltage source be DC and generate a sawtooth signal? Pretty much what the title says. I'm fairly confused with this simple question. Shouldn't waveforms which change amplitude be AC? EDIT: So this is about a RAMP Type DVM (Digital Voltmeter). Can the input signal be both DC and sawtooth is my question? AI: Just don't get too hung-up on calling something ac or dc. If there is an ac signal superimposed on a DC level then that is exactly what it is, an ac signal + a dc level. Calling that composite waveform either dc or ac is missing the point. You wouldn't call a battery an ac source even though it gradually discharges and then possibly is recharged - that would be what could be described as a signal with dc and a sawtooth. Give it a full description is my take on things.
H: Software vs Hardware control I was reading the Tivaware datasheet on GPIO: http://www.ti.com/lit/ug/spmu298a/spmu298a.pdf When I came across this(page 257): "where GPIO_DIR_MODE_IN specifies that the pin is programmed as a software controlled input, GPIO_DIR_MODE_OUT specifies that the pin is programmed as a software controlled output, and GPIO_DIR_MODE_HW specifies that the pin is placed under hardware control." What is hardware vs software control in emb. prog? AI: It usually means when used as a GPIO software can control whether it is an input, output, enabled and so on. Basically software defines how the pin works. In a micro controller there are often hardware functions, perhaps multiple select-able hardware functions such as I2C that also come out pins. In this case you would do whatever needs to be done to put the pin under hardware control. So it becomes no longer a GP pin but an input or output pin of an internal hardware block.
H: how to determine if system is matched in system I'm concerned about matching. If you look at the pictures, there is a certain tracewidth optimized for 50 ohm that is then changed to fit the pad of the rf component. How would I measure the amount of reflection in an already built system? Situations: The RF board is already built, there is another component that generates the rf signal on the other side of the board, making the attachment of an sma connector to hook up a network analyzer not so likely. Even if it wasn't there, the trace is far from the board edge (maybe a right angle sma connector and unloading the rf generator?). Additionally, it would be nice to test this for every board that comes through production (making attaching components not an option). Is there a way to test it with an rf probe (just a cable that you touch the tip of the cable to the trace) or some other method to ensure accurate matching? AI: Some things to consider. The wavelength at 2 GHz is about 150 mm in vacuum, maybe 75 mm in FR4. Your discontinuity is much much shorter than that so isn't likely to have much effect on the signal. At 2 GHz, measuring with the chip in place, no matter what technique you use, you're not going to be able to tell the difference between a reflection caused by your PCB layout and a reflection caused by the chip termination and package. The track narrowing is producing an inductive parasitic. The nearby top-layer ground is producing a capacitive parastic. You shouldn't just be worried about the track narrowing. If you're lucky (or design for it to begin with) the two effects might balance each other out. If you still want to make a measurement, you have a few options: A. Active oscilloscope probes are nowadays available up to your frequency and beyond. Assuming you can make your system generate a single-frequency excitation, you could place the probe at different points along the line and estimate the VSWR. B. If you can't spend money on a GHz active probe, a 500-ohm resitive probe should be able to measure signals on your trace adequately. These have been available for many years. They do produce a small discontinuity on the line, and produce 10:1 attenuation of the signal delivered to the 'scope, so they're not necessarily ideal. C. Companies like Cascade make coplanar microprobes that might be able to contact your trace and the surrounding ground planes. If you do this with the source and load chips in place, it will produce a substantial discontinuity (essentially an un-matched tee). If you connect the microprobe in place of the source IC you should be able to do a nice TDR and see the discontinuities in your whole setup (traces, via, and termination).
H: RX/TX labeling standard I'm familiar with the idea that RX means receive, and TX means transmit. Therefore, if I'm wiring two IC's together, feeding the TX of the sending chip into the RX of the receiving chip makes sense. How does this labeling standard extend to other devices that aren't either the source or termination of the signal? For example, I have a USB connector that has certain pins labeled RX and TX. It seems like the RX pin could mean "receiving from the cable" or "receiving from the device" - so the meaning is not as clear. Obviously I can check the standards for USB to determine the answer to this particular question, but I am curious if there is a more general labeling system that applies in these non-obvious cases. And, is there ever a case where an IC would have a pin labeled RX that isn't a receive input (ie. trying to imply that it is driving a receiver or something)? AI: Given that you are talking about USB 3.0, this does use two additional pairs. These pairs are high speed 5Gbps differential pairs. One of them carries data from the host to the device, and the other carries data from the device to the host. These actually get crossed over, much like with RS232/UART - so the RX from one goes to the TX of the other and vice versa. If it is a device itself then these labels would be specific enough to understand. But it can cause confusion when building things from breakout boards where connectors are labelled with no device connected to indicate their reference direction (whose RX is it? ours or theirs!) - in that case you are better of referring to the correct specification or any documentation that came with the board. The same is used in PCIe devices which have one or more simplex pairs for RX and the same number again for TX - so for example an 8 lane PCIe device actually has 16 pairs, 8 in each direction. Again here the RX and TX are crossed over. These are not always named RX and TX, you can also find them called HSI and HSO ('H'ighspeed 'S'erial 'I'n and HS 'O'ut). You also sometimes see the pairs labelled as +/- or P/N or just one (the inverting one) labelled 'n'. When it comes to the other signals for USB, the D+/D- pair, these are actually bidirectional, so RX and TX make no sense. Instead you have the positive and negative (inverted) 'D'ata pins. Again here the +/- can be named P/N as well. Firewire (IEEE1394) is similar to USB 2.0 lines in naming, you have a data pair and a strobe pair. Usually you wouldn't have a pin labelled RX that transmits. I say usually because some UART type devices unhelpfully label the RX pin as TX and vice versa in which case you would connect RX to RX. But I've only ever seen one device which did that and to be honest it is a stupid thing to do!
H: How to design a metal plate for PCB I am designing a Esp8266-based WiFi module and I'm not sure if I need one of those metal plates. They are suppose to protect a sensitive area from EMI/RFI, right? Also, how can I design one with custom measures and writing? Here is an example: This is with the shield on This is with the shield removed AI: These shields are used to deaden EMI/RFI both to the circuit, and from the circuit. I have seen them most often used to contain RF noise so that the product passes regulatory emissions testing. Also, these can help "modularize" the design. One of the problems with RF circuitry is that the tuning changes with the surroundings. Generally an RF-enabled product is tested while it's in the case/package that it will be used in. If you change (or remove) the case, the RF path can go out of tune. Isolating your RF circuitry inside one of these faraday cages can minimize the external influences on the product. The shields come in a large assortment of dimensions. Here is a link to DigiKey's RF shielding products. As far as customizing the case with your logo or part number: this is often done with a laser etcher, but a simple label is easier :)
H: Numbering format in code syntax For the code, which I am referring following is syntax: Write_Parameter(0x00); In above line, what does "x" stands for and what is data size for x? My assumption is its dec format. So, What other format, we can use? Thank you. AI: 0x followed by a series of digits means a hexadecimal number in C and many other languages (other common formats are decimal, octal, and binary). The number of digits after the x represents the number of bits, in multiples of 4: 0x0 - 4 bits (or one "nibble") 0x00 - 8 bits (or one byte) 0x0000 - 16 bits 0x000000 - 24 bits 0x00000000 - 32 bits But as Nick Johnson points out, regardless of the number of digits in the constant, in C a numeric constant is treated as an int unless it has an l or L suffix, or preceded by a cast. On 8 and 16-bit machines, an int is usually 16 bits, and on 32-bit machines it is 32-bits. Because the number is hexadecimal, each digit can represent one of 16 values, 0-9 and A-F (A=10, B=11, C=12, D=13, E=14 and F=15). Each digit position, going from right to left, represents a hexadecimal "nibble" or four bits, with a placeholder value of 1, 16, 256, 4096, 65536, etc. So 0x0ABC, for example would equal decimal 2748: 4096 256 16 1 0 A B C => 0*4096 + 10*256 * 11*16 + 12*1 = 2748 The 0 after the x could be omitted and you'd end up with the same thing. The largest unsigned value in each of the fields above is: 0xf - 15 (2⁴-1) 0xff - 255 (2⁸-1) 0xffff - 65535 (2¹⁶-1) 0xffffff - 1677215 (2²⁴-1) 0xffffffff - 4294967295 (2³²-1)
H: capacitive touch screen I am currently trying to build a capacitive touch screen. My end goal is to create a giant track pad/keyboard for my computer. Since abnormally large touch screens are quite pricy I have set out to build my own. Unfortunately it seems as though this has not been done before by regular electronics enthusiasts. As far as the touch pad goes, I don't need more than one touch to be registered at any one time. From what I understand, this can be accomplished by using a large conductive plate (I am currently using sheet metal) and four capacitive sensors in the four corners. A set voltage is applied to the plate through a large resistor. The sensors in the corners continually measure the voltage of the plate. When a user touches the screen, it will act as a capacitor and disrupt the voltage making it drop. This will be read as a touch and can somehow be interpreted as x y values. Designs for capacitive touch screens typically involve a "grid" of sensors that give x y values, but if I am not mistaken, this is only needed to register multiple touches. So far, just for testing, I am using a small piece of sheet metal. I am using an Arduino Uno to report the raw voltage levels from either side of the metal. When it is not touched the sensors report a value between 1014 and 1023 (the Arduino has a 10 bit ADC). When the plate is touched the values drop. These values, however, don't seem to be consistent enough for me to get any location information about the touch. So my questions are: Does my project seem like it can be done? Is there anything that could be changed about my project to make it better? Would making a touch pad in this way be possible with reasonably accurate results? How can I stabilize the readings so I can translate them into x y values and how do I convert them into x y values? I tried to do research and I think I understand the basics of capacitive touch screens, but I could only find information giving a general description of the science of these devices. I couldn't find anything that would give me enough detail to replicate the process. Thanks for taking an interest in this question! AI: It's hard for me to imagine that your 1 big sheet of metal would work as a touch pad for 3 main reasons The (x, y) extraction from the measurement. Having only one big capacitor won't be accurate enough, and that's why touch panel on the maket place have a grid of capacitors. This is the first problem you are trying to solve now. The touch tracking. It's a fundamental need to detect the position of a touch, but not enough. To build a touch pad you'll also need to follow the touch movement, manage the case of a possible "not desired" second touch, handle the "tip switch" in other words when the touch is leaving the touch pad... and many others. The touch driver. To make your customized touch pad as pointing device, you'll need your OS to understand data from your touch pad. You'll build you own protocol, or used a USB standard for example, which requires a huge work IMHO. Although, I congratulate you for your effort, and I'm just adding one remark Designs for capacitive touch screens typically involve a "grid" of sensors that give x y values, but if I am not mistaken, this is only needed to register multiple touches. No, not really. In an other post that have nothing to deal with yours, I've added 2 pictures that a touch screen controller (with image processros inside) is using as primary data. You would notice how a grid is used to capture the touched area. Imagine a big big finger touching the screen. It would be seen on many "touch pixels", then an algorithm like a centroid detection, will compute the center (x, y) of the touch area. That's not only for multi-touch.
H: Integral and Derivative terms in PID control Integral Term My understanding of the integral term is: Sum of all errors since we started counting. So, even though we have reached our desired final target position, the integral of the errors should be high (no?) since we started adding all the errors from when we were in our initial position. And if the Integral term is high at our target position, the controller would still be continually ramping up...? [I understand that the Integral term's value will be a constant at this point since the error is 0. But, would it not still be a high value?] Derivative term Say, we are in time instance t1. Can I predict the rate of change for a specific time instance, say t20, and then apply this parameter to the current state? Is that how the derivative term works? AI: The Short answer The constants for your PID controller as well as the error signal can be negative or positive , as your system adjusts to your PID control signal it will produce decreasing error and eventually an error of opposite sign and the integral will not continue increasing indefinitely. As the system oscillates from negative to positive error the derivative term will also change sign relative to each other. Typically the derivative and integral constant will be of opposite sign so that the control signal is rapidly reduces when the signal finally starts moving to avoid overshooting. The Full Answer The integral term determines how strongly the PID controller "ramps up" its response to error. The idea is that if you are outputing a control signal and the error stays high you want to keep increasing that control signal above the proportional level. The derivate term determines how strongly the PID controller "braces" for the error inversion and compensates for the integral term as the system responds to the PID output. The constant term here is usually of opposite sign to the Integral term, as the system starts to move to lower error, you start to increase a control signal in the opposite direction to minimize overshoot and decrease settling time. Conceptually you are using the integral and derivative terms to set the proper damping to settle your system. For a majority of systems a slightly underdamped loop is ideal, the system settles quickly and with no overshoot. Depending on your application you will have to determine what kind of overshoot is reasonable for you. The Rest I think in cases where confusion is a foe that always finds an opportunity to strike it is best to refer to the definition to center your discussion With error signal \$e(t)\$ at current time \$\mathbf{t}\$ we produce a signal \$u(t)\$ with the definition \$u(t) = A_Pe(t) + A_I\int_0^\mathbf{t}{e(t) dt} + A_D \frac{de(t)}{dt} \$ The definition puts no bounds on the constants associated with each term. Or any assumptions on effect that u(t) has on the system being controlled. Additionally there are many variations on the core definition that can be used. You can window the input (only chose the last 30 seconds) or weight the input with a convolution (simplest case: redefine constants to also depend on t) Consider 3 Cases The output signal has an immediate effect on your system The system has no resonance or inertia and your output immediately moves your system to 0 error from the proportional term alone, you set the derivative constant to close to 0 and the integral term never has a chance to grow. This is an ideal system that probably doesn't need a PID at all to control The output signal has minimal effect on the system (error signal stays constant ). Regardless of \$u(t)\$ the system refuses to budge, the integral term grows larger and larger and diverges to infinity. Whatever physical device you are using to generate the influence will likely burn up. Consider a PID controller driving a piston trying to move the earth, no matter how hard it tries push the earth will not budge off its course. As a theroretical concept there is nothing preventing \$u(t)\$ from growing arbitrarily large The output signal has a proportional effect on the system (properly tuned PID) The \$u(t)\$ generated drives the system and reduces the error, the integral term slows its steady accumulation and the derivate term increases as the system starts moving. At some point the system will cross a threshold and the error signal $e(t)$ will change signs, this causes the integral term to start decreasing and at some point it will also change signs. . If you pick yout constants correctly you can tune your system into a properly damped loop that has your output signal driving your system to 0 error in the shortest time allowed by the dynamic characteristics (mechanical, electrical, or otherwise) of the system you are controlling
H: Portable 1A battery phone charger I want to make a little battery-powered portable phone charger with 2x AAs that outputs 1A. I have seen similar USB powered battery chargers such as the Mintyboost but it only outputs 500mA. For 1A output, would the design be fairly similar? Does anyone know what changes would be needed to make Mintyboost give 1A? Instead of USB I'd use a micro-USB - would that be safe? Thanks AI: USB charging over 500mA works through negotiating with the host to determine if it's a standard downstream port (which supports up to 500mA power and comms), a charging downstream port (which supports up to 1.5A power and comms), or a dedicated charging port (which supports up to 1.5A but no USB communication). There's no way to tell a device it may only draw 1A, unfortunately - your limits are 500mA or 1.5A. You can do this negotiation yourself with discrete circuitry or a microcontroller, but there are dedicated ICs to do this for you, such as the TPS2540. You'll also need to boost your battery voltage to 5V at the required 1.5A. I'm aware of the fantastic PAM2401, which is capable of boosting from 2xAA batteries with 5V output at 1 amp, with very few external parts. However, I'm not aware of any ICs that will support 1.5A output current with such low input voltages, unfortunately - and as PlasmaHH points out in the comments on your question, supplying enough current from two AA batteries may be problematic in the first place. As far as connectors go, yes you could use a USB-OTG micro port - but OTG cables are a lot harder to find than regular ones, so unless you have a compelling reason to do so, it's probably simpler to stick with USB A.
H: MOSFET Switching without gate voltage / LED Strip I have ordered logic-level MOSFETS of the type IRLZ34N (for the sake of working on a Raspberry Pi) but I have problems in Wiring it up. I have so far connected: +12 to the +12v lane of the switch FET Drain to the blue color of the switch FET Source to the negative terminal of the lab PSU FET Gate to GPIO pin My setup is comparable to this diagram: Apart from me having only wired one color, not three and not using TIP120 but IRLZ34N. Same pinout (Gate/Drain/Source and Base/Collector/Emitter, read from front left to right) However, the LED strip just lights up blue right away. Even with the raspberry pi turned off. Or the Gate Wire removed from the jumper cable (i.e. 100% sure that there is no voltage on gate) Where did I go wrong? AI: If your GPIO pins are not configured to output low, they'll be in an undefined state. A FET's gate takes effectively 0 input current, so the voltage on the gate will fluctuate arbitrarily, and may well lead to it being biased 'on'. Add pulldown resistors to your circuit so that the switches default to off unless being driven by the Raspberry Pi.
H: 4-20mA Loop powered DAC I was selecting a DAC for HART network and in the process I came across two terminology. 12-/16-Bit, Serial Input, 4 mA to 20 mA, Current Source DAC AD5420 and 16-Bit, Serial Input,Loop-Powered, 4 mA to 20 mA DAC AD5421 As per my understanding, the difference between the two terminology is, the Loop-Powered, 4 mA to 20 mA DAC will be powered from the input signal itself whereas for 4 mA to 20 mA need to provide supply as well as like other IC, correct me if i am wrong. My question here is what topology will make the Looped power devices to get the supply from the Input signal itself and what will be the behavior of these signals? AI: The loop powered devices are powered by the output signal. A fixed loop supply is put in series with the device and whatever loads it is driving. To make this work, the loop powered device drops a bit of voltage (minimum), at since there will always be some current there (usually a bit less than 4mA is okay for a minimum) there is power available for the transmitter. For example, 3.6mA at 7V drop is 25.2mW. It's important that all the supply current (including that taken by the regulator itself) be measured so that the output current is accurate. The power the device requires imposes a minimum compliance voltage (voltage drop across the transmitter). If all the circuitry can run from 3.6mA a linear regulator can be used, otherwise a SMPS converter (eg. buck) can be used to get more current (at the cost of higher voltage drop). At some point (for example a sensor that requires several watts) it becomes impractical to use 4-20mA loop power.
H: Simplest AC-DC: charging capacitor at needed AC input voltage To implement a simple AC mains input circuit to charge a capacitor with low voltage DC I think that it should be possible to connect the output capacitor to the AC line through a diode, and a transistor which will disconnect the capacitor from AC line after the input AC sine will go higher than some certain voltage (Uthr on the picture). So the power will be consumed from the input AC line only within narrow periods of time when the AC voltage is higher than the current capacitor voltage and lower than some certain limitation (let's say 30 Volts): After this "rectifier" an LM7805 or similar IC can be used to stabilize the output voltage. I suspect that this schematic can be useful in application not demanding for power, efficiency, input to output isolation and power correction factor. However it could be extremely cheap and simple. If this was already been realized, how can I search for related products (switch driver schematic, special purpose ICs, switches...)? UPDATE 1 I have to say sorry to many of downvoters for my poor English. This was a struggle for me to put my idea into English words. AI: The concept you describe is implemented both by some commercial IC's and by discrete circuits such as the one below, designed by the great Dave Johnson. Very briefly: After mains AC zero crossing positive going rising mains voltage couples to the gate of the MOSFET turning it on. The MOSFET connects the "ground" of the output circuit to the -ve of the input bridge rectifier BR1. The 470 uF charges to the so-far-still-low mains voltage. The 220k:10k divider drives the 2N222 transistor base. When the mains voltages rises high enough to to turj on the transistor, the transistor clamps the MOSFET gate to its source, turning it off. This state continues until Vmains again falls below the critical level. NB! When the MOSFET is OFF the output circuit floats to rectified mains phase voltage above AC "neutral". Touch it and you may die. Even if the circuit was rearranged so that output earth was at neutral when Vmains was high the circuit would still be a potential death trap. Here is a very slightly altered version - same circuit - load wiring shown slightly differently to make it clearer that the whole output circuit is effectively alternately connected to Neutral and then to phase. "Interest only" and of not much effect on the output when considered in isolation - When rectified AC in is between about 3V and 8V the FET is on and output ground is one diode drop above the most negative AC lead. When Vin_AC > 8V the FET is off and Vout + is one diode drop below the most positive phase lead. So regardless of which input lead is phase and which is neutral, the output effectively "dances" between them every cycle. Above is based on PDF here For an explanation of this circuit (which effectively does what your idea does) see my answer here Note very carefully that ALL parts or this circuit MUST be treated as if they were at mains voltage - as they may be. This is a very dangerous circuit and must only be used with a full understanding of and allowance for the dangers. Circuits like this are prone to occasional sudden noisy & explosive failure with release of magic smoke. Mains spikes or dips or surges can "fool" the switching logic in various ways. While the concept is good the risk is so high that use of safer isolated supplies is almost always preferred. Even if the user is not endangered the circuit is liable to destroy the powered equipment "just because it can".
H: Is this transistor datasheet correct? I was about to post a question asking for a schematic critique, although while checking things I've noticed a few things on the transistor datasheet that strike me as being a little strange. The datasheet in question is for an NPN, TO-92. The second page states the electrical characteristics, and they're making things a little harder to understand how transistors actually work. The Vceo and Vces are marked down as minimum values, which would seem to imply that there must be a minimum voltage between the collector and emitter of 45V to 50V depending on the total current passing through the collector. Should these two values be marked as maximum rather than minimum? Similarly, the Emitter Base Voltage, as I understand is the maximum voltage that can exist between the emitter and base, assuming that the emitter ended up with a positive voltage in reference to the base voltage. So again, should this be marked as maximum rather than minimum? Finally, the DC Current Gain has a minimum of 100, but this appears for an Ic of 100mA. Am I able to assume that I'll always have a current gain of at least 100, irrelevant of Ic? If not, how am I to know the minimum current gain if I'm not passing in 100mA? EDIT: After looking at a different transistor, I've found the 2N5551 from Fairchild Semiconductors, and the respective datasheet. It's far easier to understand, as the parameter names are far less ambiguous. For example Collector-Emitter Breakdown Voltage etc, the keyword being breakdown in the name. Also, they also provide a spice model and plenty of graphs. Seems there's a large difference in the quality of datasheets. AI: It's saying that the transistor can be operated up to 45V. This has to be specified as a minimum value because if it was specified as a maximum value then you wouldn't know the lower limit that might cause it to fail. It's a guarantee on performance - if you bought a car that was guaranteed to do 150mph you'd want the MINIMUM guarantee to be 150mph. It can't be expressed any other way. On the other hand if the car manufacturer specified acceleration from 0 to 60mph as 4 seconds, you'd want that to be a maximum value i.e. you can always guarantee to do 0 to 60 in 4 seconds (max). Think about it. Regarding hFE, use a better transistor that has a full spec. The spec you linked doesn't even have a part number other than the generic (but suspicious) name "T0-92". Here's what the current gain for the BC847A transistor looks like in its data sheet: - This is the sort of data I'd expect to see in a data sheet.
H: Is it normal for a transistor running a motor to be very hot? I've researched for a few hours but I'm still concerned. I'm building a very low budget quadcopter (think toothpicks) and as I've seen on this site, a D10N05 mosfet would do the job. I've visited 3 of the largest electronics shops in my area but unfortunately, they don't have this specific part, or any mosfet as a matter of fact. Then, I saw this post here on se and lucky enough I have some 2222's collecting dust in a container. I tried it, and it works like a charm. But, one thing I noticed was the transistors would run so hot to the point that I couldn't touch them. Is this to be expected? I have some small heatsinks and some thermal adhesive that I can attach once I know it's okay. Thanks in advance! EDIT: The transistor does not reach high temps immediately. It heats up over time. Here are the the parts I'm using: Small motors, rated at 3.7v 100ma 2n2222 transistors 1n4001 as a flyback diode 5v power supply (but I'll use a 3.7v battery on the final build) Arduino nano (PWM control) AI: To answer your question: Yes, it is normal for (power) transistors under load to become very hot while operating. Most are rated for temperatures well above 100 deg C. Even 60 deg C is too hot to touch, at least for exposed metal tabs and such. Note that it is only normal for transistors to become hot when operated with substantial current. The transistors used in the question are rated at 1A, and 100mA is substantial enough to cause heating for them. When operating very small current, for instance for low-speed logic, a hot transistor is indicative of a fault. Note that the transistors in a modern CPU DO get very warm, but that is not because of high current per transistor but because there are so very many of them in a small constrained package. When designing a circuit, of course it is desirable that it not run too hot. Keeping the temperature down increases the longevity of the device. However, keeping temperature down can mean choosing beefier transistors, and this costs more. For a quad copter it can also be noted that bigger transistors lead to smaller losses, but also higher weight and cost. For optimal performance, the transistors shouldn't be too small (short life, danger to operator, high power loss) and not too big (heavy weight, high cost).
H: Measuring currents between 100pA to 100uA I want to measure absortion/resorbtion currents of dielectric when applying 1000V, 1500V, 2000V. I have made a small currents measuring device using a LOG114: I use : LOG114 with 1uA reference current on input I1. The power supply for the LOG114 is made using an 78L05SMD (12V -> 5V) and after, the ICL7660 to get the -5V. The logarithmic output of the LOG114 is scaled to 0V..2.5V and feeded to the 24bit ADC LTC2400. I use an microcontroller to get the readings and send to computer for further processing. The problem is how do I connect this device to measure capacitor charging/discharging? If I use for example a simple current source made of a 1.5V battery and a 91Mohm 5% resistor, I get correct readings of current 16nA. I need help me adapt this to measure charging and discharging of a capacitor. I have found this board used by someone to measure this currents but no explanations, it is using the LOG104 : I made the schematics: The connection of current input is like this on the board that person uses: The question is what is this: Why the 50Mohm resistor is not connected to ground, are those voltage dividers of 10K/1K from the 5V reference used to offset both input current and reference current that goes to LOG104? AI: First, the direct answer. You need to connect your circuit between the lower end of the lower 1M resistor and ground. Any charge or discharge current in the cap also flows through both 1M resistors. Now, about your other circuit. R6/R7/R9 sets the reference current at about 1 uA. R23 provides a 10 nA offset. Apparently the input current is expected to occasionally go negative. Alternatively, the designer wanted to guarantee that if the current goes to zero, the resulting output could be identified as that condition. The R24/R25/R26/C9/C10/C11 provides a comprehensive low-pass filter for the input current. The varying capacitor values avoid problems with self-resonance at any particular frequency. EDIT - My direct answer referenced your resistor/capacitor diagram, and the result should look like simulate this circuit – Schematic created using CircuitLab You will note that the LOG114 should not be connected where you think it should. It is connected at "the lower end of the lower 1M resistor", just as I stated. And I agree that if you try to apply the low-pass filter to the top of the lower 1M resistor, and add a 50M resistor after that, you will get a lower current. But that is irrelevant, since you don't want to do it in the first place. Attempting to infer current by measuring the voltage across the lower 1M resistor is a supremely bad idea - at the very least, a 100 uA current will produce 100 volts, and I can't think of a good way to attempt to measure that. You are attempting to adapt a circuit approach which is inappropriate to your problem.
H: Powering a Futaba S3003 servo I'm working on a project and I need to use a Futaba S3003 servo, I'm about to buy a transformer that gives 6v, the thing I'm not sure about is the amperage. Is this transformer ok? I can choose 3V, 4.5V, 6V, 7.5V, 9V and 12V, but its 800mA and I don't know if it is OK with the servo. EDIT: Link to servo datasheet: http://www.es.co.th/schemetic/pdf/et-servo-s3003.pdf The transformer is only for powering the servo AI: I'm going to do a bit of math on this and make some outlandish assumptions because the data sheet does not give enough information. Stall torque is reckoned to be about ~3.5 kg.cm and full speed is reckoned to be about ~0.2 seconds per 60 degrees of rotation. Many thanks to Brian Drummond for correcting my stupid math mistake so here's the corrected answer with a bit more theory. First, it is a fair assumption that the servo will contain a small dc motor and, generally, this is the torque-speed characteristic for such a motor: - Note the blue line - at zero speed, torque is maximum (stall torque) and with no load (zero mechanical torque other than losses in the bearings), speed is maximum. This is just a graph of any old motor I stole from the internet BUT it is largely representative of all DC motors. Now look at the red curve - this is mechanical power out and equates to: - Mechanical power = \$2\pi n T\$ where n is revs per second and T is torque in newton metres (N.m) So, the 3.5 kg.cm translates to approximately 35 N.cm or about 0.35 N.m A "speed" of 0.2 seconds per 60 degrees is upside down but, rearranging, it basically means 0.166 revs per fifth of a second and this translates to 0.833 revs per second. Go back to the graph and note that max power is roughly when both torque and speed are at their respective half values therefore, Power is \$2 \times\pi \times (0.833/2) \times (0.35/2)\$ = 0.458 watts This is the peak mechanical output power I have estimated from the limited information in the data sheet. Of course it might be a bit higher or lower. Next, a motor this small may not be very efficient at converting electrical power to mechancial power so we need to apply a "frig" factor. Let's say it's 50% efficient. This now means the input electical power might be about 0.9 watts. There is a lot of hand waving here and to play a little more safely you might assume that the power supply needs to supply maybe double this value. I suspect there will be a little H bridge controller inside the servo and this might only be 50% efficient so maybe 2 watts should cover most eventualities. Please insert your own numbers and frig factors into the equations if you think I may have over-egged the omelette.
H: Series inductor as discontinuity in transmission line Dual to this question is the following circuit: simulate this circuit – Schematic created using CircuitLab An infinite transmission line (with characteristic impedance \$ Z_0 \$) ends upon a series inductor \$ L \$, then another infinite transmission line (with the same characteristic impedance \$ Z_0 \$) begins. A step signal of amplitude \$ V^+ \$ is going from left to right: it will come across the inductor and the current will "charge" it. The following schematic is the equivalent circuit: simulate this circuit I followed a procedure similar to the previous one, and wrote the following equation for the charge process of the inductor: $$I_L (t) = \frac{V^+}{2Z_0}(1 - \exp{(-t/\tau_L)})$$ where \$ \tau_L = L/(2Z_0) \$. But now I would like to obtain the following result: $$V^{++} (t) = V^+(1 - \exp{(-t/\tau_L)})$$ (exactly the dual of this) where \$ V^{++} \$ is the voltage travelling from the inductor to the right infinite line. I am supposing that \$ V^{++} \$ is the voltage across the right impedance \$ Z_0 \$. So, $$I_L(t) = \frac{V^{++}}{Z_0}$$ but anyway $$\frac{V^{++}}{Z_0} = \frac{V^+}{2Z_0}(1 - \exp{(-t/\tau_L)})$$ $$V^{++} = \frac{V^+}{2}(1 - \exp{(-t/\tau_L)})$$ and there is an undesirable \$ 2 \$ factor. I would like that \$ V^{++} \to V^+ \$ for \$ t \to \infty \$, but when \$ I_L(t) \to V_0 / (2Z_0) \$ there is an unavoidable voltage divider, maybe due to the circuit. Is it possible to cancel this \$ 2 \$ factor (and obtain exactly \$ V^{++} (t) = V^+(1 - \exp{(-t/\tau_L)}) \$ like in the capacitor)? AI: ... undesirable 2 factor. I would like that \$ V^{++} \to V^+ \$ for \$ t \to \infty \$, but when \$ I_L(t) \to V_0 / (2Z_0) \$ there is an unavoidable voltage divider, maybe due to the circuit. The factor of 2 has nothing to do with the inductive discontinuity. To see that this is true, take the limit as \$L\to{}0\$, and you'll still have the factor of 2. The factor of two is fundamental to using matched sources and loads with transmission lines. If you want to have a matched source generate a signal on a transmission line with amplitude \$V\$, you need the amplitude of that source to be \$2V\$. Is it possible to cancel this \$ 2 \$ factor (and obtain exactly \$ V^{++} (t) = V^+(1 - \exp{(-t/\tau_L)}) \$ like in the [capacitor][1])? No. The factor of 2 was also there with the capacitive discontinuity, if you did your math right.
H: Understanding alternating current (sine wave) I want to study the basics of propagating a periodic signal, i.e. sine waveform, which is a power signal. Let us consider an alternating current and write its expression as $$I(t) = I_m \sin(2\pi f t)$$ Let f=50Hz In physics we have learned that there are mainly two types of energies based on position and based on the motion of particle. Potential energy (P.E.) Kinetic energy (K.E.) Can anybody explain something about the following issues: If we consider the period from \$0\$ to \$2\pi\$, in what proportions the above 2 energy values vary at following intervals \$0\$,\$\frac \pi 4\$,\$\frac \pi 2\$ ,\$\frac {3\pi} 2\$ ,\$2\pi\$ that make the sine wave keep propagating? Why the traveling wave is sinusoidal? AI: In the sense of classical physics (and hence classical electromagnetism a la Maxwell) EM fields have nothing to do with kinetic energy, which is a mechanical concept related to the mass of a body. In modern physics you could consider photons and their equivalent mass, i.e. their relativistic mass (as explained here). But in Maxwell's theory, which is part of classical physics, electromagnetic waves have no mass, so it makes no sense to talk about their kinetic energy. They do have some energy content, but this is explained in terms of "traveling" potential energy, i.e. the electric and magnetic field in a region of space possess some potential energy; if the fields propagates, so does the energy associated with them. This is expressed using the Poynting vector. From what you say it seems to me that you are mixing up concepts of different fields, in particular signal theory and electromagnetism. In signal theory we define the energy of a time signal \$y(t)\$ as: \[ E_y = \int_{-\infty}^{+\infty} \left| y(t) \right|^2 dt \] whereas we define its power as: \[ P_y = \lim_{T \to +\infty}{\dfrac 1 T \int_{-T/2}^{+T/2} \left| y(t) \right|^2 dt } \] It is a well-known result of signal theory that signals that have finite energy have zero power and signals with finite power have infinite energy. All these definitions have nothing to do with the physical meaning of energy and power! They are mathematical definitions applicable to any signal that can be expressed mathematically. In fact \$y(t)\$ could have any physical dimension (or can be dimensionless), therefore it's energy (as per above definition) will have \$[y]^2\cdot T\$ dimensions, where \$[y]\$ means "dimension of the quantity y". For example, if y represented a voltage, the dimensions of \$E_y\$ would be \$V^2 \cdot T \$ (units \$V^2\cdot s\$ then), which are not the physical dimensions of the "physical energy". Moreover, y could well be, for example, a pressure level, so it would be measured in pascal (Pa), hence the dimensions of \$E_y\$ would be \${Pa}^2\cdot s\$, again not an energy in physical sense. Now, let's examine your example: \[ y(t) = A \cdot \sin(2\pi f t ) \] you say you want to study propagating signals, but y does not represent a propagating signal, since there is only one independent variable. Even restricting your study to a mono-dimensional case, i.e. just one spatial coordinate (say \$x\$), you would have a more complicated mathematical expression, like the following: \[ y(x,t) = A \cdot \sin \left[2\pi \; \left(\dfrac x \lambda - f t \right) \right] \] where \$\lambda\$ is the wavelength of your signal. The wavelength is analogous to the period of a periodic signal, but referred to the spatial dimension (like a "spatial period"). In other words it is the length along the x axis after which the signal repeats itself. Note that mathematically the signal \$y(x,t)\$ above is periodic both along the x (spatial) axis and along the time axis. Try to plot that signal along the x axis for different values of t and you'll see a sinusoidal wave "moving" along the x axis (toward more positive values). Let's tackle your point 1. Energy has nothing to do with the propagation of an EM wave. Whether or not a wave propagates depend on the sources of the EM wave (e.g. an antenna) and on the medium in which the sources are immersed. The fact that a traveling EM wave carries some energy with it is a consequence, not the cause, of the propagation. In the vacuum a propagating wave will keep on propagating forever even if its energy content will be spread in an ever-growing volume of space (spherical waves). There won't be an energy threshold that blocks the energy from propagating in general. Interaction with physical media is extremely more complex. There could be media in which a wave will be attenuated as it progresses along, making the wave lose energy in the process, thus leading to a gradual fading. There could be media in which an incident wave could not even pass (total reflection, as in a mirror hit by light). And there could be media that could even distort the form of the wave. That's an enormous can of worms, and the only general approach is to solve Maxwell's equation knowing the constitutive relations for the media the EM wave is supposed to interact with. Let's consider point 2. Why it takes less time to go from 0 to 0.7A than from 0.7A to A? Well, that's simply a mathematical property of the sin function. There is no physical explanation, if this is what's you're looking for. Maybe the question you should ask is: "why a traveling wave is sinusoidal?". Well, the answer is "in general a traveling wave is not required to be sinusoidal". Sinusoidal waves are common just because it's very easy to analyze them and they are among the simplest solutions of Maxwell equations. Moreover they are the basis for more complex methods that allow to decompose a complex waveform into sinusoidal components (Fourier analysis and the like). But you can have traveling waves with arbitrary waveforms. For example, in most PC's high-speed buses signals travel as waves but they are not sinusoidal, but usually rectangular, because on those buses you transmit digital information (0-1, Hi-Low - and I won't bother you with details on digital signals which are not just two levels or "square").
H: How to figure out how much time you have for writing to flash when voltage source breaks down? I try to figure out how I can make sure, that my controller (STM32F030K6) is always able to save a 16 bit integer to the flash when the power is breaking down rapidly. This controller has an Analog Watchdog that fires an interrupt when it detects a value below a certain threshold. The ADC runs in continious mode and multiplexes 4 channels of which one is the critical and is used for the Analog Watchdog. So I figured I get a new value for this channel every 350 cycles ( 87.5*4, to scan and convert 1 channel the adc needs 71+12.5 = 87.5 cycles). When the IRQ fires it runs this function: uint16_t data=...; ... void ADC1_IRQHandler(void) { HAL_FLASH_Unlock(); HAL_FLASH_Program(TYPEPROGRAM_HALFWORD,0x8007C00, data); HAL_FLASH_Lock(); HAL_ADC_IRQHandler(&hadc); } According to the data sheet, it takes this chip ~50µs to program a 16 bit value to the flash. My set up is a PCB with a 24V supply, an LM317 generating 3,3V and a charge pump for a MOSFET, which takes the clock from the controller. I thought about shutting everything down before writing to flash, to save some power, but shutting down costs cycles... I've got 100nF on the 24V input and 1µ on the input and output of the LM317 voltage regulator. How can I make sure I can always save that value, even if the voltage on the input breaks down immidiately? AI: Something like this should work. Since C1 only supplies the current for the LM317 + controller, you know it is discharging with ~35mA. If you set the threshold at (say) 10V, then you have at least 5V delta-V for C1 before U1 starts to drop out. Say you want it to stay up for 1ms after power fail is detected, then C1 = (0.001 * 0.035)/5 = 7uF. So you could use a 10uF cap. simulate this circuit – Schematic created using CircuitLab
H: Show charge state of a car battery I'm building a mobility music box, powered by a car battery (12v, 74Ah). What can I build into this box to show the current charge state (read somehow from a display if the battery should be changed)? Will a simple voltage or ampere meter be enough? AI: A car battery has some very specific charge/discharge characteristics. In general, it is not simple to accurately measure the state-of-charge without resorting to physically measuring the specific gravity of the electrolyte. One can attempt to measure the voltage, but many factors will affect it's accuracy, including temperature, load, past loading, amount of time left to rest, etc. That might be fine for a low-accuracy idea of how much battery is left. Here is a fairly straightforward implementation. Here is a more rigorous one, and a very rigorous one. Google "12v lead acid battery indicator schematic" or similar. One electronic way of doing it would be to measure the amps used by the music box and average this over time. If it's a 74A/h battery, and over the past week the music box has operated for 16 hours whilst drawing exactly 2A of current, then (16*2) = 32A/h of the battery capacity has been consumed. 32A/h / 74A/h = 0.43 * 100 = 43% of the battery is consumed. 100 - 43 = 57% remaining. Doing these calculations can be done many ways, most today utilizing a microcontroller such as the AVR, PIC, or Arduino.
H: How to work with the MCP1702? I'm reading the MCP1702 datasheet and there's the typical circuit on page 2 depicting a 9V source and a 3.3V 50mA output. My question is: How come the current output is 50mA when the spec says that when Vr < 2.5V, Vin > 3.45V the min. output current is 200mA? How is the output current determined? Why is it 50mA? Thanks for the help AI: It's an example circuit. They could have written 35mA. Power dissipation is (Vin - Vout) * IL, so 285mW in this example. So in the SOT-23 case we'd have a junction temperature rise of about 96°C. If we allow a maximum junction temperature of 125°C (the highest steady state temperature for which the characteristics are guaranteed- see table below), the circuit would be good for an ambient up to 29°C, which isn't very impressive. Maybe they should have written 35mA. It would be better in the other packages. SOT-89 would only rise 44°C so would be good to ambient 81°C (or higher current at a lower ambient). These numbers are calculated from this table: They may be optimistic because they assume a 4-layer board, probably with ground and power planes, so caveat emptor. Edit: Yes, it does assume 1-oz power and ground planes, so if your design is 1 or 2 layer it will not perform as well: If you only require brief pulses of current from the source, such that the junction does not heat excessively, the higher current rating may indeed apply, but you would have to pay attention to the transient thermal characteristics to determine if those operational conditions were acceptable. In design it's important to make sure that all the constraints are satisfied. It's no good saying that the regulator is supplying current as specified if it shuts down a second later (and eventually fries) due to overheating.
H: PCB Stackup - Current return path It is a well known fact that high speed signal would have return current path on the plane right beneath it's PCB trace. Suppose we have 4 layer stackup, SIG-GND-PWR-SIG with dielectrics CORE-PREPREG-CORE respectively. Difference between core and prepreg is that core has cooper filled on both sides of dielectric and prepreg is just full dielectric, no copper on any side of the material. Why wouldn't return current flow on the top side of CORE between SIG-GND since there is a full cooper plane on top side of CORE? AI: Difference between core and prepreg is that core has cooper filled on both sides of dielectric and prepreg is just full dielectric, no copper on any side of the material. Since you just sandwiched the prepreg between two cores, which are themselves clad with copper, the prepreg now has copper on both sides of it. Why wouldn't return current flow on the top side of CORE between SIG-GND since there is a full cooper plane on top side of CORE? High frequency return currents for layer 1 (SIG) will mostly flow on layer 2 (GND). Just how you want it. High frequency return current for layer 4 (SIG) will mostly flow on layer 3 (PWR). Making this work well likely requires having good bypassing near all source and load locations for high-speed signals. Return currents for PWR will indeed flow in the GND layer, because those two layers are separated by just the few mil of prepreg. If there also large ground fills on layer 4 you will also get substantial return currents there, even more so if the core layers are much thinner than the prepreg layer.
H: photodiode amplifier I am a mechanical engineering student and I am working on a research project where we want to use a reverse biased segmented photodiode (OSI SPOT2DMI series) to detect deflections from a high speed laser. We are trying to detect very small variations in the laser signal so there is a large noise signal to deal with. Up until a month ago I had very little knowledge on photodiodes and I have never designed nor built a circuit board before so please forgive me if I am too vague or use the wrong terminology. The design I currently have utilizes four high speed op amps (OPA680 & OPA650). Two OPA680 op amps are used as transimpedance amplifiers for current to voltage conversion of each of the current signals from the segmented photodiode and another 680 is used to generate a sum signal. The OPA650 op amp is used to generate a difference signal which will later be connected to a lock-in amplifier. The laser signal we are studying is around 10MHz so according to the datasheets for each of these op amps they will meet the speed requirements. My problem is that I don't understand how to connect the power supplies for the op amps. I am going to use a 12v battery for the reverse bias voltage and I would like to use a battery supplied voltage for the op amps instead of a bench top power supply. I am planning on using this prototyping board and soldering on two female BNC pcb mount connectors to extract the sum and difference signals. The OPA 680 requires a +5v and -5v power supply with a max rating of +-6.5Vdc. The OPA650 has a specified operating voltage of +-5V and a max rating of +-5.5V. I don't know much about circuits but I am assuming there is some way you can split a 12Vdc battery supply into +6V and -6V supplies, which would work for the 680, but not the 650. Somebody mentioned to me that I could usse a diode, which usually has a specified voltage drop, to reduce the voltage from the battery, but I am not sure if that will work/how to do that. If there is a way for me to use a 12V battery and split it into +6V and -6V I am also unsure of how I set up my ground bus on the circuit board and how this will affect the bias voltage since the positive terminal of that battery will be connected to the ground. If you would like to see a crude sketch of my circuit I can post it and any help is appreciated! AI: Yes, there is a way to split it. Some people just use two biggish equal resistors across the supply, and use the middle as ground (it really is a reference), and the negative terminal would be your negative, and the positive, your positive. There are some disadvantages, not the least of which is the lack of a low-impedance ground that can sink current A better approach is a chip like the TLE2426. Just read the data sheet. An alternative is to just use two DC-to-DC converters, one to +6, and one to -6, off your 12 volts. Also, once you have +/- 6V, you could use the appropriate voltage regulators to bring that down to +/- 5V. For example, http://www.digikey.com/product-detail/en/MC78L05BP-AP/MC78L05BP-APMSCT-ND/804696 and http://www.digikey.com/product-detail/en/MC79L05BP-AP/MC79L05BP-APMSCT-ND/804701. I haven't verified the drop outs (i.e., how much voltage you need to feed them to get your required output voltage), or asked about your current requirements, but your search term would be LDO regulator if these don't suit.
H: confusing current readings I know that Ohm's Law is V = IR but I am getting some very confusing current readings from multiple multimeters. Here is my very basic breadboard configuration: V = 6v R = 200 Ohms I = Should equal 30 mA but it does not (see multimeter pic) The multimeter shows 18.8 mA but I do not know why. I have also tried with 3.3v and it registers 6.6 - 7 mA. I would like to know why this is happening. I have tried different resistors, LEDs, multimeters, breadboards, power supplies but it continues to happen and I am very confused with the readings. AI: Diodes do not follow Ohm's law. Instead, when forward biased they have roughly a constant forward voltage. For an LED, this could be on the order of ~2V to 3V though you should check the datasheet. Assuming your circuit looks like this (you should include a schematic of your circuit to clear up ambiguities): simulate this circuit – Schematic created using CircuitLab Then the voltage across the resistor is \$V1 - V_D \approx 4V\$. Then using Ohm's law: \begin{gather} I_{R1} = \frac{4V}{R1} = \frac{4V}{200 \Omega} = 20mA \end{gather} Which is much closer to the reading you were getting. Further discrepancies can come from any number of sources: I just roughly estimated \$V_D\$. You can measure this with another multimeter to figure out what it is. Resistors have some tolerance. Again, measure the resistance before inserting the meter. The multi-meter has a shunt resistor inside to measure current, and also has some tolerance. You can measure the shunt resistance with another meter, though it's possible the resistance is small enough that you'll need to use a 4-wire Kelvin bridge in order to measure it accurately. You can find the multimeter's tolerance rating on the box. etc.
H: Making a simple solar-powered lighting system, a few concerns I'm building a fairly simple solar-powered lighting system to use at home, which charges up a battery by day and then the battery powers a few bulbs at night, switching automatically. So far, I got that switching mechanism working with an LDR and a relay. Now I am planning my circuit to look like this (a few things omitted for simplicity): I have a few questions: 1)Does the circuit make sense and do you see it working? 2)I know I need a 'common ground' between all voltage sources, so I simply connect all the grounds (negative battery terminals) to a single node? 3)Each of my bulbs draw 333 mA (4W / 12V). If I put many of them in parallel my total current draw will be very high. Are transistors the best option here, or am I better off with relays? Thank you AI: Does the circuit make sense and do you see it working? The circuit is rubbish (I'm not noted for my human skills BTW) because the top NPN will only ever produce about 8.2 volts at the emitter to charge the battery - you need to consider using a PNP transistor wired differently. Also the two voltage sources are floating i.e. their negative connections are floating and please don't whine saying that I should presume they are connected to ground. Accuracy is something that needs to be a commitment in electronics. Also, the LED shown in red isn't described as being a 12V type and therefore it might need a current limiter BUT why is it there at all when you have the other LED in parallel? I also read that you are using lamps but, please get used to the fact that a circuit diagram (and what it contains) is the gospel and, contradicting it with statements about lamps is really just a sign of laziness when using the circuit diagram editor. Get it right in the editor. In other words, draw an accurate circuit to the best of your ability and let that speak for itself. Transistors all round are probably the best option when it comes to Q3.
H: Why does I2C look like this? I'm trying to debug an I2C device, and the wave is looking really weird. Why is it curved? AI: The ICs internally use open drain/collector drivers to actively pull the signal low so you see "fast" fall times. In contrast, when the drivers are off the line is pulled high through a pull-up resister and consequently you have a longer RC time, and a slower rise. You don't say what kind of the design this is. Is it a commercial device or something you've soldered up or perhaps built on a breadboard. Depending on those things you may want to check the connections and size of resisters being used. It might also be that the ICs you're using require that you enable pull-ups.
H: Precautions for powering up an old oscilloscope? I have a Phillips PM3264 100MHz 4 channel analogue oscilloscope, I have not powered it up in around 8 years. I have not been able to find a users manual, nor service manual as of yet, only a few pages of specifications from a brochure [pdf]. I am concerned that due to the time it has spent in storage, and the overall age of the oscilloscope that merely plugging it into mains and turning it on may not be the wisest plan of action. There do appear to be reports that the line filtering circuit can be problematic on these oscilloscopes. If it is of any importance we have a mains ground circuit breaker (I was honestly shocked to discover that in some areas of the world it is not a legal requirement), and I do not have a variac (even so, I'm not sure that a variac would be the best idea at all). Mains power in the area is 240v at 50Hz, 240v is right at the upper end of the oscilloscopes power supply voltage range. I do not have probes for it at current, and I would prefer to at least get an idea as to whether it is still functional prior to purchasing probes given budget constraints, and location. So, are there any precautions I can take when powering it up to prevent damage to the oscilloscope? AI: Usually the most problematic parts in old (but not ancient) electronic equipment are electrolytic capacitors with liquid dielectric. The most common problems are: Some caps dried up (electrolyte dried up). Some of the dielectric oxide reduced. In the first case the damage is permanent (unless you change those caps) and the result could be reduced capacitance values (even drastically). This could lead to erratic behavior and even short circuits as a consequence. Usually the problem is apparent as soon as you switch on the power: a fuse could blow up immediately or in short time. If the apparatus is not fused, that could be a problem. The second problem is less severe. If charged at reduced voltages the oxide layer will form back in minutes and everything will be fine. Of course you would need to power the device with a reduced supply. But you could try a bit riskier operation, which often works: power the equipment up for a short time (5 seconds), if it doesn't break because of the first problem, it usually can bear its full voltage for such a short time. Then power down and leave it alone for half an hour. Then repeat, now keeping the power on for 10s, then power down and let it rest for half an hour again. Repeat again, ever increasing the interval you keep the power on (1min, 2min, 5min, 10min). Always keep an eye on the thing while it is powered up, looking for magic smoke, funny sounds or strange smells (and shut down the thing if it happens). When you reach a point where the device can survive half an hour of continuous operation probably its caps, if not damaged because of the dry-up, will be regenerated. Note that 8 year storage is not too bad, if the device was stored in a dry, cool place, with no temperature extremes or other atmospheric "danger factors" (salt from seaside air, for example). I expect it to be in good shape since it is professional equipment from a reputable manufacturer, and not some el-cheapo consumer electronic gadget.
H: How to restrain this soft latching power switch from eating too much current? I am designing a two buttons soft latching power switch for a project involving a raspberry pi, li-ion cells I salvaged from the battery of a broken laptop, and a power booster from adafruit. I wanted the circuit to be controlled by two momentary push buttons : one for ON and another for OFF (so this is NOT a regular one button soft latching switch). I came up with this design : P1 is the battery input (5V currently regulated by a 7805, see details at the end) and P2 the output to the raspi (requires 5V). I am beginning in electronics but this is how I understand it : When you press SW1, Q1 gets activated, so current can pass through. The base of Q2 gets activated too, so that it is no longer required to hold down SW1. When pressing SW2, the base of Q2 gets pulled to ground, so the base of Q1 is no longer connected to ground, thus cutting off the circuit. Without the capacitor C1, noises can trigger the circuit making it unreliable. I tested this circuit with a LED first, and everything was ok, but I had some doubts about getting it to work with a bigger load, like the pi. As I thought, when testing with the pi, there is not enough current to power it fully : its power LED is very dim, and it cannot boot. Also, I have to hold down the OFF button for a few seconds, otherwise the circuit gets ON immediately after. So I thought well, I don't have enough power coming out of there, but I could use this circuit to drive a single transistor as a switch. So here is the revised design : The result is way better now : The pi's power LED is very bright, and it tries to read the SD card and engage the booting process. But it's still not enough. The pi seems to loop into its first booting process, without getting completely ON. To add more details not showing up on these schematics : As I wait for the power booster to ship (I just ordered it), for a quick and dirty alternative, I am using a 7805 to get the voltage of my 11.1V laptop battery down to 5V. So my questions are : Is my design correct considering what I want to achieve ? I only have those BJT (547 and 557) at hand right now, they are rated 50V 100mA, are they really efficient ? The resistors' values were chosen quite randomly, inspired from what I saw on some forums (there was one guy who retro-engineered a similar circuit from a chinese product, so I thought well, those values might be ok). Are the values of the resistors really well chosen ? (I still don't understand how to choose them well) Finally, is it safe to keep that circuit connected to the battery when in OFF position ? Will it still draw current ? AI: The FETs can hog current upto 500 mA. For higher load, it is very easy to find FETs with low Vgs threshold. Before pressing the switch SW1, M1 will be off since Vgs is zero. Once switch is pressed, M3 turns on followed by M1 followed by M2. M2 holds the ground to gate of M1 there onwards. When SW2 is pressed, M2 releases the Gate of M1, making the Vgs of M1 zero again, thereby cutting out 5V_OUT. 7805_5V is regulator output. Needless to say, the switch section will consume significantly less current to be suitable for portable applications. I hope, power dissipation across 7805 is looked upon. (Vin - 5V)/0.7 Watts simulate this circuit – Schematic created using CircuitLab
H: How to program modules on assembled PCBs? Suppose a Bluetooth module like the HC-05 is part of the PCB design. During production, how/when are the modules programmed? Is each programmed before or after assembly? If it happens after assembly, how are the pins accessed? Thanks AI: They either have programming points, which are basically just a small round point on the PCB, on which they push the pogo pins down and program it. pogo pins are like your normal header, but they have springs in them, which means you can press them down and they move with it. Another way would be that they have a test rig on which they press the assembled PCB down. They use again the pogo pins, but instead of touching some points on the PCB, they touch the solder points (around the HC-05) and then program it. But that may dont work always, like with the half holes from the HC-05. Then you would use these hooks. You just slide the populated PCB in it and the hooks hold the PCB in place. But those may wear out after some time. They can also pre-program the chips with test sockets. They place the bare IC in a socket, close it up and can program it with the broken out pins. Here's a picture of it: but that is rather bad for manufacturing when you do the programming by hand, because when you program it before its soldered, you need to take it out of the reel and put it back in, instead of holding a little board for a few seconds and then ship the board.
H: Splitting a big Power Trace to several smaller I would ask if i can layout a big trace and split it into many smaller ones (see attachement) I need to run a trace capable of handling ~5A. But the trace would be too thick to fit between the pins (screw terminals). My idea was to run a big trace and then use smaller traces (2mm)from the screw terminal to the big rail. Is that OK or wold it burn the board? Its homemade btw. ~Straw AI: 2mm trace is about 78mil. For an external trace carrying 5A that heats up by 20.2 K. Assuming you mis-etch by 10%, leaves >= 70mil. With 6A gives a rise of 31.8 K. So at ambient of 30degrees C a single 2mm trace on top or bottom carrying 6A with good enough manual etching will become about 62 degrees Celcius. That may not be very good for a precision board, but it's not dangerous. So it'd be good to split it over 3 traces that are within 25% of the same length, but especially if they are short and connected to fatter traces, their heat will also be wicked away. If you make it 1cm between large traces that are 0.75mm or more wide, you will not see much extra heating at all from a single 2mm trace. But it is better to have a main trace >4mm wide and two or more 2mm traces, to reduce the voltage drop. For reference, the estimated voltage drops for 10cm of trace at several widths with 6A (I use 6A because you say ~5A and it's better to use too much than too little): 2mm: 0.111V (heating =~ 26K) 3mm: 0.072V (heating =~ 20K) 4mm: 0.052V (heating =~ 14.5K) 5mm: 0.041V (heating =~ 12 K) So, depending on the length you may already be overestimating the need for a certain size of traces. This does assume the final trace is the size stated with slightly under etched sides, so if you manually etch take a decent margin. I.e. if 3mm would be acceptable it's good to use 4mm, etc. EDIT, by request: If you have no engineering handbook for electronics design with all the normal, integral and differential maths to do with anything ever, you can also use the Saturn PCB tool to calculate numbers like the above ones, which I used in this case, because I didn't want to spend too much time on it: The Saturn PCB tool, free download from http://saturnpcb.com
H: OP AMP fabrication technologies impacts on design I am referring OP AMP selection guide for implementing it in medical application where it involves optical sensing using photo diode then I/V converter and ADC for data conversion. My question is how OP AMP fabrication technology like BJT, FET, CMOS makes impact on design. I want to have more insight of fabrication aspects and its impacts (pros/cons) while implementing it in design. Thank you. AI: You can usually find a fabrication hint on the front page of a device's data sheet - it might say something like: - Single Supply, Rail-to-Rail, Low Power, FET-Input Op Amp This is for the AD824 and it does mentions "FETs". However, I'd be more interested in it being low-power and rail-to-rail rather than the technology used. But, "FET" input usually means low-bias currents so, do I then choose it on that basis? No, I certainly do not - I read the data sheet and look at the specified bias and offset currents and make a judgement on those numbers. In fact I don't give any credence to the word "FET" at all - I read the numbers and make a judgement on those numbers. I did a search of "FET" in the document and a lot of mentions came up on page 1 (the BS page that should only be read with a pinch of salt) then, it wasn't until page 11 that the next mention of FET arose. One mention on page 12 and this time it said JFET - a more meaningful statement about technology but still, I'm not swayed because I read the numbers in the tables. So, my advice from nearly 40 years of using op-amps on a regular basis is, forget the tech and read the data - understand the implications of each line in the tables of numbers because this is the true performance guarantee. The other think is that if you go to TI's (or ADI's or LT's) website and do a search, it's a parametric search and not a fab/tech search. This should tell anyone to forget about fabrication methods and concentrate on real maximums and minimums and get reading the nitty-gritty of the data sheet. However, if you don't know what you are aiming for as a design, spend more time thinking about this THEN start trawling the parametric tables and THEN compare data sheets.
H: Passive POE: Need 5V @ 2A at the destination Having a bit of trouble finding the right information on google, and I'm worried I might fry some cables so I thought it best to ask some far more knowledgable than myself. I want to connect 2 or more devices, giving them 5V/2A plus networking between them. I figured to do so with the least amount of cables, Passive POE would be a good choice. The distance isn't far, probably maximum 20ft, as each device will be somewhere in a car, connected in to the boot/trunk area. I'm looking at splitters and injectors, from what I've read its not as simple as just injecting 5v and it'll work? I have to worry about loss and also heat. So my questions are, what is the best way to get 5V with max 2A current to the destinations? Do I need to send higher voltage to ensure it doesn't drop below 5, then use a regulator to ensure 5V? If I do that, the power will also be higher therefore more heat, is that ok? Studying Wikipedia page I've read "Category 5 cable uses 24 AWG conductors, which can safely carry 360 mA at 50 V according to the latest TIA ruling" 50v * 0.36a = 18W, so if I were to send 9v * 2a = 18W. Then I could use a regulator to drop the ~9V(allowing for loss) down to 5V. Does that sound reasonable? Many thanks AI: Let's start with a couple of straight answers: Good choice, possible, maybe, correct, yes, unless they use AWG26 or 28, which some flexible ones do, that's not how that works. I'm betting you want more, right? So, starting with your "biggest mistake": Power output at the end is not what a cable cares about. Cables care about current. Current creates a voltage drop caused by the wire-resistance. This voltage drop multiplied with the current creates power loss in the cable, which creates heating. Heating is bad. Bad is not good. If you want to stick to "safe practise" you need to stay at the current level described in the standards, not the power level. So to transport your 10W, you'd need: V = P/I = 10/0.36 =~ 28V But, that doesn't account for power loss in a conversion. If you use a buck regulator, which actively turns a given voltage into a stable 5V very close to the device, it can give you an efficiency of 85% or more, depending on which you choose. So then you are allowed to estimate using: Pin = Pout / efficiency = 10W / 0.85 =~ 11.8W. Then you need to put V = Pin / I =~ 11.8 / 0.36 =~ 32.7V into the converter. Because you still have wire losses you will need to put in a little more, so round up. Let's say 35V to be safe. Because of possible spikes and low-power-use moments your buck converter will need to be able to convert 28V to 38V without problem if your 35V is a clean voltage. Direct car voltages are unclean and very dangerous to shop for! You can then create the boosted voltage from your car voltage with a boost converter that turns 9V to 34V into a nice stable 35V. Make sure it's rated for car voltages, or search for questions about "how to protect my device from car voltage spikes and load dumps". Of course you can also just use the 48V that most early PoE systems use and get a ready made PoE to 5V converter on your device, then you just need a booster for car voltage to stable 48V. But be very carefull in wiring all of this, make sure you look up how to transport a DC voltage over network cables, if you do it wrong your transmitter and/or receiver magnetics may melt.
H: Reverse current protection on power-switching MOS It was suggested in "Select power supply voltage using MOSFETs" that a second MOSFET can be added in series to prevent reverse current flow. My question is, can I just reverse Drain and Source on the switching MOSFETs and not need extra MOS or diode? . AI: If you just reverse Drain and Source then in normal operation the body diode will conduct, even when the FET is switched off! The solution is to wire two FETs 'back-to-back' so that their body diodes are in opposition, like this:-
H: A/D conversion loop infinitly I'm quit new one PIC microcontroller, and i'm stuck with a new problem. I was using the A/D converter of my PIC18F46j50 to catch 4 push buttons on 1 PIN (RB2), and it worked well. But since I soldered a 32.768kHz oscillator for Timer1, it doesn't work anymore. unsigned int HAL_SWITCH_GetValADC(void){ ADCON0bits.VCFG0 = 0; ADCON0bits.VCFG1 = 0; ADCON0bits.CHS = 0b1000; ADCON1bits.ADFM = 1; // A/D Result format select bit : right justified ADCON1bits.ADCAL = 0; // A/D Calibration bit ADCON1bits.ACQT = 0b111; // A/D Acquisition Time 12 Tad = 12us ADCON1bits.ADCS = 0b001; //Tad = 1us (Fosc/8) ADCON0bits.ADON = 0b01; // A/D enable PIR1bits.ADIF = 0; //make sure A/D Int not set ADCON0bits.GO=1; //and begin A/D conv. while(!PIR1bits.ADIF); NOP(); return (((unsigned int) ADRESH << 8) | ADRESL); } Using breakpoint I determined that the problem come from the while loop, when i debug step by step, it works fine, but the programm never stops if the breakpoint is on NOP(); got error like "No source code lines were found at current PC" + few adress, mostly those of the interupt instructions... I don't know if their is a link. Also someone told me to change the clock used by the A/D convertor... How can I manage to do so ? Ask for more code if it can help. AI: ADCON1bits.ACQT = 0b111 <- that's not 12 Tad, but 20 Tad (according to datasheet), which translates roughly to 20us. Try using 0b101, for the value you are trying to achieve. Try setting bit 6 of ADCON1 register (ADCAL, responsible for automatic calibration) to 1 and running your code again. You have also put semicolon after the while loop, which does not seem like a good idea at the moment. Weren't you going for something more like: while(!PIR1bits.ADIF) { NOP(); } return (((unsigned int) ADRESH << 8) | ADRESL); EDIT: What is nop function exactly? Is it literal use of nop assembly instruction or is it a delay function? Other thing, you should probably put whole A/D routine with saving the result to into a loop, since it's 10-bit A/D converter. PIC18F46J50 datasheet suggests something like this(page 400): #include "p18cxxx.h" #define COUNT 500 //@ 8MHz = 125uS. #define DELAY for(i=0;i<COUNT;i++) #define RCAL .027 //R value is 4200000 (4.2M)//scaled so that result is in//1/100th of uA #define ADSCALE 1023 //for unsigned conversion 10 sig bits #define ADREF 3.3 //Vdd connected to A/D Vr+ int main(void) { int i; int j = 0; //index for loop unsigned int Vread = 0; double VTot = 0; float Vavg=0, Vcal=0, CTMUISrc = 0; //float values stored for calcs //assume CTMU and A/D have been setup correctly //see Example 25-1 for CTMU & A/D setup setup(); CTMUCONHbits.CTMUEN = 1; //Enable the CTMU CTMUCONLbits.EDG1STAT = 0; // Set Edge status bits to zero CTMUCONLbits.EDG2STAT = 0; for(j=0;j<10;j++) { CTMUCONHbits.IDISSEN = 1; //drain charge on the circuit DELAY; //wait 125us CTMUCONHbits.IDISSEN = 0; //end drain of circuit CTMUCONLbits.EDG1STAT = 1; //Begin charging the circuit //using CTMU current source DELAY; //wait for 125us CTMUCONLbits.EDG1STAT = 0; //Stop charging circuit PIR1bits.ADIF = 0; //make sure A/D Int not set ADCON0bits.GO=1; //and begin A/D conv. while(!PIR1bits.ADIF); //Wait for A/D convert complete Vread = ADRES; //Get the value from the A/D PIR1bits.ADIF = 0; //Clear A/D Interrupt Flag VTot += Vread; //Add the reading to the total } Vavg = (float)(VTot/10.000); //Average of 10 readings Vcal = (float)(Vavg/ADSCALE*ADREF); CTMUISrc = Vcal/RCAL; //CTMUISrc is in 1/100ths of uA }
H: High-voltage frequency divider How can a frequency divider for high voltages be implemented? Is it possible to make it cheap and compact? An application would be to mount it between the output of fluorescent lamp ballasts (delivering 20kHz at a high voltage above 500 volts) and the input of the lamp and change that frequency to control the flickering frequency of the lamp. AI: A better and simpler way, in my opinion, is to alter a value of a component in the electronic ballast. The ballast circuit (usually) rectifies the incoming AC power to fuel a power oscillator that then drives the fluorescent tube. Here's a simple picture that should help in understanding: - And below is a block diagram of one (this one has dimming facilities but ignore that: - So, I would begin to look for EB circuits on the web and build one just to get a prototype then experiment with altering the oscillation frequency. Then replace the EBs in the lamps with the modified EBs BUT PLEASE BE CAREFUL BECAUSE THESE THINGS CAN BE LETHAL. The approach of using the existing EB and inserting something betweeen it and the lamp is basically using two EBs in series and the 2nd EB has to be developed in exactly the same way as what my preferred route is (above). You also might be able to get an existing EB and alter its operating frequency a bit BUT without a circuit diagram you are somewhat in the dark (pun intended). I'll repeat what I said earlier: - PLEASE BE CAREFUL BECAUSE THESE THINGS CAN BE LETHAL.
H: Relay or Transistor for DC Resistive Load? I'm building a circuit that includes a resistive load that I have to switch, which is going to be supplied with ~200 VDC and 0.1 Amps. I've looked at different mechanical relays, and typically they are specified as "30A@240VAC or 30A@30VDC.". Ideally, I would like to use one of these. Would they be safe to operate at 200 VDC, since I am using a drastically reduced current? There is also a range of solid-state relays, but they are only specified at (for example) 250 VAC and 2 A, making no mention of maximal allowable VDC. As an alternative to the relays (which I guess are generally targeted at AC applications), I suppose a power MOSFET might be usable? Thank you for any assistance.... AI: I would use a MOSFET and the simplest arrangement is an N channel load switcher: - Ignoring the requirement for switching it on and off at high speed (i.e. kHz upwards), when operating at 200V, certain precautions may be advisable. The first relates to the common earth/0V/ground point. You may want isolation between control signal and the load ground so you may want to go to something like this: - You'll need to generate a small 12V isolated supply (note B2) and this can be done with a multitude of isolating dc/dc converters such as from Traco and others. You also need to pick a MOSFET that is rated probably in excess of 300V and there are plenty to choose from here. Given that there may be some back-emf due to load cabling I would still use a reverse protection diode across the load to snub-out any high voltage spikes from damaging the MOSFET. My 2nd advise is be very careful with the 200V when building something and testing it - make sure it is current limited (fused to prevent a fire) and, if possible find a dc residual current detector to switch off the supply should you get connected to the 200V like this one
H: Is it possible to multiplex SIM cards using a CPLD? I am building a hobby project using a GSM module and would like to be able to switch between multiple SIM cards, in case one stops working or I have poor reception on one provider (the project will be quite inaccessible once deployed). Would there be any issues doing this with a CPLD? I can supply the SIM cards with 3V always. I was thinking I could switch them on / off with MOSFETs and just multiplex the CLK, IO and RST connections for each SIM. Would it be easy/possible given that the IO line needs to be bi-directional? Would the propagation delay of the CLK be an issue at all? Anything else that might prevent this from working? I don't have any experience with CPLDs AI: Would it be easy/possible given that the IO line needs to be bi-directional? Possible? Yes. Easy? Not so. You would have to detect the direction within the CPLD and switch the pins between input and output accordingly. It is a lot easier to just use an analog multiplexer chip like the 74HC4051 and control the address bits from a CPLD or microprocessor. Would the propagation delay of the CLK be an issue at all? In practice there is no phase relationship between CLK and IO, so it is not an issue. CLK is only used to define the baud rate of the IO line and runs at a much higher speed than the duration on a bit over the IO line. The initial speed of the IO line is one bit per 372 clock ticks. Your GSM modem may negotiate a higher speed transfer later on but lag on the CLK will never be a problem. Anything else that might prevent this from working? If you want to switch the VCC of the SIM cards via the CPLD check the maximum current that the CPLD can drive. You may need an additional driver to provide enough power. I don't have any experience with CPLDs A good opportunity to start lerning how to use them. They're fun! On the other hand if you want to finish your project fast it is probably easier to just use four analog multiplexers like the 74HC4051 and switch all signals in parallel from a microprocessor. All you need are 3 GPIO pins to control up to 8 SIM cards. You won't have to deal with different voltage levels that way either. Oh, one last thing: In practice all SIM cards nowadays support 1.8V and 3V so you don't really have to follow the power up sequence of starting with 1.8V and then switching up to higher voltages. For a commercial project I would not recommend this, but for a hobby project I think it's fine to simplify here.
H: Old Radio RF Transformmers I want to make a TV transmitter (http://electronics-diy.com/electronic_schematic.php?id=851). There is an RF transformer on it (T1:4.5MHz 1F-can-style RF transformer) that I want to find it from old radio circuits. There are a lot of transforms with different colors and different numbers on them, but I don't know which one I must use? What's the meaning of colors and numbers? AI: The meaning of the numbers and colors is specific to the manufacturer of each coil. There is no standard. If you can find the manufacturer, then maybe you can get datasheets. Those should tell you what the markings mean for that family of transformers. Going the other direction is basically impossible unless you get lucky and recognize something. The markings will be unique within a manufacturer, but there is no guarantee that other manufactures don't use similar markings to mean different things. No matter what you do, you must first determine what specs you need the transformers in your circuit to have. You can measure any you find to those specs. However, unless you value your time at pennies per hour, you're better off buying new trasformers that come with datasheets and have the specs you want.
H: Enhancement type nmos threshold voltage in an enhancement type nmos when a channel is created then a depletion layer should be created under the n-channel which means electrons get a potential barrier to overcome.now is this potential barrier is included in threshold voltage?? AI: Your Channel is Itself in depletion region To understand whats happening imagine a freshly created MOSFET a just newly put together wafer(though they are diffused with impurity but just for example lets imageine),so as you are using NMOS your substrate is P type,and Source and Drain is N type.At first instant both the regions of the Source and Drain they have both carriers(e in S and D and holes in P substrate) which will diffuse across the barrier creating a depletion region i.e there are no charge ,only immobile ions there,the diffusion will stop when a voltage cause by the immobile ions exceed the gradient voltage of carriers. This voltage now stops the diffusion of the carriers,and is called the Threshold Voltage.(Vth) Now as your NMOS is enhancement type you will have no pre-made channel,all you have is depletion region lying between the DRAIN and the SOURCE.A channel is one which has free carrier to casue flow of charge,you already have a depletion region all you need is charge. Voltage through gate that will be act against the Threshold voltage,and hence will create a voltage difference along with action of attracting electrons form the substrate to act as carrier in depletion region.Now By applying a suitable Drain voltage you can have a current flow through the channel.
H: In current mobile phones, what are some specific techniques that prevent handling noise (rubbing, jostling) from being picked up by the microphone? I've noticed that when using my smartphone the vibrations from my actions aren't picked up, or are picked up very faintly by the microphone. I've worked quite a bit with microphones and I know it must be a non-trivial problem. Does anyone have experience in this arena? AI: The microphones are generally mechanically decoupled from the housing. If the mic is in the housing then it is usually in a soft rubber boot that reduces noise from carrying over. If the mic is on the board, then there's already decoupling from all the mechanical barriers (noises have to go from the housing to the PCB to the mic, and there are losses at each stage.)
H: LM386 noise when using 5v power supply I'm using LM386 with my guitar and currently I power it with 9v battery but now I want to switch to 5v power supply because I don't want to use a battery. I want to use a 5v usb wall charger + sparkfun usb mini-b breakout but it doesn't work, it haves a lot of noise/static. If I use a 7805 with the 9v battery it works flawlessly. What's wrong? Thanks! AI: The most likely cause is noise from the power supply. 5V USB power supplies assume that they don't have to clean up the output from the switching power supply, since you are going to use it to charge a device - the device's charging circuit doesn't care about noise, and the device itself runs off of the battery. By the time the current from the charger reaches any audio stages, it has been through the charge regulator, various amounts of filtering, and the battery itself (which can swallow some/all of the noise.) But, you are using it to power the amplifier directly so you get the full effect of the switching noise. This guy ran some tests. As you can see by the oscilloscope pictures, there's a lot of noise. Like this: There's better ones and worse ones, but yeah, noise from a USB charger is to be expected. You'll need to do some filtering of your 5V and GND lines if you want to use that charger. Easiest is probably getting hold of a 9Volt charger and using a 5Volt linear regulator. You don't need an LDO (Low DropOut) regulator, just a garden variety linear regulator like the 7805 you mentioned. Actually, you could probably run the amp straight off of the 9V power supply if it is clean. If not, use your 7805.
H: Finding gain from a transistor datasheet I'm trying to work out the gain of a transistor, the datasheet is here, although I have extracted the relevant images here: The datasheet gives the gain for Ic=5mA and Vce=2V as 25, and the remainder of the results seem to indicate something of a bell-curve of the gain plotted against Ic, which with some rough interpolation would allow you to find a very rough and approximate gain for any Ic value in between 5mA and 500mA; although this is all for a Vce=2. The graph gives a shape expected of the results, but the tabular results don't seem to match the graph (i.e. 150 mA should be 40, but graph value seems closer to 160 - i.e. the maximum). It seems the graph is plotting the maximum gain rather than minimum - doesn't make the graph useless? The tabular data, while useful is strictly for the stated values of Ic=50-500mA and Vce=2. Obviously, 2V is quite low, so if this was part of a circuit running at Vce=5 and the Ic pulling say 100mA, then how could this datasheet ever be useful, considering those values can't even be found in the datasheet? AI: As they've not labelled the different curves it looks pretty dubious to me. Normally the graph would apply to typical values so you would not necessarily find them in the tabulated values (this one does not show typical values). I might guess it's showing you either temperature (highest trace would be highest temperature, lowest trace lowest temperature) or unit to unit distribution for the high gain version, with the middle trace the typical value. For what it's worth, the graph is unchanged from the Motorola BC635 datasheet. In any case, the relevant curve is probably the middle one. hFE is not very dependent on Vce once Vce is high enough, so typically the gain would be around 150 at 100mA and 5V, but it might be as low as a bit less than 40 or as high as a bit more than 160 (assuming 25°C, and assuming it could be any of those transistor types. So you should design your circuit so it will function for hFE between (say) 35 and 180 and you'll be fine. If you need higher gain, or tighter beta specifications, other transistors have higher gain at 100mA and in some cases you can specify the beta bin to reduce the range to more like 2:1 than 4:1 (best avoided if you can). Edit: To clarify where the numbers came from- what I get from the graph (taking the middle curve) is that the gain does not typically change much between 150mA and 100mA, so we can reasonably assume similar limits. Those limits (not the graph) are what is guaranteed for the transistor. Only those. It's dropping pretty fast above 150mA so I would not make the same assumption if you said 200mA. The 40 and 160 (from the tables) are hard guarantees of transistor performance (you can complain to the supplier if the transistor does not perform within those limits). The curves illustrate what usually happens under some conditions and if the transistor does something different, you have no cause to object. Gain vs. Vce, as you get much above saturation (when Vce >> Vbe, say above a volt or so) the gain hardly changes. 2V is well above 1V, as is 5V, so we can expect the gain to be almost the same. To illustrate this, consider this set of 2N3904 curves: If the gain stayed constant the lines would be horizontal with voltage- they are not quite horizontal at higher base currents, but they are reasonably horizontal, and (more importantly in your example) the gain is only higher at higher Vce, so we're fine on the low end, but had better add a bit to the maximum gain guarantee.
H: Is it OK to use the USB 5v pin as power source? I am doing some stuff in my case and I need a power source for one LED from inside my case. I looked up and there are two +5v pins on a USB header inside my case. Is it OK to use them as power source? Can it handle sustained usage? AI: Usage that is within the USB spec and you wired it correctly, yes. Normally that means 100 mA without negotiation, 500 mA with (though the distinction is rarely enforced), and potentially more in some follow-on versions. The answer would ultimately depend on the type of LED utlized - your common small indicator ones typically should be run with 20 mA or less (you did use a resistor, right?). But if you are talking some sort of LED illumination light or adapted flashlight, then quite possibly you are stressing components beyond their designed capability. Doing something like putting a huge LED (or parallel array) directly on a port and counting on the port's likely but not certain resettable polyfuse protection feature (or any pre-trip resistance of it) as the current limit would be a very bad idea.
H: Calculate jitter of oscillator from PPM I found oscillators with from 10ppm up to 50ppm and more, but how I can calulate maximum jitter of this oscillators? With an online calculator I've found with 40Mhz and 50ppm this value: 2.500e-12s Max - Min Period (sec), so 0.0025ns Can I assume that this is Max. Jitter time? AI: The ppm spec on an oscillator is the accuracy and is (usually) specified over temperature and initial calibration. It says nothing about jitter. You will need to measure it or check the datasheet. Here's a jitter spec on a typical oscillator (10MHz CTS type) So the peak-to-peak period jitter is less than 50 picoseconds for this part. JEDEC definition of peak-to-peak is +/-3\$\sigma\$. In theory the maximum jitter is unbounded (as Rimpelbekkie says) so you need to define an acceptable error rate or something of that ilk in order to talk about maximums.
H: Purpose of breadboard "studs" on base off micro breadboards? I recently bought some micro breadboards on Ebay. Extremely useful little things. However each have two awkward studs on their bases. See the attached photo. What I'm curious about is their purpose? What might these "plugin" to or be used for? I think I'm going to file them off. AI: They connect to a base that fixes them with regards to each other.
H: Is it voltage or power of the signal amplified when the opamp amplification is given in dB unit? Today, one of my colleague said that he entered a preliminary examination in a company after his job application. One of the questions is exactly "Design a non-inverting amplifier with 20dB gain.". The goal of the question is to find the resistor values \$R_1\$ and \$R_2\$. simulate this circuit – Schematic created using CircuitLab If we take this 20dB as "power amplification", then $$ 20dB = 10 log_{10}\dfrac{P_o}{P_i} \implies \dfrac{P_o}{P_i} = 100 = \dfrac{V_o^2}{V_i^2} \implies \dfrac{V_o}{V_i} = 10 \implies \dfrac{R_1}{R_2} = 9. $$ If we understand it as "voltage amplification", then $$ 20dB = 10 log_{10}\dfrac{V_o}{V_i} \implies \dfrac{V_o}{V_i} = 100 \implies \dfrac{R_1}{R_2} = 99. $$ Which one is the correct approach? AI: Deci-Bels (dB) always represent a power ratio. Specifically, the power ratio of P2 with respect to P1 expressed in dB is:   dB = 10Log10(P2/P1). Sometimes, as in the question you show, we use dB as a short form for voltage ratios. However, since power is proportional to the square of the voltage, a voltage ratio expressed in dB is:   dB = 10Log10((V2/V1)²) = 20Log10(V2/V1) Therefore the correct answer to the question was to realize that a voltage gain of 10 was being asked for, and R1/R2 needs to be 9.
H: RF: Do I need a resistor at line driver output for impedance matching? I have a digital RF signal (~50Mbps max) passing through SN74BCT25240, a 25-ohm octal buffer/driver. This is on a 4-layer PCB with a ground/power planes and proper bypassing, etc. I was wondering do I need 50-ohm termination on the output of the buffer, to avoid ringing or over/undershoots? i.e. maybe a series 50-ohm resistor, or ac termination? Because I'll be driving 50-ohm cables and a 50-ohm load. The cable can be quite long (up to 25feet). I was told by an engineer at work that 'this thing is designed for >25ohm loads -- no termination is necessary, you're just going to divide the voltage for no reason' - yet I've seen at least one design from a colleague with this part using a series resistor. Now, even if I decide a series resistor is needed; how do I choose it? There is no spec for the output impedance of the driver. My earlier guess of a 50ohm resistor was assuming this buffer has 'low' output impedance. Thoughts? AI: I was wondering do I need 50-ohm termination on the output of the buffer, to avoid ringing or over/undershoots? i.e. maybe a series 50-ohm resistor, or ac termination? For data rates from roughly 50 - 250 MHz, it's fairly common to terminate only one end of the line. Usually this is the load end rather than the source end, although source termination is also possible. If your load is matched to the line characteristic impedance, there will be very little reflected signal coming back to the source, and you very likely to not need to match the source impedance. If you do match both ends of the line you will, like your colleague says, cut the signal amplitude in half. There is no spec for the output impedance of the driver. My earlier guess of a 50ohm resistor was assuming this buffer has 'low' output impedance. For ECL circuits we typically assume about 5 ohm source impedance, so we use about 45-ohms in series when doing source matching. But that is a totally different output structure than what you are using. For CMOS outputs though, there might not be any single resistor that gives perfect matching, because the output impedance of the driver might be different when driving low from when driving high. You can see in your datasheet, for example, that the maximum output current is different for low and high outputs. From your comments the low level output current is ~180mA; why would there be any current in this state? The driver needs to sink current in the low state if the termination is to a positive voltage, like VCC or VCC/2. Since the driver is stronger when driving low, it's actually a good idea to terminate to one of these voltage instead of to ground. It could also need to sink current when driving a capacitive load. Further, in the 'high' state, why is the max current negative? I'd expect it to be positive (sourcing)! TI datasheets pretty consistently use the convention that current in to a pin is positive and current out of a pin is negative. This is consistent with the passive sign convention which lets you get the power delivered to the pin from I * V.
H: How Much Current Draw From Speakers/Amplifier? So I plan on using the VS1053 Codec connected to a class D Amp (2 x 2.8W channel) with two 3W 4 Ohm speakers. If I supply 5V to this setup, what would the current draw be at full use? Codec: https://www.adafruit.com/products/1381 Amp: https://www.adafruit.com/products/1712 Speakers: https://www.adafruit.com/products/1669 AI: According to the docs the efficiency is reasonably high, I believe 89% for 8Ω is mentioned. If you want to be able to drive the speakers at full power continuously: Total power [Watt] = number of channels × power per channel P = 2 × 2.8 = 5.6 W Supply current drawn for the speakers alone would be: Current [Ampère] = Power [Watt] / Voltage[Volt] I = P / V = 5.6 / 5 = 1.12 A Accounting for efficiency, you are looking at 1.12 / 0.89 = 1.26A. This is with 8Ω load, efficiency with a 4Ω load will be worse. The datasheet for the amp states another 5.5 mA supply current. The datasheet for the codec lists power draw of up to 60 mA. Total current draw would be at least 1.35A at full load. However there are quite a few assumptions here and you really want some headroom for unforeseen things. Maybe you want to add a indicator LED? I did not account for an SD card or another microcontroller to control things. In practice you mustn't aim for a power supply that can't do at least 1.5A and I'd probably pick a 2A power supply as it is good practice to not push a power supply to its spec'd limits.
H: Wireless data exchange up to 2 bytes/s I would like to set up communication between two Arduinos with a distance of 20 cm, but not more than 40 cm. I looked for an RFID solution, and I found a lot of PCBs which can be used to read and write to the RFID chip. However I am wondering if it is possible to use such a PCB to exchange information. I need only up to 2 bytes/s transfer rate with a range of 20 cm. Can RFID be used for such communication? AI: The easiest way would be with the nRF24L01. These modules cost on ebay 1€. with these you can exchange data in higher speed and lower cost. You connect them via SPI, like with the RFID Module. This is one of the most known designs out there. There are also many other designs with a PCB antenna or with an external one. Range with the Black one is about 60 Meters open Air with 8 bytes/s.
H: Is a buck regulator the best option for my needs? I'm looking at using an MC33063 buck/boost inverter in a QFN package to step down 5-30V to 4.2V. This will be used to power an MCU, some modules, LEDs cosuming about 200mA max, optionally to charge a small LiPo, so the 1.5A is more than enough. What I would like to know is if this is the correct way to go considering space is of the essence and I need to use as little extra parts as possible, ideally low part heights. The additional diode, resistors and caps I saw in example schematics could probably be made to fit. Everything is SMD. Can I expect to be able to go as low as 5Vin or more likely around 6V? 1.5A isn't mandatory, but I would rather not go down to 0.5A, just in case, so 1A is a good compromise. AI: This will be used to power an MCU, some modules, LEDs cosuming about 200mA max Linear technology parts are not cheap (I haven't checked on this part) but it has a low parts count. The picture below directly converts to 3V3 but, by using resistors connected to Vfb, higher regulation voltages can be obtained: - GOALPOST CHANGE: 1.5A isn't mandatory, but I would rather not go down to 0.5A, just in case, so 1A is a good compromise. Or, plug your numbers into the LT parametric engine here. I chose to tick the radio box marked "synchronous" because then you don't need to worry about the flyback diode.