text
stringlengths
83
79.5k
H: Is there any heat/energy 'lost' to computing power? I have a Kill-A-Watt Power meter on my computer that has a GPU mining bitcoins. It draws 500W from the wall outlet. My question is, is my computer outputting any less heat than an equivalent 500W heater? Or is 100% of the power drawn from the wall converted into heat? I'm not sure where the energy would go, so my gut reaction seems to say yes. However, the computer is performing other operations with the power, flipping transistors and spinning fans and such. Would it have some less-than-100%-percentage of the power input that is converted to heat then? If the fans and hard drives and other kinetic components were excluded (say 500W with nothing spinning, all solid state), would it then have the equivalent heat output of the 500W heater or a perfect 500W heat source? AI: Pretty much all those 500 watts are turned to heat - the motors stop spinning eventually and no energy has been siphoned off for re-use so heat is the 99%+ by-product. Your screen produces light but this is a small fraction of the energy usage. Your internet connection needs a few volts to drive signals down the wire but this again is milli watts. It's pretty much all heat. Speakers - a few watts maybe but most of that gets turned to heat in the speaker - they are not very efficient (less than 10%)
H: Which Battery pack use for Arduino TimeLapse dolly I'm trying to create a small TimeLapse Dolly during my spare time. I'm planning to take away the dolly to film nature outside but I'm not sure which battery pack should I use. I would like to maintain the complete system moving for about 2-3 hours, so I presume that using a 9V battery is not enough. I have the following components: Arduino Duemilanove Stepper motor Driver (EasyDriver) Mercury Stepper Motor SM-42BYG011-25 (12V/0.33A) I need assistance selecting a battery that will last for at least 2-3 hours, compatible with the component list above. AI: Assuming the motors are running the whole time you have 330mA for the motor. What the Arduino and driver will consume depends on a number of things but I'd hazard a guess of somewhere under 100mA so for a round number and a bit of a margin we'll say the whole lot is 500mA or 0.5A. Driving everything from 12V is the easiest (but not most efficient) solution so for three hours of operation so you'll want a 12V 1.5Ah (3h x 0.5A) battery. That could be something like an SLA battery or maybe 10 x 1.2V AA rechargeable cells. You can also get 11.1V LiPo battery packs that are often used in model cars etc and that should be close enough to drive your motors well and will be smaller than the above two options. You'll need a charger for those options, there are a lot of choices so it really depends on whether you want to shell out for new charger or maybe use something like rechargable AA cells where you may already have a charger but using ten will be less convenient. For occasional use you could also use eight alkaline cells. You'll certainly need something larger than a 9V PP3 battery.
H: E-Ink screen pixel update How noisly common E-ink screens when they update pixel ? I mean do they have strobe signal or something like this, or they update exact pixel using pixel coordinates ? AI: only the regions of the screen that are changing require updating. Any pixels that are not changing do not require updating. See http://www.eink.com/faq_matrix.html See http://www.essentialscrap.com/eink/Driving_E_Ink_Displays.pdf Whether E-ink pixels can be changed independently depends on the design of the control electronics of the specific display module that incorporates an e-ink panel. You need to consult the data sheet for the specific e-ink product you intend to use.
H: Stackable and recognizable Lego I want to create small blocks (lego 2x2 bricks) that contain a small circuit that allows them to be recognized when stacked. I have about 25 different colors. Of each color, I have 10 blocks. Each block contains a small circuit (slightly different per color) that has X connectors at the bottom (let's call that input) and X connectors at the top (let's call that output). Then I have a base plate that also has X 'output' connectors. When stacking those blocks in a small tower on the base plate, the input connectors of each block, connect with the output connectors of the block below it, of with the base plate. For the sake of the example, let's limit the tower height to 10 blocks. What I want to do is connecting some device to the base plate (Arduino, for example) and in that device I want to be able to tell which colors of blocks are in the tower and how many of each color. Is this even possible? And how? AI: One thought is a unique identity for each block with a chip like DS2401 , then the data can be read using one wire protocol. Relevant reading , it's solution 1A
H: Response of First order circuit to a pulse input Dear All, Greetings, I am studying Response of the RC series circuit to a Pulse input. For calculating voltage across capacitor after pulse input ceases,author considers a time shift. I am not able to understand what for & why the time shift is considered here ( Highlighted in Red ). AI: The pulse starts at t = 0 and ends at t = T. And you're trying to find the response after the pulse ends. First you solved for the response during the pulse, so you know the capacitor voltage at t = T. Now you want to find a response starting at time T. You're basically solving a whole new problem starting at time T, using the previous calculation to tell you the "initial" conditions at time T. So the problem (and solution) is "shifted" in time compared to what they probably taught you previously about finding a response starting at t = 0, given initial conditions at t = 0.
H: Should "get new sensor data" be its own task in an RTOS? I am new to RTOS coding practices/architectures, and am specifically learning on RTX. Should I have a get_new_sensor_data task for each sensor, or is sensor data usually taken care of by some other means, such as in the ISR outside of any particular task? How do you flag your applications that you have a new piece of data for them? I don't want to call hardware reading subroutines from the applications that use the sensor data because the data may be blocking several different applications. e.g. temperature may go into a relative humidity calculation task, it may get used by a task that outputs temperature to the user over the UART, and it may get used in another task that is correcting some other sensor that has a temperature-dependent output. AI: Some kinds of sensor must be read on a very strict schedule or else the information received therefrom will be erroneous, either because the read has to have a certain timing relationship with some other event (e.g. one is measuring light reflected from illuminating lamp which is only for 100us every 10ms), or because readings encapsulate implied timing information (e.g. if one is trying to sample audio at 44100Khz, each reading should encapsulate the fact that it was taken 22.6757 microseconds after the previous one; simply taking 44,100 readings at arbitrary times throughout a one-second interval is not equivalent!). Other kinds of sensor may be read at one's leisure. If you are dealing with the former type of sensor, you should either have a very-high-priority scheduled task to do the reading, or else do it within a timer interrupt that's dispatched directly rather than through the OS. Arrange things so that unless the application gets so far behind that data loss will be unavoidable, the sensor-reading code will always have someplace to put its data. If you have multiple sensors that need to interact, it's often good to handle them all within the same timer interrupt when practical. If everything can be handled by e.g. a 10Khz sensor-handling interrupt, using one fixed-rate interrupt for everything is often much simpler than trying to deal with changing interrupt rates, even if oftentimes the only thing the interrupt will do is decrement a "how many more ticks until I do something interesting" counter. Sometimes having different tasks for different sensors can be a good approach, but if any sensors share resources (such as ADC channels) it can be very difficult to ensure that there are never any timing conflicts. For example, if e.g. one has one sensor that needs to be read at a strict 5KHz rate and another that needs to be read at a very strict 2Khz rate, and both sensors use the same ADC, it may be most helpful to have a 20Khz interrupt and arrange things so that each interrupt captures the previously requested reading, requests a new reading, both, or neither, and the two sensors will stagger their readings so they never need to have requests pending simultaneously. If the two sensors were handled by separate tasks, ensuring that no sensor will want to use the ADC when the other sensor is using it may be more difficult.
H: Exchange serial messages via UART between 3.3V µController and 5V µController concrete (STM32F4 and ATMega 2560) I would like to send messages from STM32F4Discovery board to Arduino Mega 2560 via UART. How do I connect the Arduino to the STM32F4Discovery? Do I need any extra electronics? If I understand correctly, Arduino's UART has voltage level of 5V and the STM32F$ 3.3V. AI: You only need wires. The STM32F4 has 5V-tolerant inputs and 3.3V is above the '1' threshold for the AVR. Connect ground and one or both pairs of TX/RX depending on whether you want bidirectional comms.
H: Searching for an analog circuit solution, where an output voltage is incremented or decremented based on an input So I have an interesting request that I've searched the internet for and have not been able to find, or been able to come up with in my head. I have a circuit with a feedback loop that is meant to control a MOSFET. The feedback loop has a difference amplifier that outputs the difference between the current output and the desired output. Based on this, the voltage to the gate of the MOSFET should change. In other words if the output of the system is currently 11V, and the desired output is 12V, the difference amplifier has an output of 1V, and this 1V output should somehow signal that the MOSFET gate voltage needs to increase. Similarly, if the current output is 13V, the difference amplifier would have an output of -1V, and should signal that the MOSFET gate voltage needs to decrease. I initially tried hooking the feedback output from the difference amplifier directly, but quickly realized that wouldn't work. Rather, I need a circuit where a + voltage causes a constant voltage increment until the feedback reaches 0, or a - voltage causes a constant voltage decrement until the feedback reaches 0. So the feedback should be a sort of specification of the rate of change to the base voltage. In a nutshell, this is what I'm referring to: My initial guess is that this might have to include a non-inverting amplifier, or even just a comparator comparing the feedback signal to ground, and charging of a capacitor that powers the base voltage to the MOSFET. Edit Came up with something, looks like this works fairly well. Still open to better suggestions though. AI: Sounds like all you need is an integrator. https://en.wikipedia.org/wiki/Operational_amplifier_applications#Inverting_integrator
H: Components necessary to automate hand crank I'd like to automate a simple crank on a rotating hex bolt thingy so I don't have to manually turn the lever/knob. I was planning on bluetooth module -> Arduino (or some easily programmable MC) -> motor -> hex bit as the component diagram. I can learn the Arduino programming, etc I'm sure, but I wanted your help with the motor: I think the torque required is a pretty important factor - the manual rotating handle has a ~3in length arm, and requires a hefty deal of force (scientific, I know, but I'm not sure how to measure this short of a force meter) to turn clockwise, but much less while rotating counter-clockwise. I'd like to be able to have the motor sustain this at 5+ revs/sec (the more the better). The whole setup should be as quiet as possible as it will run in an office environment Thanks for your help! P.S. Any improvements to / ideas for the entire scenario (raise lower my adjustable height desk without rotating the hand crank) are certainly welcome - this isn't mission critical! AI: 5 rotations per second is a lot. I wouldn't be surprised if the C nut and ACME rod that probably drives your desk were not actually rated for that speed. To get a reasonable amount of torque at, say, 1 revolution per second, you'd use an electric gearmotor. Pololu.com has a number of good choices. For example, the 37D 5A gearmotor at 100:1 gearing will run at 100 rpm, giving you 200 oz.in of torque (which is a fair bit -- probably more than you're cranking on a 3 inch lever.) http://www.pololu.com/product/1106 You also need a way of mechanically coupling the 6mm D-shaft output to the hex bolt, some way of fastening the motor so it doesn't counter-spin, and some way to drive the motor. Driving the motor means a 5A/12V power supply, and an H-bridge that can take 10A/24V to safely withstand the worst-case reversing-direction transients. A Pololu simple motor controller, or an Orion Robotics RoboClaw, or a Dimension Engineering Sabretooth, would be a reasonable hobby-level choice.
H: Powering a modem over extreme distance (~2k feet) We live in a rural area and have about a 2000 foot run from the end of our driveway to our house. The cable company wanted quite a bit of money to run internet to our house, but there's a drop at the end of our driveway, so we convinced them to put a modem there, and are sending the signal over a directional parabolic antenna to our house (which is being picked up by a repeater at the house using a second directional parabolic antenna). That all works great! The modem itself is 12v, 1.5a, and originally I thought I could get away with having a marine battery and a 30w solar panel. That works fine during the day, but at night, the battery is drawn low enough that the panel can't charge it back to full and power the modem at the same time. I could upgrade the panel to something which would handle it (around a 230w panel), but I wondered if I could get away somehow with running power from our house to the end of the driveway. I only need to end up with 12v / 1.5a, so I'm wondering if I can somehow get away with 14 awg. I am (obviously) not an EE, but I didn't know if I could use a step up transformer to reboost the signal at the end over that far of a distance. I'm open to other ideas - we've already called the power company about doing a service pole, since we're about 30' from a transformer. Just trying to understand the calculations on running power long distance, or what else is out there. AI: 2000' of 14 guage wire = 4000' * .003 Ohms per foot = 12 Ohms. Voltage drop at 1.5 amps is going to be 18 volts, you would have to feed it with 18+12, which isn't a good option. 12v*1.5a=18watts, 18 watts / 75% efficient switcher/transformer = 25watts / 120v = 0.2 amps. A better option would be 120v, which would calculate to around 0.2 amps, for a 2.4 volt drop, which could work. However, protecting your electrical system from lightning gets difficult with two systems operating 2000 feet away, yet connected. If it is fiber, isolating the modem may be best. Note that the 120v neutral is probably just as dangerous as the hot at these kinds of distances. All in all, consider yourself lucky that you can get cable internet in a rural area.
H: Compare two voltages and output the lower of the two I am working on a circuit that is connected to a 10V supply (can supply about 1-2mA). We have two signals, let's call them S1 and S2. We also have an input to the circuit called IN1. My goal here is to compare the two signals, S1 and S2 (They may range from 0 to 10V) and output the LOWER of the two into the circuit's IN1 pin. What makes this challenging is the fact that the LOWER voltage needs to be output. I can easily make a microcontroller compare two voltages on the A/D pins and output the lower on the D/A pin, but i'm afraid 2mA of power will not be enough to run the microcontroller properly - plus i'm sure there must be a much easier way. EDIT: According to the simulation, accepted solution works like a charm! OpAmp source current is important in order to make sure it doesn't go past the current limit. Proper selection of OpAmp also allows OUT to be very close to V- (0V in this case). I simulated this in LTSpice with a LT1490A OpAmp and a 22K resistor instead of a 1K. To simulate i simply chose IN1 as 5V and varied IN2 from 0 to 10V. The results should be quite clear and self-explanatory. V1 (not shown below) and V2 are my V+ and V-. These are 10V and 0V. AI: I think you can just use standard "precision rectifier" circuits. You need a dual opamp and diodes. To get the output down to zero volts, a negative supply is required.
H: Why does the resistance of an 8x8 LED Matrix have to be on the cathode? Looking at these instructions for wiring up a LED matrix ( http://oomlout.com/8X8M/8X8M-Guide.pdf ) I see that they tell me to put the resistors that limit the current through the LEDs on the cathode (output) side of the LEDs. Is there any reasons for this preference? Could I not put the resistance on the anode side instead? AI: In a LED matrix you're either scanning rows or columns. If you're scanning columns the resistors have to be on the rows, and vice versa. Scanning columns as is done here means that one column at a time becomes active. Then for each LED in that column you have a corresponding resistor on the rows connection. Regarding Michael's comment: if you would put the resistor on the scanning side (here the columns) then you'd have 1 resistor for a complete column, the one you're driving at that moment. Then the brightness of the LEDs will depend on the number of LEDs you have on. If you have 1 LED on it will shine 6 times brighter than when you have 6 LEDs on.
H: Resistance and power requirements for a current-limiting resistor I'm making my electronics project. I need answer please I need an resistor I just need to clarify and validate. Given \$V_s\$-15 V \$V_{LED}\$-3.5 V \$I_{LED}\$ - 25 mA I did: R= \$\frac{V_s - V_{led} }{I_{led}}\$ = \$\frac{11.5 V}{25mA}\$ = \$\frac{11.5 V}{0.025 A}\$ = \$460 \Omega\$ And a power of 0.2875W, but I bought 470 \$\Omega\$ with 1 W What will happen to my project? Fail or burn the LEDs? AI: Your 1W resistor exceeds the power requirement so that's perfectly fine. The only time you run into problems is if you use a resistor with a lower power rating. For example if you used a 0.25W rated resistor it may not be able to dissipate enough heat, get too hot and fail. On the resistance side 470 ohms will cause a little less current to flow than the theoretical value of 460 ohms you've calculated, so other than delivering a little under 25mA that's fine as well. The approximately 0.5mA lower current won't make a visible difference.
H: How to connect a Printer WIFI module wires to an Arduino? I’m a digital artist, found this HP printer on the street and wanted to use its components (motor etc.) on my projects. I was wondering if any of you know if I can use this WIFI module to send/receive data from/to a PC through Arduino API. (I just want to connect it to an Arduino card and be able to receive the simple signals i.e.: High-Low / 0-1 from a PC) If so, First I need to know how to connect the wires, specially the power (+how many volts?) and ground ones (I can test the rest and read them as inputs by Ardunio even though am not sure if it works!) So I’d really appreciate if anyone can help me to figure out what’s what in these wires and how can I occupy data signals from a pc? PS: as you see, one of the wires is soldered in a square form on the back of the PCB, is it a common sign of V or GRND in electronics, and does the standard color codes respected here or not? Thx again! :) Found Can anyone locate specs on this wifi module? (if it helps)! AI: "Simple" is extremely hard these days. What you are looking at is a small computer in itself; the Broadcom chip (datasheet) contains an ARM processor and is an entire computer in itself to run the WiFi. The datasheet says that it speaks either SDIO or USB. The square pad on the board usually indicates pin 1, although that doesn't tell you what pin 1 means. I would take a look at and probe voltages on the other end of the connection as well. I suspect that the black and red paired wires are power and ground, but we don't know what voltage. Either 3.3V or 5V are likely possibilities. Maybe one of each. Get it wrong and you'll destroy the board. This page: http://wikidevi.com/wiki/Foxconn_U98H035 and the linked forum post confirm that it's USB, although infuriatingly neither page properly describe the pinout. It's basically identical to a cheap wifi USB dongle. Which is very little use with an Arduino. Its approximate value is $25 as a spare from HP or $10 on ebay.
H: kWh per 24hours from system that uses 950W my friend asked me a questions how much kWh he would get per day around if he is going to buy a power suply that is 1200W and place in the system and system would use 950W as he said http://www.newegg.com/Product/Product.aspx?Item=N82E16817153145 his power suply I really hope you are able to help me :/ AI: You don't need to factor in the 90% efficiency. You would have to if the 950W was what the CPU, GPU, etc consumed, but here the 950W is what goes into the system, and then the power supply's efficiency is already included. So \$ 950W \times 24h = 22.8 kWh \$ Multiply by the cost of 1 kWh your power utility charges you, and you know what the system costs you per day.
H: Is there a table that shows how 8b/10b encoding tries to ensure running disparity on a transmission line? In telecommunications, 8b/10b is a line code that maps 8-bit symbols to 10-bit symbols to achieve DC-balance and bounded disparity. In this case we take each 8-bit data and map it to a 10-bit symbol. Now long time ago some humans sat down and thought about which 8-bit value corresponds to which 10-bit value/values. They also decided to create some special symbols e.g comma symbol. As far as I know, there are many 10-bit symbols which are not used and I assume that 0000000000 and 1111111111 are included in it. Which 10-bit symbol shall be transmitted next also depends on which 10-bit symbol was transmitted last time and also on the current 8-bit data to be mapped. Is there a table that can show me which 8-bit symbol is mapped to which 10-bit symbols such that running disparity is maintained? In simple words, I want to understand how does 8b/10b encoding ensure running disparity. AI: Basically what's done is some 8-bit message words have two corresponding 10-bit code words. One of these has positive disparity (more 1's than 0's) and the other has negative disparity (more 0's than 1's). When encoding you keep track of the running disparity. If the running disparity is positive and the next input octet gives you a choice of code words, you pick the one with negative disparity, and vice versa.
H: Eagle CAD template for Arduino Shield I would like to reuse a PCB layout of a design to make an Arduino shield. I want to reuse Arduino Uno R3 board to make an Arduino shield package in my library by deleting every components in the original design (leaving the stack headers intact for the shield). I tried block copy to bring the block in board to the package window (in create new package) but it did seem to work. It did not allow copying of pads from layout to package window. I would not want to draw everything from scratch and even pad placement in this case. AI: What you want is to start out your design with an Eagle CAD template for an Arduino Shield, as W5VO pointed out in his comment. Here is a link to one library that contains such a template, from Adafruit Industries.
H: Connect Android device to Arduino Uno via USB I have an Arduino Uno and need to connect to an Android device: Do I need a USB host shield? Would I be better off in buying a board that has USB host functionality built-in? Is the Android Open Accessory framework really the only software solution for communicating via USB? AI: You would need some hardware added to the Uno which supports USB host mode, yes. This could be in the form of a USB host shield or some other USB host module (typically with its own on-board microcontroller) Yes, definitely. Typically a board which incorporates USB host mode, would also be supported by its tried and tested libraries for implementing the host mode. Not the only option, but certainly the most updated and perhaps the most convenient. The classic ADB mechanism, predating the introduction of the Android Accessory Development Kit, is still supported. Depending on what the Arduino side of the system is expected to do, this might suffice at least until the ADB support is removed.
H: Thermal calculation for a D2PAK with a SMT Heatsink I am trying to calculate the junction temperature of a D2PAK FET that is dissipating 5W. The junction-to-case thermal resistance is 0.4 C/W. The junction-to-ambient (PCB mounted, steady state) resistance is 40 C/W. It seems that D2PAK datasheets don't give a case-to-sink figure. I am using this sink which has a thermal resistance of just 3 C/W with forced air flow. My question is, when calculating the junction temperature do I include the junction-to-ambient figure in the calculation? Tj = Pd(Rth(jc) + Rth(ja) + Rth(heatsink)) + Tambient Or can I ignore the ambient figure when using a heatsink? AI: You don't use the original Tja anymore because it's not valid - there are new thermal resistances to place between the junction and the ambient air. Have a look at this Analog Devices application note MT-093.                   You can see that: $$\Theta_{JA} = \Theta_{JC} + \Theta_{CA}$$ Now when you add a heatsink, you are inserting another thermal resistance between the case and ambient air, so your equation becomes: $$\Theta_{JA} = \Theta_{JC} + \Theta_{CS} + \Theta_{SA}$$ Where Tcs is thermal resistance of the case to your sink. This depends on your interface material, sometimes known as "thermal grease". Various factors (surface area, applied pressure) change how well the thermal grease will conduct heat. An estimate of .25°C/W seems reasonable. Tsa is the thermal resistance of the sink to ambient. (3°C/W as stated, with some airflow) So to calculate your maximum allowable ambient temp: $$ T_A = T_J - P * (\Theta_{JC} + \Theta_{CS} + \Theta_{SA}) $$
H: Using single-supply OpAmps with a bipolar-supply OpAmps in the same circuit I have a prototype circuit that is based around some arbitrary bipolar-supply OpAmp. It uses "virtual ground" voltage divider so that it can be powered from a 9V battery (hence the "-" of the battery goes to -4.5V rail, the "+" goes to +4.5V rail and the middle point is the "virtual ground"). The requirements evolved such that now I need to add a high-precision OpAmp to one of the stages. However the chip that I will be using is a single-supply chip that would be connected to the "virtual ground" and the +4.5V rail. Is there any general reason that I should expect degradation in signal quality, now that one of the stages uses the -4.5V rail as negative supply and the new stage uses some internal-to-the-chip negative rail that might be slightly different? The various datasheets and implementation notes that I have found do not discuss anything of the type. Here is the single supply opamp datasheet: http://pdf1.alldatasheet.com/datasheet-pdf/view/28867/TI/TLC277.html AI: If the signal out of the dual-supply op-amps is also bipolar around the virtual ground rail, the single-supply parts will face challenges with such signal - unless clipping at the virtual ground rail is the design intent. Assuming that all signal in the single-supply op amp portion of the design is definitely above the virtual ground potential, the "new stage" does not use some internal-to-the-chip negative rail, it uses the virtual ground as its most negative supply rail. One point of consideration for such designs is to ensure that the virtual ground itself is a very low-impedance rail with sufficient current sourcing and sinking capacity. Use an op-amp based rail splitter with hefty decoupling capacitors between all rails, and perhaps add a BJT stage, to achieve this. Alternatively, use a purpose-built rail splitter part such as the Texas Instruments TLE2426 for the virtual ground. Also note that your single-supply stage output will be bound between Virtual Ground and the positive rail, not utilizing the lower half of the possible voltage range. In other words, output signal peak to peak is limited to ~4.5 Volts (assuming RRO OpAmps) and not ~9 Volts.
H: Gear ratio reading I've ordered a little cheap kit of gears from Tamiya with multiple possibility os gear boxes to test. But I'm wondering how to read the value of the ratio as I'm not sure I've understand it quite well. So, let me know if I'm wrong on these two examples : 25:1 : The dc motor at source will need to operate 25 turns before the last gear accomplish a full turn 1:25 : The dc motor at source will need to operate 1 turn to make the last gear accomplish 25 turn ? Is that right ? AI: Yes, 25:1 means 25 full rotations of the motor to achieve one full rotation of the output shaft. This is its gear reduction ratio. 1:25 means the output shaft will have 25 full rotations for each rotation of the motor shaft. This is not really to do with electronic design, though.
H: Transistor which opens circuit, reverse transistor I'm wondering if there is a transistor which, when a voltage is applied to the base / gate, opens the circuit instead of closing it. If there is not, how would such a configuration be created? EDIT: Okay, here's some clarification. I have a circuit set up like this: Motor-------------Nmos-------------Gnd | | voltage from IC Currently, I am supplying a voltage to the gate of the nmos from my arduino and controlling the motor that way. I want to replace the nmos with something which will perform oppositely. As the voltage increases on it, the current between motor and gnd should decrease. I hope that helps clarify. AI: Here is a circuit that is on by default and turns off when you apply voltage to the input. When the input is floating or grounded Q2 is off so R2 works as a pullup resistor that turns Q1 on. When there is a positive voltage applied to the input then Q2 turns on and sinks current trough R2, that creates a voltage drop across R2 that drops the voltage applied to the base of Q1 and turns it off. It can also be done with mosfets with a similar logic.
H: Visualising data rate as square waves (Converting bits per second into hertz) for selecting ADC sampling frequency I know that bits per second and hertz are two different units. This question will help me in designing an oscilloscope with proper ADC sampling frequency for viewing communication protocols. Just imagine a communication protocol(eg: I2C) which has a data rate of 1Mbps. As per the protocol, there are different fields where we can keep data, address etc. But I am currently assuming that each bits in this protocol is toggling one after the other. Then this looks like a square wave. In a square wave, the fist half will high(Logic 1) and the second half will be low(Logic 0) or vice versa. So in one cycle we have two bits. As per this visualisation 1Hz i.e 1 cycle/sec is equivalent to 2bits/sec(or 2bps). Similarly for 1Mbps data rate, there will be 1000000 bits per second. If we assume each bit is inverse of the other(i.e they toggle like a square wave) and as per our calculation, 2bits will be present in one cycle of square wave, then 1000000 bits per second = 500000Hz (1000000bps /2 bits in one cycle). So 1Mbps is equivalent to 500kHz square wave. Is my visualisation correct(I converted bits per second to hertz)? I want to make a USB oscilloscope in which I want to select a proper sampling frequency for the ADC. So in this case if I assume 1Mbps as 500kHz, then for a good signal display(signal reconstruction based on the ADC samples), sampling should be done at 10 times the signal frequency i.e 5Mega samples per second (500kHz *10 = 5MHz) Is this calculation correct ? Also does this mean that I can view this communication protocol's voltage levels clearly on a oscilloscope having bandwidth of 5MHz (500kHz *10)? AI: If all you want to do is see the voltage levels of the signal then your analysis is correct. Also, in the case of a true square wave (rather than a stream of digital pulses) you will be able to determine the fundamental frequency, according to Shannon and Nyquist. However, a square wave has significant frequency content at much higher frequencies...at least to 11 times the fundamental for practical purposes. Unfortunately, you will be missing a lot of the information that is critical for digital signalling protocols. You won't be able to determine the actual width of a pulse very accurately. It will also be very difficult to observe the relationships between signals, such as clock and data, that are absolutely vital when debugging serial protocols. To be useful for debugging you must sample at a much higher rate, and you should be able to trigger the scope on the edges of one signal while sampling another signal simultaneously. My opinion is that a good scope would be sampling at about 20 times the data rate. EDIT: For serial communications the pulse width, in time, for each bit is a very important parameter. If your data rate is 1Mbps then you expect the pulse width to be 1\$\mu\$s, but if you only sample that signal at 5MHz then your pulse width measurements will be \$\pm\$0.1\$\mu\$s which is pretty rough. More important in my mind are setup and hold measurements. You want to know how long the data signal is stable before a clock edge and how long it remains valid after a clock edge. Specifications for setup and hold may be tens of nanoseconds for a 1Mbps data rate, and it will be very difficult to observe these when sampling every 200ns. For debugging serial communications the instrument you really want is a logic analyzer. These devices can sample data at very high frequencies but they don't try to measure the actual voltage of the signal, only whether it is a valid logic 1 or 0. They also have other capabilities that are made possible by treating the inputs as digital data rather than analog voltages.
H: Pull up circuit current flows? Im trying to understand how pull up/down circuits works . Let's consider this schematic : I understand that there are two possible current flows : When the button is not pressed, the current flows from VCC through the input pin . When the button is pressed , the current flows from Vcc through the button , to the GND . I cant understand the second flow . Why the the current goes directlly through the button ? After the R1 resistor there is a "crossroad" . So , why the current flow is not divided to both paths (left to the button , and right to the input) ? How it knows to flow only to the left path i.e. to the button, and not right to the input ? Thanks AI: Because when the current gets to the "crossroad", it has two options to go to GND. One is through R2 and the other is direclty to GND. In other words this is like putting R2 in paralell with a resistor whose value is zero ohms. This lead us to a zero ohms equivalent, which is like a short circuit (left path). In a intuitive way, it finds no resistance to go to the left while there is R2 if it goes to the right. The current division in a "crossroad" is a proportional division calculated by the resistance ratio of each path. Since one path is free, all current goes to there.
H: Debugging my bipolar stepper motor design I'm trying to connect a NEMA 17 Bipolar Stepper Motor to an Arduino Uno using an L298N Stepper Motor Controller Module and control its speed using a 10K potentiometer. I haven't found any examples online on how to do this explicitly (using the L298N controller module), so I've resorted to trying to design the circuit myself. This is, literally, my very first attempt at designing a circuit myself. I have no background in electronics or electrical engineering. I've gathered as much info as I can from the arduino website and the manufacturers of the motor itself. This much I'm certain of: The motor should be powered independently from the arduino, using 2.55 volts and 1.7 amps. The motor and its power source must be connected to an H-bridge before connecting to the arduino inputs. Pairs of wires on the stepper motor are connected and can be determined easily by hooking an LED light to a pair of wires and rotating the motor manually. Connected wires will cause the LED to light up. All grounds should be connected together. In addition to this, I'm also making a few (hopefully true) assumptions: The L298N Controller module should provide the necessary H-bridge. The H-bridge inputs should be connected to a contiguously indexed array of digital pins on the arduino. Despite the specs indicated the need for 2.55 volts, a 2.5 volt source should be sufficient for this motor. Since a 2.5 volt source is not readily available, I can create one with a voltage divider. Reversing the polarity of the stepper wires to the Controller Module (h-bridge) does not matter. That is, if a pair of connected stepper motor wires Wire1 and Wire2 are wired to Out1 and Out2 on the L298N Controller Module (respectively), then hooking up Wire1 to Out2 and Wire2 to Out1 would produce the same effect as the original wiring. Based upon the above facts/assumptions, I created a schematic of how I think everything should be hooked up: Note that the two instances labeled 2.5V are connected to each other. Additionally, all grounds are also connected together. I would like some feedback from the community on my proposed stepper motor design. In particular, I would like to know if my assumptions above are correct and whether I can obtain the necessary current for my stepper motor using my voltage divider as displayed in the picture above. Any suggestions to improve / ensure functionality would be greatly appreciated! If anything is unclear about my schematic or assumptions, please let me know and I will clarify as best I can. AI: Okay, you have a couple of issues: Your voltage divider will present ~2.55V at it's centre, but only unloaded - due to Ohm's law as soon as you present a low resistance load the voltage will drop severely. For instance, if your stepper coil has a resistance of around 3 Ohms, then the voltage will drop to ~9mV!. See the various wiki pages on maximum power transfer and voltage dividers. Rather than making sure you have exactly the right voltage, you would be better off with a stepper motor driver that will ensure no more power than the motor can handle will be used. They do this by "chopping" the voltage into pulses, and there are many to choose from. The L298 is pretty old now, uses bipolar transistors and after the source/sink saturation voltages you will have almost nothing left to drive the motor. I would read this wiki page on Stepper Driving (and related pages) plus ask people who have already used these setups - the reprap folks are probably a good source of info. On dropping small amounts of voltage, a series diode can come in handy to drop between 0.3 and 0.8V or so per diode. But for efficient power regulation, depending on the difference between input and output, linear or switching regulators are the norm, (almost) never voltage dividers for supplying power.
H: Battery power supply for Arduino and DC motors with L293D I got a 6 AA cell pack. So I can basically get 8.2V. I need to power an Arduino and 2 DC motors driven by a L293D. My Arduino can accept 7V to 12V DC input and the L293D between 4.5v to 36V. Can I simply deviate another line from the cell pack and feed the L293D with it? I want to do that because the load of the two DC motors can quickly be around 200mA/motor, the 5V input is 500mA max, I've got other things to feed with (one servo, an IR sensor, some leds and two other sensors) so I can quickly be higher than 500mA. Something like this: simulate this circuit – Schematic created using CircuitLab AI: Yes, you can have multiple devices hanging off the same pair of supply rails. You should not have multiple ground paths though - like the ground-to-ground connection shown between the Arduino and the L293D in the diagram. Ideally, all the devices should connect to each other and the supply ground at a single point, to avoid ground loops. Also add hefty capacitors (10 to 100 uF) between Vcc and Gnd pins of each device to decouple the supply.
H: L293D and Arduino working only with common ground. So I have an Arduino and an L293D. The L293D logic is powered by the +5V output of the Arduino, while the DC motor is powered by an external power supply. Here's the part I don't get. If I connect the Arduino and the power supply grounds together the circuit works, otherwise it doesn't. Can you explain me why? AI: While a schematic would have helped describe the problem statement better, one key concept might help in clarifying this matter: A voltage is the potential difference between two points in a circuit, it is not an absolute value of any physical characteristic at a single point in a circuit. Thus, there is no absolute potential involved, it is relative value, a difference. How this applies: The control side of the L293D is actually powered by the +5V from the Arduino only when the +5V has a reference ground available, that corresponds to that particular +5V supply, in other words, the ground of the Arduino board. The L293D does not have a separate drive-side ground pin, just the "Heat sink and Ground" pins, which are also the ground reference for the \$V_{cc1}\$ pin. If you note the schematic on page 3 of the datasheet, the ground references for \$V_{cc1}\$ and \$V_{cc2}\$ are one and the same, the GND pin(s). Thus, that reference needs to be connected to the Arduino's reference ground.
H: Is the JHD12864E compatible with an Arduino board? I am using a KS0108 compatible graphic LCD (JHD12864E) and I want to connect it to my Arduino Leonardo board to display some text. I searched using Google and also in the Arduino forum but I didn’t get much information. The examples I found were for a 16*2 LCD. Please suggest connections and a basic program for an Arduino board. AI: There is a link for Mega2560. Check this link below which has the schematic and sample program. Arduino Leonardo board is not supported since it has less memory space. http://playground.arduino.cc/Code/GLCDks0108 Also a google projects page http://code.google.com/p/glcd-arduino/
H: Why don't typical digital multimeters measure inductance? Even with predominantly digital circuits, I am using inductors much more often than I used to, generally because of all the buck or boost converters (a recent board I was involved in has 12 different voltage rails -- six of them needed just by the TFT LCD). I've never seen a standard digital multimeter (DMM) with an inductance range. So I ended up buying a separate meter that does LC measurements. However a lot of DMMs have a capacitance scale. Since capacitors and inductors can be thought of as mirror images of each other with voltage and current flipped, why don't DMMs include an inductance scale also? What's so difficult about measuring inductance that it is left off of DMMs and relegated to specialty meters? Since inductance meters are usually LC meters (even LCR), do they measure capacitance in a different way than DMMs? Are they more accurate than the capacitance scale of a DMM? AI: The only reason DMMs can't measure inductances is that it is more difficult to measure inductance than resistance or capacitance: this task requires special circuitry, which is not cheap. Since there are relatively few occasions when inductance measurements are required, standard DMMs do not have this functionality, which allows for lower cost. Simple DMMs can measure capacitance by just charging the capacitor with a constant current and measuring the rate of voltage build-up. This simple technique provides surprisingly good accuracy and wide dynamic range, therefore it can be implemented in almost any DMM, without significant cost penalties. There are other techniques as well. Theoretically, one could measure inductance by applying a constant voltage across an inductor and measuring the current build-up; however, in practice this technique is much more complicated to implement, and the accuracy is not that good as for capacitors due to the following reasons: Inductors may have relatively high parasitic resistance and capacitance Core losses (in cored inductors) EMI (incl. stray inductance and capacitance) Frequency dependent effects in inductors More There are few techniques for measuring inductances (some of them are described here). LCRs are special meters designed for inductance measurements and containing the required circuitry. These are costly tools. Since the hardware for measuring the inductance may also be used for accurate measurement of R and C, LCRs also employ this circuitry in order to improve the accuracy of capacitance and resistance measurements (for example: AC resistance, AC capacitance, ESR etc.). I believe that the difference between measuring inductance and capacitance with LCR is just a matter of different firmware algorithms, though it is just a guess. Therefore, the general answer to your question is "yes, LCRs are usually more accurate in RC measurements than DMMs, and they can measure a wider range of measurable quantities". However, this is just a rule of thumb - there are many superb DMMs and lousy LCRs out there... Read specs.
H: How can I power a SCSI hard drive without a motherboard/scsi card? While this is possibly more of a Super-User question, I chose to put it in EE because I'm looking for information about power assignments on SCSI cables, and understanding how to send power ONLY (not data transmission) to a SCSI drive via it's ribbon cable or some other method. I figured that's going to involve schematics and likely some soldering...hence, EE. :) I`m building a DIY gyro-stabilizer for a camera, and have determined through a few experiments with long ribbon cables that two 10000rpm SCSI drives offer just the right amount of resistance for the device I'm stabilizing. Once I'm disconnected from the computer/SCSI card, though, I have no power to the drive. For an IDE drvie, I'd just solder a battery holder to a molex connector and be done with it. All I need is for the drive to spin. This SCSI Ultra160 (16-bit, if it matters) connector is what I'm working with, but I can't seem to find any pin-out information that tells me which of the pins/cables supplies power to the drive. I'm also interested to know if there are any hardware mechanisms in SCSI that would cause the hard drive to stop spinning. For instance, there may be a 3V connector somewhere that causes a standby mode if I don't connect that as well. I'm not sure if there's anything like that hidden in the ribbon cable of which I need to be aware. Can anyone help? Does anyone have experience doing this? AI: This connector is called Single Connector Attachment (SCA): Wikipedia page. This should help you find a pinout. Also, AFAIK, ALL disk drives require the controller electronics to be powered to spin up a drive. Powering the motor alone will not spin up the drive. Also, I wouldn't guarantee that if powered but with no host communications, the controller wouldn't eventually spin gown the drive.
H: What does this power designation/rating mean, and do I need to custom-build a power supply to provide it? I'll start by saying that I'm a relative self-taught newbie in the electronics world. I recently bought a tube amp kit off of eBay. There were no assembly instructions included, but a very self-explanatory screen on the PCB made it easy to put together. Power supplies are a gap in my knowledge; I usually just trust the product specs. But this fails my reasonability check, so I was hoping someone else could share their knowledge with me. According to the auction listing, "Power requirement is 60VAC ~ 70VAC 0.2A & 0 - 9VAC 1 ~ 2A." First, I'd expect it to be an OR, not an AND for the two voltages. Second, when I try to google the power supply specs, I get overrun with results that match 60Hz...not VAC...and sifting through the results for something relevant is challenging at best. If this isn't a type, I suspect that I may need to create SOMETHING that takes 120VAC in and uses two transformers to output 9VAC and 60VAC. If that's the case, I'd like some references to sites that have examples of "splitting" the power like that so I can research the circuit. I understand how to use a transformer to change 120VAC to X-VAC, but not sure if there are other considerations to get X-VAC and Y-VAC from a single 120VAC source. If nothing else, it's a great time for me to start learning about power supplies. :) AI: There are two solutions for this problem - 1)Use two transformers - one for 60VAC and other for 9VAC 2)Make a custom transformer having two secondary coils - one for 60VAC and other for 9VAC. This is a single transformer with 2 wires on primary side and 4 wires on secondary side(two for 60VAC and two for 9VAC) There are solutions for splitting AC. But are costly. Best solution is to use transformers. I have also faced a similar situation in building audio amplifiers where the power amplifier needs 22V and the filter circuit needs 12 volts and the solution was to build a custom transformer (since 22V was not a standard transformer rating).
H: What measures should I take to protect the USB ports of my PC during development of a USB device? I'm going to start developing a USB 1.1 device using a PIC microcontroller. I'm going to keep one of the USB ports of my PC connected to a bread board during this process. I don't want to destroy my PC's USB port by a short circuit or connecting \$\pm\$Data lines to each other or a power line accidentally. How can I protect the USB ports? Does a standard USB port has built-in short circuit protection? Should I connect diodes, resistors, fuses on/through/across some pins? AI: This is to expand on Leon's suggestion to use a hub. The USB hubs are not all created equal. Unofficially, there are several "grades": Cheap hubs. These are cost optimized to the point where they don't adhere to the USB spec any more. Often, the +5V lines of the downstream ports are wired directly to the computer. No protection switches. Maybe a polyfuse, if lucky. edit: Here's a thread where the O.P. is complaninig that an improperly designed USB hub is back-feeding his PC. Decent hubs. The downstream +5V is connected through a switch with over-current protection. ESD protection is usually present. Industrial hubs. There's usually respectable overvoltage protection in the form of TVS and resettable fuses. Isolated hubs. There's actual galvanic isolation between upstream port and downstream ports. Isolation rating tends to be 2kV to 5kV. Isolated hubs are used when a really high voltage can come from a downstream port (e.g. mains AC, defibrillator, back EMF from a large motor). Isolated hubs are also used for breaking ground loops in vanilla conditions. What to use depends on the type of threat you're expecting. If you're concerned with shorts between power and data lines, you could use a decent hub. In the worst case, the hub controller will get sacrificed, but it will save the port on the laptop. If you're concerned that a voltage higher than +5V can get to the PC, you can fortify the hub with overvoltage protection consisting of TVS & polyfuse. However, I'm still talking about relatively low voltages on the order of +24V. If you're concerned with really high voltages, consider isolated hub, gas discharge tubes. Consider using a computer which you can afford to lose.
H: 24V AC-AC Power Supply Outputs ~80V Unloaded I have a AC-AC power supply with a secondary coil rated as 24V, 1500mA and 36VAC. Primary is 230V, suited for use in the UK. I measured the output of this power supply with an oscilloscope, and it was showing a sine wave that with peak-to-peak voltage of around 80V. This seems really high to me, but I have little experience with AC-AC power supplies, and not sure if this is normal. I know, for instance, that an unregulated DC power supply will output higher voltage than stated when unloaded. This might be the case here, but for the output to be so much larger seems unusual. Is what I am seeing normal behaviour, or is the power supply (which ~5 years old) faulty and should be replaced? AI: 80 volts peak-to-peak is... \${ 80V \over \sqrt 2 \times 2} \approx 28.284V\$ ... 28.3 volts RMS. This is an error of... \$1 - {24V \over 28.284V} \approx 0.1515\$ ... 15.15%. That is a bit high, but may be in spec for the equipment it's meant for, since the voltage will drop a bit when the supply is loaded.
H: Accurately measuring temperature with Arduino I'm trying to build thermostat with Arduino. I want to power it using mobile phone battery/charger which makes system voltage quite variable. Right now I use Arduino Uno, but once it is complete I will port it to Lilypad. First I tried to use TMP36 temperature sensor. So far it was complete failure. While the sensor itself appears to be very stable, I can't figure a way to accurately measure its voltage. Using built-in 5v reference for analog sensors isn't working at all -- even powered from USB arduino's +5V are actually +4.8V (which shifts measured temperature by few degrees). When the board is powered from the battery, voltage drops to about 4V and measured temperature sky-rockets. I also tried to use +3.3V from the board as a reference. It seems to be more stable when the board is powered from USB, but its voltage drops when running off the battery. Is there any other way to reliably measure sensor output voltage? For the second stage I'm planning to use thermistors. Just ordered a couple of these 20K thermistors. From what I understand, these should be easier to measure accurately if I build voltage divider and use V_in as reference voltage for ADC. A couple of questions about them: Does it make sense to use few voltage dividers with different fixed resistor to increase accuracy? I can use programmable pin as V_in, and measure temperature using few different voltage levels. Though its not clear to me whether this will actually increase accuracy. AI: It seems you are aware of the problem with the reference voltage changing and if you use a device like the TMP36 (fixed 10mV/degC) there is nothing you can do other than use a voltage reference from a chip to stabilize things. However, if you are using an RTD or a thermistor then the problem won't arise. You ADC is making a ratiometric measurement - it compares the ADC input to its reference voltage BUT, if you power the RTD or thermistor (via a suitable resistor) from the same ref voltage it won't affect readings. If the ref goes up 10% then so does the voltage into the ADC.
H: Circuit goes mad when programming the arduino So, I have a circuit with an arduino. Connected to the arduino there's an IR sensor, an LCD screen, a little servo motor, a MCP23017 expander with the A register to control a l239D and the B register for status leds and button inputs. On the other side I have two dc motor connected to the l239d and powered by an external power supply. The arduino and the external power supply are common grounded. Here's the problem, when I program the arduino the circuit start to be totally crazy, lcd start to flickr, servo too and motors runs at 100% speed. I had this behaviour at runtime too but it was solved when I placed caps on the the two l239d power inputs and one on each dc motor wires (+ and -). Until now when I was programming the arduino the external power supply was turned off. But now I need it to be on when the arduino setup method is called. And I don't have psychic power to guess exactly when that could happend so I can't turn it on a the right moment... I'm looking for a solution cause for now the arduino have survived but I'm pretty sure things will go really wrong (I'm in the software industry and Murhpy is my good ol' friend...) What can I do to avoid that behaviour ? Is a transistor to control from the arduino the external power supply connected to the l239d enough ? AI: What can I do to avoid that behaviour ? During programming, isolate the pins used for programming from the rest of your circuit. During normal operation, reconnect those pins to the rest of your circuit. Example from Arduino MIDI shield
H: Switched or linear charger IC for lead-acid battery - which one to pick? What is the difference/practical consequence of using switched vs. linear charger controlling ICs and which one should I choose? I understand that the switched regulators/chargers use a PWM while the linear ones use an adjustable voltage divider. But how does that map on the practice? I need to charge a lead-acid (Yuasa 6V 1.2Ah) battery from the solar battery and I choose between TI's linear UC2906 and a switched UC2909. AI: Linear regulators waste power because it is like using a variable resistor to control the charging current. Whatever current flows into the battery also flows thru the resistor and this generates heat. A switcher wastes very little heat normally and could be more than 95% efficient. Very useful for limited power output from a solar cell.
H: ATtiny45 Timer1 clock misconfiguration I am overlooking something with a very simple program for my ATtiny45. A program that divides the 16MHz system clock by 16 and outputs that on pin 5 (OC0A) using Timer0 and on pin 6 (OC1A) using Timer1. Pin 5 (Timer0) works as expected, I measure 1MHz. Timer1 should be configured in a similar way, making pin 6 (OC1A) toggle at the same 1MHz frequency, but somehow this doesn't work as intended. Pin 6 (Timer1) carries 32kHz. Even when I change the value for OCR1A, the frequency stays at 32kHz. I know I'm overlooking something here, but I can't figure it out. Here is the source code I use: #include <avr/io.h> #define _BS(bit) ( 1 << ( bit ) ) #define _BC(bit) ( 0 << ( bit ) ) /* * 1 PB5 !RESET * 2 PB3 XTAL1 * 3 PB4 XTAL2 * 4 GND * * 8 VCC * 7 PB2 SCK * 6 PB1 OC1A MISO * 5 PB0 OC0A MOSI */ void setup( void ) { /* * Setup timer0 for divide by 16 from system clock */ TCCR0A = // Timer/Counter Control Register A _BC( COM0A1 ) | _BS( COM0A0 ) | // COM0A[1:0] = 01 - Toggle output pin on every match. _BS( WGM01 ) | _BC( WGM00 ); // WGM0[1:0] = 10 - Clear timer on Compare Match (Auto Reload) TCCR0B = // Timer/Counter Control Register B _BC( WGM02 ) | // WGM0[2] = 0 - Clear timer on Compare Match (Auto Reload) _BC( CS02 ) | _BC( CS01 ) | _BS( CS00 ); // CS0[2:0] = 001 - System clock, no prescaler. OCR0A = // Timer/Counter0 Output Compare Register A ( 16 >> 1 ) - 1; // System clock divider. The OC pin toggles on each match introducing an extra factor 2. TCNT0 = // Timer/Counter0 0; // Initialize counter to 0. /* * Setup timer1 for divide by 16 from system clock */ TCCR1 = // Timer/Counter Control Register _BS( CTC1 ) | // Clear Timer on Compare match _BC( COM1A1 ) | _BS( COM1A0 ) | // COM1A[1:0] = 01 - Toggle output pin on every match. _BC( CS13 ) | _BC( CS12 ) | // CS1[3:0] = 0001 - System clock, no prescaler. _BC( CS11 ) | _BS( CS10 ); OCR1A = // Timer/Counter1 Output Compare Register A ( 16 >> 1 ) - 1; // System clock divider. The OC pin toggles on each match introducing an extra factor 2. TCNT1 = // Timer/Counter1 0; // Initialize couter to 0. /* * Enable output drivers */ DDRB = // Data Direction Register B _BS( PB1 ) | // Enable output driver for PB1/OC1A _BS( PB0 ); // Enable output driver for PB0/OC0A } int main( void ) { setup(); while ( 1 ) { } } AI: You need to configure timer 1 for CTC, set OCR1C to the max value you want for it, and then set OCR1A to the match value. TCCR1 |= ( _BV(CTC1) | // CTC on OCR1C, _BV(CS12) // System clock/8 ); OCR1C = 2; // Clear every 2 periods OCR1A = 1; // Match every 1st period Set other bits as required for the application.
H: How to measure open-drain vs. hi-z with multimeter I have an output pin configured to be either open-drain or hi-z. How can I use my multimeter to tell which mode it is in? AI: If the pin can only be high impedance or open collector then you can add a pullup resistor to the pin and try to write a logic 0 to it, If the pin voltage goes low it is open-collector, if it stays at a high voltage then it is high impedance.
H: What is the purpose of a voltage divider in a flex sensor? I've been following this flex-sensor-arduino tutorial on setting up a simple flex sensor with Arduino, and I got confused on this part: The flex sensor changes its resistance when flexed so we can measure that change using one of the Arduino’s analog pins. But to do that we need a fixed resistor (not changing) that we can use for that comparison (We are using a 22K resistor). This is called a voltage divider and divides the 5v between the flex sensor and the resistor. Why exactly did I need to add the second resistor? Couldn't the Arduino just get the voltage change from a single variable resistor that is the flex sensor? I'm very new to electronics, so an explanation in simple terms would be great. AI: This is called voltage divider. To to be able to discover the unknown resistance you put it into a combination with a known resistance and apply the formula. You can connect a fixed current source to the unknown resistance, to measure voltage drop over it. A fixed current source is a bit more tedious to implement though. I'd suggest you go and read about it, experment with it on a breadboard. You'll need two multimeters - one for voltage, another for current. Learn your Ohms law amen.
H: How to add "Diac" in OrCAD? I am trying to add Diac component into my OrCAD v16.5 Schematic Layout. But, I only find this code below as a netlist. Even Though, I can't include the netlist into OrCAD Capture perfectly. It didn't worked. There is no Diac component in among OrCAD Capture libraries. I really searched too many times in web. The question is: How can I work with diacs in OrCAD Capture? The real Diacs are commonly named as: DB3, DB4, DB5, BR100, ER900. But there is nothing in OrCAD :( .subckt diac 1 2 *Based on BR100 measured data *Convergence problems often occur with this model *If you have a better model please tell me Vdummy 1 5 dc 0 Ediac 5 2 TABLE {I(Vdummy)} = + (-10.06m,-20.46) (-9m,-20.5) (-7.02m,-20.72) (-5.98m,-20.89) + (-5.05m, -21.11) (-3.26m,-21.91) (-2.15m,-22.96) (-1.6m,-23.99) + (-7.2n, -32.5) (-4.0n, -32) (-3.2n,-31) (-2.9n,-30) (-2.5n,-28.03) + (-2.3n,-25.27) (-2n,-20.15) (-1.9n,-15) (-1.8n,-7.96) (-1.5n,-1.2) + (0,0) (1.6n,1.24) (1.65n,5.15) (1.7n,7.91) (1.8n,10.1) (1.9n,15) + (2.1n,20) (2.4n,25.28) (2.9n,28.26) (3.3n,30.5) (1.6m,23.21) (2.3m,22.16) + (3.1m,21.44) (4.05m,20.99) (5.01m,20.65) (6.04m,20.32) + (6.98m,20.14) (8.09m,20.02) (9.08m,20.02) (10.12m,19.91) .ends diac AI: I am trying to add Diac component into my OrCAD v16.5 Schematic Layout. The subcircuit you listed is for doing simulations BUT you only want it to be a component in the schematic. Yes? Find a component that looks like a diac (maybe an SCR or a diode) and place it somewhere on your schematic page. Right click the component and selct "edit part". This takes you to a new screen where you can edit the circuit symbol to be whatever shape you want - you can add pins, rename pins and totally redraw it to how you want it to look. When done editing the part leave edit mode by pressing the X in the top right hand corner (as you would when closing down a sheet of a schematic). OrCAD will then ask you if you want to update all parts - just select the option that says something like "only update this part" and hey presto you've edited a component and in your schematic it should look like a diac (or whatever you redrew).
H: Electric Fields According to this article, the electroreception is an ability used by some animals to navigate through their medium without using vision. It was published another article explaining how to build an electric charge detector. In order to do some active electroreception experiments (detecting the own electric field, as electric fish do) it would be nice to find some circuit that can generate some kind of field Does anybody know about a circuit like that? Or a place I can research more? Thanks in advance AI: You don't say what field strength you need, but apparently only a few V/m. To get 1 V/m, for example, connect wires to each end of a 1.5 V battery and hold them 1.5 m apart. To get 3 V/m, for example, hold the wires from a 1.5 V better 500 mm apart, a 3 V battery 1 m apart, a 9 V battery 3 meters apart, etc. Yes, it really is that easy. A Van de Graaff generator is gross overkill and will create much larger voltages than you probably want.
H: Is it possible to use coolers/fans as wind powered generators? Is there a way to make a fan/cooler generate electricity by rotating its blades using the forces of nature? I just tried rotating different coolers and fans I have at home with a 2 volt pocket flashlight lamp attached to the wires, but it wouldn't light up. Then I remembered that there are controllers installed to make fans utilize energy with more efficiency or to help control rotation speed, so I guess that'd be the problem. Would a simpler design of a fan work both ways? AI: DC-powered fans often use a brushless permanent-magnet motor along with some control electronics. The motor itself could act as a generator, but the electronics generally won't allow any power the motor could generate to escape. Taking apart such a motor would likely allow one to make a generator, though I doubt it could produce much power. Mains-powered fans often use a different style of brushless motor which won't work well as a generator unless there's already AC voltage present. It's sometimes possible to use such motors as generators if one properly connects capacitors between the windings, and ensures that there is no load other than the capacitors until the unit has built up some voltage [residual magnetism in the motor's parts won't produce any significant power, but in the absence of a load it may produce enough to produce voltage to build up a magnetic field which would then be capable of producing significant power. An interesting feature of motors used this way is that they have a limit to the amount of power they can supply without collapsing the magnetic field; trying to draw more than that will collapse the field and shut everything down.
H: Identify Logos on Bridge Rectifier This is one of two bridge rectifiers recovered from a failed LED lamp. I've seen the 'backwards R' before but don't know what it means/identifies. The other logo on the left is one I've never seen before. Can anyone identify/explain either of these? Thanks. AI: This appears to be Russian, or sold by Russians. At least, I find Russian parts suppliers listing bridge rectifiers with the same logo. For example at this odd URL with spaces in it: http://radimexbg.com/index.php?pid=1%20%20%20%20%20%209122 or same part at http://radiodetali.spb.ru/diody-i-diodnye-mosty/most-diodnyjj-kbu6m/id190/ I hope you read Russian! Google translate didn't turn up any obvious manufacturer's name, so far. But having gotten this far, my curiosity will not rest... UPDATE: Aha got it! Yangzhou Yangjie Electronics Co Ltd http://www.21yangjie.com/en/ PDF datasheet for the other part (not the one in the original question): http://images.ihscontent.net/vipimages/VipMasterIC/IC/YANG/YANGS00160/YANGS00160-1.pdf
H: Working of a Comparator based Oscillator Circuit I was trying to understand the working of this circuit, but couldn't figure out, how does it generate a square wave. Here is what I figured out by looking at this. The Op-Amp behaves as a comparator. Assuming output to be +3V initially, the capacitor will charge. Once it charges the output will be -3V. The bottom circuit, looks like a divider giving -1.5V at the non-inverting input. What happens next? AI: Definitions: The inverting input of the opamp will be indicated by V-; The non-inverting input of the opamp will be indicated by V+; Analysis Initial state: The opamp has positive feedback through the two 10kΩ resistors and is configured as a comparator as a result. It's output will be either HIGH or LOW. When the opamp output is HIGH V+ = +1.5V and when the output is LOW V+ = - 1.5V. A good start to analyze the circuit is to assume the capacitor is discharged. The voltage across the capacitor is 0V and therefore V- will be at 0V too; Continuous cycle: Let's asume the opamp output is HIGH, V+ = +1.5V. With V- = 0V, the capacitor will be charged through the 100Ω and with that V- slowly rises until V- reaches the same voltage as V+ = +1.5V. At that moment the opamp/comparator flips LOW and with that it pulls its own V+ input to -1.5V. Now the capacitor starts to discharge slowly, down until the point where it reaches -1.5V. At that moment the opamp/comparator flips HIGH again, pulling its V+ input up to 1.5V and the capacitor is being charged again. The cycle continues like that.
H: How the pull-up resistor settles the logic level? According to Wikipedia, "Pull-up resistors are used in electronic logic circuits to ensure that inputs to logic systems settle at expected logic levels if external devices are disconnected or high-impedance is introduced." and in the above figure, When the switch is open the voltage of the gate input is pulled up to the level of Vin. When the switch is closed, the input voltage at the gate goes to ground. What is the point of using the pull-up resistor anyway in this circuit ? For example, If i were to remove the pull-up resistor from the circuit above, and the switch is open, still the voltage of the gate is pulled up the level of Vin. Why use the Pull-up resistor then ? AI: For example, If i were to remove the pull-up resistor from the circuit above, and the switch is open, still the voltage of the gate is pulled up the level of Vin. There are two ways of interpreting this sentence, both of which lead to problems in the circuit. If we replace the resistor with an open, the input will be floating when the switch is open. You do not want floating inputs on CMOS inputs as that can lead to increased power consumption and possibly damage the input stage. If we replace the resistor with a short, the input will indeed be pulled high when the switch is open. But if the switch is closed then you will short out your supply which is a Very, Very Bad Thing. In both cases the solution is to have a resistor to the positive supply and a switch to ground, or vice versa depending on what you want the default input logic level to be.
H: ADC in Digital Temperature Sensor DS18B20 According to the datasheet of DS18B20 temperature sensor, it is clear that the sensor is digital so the output is in digital form. The resolution of the temperature sensor is 9, 10, 11, or 12 bits, corresponding to increments of 0.5°C, 0.25°C, 0.125°C, and 0.0625°C, respectively, and by default it is 12-bits. Which means, for 12-bits, a change of 0.0625°C in temperature causes an increment of 1-bit. But there is no information given on how much change in voltage will result from a change in Temperature (i.e. scale factor). For example, there is an analog temperature sensor in which a change of 10mV in the output voltage is equal to a change of 1°C of temperature. Is there any way to calculate the scale factor of the digital temperature sensor like the way we do for analog? AI: All you really need to know is contained here: - Internally the device may have a sensor that produces 10uA per degree or 10mV per degree or it may be like a thermistor or RTD and vary its resistance to indictate temperature. This is Maxim IP and we are not allowed to know what method they use unless they tell us. If it's not in the data sheet then we cannot know - but you could assume it is one of the four methods I've mentioned and give details in your presentation of all ideas. If you want to know the types of constant voltage or current sensors that could be used try looking up the AD590 (constant current at 10uA per degC) or the TMP36 (10mV per degC). I'm not aware of a particular name that describes the technology.
H: Why don't wires block out the backlight of LCD/TFT displays? Every explanation I've seen about how TFT/LCD screens work only talks about one pixel at a time. My question is: how are thousands of pixels and subpixels connected and controlled? I assume that they don't have a +ve/-ve pair of wires each or else the wires would block out the light. If the signal is routed through other pixels, how do we control where the signal goes? AI: The question appears to be essentially about how light can pass through the conductors connecting to each pixel in an LCD display - and secondly, how the connectivity to individual pixels can be achieved without interfering with the densely packed pixels themselves. For the first query, the answer is transparent conductors. The most well-known such material is Indium Tin Oxide (ITO), a transparent, colorless (in thin layers) conductive material. Thin traces of ITO, or other such transparent conductors, are sandwiched between layers of glass, to form the matrix of conductors in an LCD panel. A useful, simple article here describes this better than perhaps I can. The ITO conductors and the individual "pixels" can be seen by looking through an LCD panel into polarized light. For instance, the reflection of the daytime sky on a glass window or automobile windshield serves nicely: The reflected light is polarized, so by rotating the LCD around, at certain angles the pixels (and to an extent the ITO traces) will block this light through cross-polarization. For the second question, the simplest parallel is to consider double-sided PCBs. The copper traces on such PCBs are etched on both sides of the substrate, thus a crisscross matrix of connections can be achieved without any two traces intersecting with each other. The same rationale applies to transparent ITO conductors in an LCD - to over-simplify, consider all horizontal traces to be on the upper layer of glass, and all vertical traces to be on the lower layer. In many modern LCD technologies, the traces can actually pass not just between the pixels, but also beneath them: The conductor layer is distinct from the liquid crystal layer. The liquid crystal cells themselves are activated not by electricity passing directly through them, but by the effect of an electric field they are exposed to. Thus the ITO conductors simply need to be above and below each pixel, and the liquid crystals align according to the direction of the field. This crystal alignment gives rise to the polarization of the light passing through. As a fundamental principle of optics, if light polarized in one direction is passed through a polarizer aligned at right angles to it, the light gets absorbed - thus giving rise to the opaque pixels. Change the electric field, and the polarization changes, the opacity abates.
H: How do I know I have the right Bootloader Installed on my ATMega328P-PU? I got an ATMEGA328P-PU , already bootloaded , but when I tried to upload the program (a simple program for blinking the LED on pin 13 ) I'm getting an error as : avrdude: stk500_getsync(): not in sync: resp=0x00 I have googled a lot and have tried numerous way to get rid of this error viz : -press reset just before selecting Upload menu item -correct Serial Port selected -correct driver installed -chip inserted into the Arduino properly and followed every instruction on www.arduino.cc but heck AI: Have you ever programmed your ATmega328P successfully before? If not, that message most likely mean a configuration problem. It is just saying your IDE can't communicate with the MCU. It may take a while before you can successfuly program your ATmega for the first time. In this case, I can't help you without more information about your setup. If you were able to program it at some point, but can't do it anymore, then the message you're getting from avrdude may be a sign that your MCU is no longer working. To check if your ATmega is still alive, follow these instructions: Does the ATmega still display its heartbeat? Normally the bootloader for Arduino Uno and similar boards have a heartbeat feature to tell the users it's alive: it's three quick blinks on the LED attached to pin 13, right after boot. Does yours still do it? If so, you can relax: it's alive. If it does not blink three times anymore, has it ever blinked after boot before? For example, when you hooked up your Arduino board to a USB port in your computer (I'm assuming you have a USB board), has it ever blinked three times after boot? I don't want to alarm you or anything. I'm not saying that your ATmega is burnt. But it is kind of difficult to really know when it is burnt. The message you're getting is one sign of it, but can be many other things. I have burned 3 of those chips, myself, and it is a sad moment, that's for sure. In my case, a few things hinted at the problem. Before I had the problem, I was able to program my MCU using my Arduino Uno board. At some point, I did something that made the MCU stop working. Often is some short-circuit I caused when making changes to a circuit in a breadboard. After that event, the heartbeat stopped and I could no longer program the chip with my Arduino Uno nor burn a bootloader on it. The message from avrdude in all my cases were the same one you're getting. I could however program other ATmegas I had laying around using both methods (that meant it wasn't a problem with the board). If your MCU continues to do the heartbeat, then it's alive and you are experiencing some other problem, probably communication or IDE configuration. What I usually try next is to burn the bootloader again. If the MCU is ok, it will happily take the bootloader. This way, you also make sure the right bootloader is in place.
H: Direct connecting 5v relay interface board to usb I'm absolutely noob in electronics but I have this relay and I want to connect it to USB. When PC switches on usb VCC has +5v. Can I connect USB VCC to Relay Board "VCC" and "IN" wires to open relay (and GND to GND)? I need open relay when PC switches on and close relay when it switches off. upd: 1-Channel Relay interface board info: Each one needs 15-20mA Driver Current Equiped with high-current relay : DC30V 10A AC250V 10A Standard interface that can be controlled directly by microcontroller (Arduino , 8051, AVR, PIC, DSP, ARM) AI: Each module uses 15-20mA of current from the USB's 5V, which is safe. If you want the relay to switch on when power is applied, connect the input to ground. (You don't want the relay to switch off when power is applied, because then it will always be off.) Notice that the relay's contacts are switchover, so you can use it either as normally-open or normally-closed. You can save some power if you disconnect the power indication LED (at the right on the schematic.)
H: Switching 100 different LM35 with one uC I want to read the temperature of about 100 different LM35 with only one ATmega16 or ATmega32. I want to read 8 LM35 at one time and switch to the next 8 and so on. what kind of multiplexer or switch shall I use? any other suggestion will be very appreciated. AI: If you are using LM35 for the +2°C to +150°C range which outputs positive voltage only then an analog switch like 74HC4066 or 74HC4016 seems fine. The Maximum ON resistance of the switch is the range of 100 to 200 Ohm which would work fine with the ADC input of the AVR. If you intent to use the full range −55°C to +150°C then the negative voltage will be a problem with the switch. Since you intend to use 100 switches in groups of 8 you can bridge the control inputs together for each group, then you can lower the control pins needed to 100/8 = 13 pins To reduce that even further you can add a couple of shift register like 74HC595 and use the outputs to drive the control inputs of the analog switches. Is the use or the analog sensors a requirement? If not I would suggest the use of a digital sensor like DS18B20 that will give a higher accuracy and easier deployment using just a few wires without the need for switches.
H: Crosstalk between secondary transformer windings I have hand wound a transformer which has a 220v primary winding, two 25v secondaries and a 15v secondary: simulate this circuit – Schematic created using CircuitLab I have centre tapped the 15v secondaries (to later rectify to +-25v) and when measuring the voltage between A-B or B-C, I get 25v as I would expect. Similarly between D-E I get 15v. However, If I measure the voltage between B-D I get 5v, and B-E gives 15V. A-D is also at 24v and A-E at 34v. I would have expected these to all be ~0v. Why am I getting these voltages? I would have assumed that the 15v winding would be isolated from the 25v centre-tapped winding? I have checked there are no shorts between any the secondaries. I should also point out that this is under no load. As I said I hand wound this transformer (well the secondaries), so is this something to do with the direction of the windings? Or unbalanced windings? I would like the 15v winding to be isolated from the 25v ones. Is this not possible with a shared core? AI: A high impedance meter in most cases will give more accurate readings because it does not draw much power from the circuit under observation, but it can give misleading readings when the circuit produces high voltages without a load. What you are observing is the result of an overly sensitive meter combined with inductive and capasitive coupling. If you put a load on your transformer, you won't notice this.
H: What component to use to make object levitate imagine you have a printed circuit board. I'd like to put a component at each corner of the PCB that would create air, something like a fan, but powerful enough to be able to make the PCB levitate. In fine, the component must be as small as possible but for the beginning the size does not really matter. I'm not sure that I have to use a fan because it could be not enough powerful. In fact, I really don't know what to use and if such component exists or not. Does somebody have a lead on that ? (from comments:) As I (Flup) understand it the idea is to make a soft landing for the PCB when it falls on the floor. AI: You can levitate a PCB in two ways: One, like a hovercraft, with fans. Two, like a maglev train, with magnetic repulsion. Neither solution is going to break any significant fall. Moreover, the first two proposed solutions require a vertical guide of some sort (else the unit will move horizontally and fall or tip over). If you are talking about a handheld device, it would typically be at least several inches from the floor, if the unit falls it will gain velocity at 9.8m/s^2, and within a few milliseconds no practical levitation technology will overcome its inertia. Likewise you won't be able to build in airbags. Your best shot at protecting the unit from fall damage is adequate cushioning. Try designing an enclosure that will cushion a raw egg dropped from a tall building and you'll be on the right track. If you need the unit to fall only on one side, you could attach it to a piece of buttered toast, or to the back of a cat.
H: powering +5v device with usb and/or battery I made a PCB with an arduino clone and a tiny motor driver. The arduino clone itself needs +5 volt power supply, so I decided to use a DC/DC boost converter to boost a 3.7 volt Li-Ion battery to +5 volt. Then, a battery charger comes to my mind. After some thinking time, I wired my circuit like this, sorry for bad lights and an misspelling "converter"... I used one-cell Li-Ion charger bq24032a, according its datasheet, it can accept power from USB and/or AC( AC not used in my circuit). It can also provide power to system while charging the battery. Some facts I discovered: ONLY USB presented, battery absented. Bq24032a's OUT pin voltage will be +5 volt approximately( with no load). ONLY Battery presented, USB absented. Bq24032a's OUT pin voltage will equal to battery's voltage approximately...of course...( with no load). USB and battery presented, Bq24032a's OUT pin voltage will be +5 volt to battery's voltage. The charger is charging the battery, so the OUT voltage just lowered... I used tps61032 for DC/DC converter, it is dedicated for one-cell Li-Ion battery boost to +5 volt, but accept input voltage for 1.8-5.5 volt. So I have two question: Is my circuit's block diagram just looking OK? When bq24032a's OUT voltage is +5V( ONLY USB present), is it OK for tps61032 to boost a input +5 volt to a +5 volt output? Sounds weird... By the time I posted, I already have my PCB in hand... But I cannot figure out the two question( and many many tiny questions...). Answers desired... thanks :) AI: A1: The block diagram is a good start. A schematic would be even better. A2: 5V is fine. The data sheet shows it is 97% efficient with a 5V input (see figure 7 in http://www.ti.com/lit/ds/slus534e/slus534e.pdf)
H: Getting ADXL345 accelerometer to work over SPI with Arduino Uno I'm using this cheap ADXL chip with Arduino Uno. When I read the sensor with I2C - it works fine. However I have some servo motors as well which generate a lot of noise and when I turn the motors on, the sensor readings become pretty much useless. I read that SPI is much more immune to noise, so I decided to go this way. However I just cannot get it to work with SPI. I'm using this code, which seems to work for other people: https://www.sparkfun.com/tutorials/240 I triple checked the wirings, they seems ok to me, tried with and without level shifter, tried hooking up various pull-up resistors... and still I get just zeroes. Yet I2C works just fine (without any pull-ups). I'm wondering since the Sparkfun code uses a different breakout board for the ADXL chip - could it be that mine needs some specific pull-ups, that are not mentioned in that tutorial? How can I know what pull-ups need to be placed? And any other suggestions will be much appreciated! AI: You should read the datasheet for the part to double check your connections. You should not be having any pullups for SPI communication. Regarding being unable to communicate via I2C when motors are on - how long are your I2C wires? Trying to lower the resistance of I2C pullups might help. In general you can try to remedy this situation by adding bigger caps near microcontroller/accelerometer power supply or even adding a small (~10 ohm or less) series resistor and a cap on Vcc that goes to noise sensitive part. Read up on star grounding and powering techniques, it is possible you could solve your problem by just reconnecting wires in "star" manner.
H: Can 12.74V (iso 12V) result in a PC not booting anymore? My desktop PC doesn't boot anymore (no leds, no fans, ...). Last week, we could get it started by toggling the power switch a couple of times but this doesn't help anymore. I tried replacing the 3V CMOS battery and resetting the CMOS visually inspecting the capacitors measured the voltages on the 24 pin ATX connector of the PSU I measured 12.74V on the 12V pin which falls outside the 5% tolerance. (all other pins measured well within the tolerated ranges). Can this 12.74V be the root cause of the not-starting? AI: It is possible that an excessively high voltage could have damaged your motherboard and prevented the processor from booting, but it seems unlikely that a voltage of 12.74V would cause any damage. I would suggest that you try measuring the voltages under load if you really want to see if the power supply is working properly.
H: Charging 24V battery from 12V-24V converter I have a wind turbine, which generates 12V/400W and two 12V batteries connected in series to have one 24V. I have two questions, is it possible to charge them from the turbine just through the 12/24V converter without using the 24V charger? The second question: Is it possible to charge them just with the 12V from the wind turbine without using the converter at all? The batteries must be connected in series the whole time. Thanks in advance. Edit: The batteries are both Varta Professional DC -LFD140-12V-140AH - lead acid. Edit2: Is there any way how to charge the batteries from the turbine? AI: You need to add more detail but I will say that this will probably not work. I'm going to assume that your batteries are 12V lead-acid batteries, please edit your question if that is not correct. To properly charge a 12V lead-acid battery you need a charging voltage of at least 13.8V and something like 14.4V is better. So, you would need a charging voltage of about 28V to 30V. If your 12V-24V converter really supplies 24V then it will not be able to charge the batteries. It's worth mentioning that you need to be careful when charging batteries in series like this. A fault in one of the cells can cause all of the other cells to be overcharged and destroyed.
H: Core and winding dimensions for an electromagnet and bifiliar winding I am making a powerful electromagnet for repulsion for my project. I made some electromagnets with iron core diameter of 1 cm, 1.5 cm and 2 cm for each 6 cm and 8 cm length. Different gauge enameled copper wire I used is 0.42 mm, 0.70 mm and 1.0 mm. Winding width is 1 cm for each electromagnet. The end result is an electromagnet with 2 cm x 8 cm dimension with 1.0 mm wire gauge is the most powerful of all. But still not enough for what I want. Now I am going to experiment with using 4 cm, 6 cm, and 8 cm diameter iron core of 8 cm length. My question is: is there any rule/what is rule to decide winding dimensions in relation with core dimensions? As I used 1 cm winding diameter with wire of 1.0 mm and 2 cm diameter core. Will increasing the winding diameter say using 1.5 cm winding instead of 1 cm on an increased 4 cm diameter core will make a more powerful electromagnet? I am also thinking to make an electromagnet with this same dimension as of my current best electromagnet (i.e. 2 cm x 8 cm with 1.0 mm wire gauge) using bifiliar winding (winding with two wires together and attach the ends) to compare both. As I read winding this way decreases overall resistance of wire, input more amperes & increases power of electromagnet. Any comment about this ? I find this one online simulator for air core online electromagnet calculator. It's very helpful for finding resistance of coil and number of turns for cored EM too. Is there any such simulator available for electromagnets with core? AI: I found this calculator on the web. It seems to use the correct formula and that is: - Force exerted = \$(NI)^2 \times \mu_0 \times\dfrac{A}{2g^2}\$ Where N is number of turns I is amps A is cross sectional area of coil \$\mu_0\$ is permeability = \$4\pi\times 10^{-7}\$ g is the gap between the solenoid and the thing it attracts to Note that the permeability of the material you wind it on does produce more flux density but the permability of the gap is the totally dominant part of the equation and material permeability is not included because it is so very minor. An an electrical analogy, having something with high conductance (ferrite) in series with something with low conductance (air) still means something with low conductivity i.e. air is dominant except when the gap becomes small as in gapped ferrite transformers or inductors (which you haven't got) Doubling the turns or doubling the current produces 4 times the force but doubling the gap quarters the force. Doubling the diameter of the solenoid produces four times the area and hence 4 times the force too. Increasing the wire diameter allows more current to flow (for a given power supply voltage) BUT only if the supply can give the extra current. Ideally, wind with silver wire (costly) thus keeping the resistance low and feed as much current in as you can. Make the coil diameter as big as you can too. As many turns as you can manage also. Bifilar winding won't help - this will be a dc solenoid with maybe a low frequency excitation and skin effect will be almost negligible - better to use two wires in series because N doubles rather than split current into two parallel paths (in effect this is just one turn still).
H: How safe is this? I'm wondering how safe this is to make and to build into my setup. :P A bit afraid of it exploding. http://www.apartmenttherapy.com/make-your-own-batterypowered-u-100359 AI: Mechanically there is a risk of shorting. If it gets hot under discharge as hot-melt glue, which they use, may soften and allow movement. Shorting the battery terminals will probably not cause a fire, but may. Explosion is very unlikely. If you short 9VDC or even >> 5VDC to a USB port it MAY kill the device being charged. Electrically it is marginal as there are no capacitors used with the regulator but it will probably work in some cases. See the circuit here that robomon cites. Regulator is IC2 at top left. Note the added caps. A 0.1 uF on input will probably be enough. Much larger is useful when battery is low. The regulator type is not specified (that I could see) but is probably a '7805' / LM340. This will stop working when the battery reaches about 7V. Other regulators with the same pinout are available that will operate down to Vbattery < 6V, when the battery will be fully exhausted if an Alkaline battery is used. Use with a NiCd or NimH battery will not allow all the battery energy to be used in many cses as Vbattery falls too low while there is still energy left in it. The energy capacity of a 9V PP3 battery is low. This would act as an emergency supply for eg a cellphone but would not fully charge even a very small cellphone battery. Maximum current will not be enough for some larger battery-capacity devices. As they say, some (or many) USB charged devices require additional resistor dividers that provide selected voltages to the USB data lines to signal charger capability to the charged device. Many Apple devices need these. Search for "MintyBoost" as a possibly superior DIY alternative. One example of many here and commercially From Sparkfun and from Adafruit. Also many many other versions via here
H: Why my full-wave bridge type diode rectifier circuit begins an analysis from 8. second on Matlab Simulink? Hi, I am working on Matlab Simulink's work page to get full-wave and half-wave bridge-type-diode rectifiers as could be seen in the picture. But, according to my Scope2 screen when I double clicked from simulink white-area it begins from 8. seconds not from zero?? How can I made it to begin with zero point to analysis? AC voltage: 50HZ Vpp-max=10Volt RLC Load: only Resistance 1KiloOhm AI: Yes, you are right! I found my fault: Double click on Continuous block On Simulation and configuration options Configure parameters Preferences Start simulation with initial electrical states from "ZERO" I chose Blocks, now it is Zero. Thank you!
H: Run an atmega328 only using an 16Mhz crystal without caps Can you run an ATmega328 only using an 16Mhz crystal, so without the capacitors? AI: Sort of - set the fuses so it runs off the internal oscillator and it shouldn't care what's connected to the xtal pins. You won't need the crystal either.
H: Servomotor takes too much power so the µController (ATMEGA328P-PU) resets all the time I have got the following circuit diagram. For a little explanation. When the button is pressed the µC is powered for about 10 sec. The µC contains code that moves the servo. When the servo is connected it takes so much power that the µC resets all the time. How can I change the circuit that this does not happen? It is powered by a 9 volt block. Now I changed the power supply for the servo with an other 7805 like this circuit diagram: Now the µC resets a bit later. AI: The AVR is powered from a 7805 regulator which takes input from the 555 timer (that has a limited output current capability). Because of that the regulator is not able to supply much current and when the servo tries to rotate and pull current the voltage drops and the mcu resets. To solve the problem you should feed the servo from a separate regulator that takes input from the 9v supply (assuming the servo can't be powered directly with 9v). Adding to what Nick Alexeev says, why do you need the 555? You can use the AVR only, put it in sleep mode and set it to wake up with an external interrupt (INT0) from a button press, work for 10 sec and then sleep again.
H: What are those "cheap" parts kits made of I hope this will not be categorized as buying related question because my question is not really on should I buy this or this. I usually find some parts kits, usually resistor/capacitors/trimpots, like 100 caps for 2€/3$. I've already try one pack of these from Kemo, the values in the pack are totally random but I got some good surprises too (like a bunch of 10K 1% resistors and 550ohm 2% resistors). For the moment I just use them when prototyping the project. My question is do you know how they can be so "attractive" from a pricing point of view ? I have my little idea, but not sure. I think it's most of them "old parts" or unselled stock from closed companies. (due to the "look" and some have a bit of corrosion). I ask because I've also thinked at a moment about harvested parts from broken electronics as some "feels" like harvested parts. Do you have any ideas about these cheapos parts ? Is it a dangerous choice ? AI: There's a variety of sources. This is, probably not the complete list, but it can give you an idea. Factory overruns. There are accidental overruns, deliberate overages, clandestine overruns. The problem is that you don't know if the overrun was quality controlled or not. In case of clandestine overrun, it's also not know if the manufacturer was following the process, or they were cutting corners. Factory rejects. When quality control decides that the tolerance is out of spec, the whole batch is rejected. Suppose that the batch of 5% resistors falls outside 5%, but within some larger number. These are still viable resistors, only less accurate. So called "new from the old stock". Company cleans out its inventory, which was procured through qualified channels, because they no longer use the part in their designs. The quality of such parts is normal, although shelf life may still apply. Except for the last type, the history of the parts is usually not known, when you buy the kit. Don't use these bargain parts in life and death matters: airplanes, cars, weapons, medical devices.
H: Online FPGA/HDL synthesizer I recall seeing a web-based HDL synthesizer a couple years ago, but I can't find it anymore. I believe it was just a frontend that ran the vendors' synthesis tools on the server. Does this sound familiar to anyone? I don't remember the name, and nothing is turning up in my searches. (Perhaps it got taken down?) AI: Yes, that company is still around. It is called Plunifiy. Please check out http://www.plunify.com
H: Changing voltage levels from 5V to 3.3 V I am asking some basic questions here. I have a sensor whose voltage specs are 0-5V and I have to interface this with my TI MSP430's ADC, whose voltage Vcc is 3.3V . For this I have to convert the level of the output of the sensor. 1) Can I accomplish this using a simple potential divider, that is, I use two appropriate resistors in series, and then tap the drop across one of them and feed that to the ADC? 2)If yes, then are there some additional things that I should look into? 3)If no, can someone suggest a suitable alternative? AI: 1) Can I accomplish this using a simple potential divider, that is, I use two appropriate resistors in series, and then tap the drop across one of them and feed that to the ADC? Yes, using a voltage divider is a good solution. 2)If yes, then are there some additional things that I should look into? Find the datasheet of your sensor an find out if it has a minimum load requirement and find its maximum load. Make sure your resistive divider is well below the maximum load of the sensor. Also take tolerances (and temperature dependency) of the resistors in account and how they reflect on the measured value. Preferably make sure the voltage cannot get higher/lower than the power rails of the microcontroller by using (Schottky) clipping diodes. simulate this circuit – Schematic created using CircuitLab 3)If no, can someone suggest a suitable alternative? Counteless ways to solve this, but a resistive divider is simplest.
H: For how long ICs can be exposed to overvoltage without being damaged? (protection circuit evaluation) I'm asking this because i'm trying to develop an active overvoltage protection circuit and unsure about how quickly it should react to overvoltage condition. Maybe someone can give me advice on that? Thanks to everyone. I learned important things. AI: An active over voltage protection scheme will be slower than such things as zeners. In any case you should ensure that any overvoltage condition is prohibited in rising to critical levels on what you are trying to protect more quickly than the protection device can respond. This can be achieved with passive components such as resistors, inductors and capacitors.
H: Do I need an external oscillator for PIC16F887A? I'm working with a PIC16F877A. Do I need to add another external oscillator to pins 13 & 14 or can I use its internal oscillator with 4MHz frequency? I don't need precise timing in my project. I just want a delay of 10 seconds which I can generate with an internal 4MHz oscillator. AI: It doesn't appear to have an internal oscillator capable of generating its own clock, but if you check page 146 of the PIC16F87XA datasheet it shows how you can use an RC oscillator if cost rather than the number of I/O pins is an issue. The PIC Mid-range Family Guide oscillator section includes the following recommendations: For REXT values below 2.2kΩ , oscillator operation may become unstable, or stop completely. For very high REXT values (e.g. 1 MΩ), the oscillator becomes sensitive to noise, humidity and leakage. Thus, we recommend keeping REXT between 3 kΩ and 100 kΩ. Although the oscillator will operate with no external capacitor (CEXT = 0 pF), we recommend using values above 20 pF for noise and stability reasons. With no or small external capacitance, the oscillation frequency can vary dramatically due to changes in external capacitances, such as PCB trace capacitance and package lead frame capacitance. While the design is based on a relaxation oscillator I found several references to Microchip not committing to an exact time determination formula. However on page 200 of the datasheet you'll find a graph of typical frequencies for several resistor / capacitor combinations. If you're running at 5V it looks like 20pF and a 5.1 kΩ resistor should be close to the mark. I guess you're using a chip you already have on hand, but the more modern devices include internal clock options that are much more accurate and leave the I/O pins available for other uses. If you won't really need that much speed you could also consider running it as a lower clock rate, as 4MHz is the highest recommended rate and component tolerances may push it over that limit.
H: Reading and writing CAN messages through ELM327 I have an OBD-II cable, and an UART-to-OBD-II board which has the ELM327 IC in it. I want to communicate with my ECU by sending-receiving CAN messages. Is it possible to communicate through ELM 327? I've been able to diagnose the ECU to fetch basic information through the UART board (ELM327) using HyperTerminal and Raspberry Pi. AI: Yes you can! ELM 327 supports AT Commands (See this PDF ). You can set filters for required CAN IDs or J1939 PGNs and it will return you corrosponding CAN Data over UART. Check list of commands. They are self-explanatory. P.S. ELM 327 has special command for DM1. DM1 is a J1939 PGN which has information about all active faults. Do check that!
H: How to cut the tracks of a stripboard Since I've started electronics I'm using this kind of board for permanent projects: But sometimes it's a bit annoying, especially when I need a line going from the top to bottom of the board. I've seen this kind of board: My question is, how can I cut the strips? By cutting the strip I don't mean cutting the board itself, just the copper strip. I've tried with a precision knife but I'm not sure about the method, the blade gets damaged really quickly and it's really hard to cut the copper. AI: There are specific tools that are designed to cut holes in this material, which is either called "stripboard" or "veroboard". These tools are basically a drill bit in a moulded handle made of plastic or wood and look something like this: (photo from here) Because it is basically a drill bit you could use any high speed steel drill bit. There are some good instruction at Instructables that show how to cut neat holes. However if you plan on using stripboard often then it is worth buying a tool with a handle, they are quite inexpensive.
H: Using UART clock 3.6864 Mhz for a microcontroller I want to use a 3.6864 MHz external oscillator to clock my ATMEGA328p to ensure 'error free' serial communication. When I looked at this page, I see that 3.68464MHz is also represented as 2*1.8432 MHZ.I'm at a loss as to what this means. Does this mean that I'd have to use two 1.8432 MHZ clocks to somehow generate 3.6864 MHz? Or does it just show me how this value (3.6864 MHz) came to be? If the former is true, how CAN I generate 3.6864MHz with two oscillators at a lower frequency? Are oscillators available at these 'multiple' rates of 1.8432MHz? Will this communication will truly be error free as the page linked claims? How would I connect the oscillator to the microcontroller? The datasheet confused me a bit because section 8.4 makes it seem that I place the oscillator between XTAL1 and XTAL2, while 8.8 suggests that I connect it to XTAL2 with XTAL1 not connected. So there's some confusion there, though 'm inclined to think that the latter is what I'm looking for. But, how can I connect the two pins of an oscillator to just the XTAL1 pin? AI: The datasheet confused me a bit because section 8.4 makes it seem that I place the oscillator between XTAL1 and XTAL2, while 8.8 suggests that I connect it to XTAL2 with XTAL1 not connected` The microcontroller has several clocking source options (internal or external). One of them is by connecting an external crystal to XTAL1 - XTAL2 (section 8.2) Another clock source can be using an external oscillator (this means an external device that generates the clock pulses) which can be used like You can use one or the other, not both of them. Regarding your question about the UART you should check section 19.11 which has several tables showing the error percentage for a given baud rated and crystal frequency used. For your specific case with a crystal of 3.6864 MHz the table that shows the possible baud rates and the error percentage is and it's perfectly usable with 0 % error in all the common boud rates.
H: Longest range remote control I would like to make a long range (5Km) quadcopter. As of right now, I'm just trying to find out the best way to control it. I know that there are some 5Km R/C transmitters but they are the size of brick which is a little inconvenient. I was wondering if communication could be made through GSM, GPS or other wireless protocol that would be cheaper and/or weigh less. Any ideas on how to achieve this long range is accepted. AI: There are at least two commonly used civilian mechanisms for long range control of UAVs or RC cars: Public-band TX/RX radio, and mobile packet data, depending on the capabilities onboard the remotely controlled vehicle. For public-band RF control at long range, modules such as the Xtend 900 1 Watt RSPMA by digi work well at 5+ miles, giving between 10 kbps and 115 kbps data rates, with very low power requirements. At 18 grams, they wouldn't be classed as "bricks". These modules are a bit pricey, at nearly $200 each, including the cost of the antenna. The antenna itself would be a concern as well, as it would need to be fairly substantial, thus interfering with airflow. The most common type of antenna is the duck antenna, similar to those used in some wireless routers. Note that the 900 MHz band is not available for public use in most countries other than the USA, Canada, Australia and a few others. Even in countries where it is permitted, the 1 Watt maximum power of this module may be far in excess of what the local telecom regulations permit. While the marketing material suggests a 40 mile range for this device, realistic tests by aeromodelers indicate a usable range of 5 to 10 miles, less in areas with a lot of radio traffic in the 900 MHz band. For a tighter budget, the XBee-Pro 900 XSC S3B, also from digi.com, would be worth experimenting with, albeit with some compromises: These modules deliver around 10 kbps data rate, at a realistic range of perhaps 3 to 5 miles in line-of-sight. The marketing material suggests a 28 mile range, take that as you will. The good thing is, the antenna is just a piece of wire soldered to the board, hence not so disruptive on an RC aircraft. Also, at a price point of ~ $70, these are much easier on the pocket. The mobile packet data options are a bit more restrictive: Data rates are highly dependent on cell-site capacity, cell circuit availability and tower distance, and latency is widely variable. If the UAV has sufficient on-board intelligence that it essentially requires only occasional waypoint updates, and non-time-critical commands (e.g. "return to takeoff point at time X:YY and land"), this might be viable. GPRS modules such as SM5100B from SparkFun are used by some RC enthusiasts. At under 9 grams weight, again these are not brick-sized. Also, the price is similar to the XBee-Pro 900 above. Range can be arbitrarily high - so long as base controller and RC vehicle are both within range of cell towers for which network access is available to the respective units, the mechanism will work - even across countries, let alone miles, so long as latency and occasional signal drops are not an issue. A good thought experiment would be to consider whether your RC vehicle communication could work by polling a web URL over the internet, for instance. If yes, then GPRS will work fine for the purpose. It is worth keeping in mind that any such long-range RF remote control is affected by the vagaries of everything from sunspot activity to local weather conditions or someone using a cordless phone nearby to make a call. Hence, there should be little dependency on continuous control channel availability or data throughput. That being said, it's being done all the time, even in hostile terrains like the Antarctic, so have at it!
H: Why 2 input bias currents are equal for OpAmp? In Floyd book it says that 2 input bias currents for 2 inputs ideally equal. I understand if they are equal in a common mode, but how they can be equal in a differential mode if in this case, one input is connected to the ground, or voltages are in opposite phase which at least gives opposite directions of the currents? AI: The basic error you made is in your understanding of bias currents: - Bias currents are not something that YOUR input signal is responsible for so, the direction or polarity of input signals are irrelevant. Bias currents can be regarded as currents taken (or given) by the input stage of the OP-AMP and they will flow into or out of your input voltage sources irrespective of their polarity. They are self-generated within the op-amp and not to be seen as some current proportional to your input signal level.
H: Mosfet suggession for large drain current Sample Hold application I'm using a MOSFET for a sample and hold circuit controlled by a microcontroller. I want to control the charging and discharging of a capacitor by a solar cell. For this I'd be using two MOSFETs. The solar cell can have a large area and can source upto 3.2 A of current. This flows through the drain of the MOSFET. I want this flow to be switched ON and OFF by applying a gate voltage from an MCU. I can boost the MCU output to required gate voltage levels, but what would be a suitable MOSFEET for my application? I'd need approximately 250 ms ON time and 750 ms off time during switching. The IC (or transistor) package may be any one of the packages that may be connected to a breadboard easily that is NOT surface mount. EDIT: Strictly speaking, the purpose isn't sample and hold but its very similar. I'd like to characterize the solar cell IV by sampling the voltage across the cap and the current flowing to it while charging. Schematic here. AI: While a schematic of the application, and the solar panel voltage, would make it simpler to provide a definitive answer, here is how one could select a suitable MOSFET: MOSFET should (ideally) switch on hard at the MCU's GPIO output voltage. Let's say 3.3 Volts, so we are looking for a logic level MOSFET, one designed for 3.3 Volt operation. The Gate-Source threshold voltage VGS(th) for such MOSFETs would typically be below 1 Volt. MOSFET Drain-Source voltage rating should be significantly higher than the expected voltages in the application. If the solar panel in question operates at say 10 Volts maximum, I would look for a MOSFET rated for VDS of 20 Volts, fairly common. MOSFET drain current rating should be significantly higher than the expected drain current. For 3.2 Amperes, I would limit my search to MOSFETs rated to 5 Amperes or higher The power dissipation at the MOSFET during full conduction needs to be dealt with, either via heat sinks, other forms of cooling, or simply by keeping the power dissipation well below the rating for the MOSFET package without heat-sink. Since through-hole was specified, the common MOSFET package of TO-220 would typically be quite safe at 0.5 Watt dissipation, and would run hot but probably not too badly at 1 Watt, without a heat sink. To achieve this, one would look for a MOSFET with on resistance RDS(on) of under 49 milliOhms (501 mW) or at worst, 100 milliOhms. A heat sink allows far greater latitude, of course. Given the rather relaxed timing requirements, switching losses are not much of a concern, nor is switching speed or gate capacitance, really. So, given the above parameters, a search on Digikey yields at least 79 results as I just checked. On sorting by lowest price for single unit purchases, a couple of options are: IRLU2703 STD95N2LH5 Of course, if SMD were an option, many, and less expensive, options would open up, including some excellent devices by Alpha Omega and International Rectifier. As pointed out by Russell, if providing a gate drive voltage higher than the MCU power rail is not a problem, and a P-channel MOSFET is preferred, then a similar Digikey MOSFET search yields several P-channel MOSFETs that meet the specifications above, setting aside the VGS(th) point. For instance: FQPF27P06 irfr5305
H: IO Pins for Computer like an Arduino Just wanting to ask if there's a way that an old computer could be like a microcontroller. In the sence that it has a range of pins (standard, PWM and analogue), both input and out put could be emulated by the operating system. AI: If you mean a VERY old computer: the parallel port on the really old ones (IBM PC) was such an I/O port. On later ones it was a bit more complex, but could still be read and written by a simple I/O instruction. On current PCs things are not that simple any more, and there are layers upon layers of hardware and software between the CPU and pins that go to the outside world. If you want to play with I/O pins: get a bare micro-controller (PIC, Cortex M0, AVR), or a development board (Arduino is a popular one), or a Raspberry Pi.
H: How do sound cards cope with negative voltage? I feel this is a basic question but I found no answer for it so far. Let's take a random sound card that lives within a PC. From the connections at the end of the datasheet I assume that it is powered by 5 V and uses the computer's ground. Maybe it is a faulty assumption, but by some small experiments with my laptop it seems that the audio input and output ground is connected to the overall ground of the computer. So the sound card does not have any fixed negative voltage to refer to. The waveform of the input and audio should have negative and positive regions. How do the ADC and DAC handle that? If there is any external circuitry that shifts the voltage it doesn't seem so. AI: Audio inputs are usually capacitively coupled. This means low frequencies are attenuated and DC, the lowest frequency of all, is blocked entirely. Usually audio circuits are designed such that low means something around the lower limit of human hearing, about 20 Hz. A typical audio input stage might look like this: simulate this circuit – Schematic created using CircuitLab C1 serves to block any DC. The parallel combination of R1 and R2 set the input impedance. You can also view this arrangement as a simple low-pass RC filter, with the RC time constant, and thus the cutoff frequency of the filter, defined by R1||R2 and C1. R1 and R2 meanwhile create a voltage divider that set the DC level as seen by the ADC or whatever follows. Usually R1 and R2 will be equal so that the DC level is midway between the supply rails, to allow for maximum voltage swing in either direction.
H: 74HC688 magnitude comparator and enable pin I'm using a 74HC688 8-bit magnitude comparator (datasheet) with Arduino. My question is how to generate active LOW E (enable) signal with Arduino? Is there another possibility (I want to enable the 688 chip)? Currently, I have the enable pin connected to ground. Is that the correct solution or do I need a resistor between enable and ground? AI: If you want the 74HC688 permanently enabled, you should connect the enable pin directly to ground. If you want the Arduino to control the enable pin, connect the enable pin directly to an Aduino output pin.
H: Implementing Multichannel ADC conversion and transfer data to PC I have developed a system using the TI MSP430 G2553 that accomplishes analog to digital conversion of multiple sensors simultaneously. So here is the question: Can someone suggest me how to transfer the digital output of the ADC to the PC and store it in say, a text file? EDIT: I am making use of CCS as my IDE for programming the microcontroller. Is there something inherent in CCS which will help me accomplish the task? AI: Use the UART module in the MSP430 to transfer data. Using a USB to serial converter, interface it to the PC. You may use a python script to read the data coming to the PC and store it as a text file. See this sample project http://eliaselectronics.com/plotting-serial-data-using-gnuplot-and-python/
H: Silicon Labs USB Debug Adapter and other MCUs Recently a friend donated a Silicon Labs C8051F devkit to me. It has this USB Debug Adapter. For me this device looks like a JTAG adapter or I'm wrong? Is it possible to debug other MCUs like ARM (Raspberry Pi rev2 specifically) or AVR with this USB device? And if possible which software to use with GNU/Linux or Mac OS X? AI: Yes. Your device supports JTAG. You need to use the Silicon Labs IDE. You can find the JTAG informations from here http://www.silabs.com/Support%20Documents/TechnicalDocs/8-bit-USB-Debug-Adapter.pdf But the problem is that this module will only allow to debug Silicon Labs micro controller. For using this debugger with Raspberry Pi or other such devices, you need a separate software. This is currently not available.
H: Pick a heatsink for voltage regulator I have to dissipate \$2W\$ from a voltage regulator. It's a 7805 in a TO-220 package. The datasheet is here. It's the first time I have to pick those so I would like to have a review of the following decision because I'm afraid of missing something as this sound really complicated for me. So I will put you here my entire reasoning. \$R_{thJC}\$ is 5 C°/W for the TO-220 package and \$R_{thJA}\$ is 50 C°/W (table 3, page 7). As I will need to dissipate 2W I will have without heatsink 100° of heat on the chip. The room is around 21°. \$T_{op}\$ is 0° to 125° so to be safe I definitely need a heatsink. In that case it will just go around 31° based on that formula \$Max_{ambiant}+ R_{thJC} \times W_{dissipated}\$ or 21 + 50 * 2 But now I'm blocked. For the example I will take this heatsink. He's rated as 40 K/W. I assume K is for kelvin degrees. In that case does it means he's rated as 233°C/W ? I've found that formula : \$Max_{JunctionTemp} >= Max_{AmbientTemp} + (W_{Dissipated} \times (R_{thJC_{C°/W}} + R_{thHeatSink_{C°/W}}))\$ Which give me : \$ 21 + (2.5 \times (5 + 233) = 595°C\$ So, there's something wrong as this would mean that the junction between chip and heatsink will be 600° hot ... What have I missed ? AI: Refer to wikipedia The SI units of thermal resistance are kelvins per watt or the equivalent degrees Celsius per watt (the two are the same since as intervals Δ1 K = Δ1 °C). K/W is the same as C/W and that's because they represent a temperature difference per watt rather than an absolute temperature. The result for your calculation using a 40K/W heatsink is: \$21 + (2.5 \times (5 + 40)) = 112.5°C \$ There seems to be some misconception regarding the meaning of the K/W rating and the cooling ability of a given heatsink. When you compare two heatsinks, the lower the K/W rating the better the heatsink, a lower K/W rating means it can dissipate more power with less temperature increase. As an example: A 40K/W heatsink increases the temperature 40 degree Celsius (above the ambient temperature) for every Watt. A more efficient heatsink (regarding cooling ability) is a model that has lower K/W rating like for example 20K/W because the temperature will increase only by 20 degree Celsius for each dissipated watt.
H: Equation for a capacitor charged by a decaying current source (solar cell)? I have a solar cell charging a capacitor. I want to find the amount of time it'd take for the capacitor to be charged to, say, within 0.01% of the final value (the open circuit voltage). I'm trying to derive an equation or relation that lets me calculate the required time. Normal capacitor charging equation obviously won't apply as this isn't an ideal constant voltage source. It can only source a current limited by short circuit current. The best description I have for the solar cell's behaviour here is that it is a decaying current source. The open circuit voltage remains constant and the current decays from a fixed short circuit current value to zero. I did some digging in the internet and found the linear approximation to be true in the behaviour of charging upto 60 or 70% of open circuit voltage. i.e, $$I = C\frac{dV}{dt}$$ $$dt = \frac{C\,d\,V}{I}$$ However this relation fails when the voltage across capacitor comes closer to the open circuit voltage of the solar cell. If I had an equation on the nature of current decay, I could've just used the $$V = \frac{1}{C}\int{i\,\,dt}$$ Is there any specific relation here? Can one be derived? My actual interest is to design a value of capacitor given the charge time required. AI: As a first approximation, model the solar cell with a Thevenin equivalent circuit as determined by the open circuit voltage, \$V_{OC}\$, and short circuit current, \$I_{SC}\$, of the cell at a given illumination. Then, for that fixed illumination, the time constant will be: $$\tau = \dfrac{V_{OC}}{I_{SC}}C $$ The time required to charge to some fraction \$\chi\$ of the final voltage is: $$t = -\tau \ln(1 - \chi)$$
H: What is the difference between the magnetic H field and the B field? Wikipedia provides a mathematical explanation. Can I get the intuitive one? I'd like to, for example, understand a ferrite datasheet. These usually have graphs of H vs B, and the definition of permeability depends on understanding the relationship of H and B. Also, I wonder: I was able to learn a great deal about electric fields before I knew what "fields" were. I learned about voltage and Ohm's law and so on, which a physicist might explain with a field, but which the electrical engineer explains with simpler concepts, like the difference between two points in a circuit. Is there a similar, simpler explanation of H vs B fields that is of more relevance to the electrical engineer, and less to the physicist? AI: H is the driving force in coils and is ampere turns per metre where the metre part is the length of the magnetic circuit. In a transformer it's easy to determine this length because 99% of the flux is contained in the core. A coil with an air core is difficult as you might imagine. I think of B as a by-product of H and B is made bigger by the permeability of the core. In electrostatics, E (electric field strength) is the equivalent of H (magnetic field strength) and it's somewhat easier to visualize. Its units are volts per metre and also gives rise to another quantity, electric flux density (D) when multiplied by the permittivity of the material in which it exists: - \$\dfrac{B}{H} = \mu_0\mu_R\$ and \$\dfrac{D}{E} = \epsilon_0\epsilon_R\$ Regarding ferrite data sheets, the BH curve is the important one - it tells you the permeability of the material and this directly relates to how much inductance you can get for one turn of wire. It will also indicate how much energy could be lost when reversing the magnetic field - this of course will always happen when ac driven - not all the domains in the ferrite return to produce an average of zero magnetism when the current is removed and when reversing the current the remaining domains need to be neutralized before the core magnetism goes negative - this requires a small amount of energy on most ferrites and gives rise to the term hysteresis loss. Other important graphs in a ferrite data sheet are the permeability versus frequency graph and permeability versus temperature. From personal experience of having designed a few transformers, I find them tortuous in that I never seem to naturally remember anything other than the basics each time I begin a new design and this is annoying - in this answer I had to double check everything except the units of H!
H: AVR Reset pin for a long time I just have a little Question, if I drive a reset pin to low (reset active) of an Atmel AVR for a long time (1 week for example, in fact it'll be really variable depending on the use) can it cause default to the controller within a year or two ? AI: No, this should not cause a problem. The one thing you need to worry about is the electrical state of the I/O pins during reset. Determine what state all of the I/O pins go to during reset (probably to input mode, perhaps with a weak pullup) and make sure that whatever is connected to them will not be damaged or cause damage to the AVR itself. Remember that all input pins should be held at a valid logic level and not allowed to float. This may mean that you need to add pullup or pulldown resistors in places where you might not otherwise need them. EDIT: Additional information from the Atmel ATmega168 datasheet (I added emphasis for references to reset): If some pins are unused, it is recommended to ensure that these pins have a defined level. Even though most of the digital inputs are disabled in the deep sleep modes as described above, floating inputs should be avoided to reduce current consumption in all other modes where the digital inputs are enabled (Reset, Active mode and Idle mode). The simplest method to ensure a defined level of an unused pin, is to enable the internal pull-up. In this case, the pull-up will be disabled during reset. If low power consumption during reset is important, it is recommended to use an external pull-up or pull-down. Connecting unused pins directly to VCC or GND is not recommended, since this may cause excessive currents if the pin is accidentally configured as an output .
H: Safely discharging large value capacitor without blowing it up This is related to my previous question. I have this circuit in which I discharge the capacitor by turning ON M2. The ON resistance of the MOSFET I have in mind (the picture shows the wrong MOSFET in an earlier design) is 0.0035 ohm. I've placed a 1 ohm resistor in the discharge path to limit the current. The 40 mF capacitor (4 X 10 mF) will have a voltage of 0.6V when fully charged. So I'd have 0.5979 A current during discharge. Is this safe? Will my capacitor spark/blow up? Will its lifetime decerease if this is a repeated operation? What would be a safer option for discharge? I could increase the resistance, but I'd like to know exactly how much current is safe. I need the charge\discharge process to be controlled by an MCU, so any manual discharge methods\removal of capacitor is not an option. AI: The capacitor should be the least of your concerns here. Let's think about this for a minute. Using your MOSFET's on resistance and the \$1\Omega\$ to discharge, your time constant will be: \$\tau = RC = 40mF \times 1.0035\Omega = 40.14ms \$ Using the 5 time constants to charge/discharge rule, your discharge time will be: \$5 \tau =40.14ms\times5=200.7ms\$ (Note: You don't give a datasheet for the caps, so the ESR is unknown, and if it's high relative to the resistor and MOSFET on resistance, all of these numbers are wrong.) Using your peak discharge current: \$P_{R} = I^2R = (0.5979A)^2\times1\Omega = 357mW\$ \$P_{Q} = I^2R=(0.5878A)^2\times0.0035\Omega=1.25mW\$ As you can see, over 99% of the stored energy is dissipated as heat in the resistor. You should make it a half Watt resistor. You could do the calculus and find the actual average power, and find a quarter Watt would work just fine. As long as the discharge current falls within your MOSFET's \$I_D\$ rating, this is a perfectly safe way to discharge that capacitor bank. You need to look closely at the datasheet and make sure they are low ESR caps, and check out their thermal characteristics to be completely sure you won't hurt anything. Given their size, intuition says you'll be fine.
H: How fast will an op amp respond to changes in input voltage? What parameter would I be looking for in a datasheet (if such a parameter exists) if I want to determine how fast the op amp output responds to changes in input? I'm using an op amp as a difference amplifier to amplify the voltage across a current sense resistor. I'd like to know at least the order of the expected delay. This is for an error calculation. I'm directly sampling some voltage values, but the 'current values' are sampled only after it passes through a difference amplifier. So I'm guessing I won't be getting the value of current for the exact instance of the voltage if I sample both at the same time. Is there any such parameter specified? AI: Several op-amp parameters combine to indicate what the "delay time" there may be for a given circuit configuration but, in critical timing situations I would strongly consider routing the "direct" signal referred to, thru a similar amplifier configuration so that these delays largely cancel. The single parameter I would most focus upon as an indicator would be frequency at which the gain becomes zero (also called GBWP, gain-bandwidth-product) but slew rate (the op-amps ability to change its output voltage in volts per microsecond) can also have a part and so can settling time. Op-amps with greater GBWP will have a smaller delay at any given frequency. The closed-loop gain is also important - the higher the closed loop gain is the more the output phase tends to lag the input by 90 degrees. 90 degrees is the natural phase angle for most open-loop op-amps due to stability circuitry within the op-amp. When the loop is closed (by feedback) the phase angle becomes dominated by the feedback components but this gets gradually eroded towards 90 degrees as frequency rises. This happens because open-loop gain falls at higher frequencies and the effect of external feedback reduces and the internal 90 degree phase shift starts to dominate.
H: Where can I buy a finished mobile camera module? I am interested in buying a really small camera module for one of my projects. I know I can buy some iPhone/Samsung camera replacements on Ebay. But I have no information on their connectors and interfacing mechanisms. Does anyone knows of a merchant/vendor/manufacturer of a complete camera on chip system with the lens and datasheet that gives examples on how to interface with it? AI: How about: https://www.sparkfun.com/products/8667 which has a full datasheet on the site. Also, most electronic distributors such as mouser or digikey will have datasheets of all the products they sell. For example, all the cameras here have datasheets. A good example to use to look for how to interface to camera modules is the CMUcam source files: http://www.cmucam.org/, which is an open-source computer vision module using the Omnivision cameras (the CMUCam4 uses the OV9665, the CMUcam 5 uses the OV9715). Take a look at the source files to see how they read from the cameras.
H: Adding a +15/-15 V chip on a 0-5 V board General Question: I would like to integrate a specialized chip that requires symmetrical power +15, 0 and -15 V to operate on a 0 V (GND) / +5 V (VCC) board I designed. If possible, I would also like to support 3V – 5.5 V power supplies. I am pretty sure it should be possible, but I do not know how to do that (I have very little knowledge in electronics) and searches turned up nothing. More precise question: The part I would like to use accepts from ±12V to ±22V power supply, so the supply does not need to be exactly 15 V. Also, the part includes an internal precision 10 V reference, thus, the power supply of the chip does not need to be outstandingly stable. The 5 V supply I have on my board is stabilized. Below are the characteristics of the part given by the manufacturer: Supply: ±22V Input Current, Continuous: 40mA Input Current Momentary, 0.1s: 250mA, 1% Duty Cycle Common-Mode Input Voltage, Continuous: ±40V I am mainly interested in learning, so any explanation will be highly appreciated. Thank you very much for reading me and for your guidance. AI: Because it's xmas I'd be looking for an off-the-shelf-and-very-lazy solution and my 1st port of call would be Traco and the TMA series of power supply modules. The TMA 0515D can provide +/-15V (isolated) from a 5V dc supply. It's a 1 watt "solution" and can deliver up to +/- 35mA to your load at an efficiency of about 80%. You can also get a +/-12V output version too. It's about 2cm long, 1cm high and about 0.7cm wide. It's an unregulated version so it does need a fairly constant 5V power supply but there are others in the range that work across a variety of input voltages and some provide output power up to over 30 watts. I'm beginning to sound like a sales man now!! They cost £3.50 from Farnell If you want this power supply to work with input voltages from 3V to 5.5v you would need to introduce a boost-buck converter to produce a stable 5V rail to feed it. Alternatively use a version of the Traco with a 12V input (TMA 1215D) and use a 12V boost(only) converter to power it from 3V to 5.5V. I would go this route because it's simpler (and probably cheaper) to design a boost circuit than designing a dual flyback switching converter.
H: Why is this switched power inlet fused on both load and neutral sides? I've purchased a Schurter 4304.6090 power inlet for a project and am a bit confused by the fuse configuration. The inlet requires two fuses: one on the load side and another on the neutral side of the circuit. Is this just for redundancy, or am I missing something here? I plan to use this for 120VAC (USA). Here's a picture of the inlet, along with a crude wiring diagram: AI: This device is rated for 250V. Assuming that you are in the USA/Canada, your 240V is actually two 120V lines, 180 degrees out of phase. If your application is 120V hot/neutral/ground, you can simply wire in only one fuse holder, on the hot Sorry, I misread the datasheet. I see now that the 6090 variant has the fuse holders already wired in.
H: Connecting a DC barrel jack to a PCB board I am wondering how I can include a DC jack such as below in my PCB circuit: There are no such PCB packages in my library, so the first step, I presume, is to make a prototype with the exact dimensions as in the datasheet (correct me if I'm wrong). What I am really confused about however is how to drill the holes in the PCB, given that I need a rectangular section instead of a circular one, for the three pins. AI: You didn't mention which PCB layout program you are using, but if it is Eagle, the part is available in the SparkFun library. See images below. I drill the holes with the 3.2mm drill bit. I then place the connector on the PCB, touch both the connector terminal and the PCB pad with the soldering iron (hot) and push the solder in until it makes a little blob, nice and round. It takes quite a bit of solder, like in the image below. Watch out not to push the solder directly into the hole or it will go into the connector and destroy it. Bear in mind that I make my boards at home, so I have no idea how that is done with production quality, but mine gets firm and steady.
H: RC Filter for Low Power consumption I was thinking about selecting R & C values for an RC filter, so that it consumes less power, in the overall circuit. Thinking about it, a larger value for R means a larger \$I^2R\$ loss. But a Larger value for C means requires more current to charge. Can anyone suggest on how should I go about selecting these? AI: For a given RC time constant, you want to increase the value of R and decrease the value of C so that the product of these values is unchanged. The disadvantage is that whatever you connect to the output side of the filter must have a much higher input impedance than R or it will affect the time constant.
H: Reducing chip count for an ARM embedded system It seems like a lot of devices use an ARM SoC + a RAM chip + a flash storage chip. In applications that are very space-constrained, such as ChromeCast dongles, micro drones, or wristbands, it would be very useful to combine these 3 chips into 1 or 2. Do you know of any solution that combines these three normally-separate chips into 1 package, through either die stacking or die-sharing or some other method, in order to dramatically reduce PCB area? Thank you! AI: You are probably looking in to POP or package-on-package technology. An example of combining an ARM SOC and memory using POP is theBeagle Board, it uses an ARM Cortex A-8 SOC and a POP memory chip that contains NAND flash memory and RAM
H: Connecting phone using copper power wires I want to install a video door phone (intercom) in my home, for this I have done a pre-wiring of 4 individual copper wires (normally used for home electricity) and the total length of wires is about 60 feet. Following are the details: Intercom Model: Panasonic VL-SW250BX Intercom Details From main monitor to door station, required DC voltage is 20V and current is 190ma and (5V DC, 2 mA standby) according to the door station back label image Door-station-back-label Recommended wiring by the manufacturer: CAT3 24Awg with maximum length of 350 feet My wiring setup: Un-twisted 4 parallel individual copper wires (normally used for home electricity) I would like to know if my system will using these wires or if I need to change my wiring. Update Just for information: I took the risk of installation and fortunately the system worked with a little noise in picture. I will follow W5VO advice to put some ferrites around the power wires near the intercom Thanks a lot for the help AI: If those two terminals that you show in your picture are the only connectors, then you should be fine. The intercom specification indicates that it is a wireless video system, so all device communication is probably happening somewhere on 2.4 GHz. Those screw terminals, and the fact that there are only two terminals, along with the power requirements being listed, are pretty good indicators that those wires carry only power. If it carries only power, then your normal house wiring will carry power just fine. If the video signal is carried by the wires, then they probably would be using the cable as network wiring and the house wiring might not work. A caveat: The twisted wire that they specify will give you some noise rejection that the regular untwisted house wiring will not. If your intercom design is somewhat marginal, then you may have random interference. You could mitigate this by putting some ferrites around the power wires near the intercom, and possibly twisting the two power wires in the run. Note that this is all independent of any building code requirements your building may be required to meet.
H: Unused slots in the stepper Motor The motor I am talking about has six wire slots of which two are unused and wires coming from the motor are restricted to four (4 to 4 jumper connecting wires are there to connect the motor ).So why are these two slots left unused? Does this means it's originally a unipolar six wire motor ? The vendor told me it's a 4 wire Bipolar motor.How do I know why these two slots are left unused? I have stepper motor from Astrosyn. I couldn't find the data sheet and sorry I cannot provide an image for the motor. So the specs on the motor are as follows : Astrosyn Stepper P/n 4K1-4054 TYPE-17PM-J311-P1ST MIEBEA CO.LTD. AI: There are many motors that have six wires and can be either used as a bipolar motor or a unipolar motor, your motor is probably one of them. There is a chance that these two points are actually dummy ones and not connected but you can easily check with an Ohm meter, if each one has a low resistance with eather of the two sides of the coil (the resistance will also be half of the total) then you can use it as a unipolar too. Refer to this How to figure out the internal wiring of a stepper motor using a meter and a battery The motor specs seems to be located here Your motor code leads to this datasheet that has a six wire pinout There is also this datasheet in the same link, in page 6 there is a guide about the model number interpretation
H: Why do ceramic insulators have a stacked disc structure? I've seen these stacked-disc structures on high voltage power lines everywhere. I could not find any information regarding this particular shape, though. From what I've noticed, high voltage ceramic insulators only insulate conductors end-to-end (not inside to outside, like traditional plastic insulators). I can only assume the shape makes it difficult for an electric arc to travel along the ceramic material, as opposed to, say, along a solid cylindrical piece. Why exactly are ceramic insulators shaped like that? Is it to reduce cost? Thermal concerns (from possible electric arcs)? AI: Electricity can more easily travel across a surface of an insulator. If the surface is made longer it makes the surface path longer and thus is able to withstand higher voltages before breaking down.
H: How do IR sensors detect color? I'm trying to make a line following robot using Arduino. I have searched the Internet for information on how to build it, but a few questions remain: How does an IR sensor detect colors? What voltage range do those sensors output when detecting these colors (especially black and white)? AI: The kind of sensors used for line following robots (IR proximity sensors) don't sense color in the normal use of that word. They actually sense reflectivity, and in particular they sense the reflectivity of whatever is right in front of them at the IR wavelength of the sensor and emitter. (Strictly speaking, the reflectivity of an object at a particular wavelength is what gives it color, I know.) So, your sensor would work best if you had a background that absorbed IR light and a line that reflected IR light. As it turns out, the colors that we call dark colors are pretty good at absorbing near IR as well as the visible spectrum, and the colors that we call bright colors are pretty good at reflecting near IR. If you really wanted a good contrast you could use a reflective material like aluminum foil for the line and have a deep dark void surrounding the line (maybe it's a line-following blimp). You don't normally think of metal foil or empty space as having a "color", but the IR sensor can easily tell the difference.
H: Reverse-engineering IR check bits/CRC I'm trying to build a simple Arduino-based IR remote control for a cheap toy IR-controlled helicopter (same as this one - it's called "Diamond Gyro" or "Diamond Force"). I've decoded the IR protocol except for the last few bits. These last bits seem to be a check or CRC, but I haven't been able to "crack" it. It's easy enough to simply repeat a recorded packet, but I want to fully control the helicopter. That means reverse-engineering the check bits. (I should add that I do software by day, but electronics is a sometimes-hobby, so maybe I'm just missing something very basic.) The details of the protocol are in the question and answer, but here are the basics: 32 bit packet spanning multiple individual values/commands of varying length (plus 1 start bit/preamble, which doesn't count as data) The values are little endian (MSB first) I'm positive I've got the first 22 bits mapped... ... but the following 4 bits are a little mysterious, although I know the purpose of at least 2 of them. The last 6 bits do seem to be a check or CRC of some kind Here's a diagram 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 --+---------------------------+-----------+---+---+-+-+----------- P| Yaw | Throttle | Pitch | T | C |X|X| CRC? P: Preamble (always 1), T: Trim, C: Channel, X: Either part of the channel data or the checksum. First of all, I'm not sure whether the X bits are part of the channel value, part of the check, or something else. They always follow the channel value though, so it's likely the channel value is 3-4 bits wide, although 2 bits would be sufficient for the 3 possible channel values. Second, there are the last 6 bits (marked CRC? above) which are clearly some kind of check (and indeed, the helicopter doesn't respond if I change any of those bits). So basically, there's a packet of 24-26 data bits, followed by 6-8 check bits. And I'd really like to figure those check bits out so I can compose packets myself. Below are a bunch of samples of the binary data I'm getting. The preamble "1" is always present, and I don't believe it counts as part of the data, but I've included it anyway, just in case it's the key to everything. Again, I don't know if the X bits are part of the data or the check. Depending on the way the check's calculated, it might be that the first 1-2 bits of the check just happen to follow the channel value. But it's also quite possible that the channel value is 4 bits long, incorporating the X bits. Or it's in between with one X bit being part of the channel, and the other being part of the check. I don't know. If anyone knows what that check is, or how I could go about finding out, I'd love to know. I imagine I can brute-force it, but even if that's the only option, I'd love to hear some hints for how to best do that. The helicopter is dirt cheap, so I doubt there's anything really fancy going on. Channel A P Yaw Throttle Pitch Tr Ch XX Check Description -------------------------------------------------------------- 1 000100 10000100 000000 00 01 01 000101 Left Mid + throttle 1 000000 10000110 010001 00 01 01 010010 Left Max + throttle 1 100001 10000110 000000 00 01 01 100010 Right Mid + throttle 1 100100 10000100 010001 00 01 01 110100 Right Max + throttle 1 010001 00000000 001011 00 01 01 011111 Forward Min 1 010001 00000000 000000 00 01 01 010100 Forward Max 1 010001 00000000 011000 00 01 01 001100 Back Min 1 010001 00000000 100101 00 01 01 110001 Back Max 1 010001 00000000 010001 01 01 01 010101 Left Trim 1 010001 00000000 010001 10 01 01 100101 Right Trim 1 010001 00000011 010001 00 01 01 000110 Throttle 01 (min) 1 010001 00010110 010001 00 01 01 010011 Throttle 02 1 010001 00011111 010001 00 01 01 011010 Throttle 03 1 010001 00101111 010001 00 01 01 101010 Throttle 04 1 010001 00111110 010001 00 01 01 111011 Throttle 05 1 010001 01010101 010001 00 01 01 010000 Throttle 06 1 010001 01011111 010001 00 01 01 011010 Throttle 07 1 010001 01101100 010001 00 01 01 101001 Throttle 08 1 010001 01111010 010001 00 01 01 111111 Throttle 09 1 010001 10000101 010001 00 01 01 000000 Throttle 10 (max) Channel B P Yaw Throttle Pitch Tr Ch XX Check Description -------------------------------------------------------------- 1 000000 10000110 010001 00 00 10 010101 Left Max + throttle 1 100100 10000110 010001 00 00 10 110001 Right Max + throttle 1 010001 00000000 001001 00 00 10 011010 Forward Min 1 010001 00000000 000000 00 00 10 010011 Forward Max 1 010001 00000000 010111 00 00 10 000100 Back Min 1 010001 00000000 100110 00 00 10 110101 Back Max 1 010001 00000000 010001 01 00 10 010010 Left Trim 1 010001 00000000 010001 10 00 10 100010 Right Trim 1 010001 00000001 010001 00 00 10 000011 Throttle Min 1 010001 00110100 010001 00 00 10 110110 Throttle Mid 1 010001 01100111 010001 00 00 10 100101 Throttle High 1 010001 10001111 010001 00 00 10 001101 Throttle Max Channel C P Yaw Throttle Pitch Tr Ch XX Check Description -------------------------------------------------------------- 1 000000 10000101 010001 00 10 00 011100 Left Max + throttle 1 100100 10000101 010001 00 10 00 111000 Right Max + throttle 1 010001 00000000 001010 00 10 00 010011 Forward Min 1 010001 00000000 000000 00 10 00 011001 Forward Max 1 010001 00000000 010111 00 10 00 001110 Back Min 1 010001 00000000 100110 00 10 00 111111 Back Max 1 010001 00000000 010001 01 10 00 011000 Left Trim 1 010001 00000000 010001 10 10 00 101000 Right Trim 1 010001 00000001 010001 00 10 00 001001 Throttle Min 1 010001 00110100 010001 00 10 00 111100 Throttle Mid 1 010001 01100110 010001 00 10 00 101110 Throttle High 1 010001 10000101 010001 00 10 00 001101 Throttle Max AI: First of all, it's pretty clear that the "XX" bits are part of the channel designation, since that's the only thing they depend on. The "XX" bits may simply be a check on the "Ch" bits. The check bits are a simple bitwise XOR of 24 of the 26 data bits: If you take the 6 Yaw bits, the 6 LSBs of the Throttle, the 6 Pitch bits, and the next 6 bits, and XOR these quantities together, you get the 6 check bits. It appears that the upper 2 bits of the Throttle do not affect the check bits at all. The following Perl script verifies this. #!/usr/bin/perl # crc.pl - verify decoding of check bits # On the lines starting with '1', just keep the '0's and '1's in an array. while (<>) { my @letters = split '', $_; next unless $letters[0] eq '1'; @letters = grep /[01]/, @letters; @letters = @letters[1..32]; $a = string2bin (@letters[0..5]); $b = string2bin (@letters[8..13]); $c = string2bin (@letters[14..19]); $d = string2bin (@letters[20..25]); $e = string2bin (@letters[26..31]); $f = $a ^ $b ^ $c ^ $d; printf "%02X %02X %02X %02X %02X %02X %s\n", $a, $b, $c, $d, $e, $f, $e == $f ? '-' : '###'; } sub string2bin { my $temp = 0; for (@_) { $temp = ($temp << 1) + ($_ eq '1' ? 1 : 0); } $temp; }
H: What is the physical significance of the unit ampere/meter in magnetics? I'm having a hard time understanding what is the stuff this unit measures. I understand ampere, and I understand meter, and I understand per, but since ampere is a measure of current, I'm having difficulty understanding how this relates to magnetics. I understand a current is associated with a magnetic field. What I don't understand is how these all fit together to make ampere/meter. What is an ampere/meter and what is the thing that it measures? How can I construct a thing that makes an ampere/meter? As I vary the parameters of this thing (whatever parameters it has: length, turns, current...), how does the amperage per meterage change? AI: In a capacitor it is easy to see that the electric field strength (E) has an obvious "per metre" part - it relates to the distance between the plates in a capacitor. In an inductor it's harder to see - the "per metre" part of magnetic field strength (H) relates to the nominal length of the path of the magnetic lines of flux. In a closed ferrite inductor such as a toroid the "per metre" part is the nominal length around the toroid - fairly easy to visualize. In a more complex transformer (such as an EI core) the "per metre" part shown as below in red: - H, being defined as ampere-turns per metre, reduces if the length of the path of the lines of flux are longer and, the resultant flux density for a given magnetic material would be less. This naturally means that larger ferrites can "hold" more energy before saturating. A toroid or any closed magnetic material with decent permeability can be assumed to contain all the magnetic flux within the material. If the length of the toroid were 10cm and you passed 1 amp through ten turns, H would equal 100. It would also equal 100 if there were one turn and 10 amps. Edit about reluctance and flux density Reluctance (\$R_M\$ or S) is like circuit resistance - it indicates how much magnetic flux (\$\Phi\$) the ferrite will produce for a given magneto-motive-force (MMF or \$F_M\$). The MMF is easy - it's ampere-turns (as opposed to H which is ampere-turns per metre). Relationships: - Reluctance of a magnetic circuit (\$R_M\$) is \$\dfrac{l_e}{\mu\cdot A_e}\$ Where \$l_e\$ is "effective" length around magnetic circuit and \$A_e\$ is the "effective" cross sectional area of the magnetic material. The MMF divided by the reluctance equals Magnetic Flux, \$\Phi\$: - \$\Phi = \dfrac{MMF}{R_M}\$ and therefore \$\Phi = \dfrac{MMF\cdot \mu\cdot A_e}{l_e}\$ This means that if the cross sectional area (\$A_e\$) of a ferrite doubles, Magnetic flux also doubles. The impact of this is that magnetic flux density, B (flux per sq metre) remains the same and the core would saturate at the same current because saturation is related only to flux density. Also the above formula can be rearranged like so: - \$\dfrac{\Phi}{A_e} = \dfrac{MMF\cdot \mu}{l_e}\$ or \$B = H\cdot \mu\$ which is how magnetic permeability is defined
H: short to ground in custom Arduino shield only when connected - how do I find it? I've built a custom Arduino shield using a PCB and surface mount components. The board has a short between power (5V) and ground (GND) when it is connected to an Arduino Due. When the shield is not connected, the short does not appear to be present. With a continuity checker on my multimeter and the board disconnected from the Arduino, I've tested for continuity between GND and all the shield pins (including 5V). I only get continuity where I am supposed to - on the GND pins. I also tested for continuity between the 5V pins and the other shield pins (including GND), and only get continuity where I am supposed to - on the 5V pins. How can I debug this problem? Why doesn't the shield show a short to ground when it is not connected, but when it is connected, there is a short? What am I missing? AI: I found the problem. It was a pin mismatch. The Eagle schematic was correct, but I had the shield XIO connector reversed in the Eagle board layout - so I had two pins connected to what I thought was ground, but on the Arduino Due, they were connected to +5V. It's a 4-layer board. I found the problem by looking at the different layers in gerbv - when looking at the ground (GND) layer, I noticed there were two ground connections that shouldn't be there... that led me to discover the connector was placed backwards in the Eagle board file. Here's a picture of part of the ground layer of the board that has the problem. The two pins in the upper right are +5V on the Arduino, but connected to ground on my board.
H: How can a small device produce two million volts? After reading a shopping magazine, one of its products featured a stun gun the size of a large wireless car door opener* with the ability to produce two million volts. How can a small device electronically produce two million volts? *Exact dimensions are 3.65"x 1.15" x .6" Edit: As requested, here's the product's link: http://www.heartlandamerica.com/browse/item.asp?product=keychain-stun-gun&PIN=170414&BC=S&DL=SEH1 AI: Generating high voltage is not a problem with low current. For example take the electric lighter who produce a really high voltage to create a spark that will fire the gas. When things start to be complicated it's when you start to get a load that drain more current. These devices draws only few µA and should, without that they could be really dangerous (for you and your opponent). But even like that they could create some severe damage. So \$I = V/R\$. Let's take a body resistance of 10K. \$ 2 000 000 / 10 000 = 200A\$ But it's totally theorical as the device can't produce 200A. (You'll get out of battery or get your hand on fire before :p) But you don't need 200A to knock out someone. Take a look at the table here to figure out what can happen. For the technical side it's basicaly a bunch of high voltage capatacitors. Here's an example for a lighter :
H: Help with a full bridge three phase rectifier powered floor I originally posed a question here asking about solutions to power a small rover 24/7 from a powered floor. It seems the best solution is a full bridge three phase rectifier circuit. I have a few questions about this: What zener diodes should I use for such power (and I'm presuming they are all the same, just different directions) Any suggestions for the component to use for brushes under the rover? AI: Zener diodes make no sense in your circuit. What you want are Schottky diodes, which is also what the schematic shows. As for the "brushes", what brushes? What will these brushes be contacting? If you are thinking brushes on a motor used as a generator or something, then they will be integrated into the device and you don't get to chose them. Added: Apparently these "brushes" are for making contact with power electrodes on the surface the rover will be traveling over. That sounds like a tricky problem since dirt on this surface should be expected. Not only will this cause intermittent connections, but could also get stuck on the brushes. A good defense against this would be lots of brushes with a pair of diodes for each. The electrodes should be arranged in a checkerboard pattern small enough so there are always a few (at least 4?) squares within reach of the brushes at any time, and with enough space between each square so that a brush can't short between them. As for what to use for the brushes, that depends a lot on what is really important. For example dragging graphite would probably work well enough and be cheap, but create significant friction and wear down and leave graphite particle all over the place. Fancy rollers would cost more and be susceptible to dirt, but nicer on the surface with less drag. Maybe metal wheels doubling as contacts might work. However, the radius of the wheels will dictate some minimum distance between electrodes to avoid shorting, and you can't use high-traction rubber then. Maybe you want a combination of electrode wheels and a few extra additional deliberate brushes. Another possibility is to put a large capacitor or a small rechargeable battery in the rover. Most of the time the rover will get external power and keep the battery topped off, but when it hits the inevitable gap, the motor can run a little while from the battery or cap. You might even add logic to not stop unless power is available, since just a little movement would get at least two contacts to hit opposite polarity electrodes. All around, this sounds like a non-trivial way to deliver power to a rover that is very high in infrastructure cost.
H: What is the purpose of a second set of 5v and ground wires found on many basic Arduino breadboard projects? On this breadboard schematic (and many others) there are two extra wires on the right side of the breadboard. I am assuming they extend the circuit to the top side of the breadboard, but I don't understand why. When I remove the two wires, the "Button" project still seems to work correctly. (I am completely new to electronics.) AI: With that circuit it will work fine either way. With larger projects, though, it makes sense to have two (or more) sets of rails available so that the closer one can be tapped off of instead of bringing power all the way across the board with discrete wires. So you put the wires in place on the far side (or near side, it doesn't usually matter terribly which), and you just never get around to removing them.
H: Electrical Circuit with Fourier Transform I'm working in my Electrical Circuits homeworks. One of the exercises says: "Use the Fourier Transform method to calculate \$v_0(t)\$" The circuit is this: where \$v_g=36sgn(t)\$, and \$sgn(t)\$ is the sign of \$t\$ (it returns 1, -1 or 0). Well, my problem is the following. I consulted my table of Fourier Transforms and I found that $$V_g(\omega)=36\cdot \dfrac{2}{j\omega}$$ However, I don't know how to calculate \$\omega\$. I need it in order to calculate the \$V_g\$ and also \$Z_C\$. I know that, if, for example \$v_g(t)=A\sin(kt)\$ then \$k=\omega\$. But in this case I'm completely lost. How can I do it? Thanks in advance! AI: However, I don't know how to calculate ω There's no reason to calculate \$\omega\$. Your approach should be to find the frequency domain representation of the output voltage, \$V_o(j \omega)\$, and transform that back to the time domain. In the frequency domain and by voltage division $$V_o(j\omega) = V_g(j\omega)\dfrac{60k\Omega||\frac{1}{j\omega 2\mu F}}{12k\Omega + 60k\Omega||\frac{1}{j\omega 2\mu F}} $$