text stringlengths 83 79.5k |
|---|
H: What voltage rating should capacitor be in this LED driver circuit?
I have a circuit that is used to rapidly turn an LED on and off. There is a capacitor in the circuit to provide some buffering (C1). What minimum voltage rating is required when selecting C1? I want C1 to be a through hole component with the smallest diameter/height possible.
AI: The capacitor cannot charge higher than the 3.3V supply, so a 4V or 6.3V type would be fine. So, probably you're looking at a 5mm diameter part.
There is nothing limiting the current through the LED other than its own internal resistance and the transistor beta (and a bit of capacitor ESR). I realized that you want a bright flash, but this could be harmful to the LED, the transistor or the capacitor.
Gain of that particular transistor falls off rapidly above 100mA but you're probably looking at a poorly controlled current of somewhere between 100mA and 200mA given the high gain of the BC847. Specs to look at would be:
Maximum peak current rating of the LED (should be in the datasheet), and based on a certain length of pulse.
Maximum RMS current of the capacitor (calculate from repetition rate, peak current and datasheet ripple current rating). Pick one with a relatively high rating such as 250mA or better for long life.
Transistor heating- assume current is limited by transistor and use repetition rate to calculate mW dissipation and thus heating.
If it's a hobby one-off and you don't care about longevity, you can just try it and see how long it lasts, of course. The LED is probably the main issue for low rep rates. |
H: Is there a best practice for resistor placement?
Resistors are color-coded by digit, multiplier, then tolerance, but the book I'm reading (comes with the Arduino starter kit) shows its breadboard diagrams with all the resistor tolerance bands leftmost, which seems backwards to me. I understand that resistors are not polarity sensitive, so they can go either way, but I was wonder if there was some sort of best practice / convention people use (read order vs reverse-read order).
AI: The text on your PCB will be in some orientation.
If you make the color codes with tolerance band on the right when the text reads right (regardless of how the PCB ends up being mounted with respect to the gravity vector) that's probably optimal. And tolerance band at the bottom when the text reads right if they are mounted vertically (or avoid designing the board with non-horizontal resistors!).
This is kind of a nitpicking thing that few really care about in production situations- resistors often end up being mounted any which way. SMT parts (newer ones) of 0603 and smaller size are often completely blank. You learn to read the 3-digit (5% resistors) 3-character (E96 series) codes and color codes upside down or right side up fairly quickly. |
H: How could I read a digital input (an open/closed switch) from a smartphone without a digitizing board?
I have to read a single digital input signal (a trivial open/closed-circuit push button) and use this signal in an Android application on a smartphone.
Of course, I could connect a tiny Arduino-like board to the USB port of the smartphone, use the digital input pins of this board to read the electrical signal and pass a message to the Android app but this task is so simple that I would like to avoid the use of any addictional board.
So, I wonder if it would be possible to (ab)use a regular headset wire for this task.
I would like to connect a regular 3.5mm headset to the smartphone, cut away the actual speakers and microphone, connect two of the resulting free wires to my push button and read the open/closed-status change of the switch from my app.
As long as I can see, Android has a ACTION_HEADSET_PLUG intent and a AudioManager.isWiredHeadsetOn() function so this is probably possible.
Does anybody have any idea about the correct wiring I should use? In particular, should I insert a resistor/capacitor to protect the inner circuitry of the audio board?
Any suggestion about the software side?
Please note that I'm only interested in reading the change of the switch status from open to closed or viceversa. I do not need to know the current status of the switch.
PS: No, I'm not willing to destroy the smartphone and connect the external push button to the existing keyboard.
AI: If you have the kind of headset with built in volume controls, you could wire your switch to the mute or volume buttons and detect that being pressed from your app. In fact...you could probably just use the existing button. That would be the easiest and most reliable to detect. |
H: 8 bit MCU with 12 bit ADC, possible?
I am trying to measure battery's voltage and current but with a very high accuracy. So i've selected a 12 bit ADC to be interfaced (via I2C) with my micro-controller. My micro-controller will receive these values form the ADC and send them to the PC via the USB.
Now my question is, can we interface a 12bit ADC with an 8bit MCU like this one ?
Being new to microcontrollers i did a research over the internet and got the concept of 8bit Micro-controllers. But i couldn't find any where if i am able to interface it with a 12 bit ADC.
Also IF i am able to interface it, would it be more easy to use for eg a 32 bit MCU like this one instead of using the 8bit micro-controller, and interfacing it with the 12 bit ADC ? P.S by 'more easy' i mean simplicity of coding.
Looking forward for your suggestions.
Thankyou.
AI: Typically you when interfacing devices through I2C or other IC level buses, you will transfer a word of information out of your device, like 8 bits at a time but the payload may vary between protocols (usually a defined protocol word or word range). So to see how your 8bit MCU will work with your 12 bit DAC, first look at the internal data structure of the ADC Output.
You can see that this is a padded 16 bit number and can neatly be stored in two bytes/words using your MCU. In c, this number would transparently be read as a u_int16 or equivalent definition for your platform. Moreover, if you program in C, multi-word data structures are handled transparently, processing and mathematical operations would be slower, but you would be able to safely store a 24bit ADC in a u_int32 and the compiler will handle the word level details for you.
Now when it comes to transfer protocol , I2C is a serial transfer protocol and you can chomp the data on MCU side however you wish (even with a 7 bit mcu if you had such a beast) , but the bus neatly divides the data for you by insisting on an ACK after every 8 bits.
Let's look at the I2C signaling for your ADC.
You can see that all communications are neatly split into 8 bit sections, writing command words, writing registers, reading data, etc. If you were bitbanging this protocol on your MCU in assembly, you would be able to easily work with your word level operations without too much headache. In C this would be done transparently by the compiler.
Your MCU is smart and will handle a lot of bus level details for for you. You can perform I2C transactions using a few control registers on your MCU without dealing with timing details like shown above. For the datasheet you linked (Atmega 48/88/168) the relevant chapter is Chapter 21 (Two-Wire Interface). A high level diagram of I2C communications using your MCU is shown in the following figure.
The benefit of using the integrated I2C is that you save a lot of program space and clock cycles that would be spent bit banging I2C in your code. |
H: Given the dynamic and static power consumption how does one determine the total power for the capacitive load?
I get that the capacitive load is determined which is also indicated by this question:
$$\frac{Power}{Voltage^2 \times frequency} = Capacitive Load$$
However, I am not sure how power (which is given in Watts) is determined when given both the dynamic and static power consumption and unfortunately my textbook doesn't really give any suggestions either. My guess is power would be equal to either dynamic - static or dynamic + static, but I don't which one would be correct, if either are correct, and more importantly why that statement is correct.
AI: Both dynamic power consumption and static power consumption are consumptions, so the total consumption is the sum of both. AFAIK for modern CPUs the dynamic power consumption dominates at practical frequencies. |
H: What is this type of radio fm antenna connector called?
I'm looking for an antenna replacement for my dad's busted radio (iHome IH8) and I'm having some trouble finding the name of this type of plug. The only things I find when searching online are coaxial cables and more professional looking cables and nothing relevant for my needs.
The male connector is 6mm and the female is 8mm.
Here are some pictures.
Thanks for your help!
AI: Assuming the ruler is showing millimeters, I'd say that the connector is of JST-XH-2.5 mm type with two pins. Sometimes, these connectors are sold and marked with 2.54 mm in their name, since that is a common spacing for inch-based measurements. Such connectors are commonly used for battery packs, so you might be able to find one, or a cable with one attached, in stores that sell equipment for radio-controlled planes/cars/boats etc.
My guess is that the radio was intended for use with a small loop antenna, such as one depicted in this photo from Wikipedia:
Most likely, two ends of such antenna would be connected to the appropriate female connector and then plugged into the radio. |
H: Use a li-ion battery at two different voltages
I scavenged a li-ion battery from a broken laptop. It is made of 6 Samsung ICR18650 cells (3.75V 2800mAh), parallels two by two so that the total pack is in fact the sum of 3 cells at 3.75V, so 11.25V (it's written 11.1V on the pack).
I have a raspberry pi which can run out of only one power boosted cell to 5V.
But I also have a TFT screen which runs on 7-12V (consumes less battery near 12V than near 7V).
I would like to know if I can actually plug the screen to the full battery, and the raspi to only one third of it.
I know cells have some kind of "balance" so I am wondering if that could make the battery unstable as one part of it would discharge at a faster rate.
As another solution to my problem, would it be possible to powerboost 5V to 7V or 12V so that everything runs from the same number of cells ?
AI: No: you have to treat all cells of a LiIon battery alike, or you will overdischarge or overcharge some cells. Yes, there are "balance" chargers which handle small discrepancies in the capacity or charge level of the different cells, but that's meant to deal with naturally-occurring differences, not deliberate differences in charge or discharge rate.
@Asmyldof is right: you should best use a regulator to convert the full voltage of the battery pack to the 5V needed for your Raspberry Pi. Buck converters can be quite efficient (over 90%); a number of manufacturers sell ICs that only require a few external components. |
H: What is the required bandwidth for QAM modulation?
Why is the allocated bandwith smaller with QAM-16 or 64 compared to e.g. QAM-4? I am not a professional so I'm looking for an intuitive explanation.
AI: NxN-QAM means Quadrature Amplitude Modulation and it is a modulation scheme where the transmitted signal is the "mix" of two quadrature carriers whose amplitude is digitally modulated independently so as to give N different possible amplitude levels per each carrier. Therefore 64-QAM is 8x8-QAM, for example.
The total bandwidth of such a signal is proportional to the baud rate \$\dfrac 1 T\$ where T is the symbol time, i.e. the time needed to transmit a symbol. Note that each simbol in NxN-QAM carries \$\log_2(N \times N)\$ bits of information, therefore 64-QAM carries 6 bit of information per symbol, whereas 4-QAM carries only 2 bit per symbol and 16-QAM carries 4.
If you consider a constant information transmission rate, i.e. a constant bit rate, you can see that increasing the number of bits per symbol makes the symbol time increase, hence the required bandwidth decreases.
To be more explicit, imagine you have to transmit a message with a bit rate of 64kbit/s. If you use 4-QAM you can transmit 2 bit per symbol, so you need to transmit at 32kSymbols/s (32kBaud). If you use 64-QAM you can transmit 6 bit per symbol, hence your baud rate drops to ~10.6kSymbols/s (10.6kBaud). Since we said that bandwidth is proportional to baud rate you see how the required bandwidth dropped using 64-QAM for a constant bit rate. |
H: FPGA floating pins, when place pull-up/down resistor on Input or Output
I've looked my FPGA datasheet and found that there is no pull-up/down resistors on it's pins(just a pull-up but that need to be enabled). So, when I power up my circuit I've for a "big" amount of time all IO pins of my FPGA floating. Since I've found that floating IO may damage some device or create problems, I want to put some pullup/down resistors.
Can someone advance me if it's better a pullup or pulldown resistor with which value? I've found someone advice pullup but they in some case can slow signal, other advice pull down, same for resistor values.
My main questions is:
Floating pins can create problems only on input pin of a device or also in output pins?(where input or output are always defined in the device)
AI: This answer was given by a member of Xilinx staff to the same question on the Xilinx forums:
In http://www.xilinx.com/support/documentation/user_guides/ug191.pdf, apge 18, the HSWAPEN pin if pulled to ground, will enable the weak pullups on all IO pins prior to configuration.
After configuration, a pin may be set to pull up, or pull down, or to remain floating (effectively tri-state) or be driven high or driven low, depending on the IO standard chosen. It does no harm to have pins float.
The default in the software is probably not something you would like to rely on. It is far better to design the IO to do what you want it to do and state it explicitly.
I believe the default is a weak pull down for unused pins, however.
The weak pull up and weak pull down may often be too weak: a resistor of the proper value is recommended if there is a standard that you are trying to meet, as opposed to relying on the weak internal pull up or down.
Austin
Austin Lesea
Principal Engineer
Xilinx San Jose |
H: Where can the detailed requirements for EU Low Voltage Directive compliance be found?
I'm designing an appliance that probably has to comply with the European Low Voltage Directive.
I've been searching for a guide on how to design a product complying with this directive, but I haven't found any.
I've found this document: http://eur-lex.europa.eu/legal-content/EN/TXT/PDF/?uri=OJ:JOL_2014_096_R_0357_01&from=EN , but it is very general in its stipulations and doesn't contain any technical details.
Searching the internet I've found blogs etc where people talk about how to crimp ground leads to comply with safety requirements, so I believe there actually are detailed technical recommendations somewhere.
But where?
AI: there are several standards that show compliance with LVD. Different types of equipment have different standards. For IT equipment like Modems, Routeres etc. use IEC 60950. |
H: Transistors emitter pin has lowered output
I have a BD135 NPN and BD136 PNP transistor, When i try to apply 5V of power to the collector pin, The emitter pin Voltage output is much lower.
The goal i want to achieve for this circuit is to control when the motor spins by a programmable circuit board which emits power which i believe is 0.5V from pins on the board, I'm connection a pin from the board to the base pin of a transistor while connection 5V to the collector pin and attaching the emitter pin to the motor which i want to control by turning off/on the pin.
I have tried directly connecting my power source to a electric motor and it spins fast, But when i try to connect the power to a transistor and then connecting the emitter pin from the transistor to the motor it spin very slow and sometimes stalls and needs to be pushed to continue. The motor needs more voltage then the transistor is emitting even when the collector pin is getting more then enough Voltage input(5V).
I thought the problem could be because i'm applying 3V to the base pin and maybe the base pin resists the collector but i'm not quite sure. I,m applying 5V of power into the collector but i don't know the output because i don't have the right equipment to measure it, All i know is that much less power comes out the emitter then what enters the collector.
I have tried researching this but i have found no topics or questions about this. I,m sure that my transistor is working because the problem happens for both my BD135 NPN and BD136 PNP transistors.
This is how i put my circuit for testing:
I have just discovered that the output is not 3v but 0.5v and the electric motor is also making a ticking sound.
AI: First: Without the proper tools you're doomed to fail, so at the very least do yourself a favor and get yourself a digital multimeter and learn how to use it.
Second: When you ask a question you should provide at least enough information (Like a schematic diagram of your circuit) to show how you connected all of the circuit elements together.
If you don't do that, then how are we supposed to know whether you connected the power supply backwards or made some other gross error which let the magic smoke escape from the circuit?
The short answer is, "We won't", and all we'll wind up doing is wasting a lot of time guessing at what your problem might be before your question gets closed.
EDIT:
The drawing below shows your circuit, which is an emitter follower, and a common emitter circuit.
The reason the emitter follower circuit doesn't work very well for your application is because the base-to-emitter junction looks like a diode and needs to drop about 0.7 volts higher than the emitter voltage before the collector can start supplying current into the load connected to the emitter. However, with the motor in there, as the current through the motor starts to increase, its voltage drop increases and starts pushing back on the emitter, so that the base-to-emitter voltage drops and the current into the load starts being limited. In your case, since there's only 3 volts available to drive the base and the base-to-emitter diode takes about 0.7 volts of that, the highest voltage that can be developed across the motor is 3 volts - 0.7 volts, which is 2.3 volts, and that's why your motor doesn't work very well.
In the common emitter circuit, however, the motor is located between the supply and the collector, so its voltage drop doesn't affect the emitter much, its being connected directly to the negative (ground) side of the supply.
That being the case, all that's necessary to turn the transistor on and put nearly all of the 5 volts across the motor is to put enough current into the base.
A transistor has what's called "current gain", or "beta", which means that if it has a beta of 100 and I want one ampere of collector current, what I have to do is force 10 milliamperes of current into the base and that'll turn the transistor ON enough to let 1 ampere flow from the supply through the load, then through the transistor's collector-to emitter junction, and then from the emitter back to the supply.
In switching situations, though, what we do to make sure that the transistor is fully turned on is to push enough current into the base to saturate the collector-to emitter junction by making the base current about 10% of the load current.
In the example I've given, I've assumed a load current of about 500 milliamperes for the motor and, consequently, forced 50 milliamperes into the base for what's called a "forced beta" of 10. If the load current is less than 500 milliamperes it won't matter at all because the transistor will still be fully turned on, but if it's a lot more than 500 milliamperes, then the transistor's data sheet will need to be reviewed to make sure everything's OK.
The diode across the motor is used to clamp the high voltage spike which will occur when the motor is abruptly turned off - and would otherwise destroy the transistor - to Vcc + 1 diode drop, or about 6 volts. |
H: microprocessor 6502 addressing scheme
I'm preparing for a test and I currently stuck with the following question.
We have a 6502 microprocessor. For the execution of an absolute jump the jump address with the address high byte (ADH) and the address low byte (ADL) are loaded into the program counter (PCH,PCL).
The question is now, why cannot both address bytes be loaded into the PC, but instead the ADL has to be stored first in the data buffer?
AI: The 6502 jump instruction is three bytes long:
JMP ADRL ADRH
It is not possible to load both bytes of the PC at the same time, since the 6502 is an 8-bit CPU and can fetch only one byte at a time.
Therefore, it is executed in three cycles, one for each byte. After the instruction has been decoded, the CPU knows it is a JMP instruction. The low byte of the destination address (ADRL) is fetched and then held over until the beginning of cycle 3, so that the original PC value (updated) can be used to fetch the high byte of the address (ADRH) in cycle 3.
At the beginning of cycle 3, a new memory fetch is started with the original PC to obtain the high byte of the new address. At the same time, the held value comprising ADRL is used to update the low byte of the PC.
At the end of cycle 3, the fetched value (ADRH) is used to update the high address of the PC. This completes the jump instruction, since the next instruction will be fetched from the new PC location. |
H: "Hot-knife"/Thermal cutter power supply design
I'm undertaking a DIY rope cutter project to avoid paying for the ~$150 store bought ones.
Many resources online told me to use a light dimmer + transformer configuration and I had planned to go a step further and build the dimmer too, using the circuit from this site: (replacing the light with a transformer)
http://www.electronicecircuits.com/electronic-circuits/filament-light-dimmer-circuit
However, upon reading a few posts here it has been suggested that dimmer circuits don't mix well with inductive loads such as transformers so I'm looking for alternatives.
I played around with a current division circuit using parallel resistors and a variable resistor however the high power would fry the resistors by a long shot.
Unfortunately this is where my education draws a blank and I open it up to any suggestions from those more educated than myself.
On a final note, please don't suggest using a bench power supply as this is not financially viable at this point in time, also needs to run off 240VAC (Australia.)
========================================================
EDIT
Blade arrived in the post today, it is advertised as a 60W but I would like to test it.
I also bit the bullet and grabbed a benchtop power supply, 0-30V 0-20A.
I thought I could find the current-voltage combination by connecting the blade across the supplies terminals however when I do so the voltage refuses to climb above 0.6V (pushing current up to 20A)
Using P=VI this means I can't get the power above 12W, much lower than the ~60W needed to heat the blade.
I'm inexperienced with benchtop supplies, is this normal? Are there any workarounds?
AI: Most hot-knife tools use a fairly beefy metal cutting tip. This is often a strip of wide nichrome ribbon - wide for mechanical strength and nichrome to make it easier to heat. You can use materials other than nichrome but these materials usually require significantly more current.
Because the cutting tip / cutting head is both small and beefy, its resistance is quite low. You therefore need a fairly-low voltage but lots of current.
To build your won power supply / controller, you need to start at the cutting tip. Determine what size of cutting tip you need. Then either figure out or measure how much current it's going to take to get it hot enough to cut your material. When you have an estimate of both the resistance of the cutting tip and the current required, you can choose a suitable operating voltage.
Most hot-knife cutting tools that I've seen and worked with use anywhere from 5 to 25 Amps at voltages ranging from about 1 to 3 Volts.
Note that I am talking about a hot-knife cutter here. There is a similar class of tools that use a long wire instead of a short ribbon for cutting. These are used for cutting foam board and sheets. Because the cutting element isn't small and beefy, these usually require less current but significantly higher voltage. But the principles are the same.
When you have determined what voltage and current you need, either purchase or build the power transformer that you need. There is a plethora of DIY articles that will show you how to re-purpose the power transformer from an old microwave oven for this and similar uses.
Finally, you need some form of current control to set the temperature of the cutting tip. Because the total power involved is relatively small (500 Watts or less), a triac-based dimmer works well. Again, you can either build or purchase your own control. However, I find that the speed controls used for ceiling fans work well in this application. They are usually quite inexpensive and because they are designed for inductive loads, have the appropriate snubber circuit that allows them to work with your transformer.
The dimmer controls that I've purchased from eBay have worked extremely well and they cost me significantly-less than what I could build them for. In fact, the price for the completely assembled and working units that I purchased recently was less than what I could have purchased the individual parts for. |
H: Using a LS248 7-segment driver, but segments are dim. Can't figure out why
I'm building a project where I want to use two double-digit 7-segment-LED displays (green, common cathode). From what I've read, a shift register wouldn't be able to source enough current, so I decided upon using a SN74LS248N IC (datasheet). This IC takes Binary Coded Decimals (BCD) as input and has 7 outputs to drive the segment LEDs, minus the decimal point LED. As I understand the *248 ICs are for common cathode displays, so pins connected to active segments are HIGH.
My problem: I can't get the LED segments to light up properly using this IC. It's visible in the image below, but worse in real life. Check the photo album I've made for comparison with a circuit where the segment is driven directly. This album also includes a circuit diagram, to help illustrate the problem.
When I connect using the driver IC, the segments light up only weakly . My bench power supply indicates the circuit is using 9 mA.
Now, I've tested the display using only power leads and a 150Ω resistor. That works beautifully, using up more than three times the power: 30 mA according to my bench power supply.
Does anyone here have any clues or tips?
AI: The LS248 has an output that looks like this:
It effectively has a (nominal) 2K resistor in series with the output when it is high, so your 150 ohm resistor adds to that, making it effectively 2.15K.
To make this work with a minimum of muss (as well as a minimum of efficiency), add a pullup resistor to each output (Vcc to output) and omit the series resistor. Try about 470 ohms to stay within the ratings of the output, but you could go lower if you feel like abusing that antique chip to get a bit more light. It would be unwise to go below about 220 ohms, as that will make the 'off' current exceed 24mA per output. |
H: Poorman's shunt theory
Background
I'm doing a DIY project of bulding a 1kW Induction heater.
in the process I have built a poormans PSU out of a MOT ( and a 50V 25A brigde rectifier. with not even nearly enough of a smoothing cap (2,500 uF from a broken switched psu for my old comp).. but anyway:
Method
I am going to build a Volt/Amp-meter with a Aurdino tiny and as I am testing my prototype something is a bit of..
I'm just wondering what I'm doing wrong..
According to the internet copper has a resistivity coefficient (q) of \$1.72\cdot 10^{-8} = q\$.
Resistance (R) in a conductor is given by \$(q L)/A = R\$
where L is length in meter and A is Surface area in \$m^2\$.
The resistance I'm using for a shunt is a 2.5mm^2 copper cable (European way. I don't know gauge)
now, I decided I want 2mV/A in drop and that, witch all other variables now given gives me a Length (L) of 0.727 m for a
simulate this circuit – Schematic created using CircuitLab
Issue
When I hook it up to a known circuit that handles 20A+ and go to calibrate it in reference to my multimeter I end up at 5.7mV/A drop instead of 2.0mV/A witch was calculated.
It's quite a difference and since this stuff is pretty straightforward \$U=RI\$ I wonder what I'm missing?
AI: A is not surface area it is cross-sectional area.
So L = \$\frac {A R}{\rho}\$ = 0.291m
A = 2.5E-6 m^2
R = 0.002\$\Omega\$
\$\rho\$ = 1.72E-8 \$\Omega\$ m (your number)
You're right, it's a lot easier (from first principles) using European units rather than gauges, but usually we just look it up in a table.
Copper has a quite high temperature coefficient (about +4000 ppm/K) so it's only useful as a crude shunt. Even brass is better, but nichrome constantan or manganin would best (in order of possible difficulty to source). |
H: Different Voltage Battery Backup Circuit
I saw a circuit on a website to make a backup battery circuit for a rechargeable 12v battery circuit.
However, I don't anticipate regular power outages, so I believe that one non-rechargeable 9v battery will last for more than the life of this project.
I came up with the following circuit modeled after the first circuit (And a voltage regulator circuit I saw):
simulate this circuit – Schematic created using CircuitLab
Is it dangerous to mix different voltages like this? I heard it could be for transformers, but what about a battery? Would the circuit only use the battery if the transformer is disconnected, and finally, does it look like it would work?
Thanks!
AI: Your circuit looks fine to me !
The diodes are a bit over specified though, the 1N5406 can handle 3 A, in your
case 1 A should suffice (the LM7805 is not going to pull more than 1 A).
So you could use 1N4001 instead. But if you have the 1N5406 lying around, you can
use those, it will work just as well.
Just build it and enjoy :-) |
H: Arduino - Controlling 8 RGB LEDs (beginner question)
First time poster here.
I have an Arduino Uno project that will require 8 RGB LEDs to be controlled. They will be turned on and off with pushbuttons, cycling through red, then green, then blue, then turn off. Multiple LEDs will have to stay on together at times, too. It's going to be part of an electronic lock, so basically a keypad that, instead of having keys, has coloured LEDs as a password input. However I am not using a physical Arduino, I'm doing it in the 123D Circuits environment (made by AutoDesk), so I'm limited as to what parts I can use.
I ran across Charlieplexing and Multiplexing, as well as using transistors and shift registers, as possibilities.
The problem is that I haven't had any electronics classes yet, so I have no idea which is better/more suitable/even possible, specially regarding wiring the parts together, and how they communicate with my project, so that's what is making it difficult for me to understand, or even begin to code.
I followed this guide to try wiring 4 RGB LEDs.
However they're common anode LEDs, and mine are common cathode, and as I've said, I have no idea how to figure the electronics (I can't even read schematics without getting lost at what am I supposed to be reading there).
Here's how I tried wiring it: http://postimg.org/image/gu4cwdv0n/full/ following the guide's instructions.
(it may be absurdly difficult to see what is happening due to the awful graphic interface for wire jumpers in the platform there)
It didn't work with the code provided, so I assumed it's my wiring that is the problem.
EDIT -- I have 8 pins that can be used to those LEDs. Also, if there is no alternative to Charlieplexing, could someone explain or compare how it is different in RGB LEDs to normal LEDs? I believe I could understand it better that way, since I think this is what is troubling me: the common cathode, as opposed to 3 cathodes in 3 multi-coloured LEDs.
Thanks in advance.
AI: The easiest way to control that many RGB LEDs is to use a strip of LEDs that already include their own controller, such as the WS2812B. In addition, there are libraries for many of the models of "addressable" LEDs already available. From there it's simply a matter of instantiating an object for the correct number of LEDs, setting them to the desired colors, and then invoking the correct method to configure them all at once.
NeoPixel Stick
light_ws2812 |
H: Why does my LCD screen emit sound when displaying black-and-white lines?
I recently discovered this page (epilepsy warning; flashing lights), which displays horizontal black and white lines and animates their thickness. Amazingly, it makes my laptop LCD screen emit an audible continuous squeak that changes in pitch. It has a few thousand upvotes on Reddit, implying this is a common observation.
If your screen does not squeak, this recording matches what I'm getting. (Thanks dadooor on Reddit!) Make the page as large as possible—it's louder that way.
For experiments, I created a large image with 1-pixel horizontal lines, and one with vertical lines. Try zooming in. For me, it's loudest at 200%. Interestingly, the vertical one is silent at any zoom level.
drivers99 on Hacker News speculates:
Without knowing anything else, I guess that there may be a capacitor somewhere that is charging and discharging along with the brightness of the screen as it is refreshed from top to bottom, which is causing it to flex in a way that produces an audible noise.
Is that a workable theory?
Why does it only happen for horizontal lines?
AI: The explanation by drivers99 is correct. Noise is generally coming from capacitors or from the AC to DC converter.
Do you remember the old style cameras? They had a flash that used to make a whining noise after every photo taken. That's the capacitor charging. Same thing with your monitor.
Why does it make that sound only in some patterns? Due to pixel overdrive. What happens is, when the pixel color changes from white to dark, the monitor supplies higher voltage so the LCD crystal changes state faster. You can see the oscilloscope photos from here http://www.tomshardware.com/reviews/viewsonic-overdrive-lcds,1042-8.html
The page you linked produces a series of fast changes, probably making the monitor overdrive a lot more than normal. Higher voltage means the AC to DC converter has to supply more power and the capacitors have to unload and reload more often, thus everything producing more of that whiny noise.
A static image can still make the monitor "work harder" due to the way it drives the pixels. Depending on the panel type, the logic behind the screen is different and can have some unfortunate worst-case arrangements. This also produces pixel-walk. Here's a page where they have some examples of such cases: http://www.lagom.nl/lcd-test/inversion.php
More information about pixel-walk here: http://www.openphotographyforums.com/forums/showthread.php?t=18552 |
H: Terminating unused unity-gain Unstable op-amp
I am trying to terminate the unused unity-gain unstable op-amp. I have tried to terminate it with the typical unity-gain stable configuration (http://www.maximintegrated.com/en/app-notes/index.mvp/id/1957) and so far in the lab, it seemed to work and gave stable output. However, I am still concerned about it as it is unstable at unity-gain region mentioned in datasheet. I want to learn if there is anything more robust than using unity-gain termination configuration. The amplifier I am using is OPA2614 from TI. So far I have tried this to stabilize the output at 12V but don't know if this is the best way.:
AI: This would be better (output left open):
simulate this circuit – Schematic created using CircuitLab
Both inputs are within the common-mode range of the amplifer- see the datasheet which gives the values with a +/-6V supply and translate by adding 6V to the numbers. |
H: VHDL 4-display counter on a Nexys 3 (0000 to 9999)
I'm triyng to implement a 4 display counter (0 to 9999) on a Nexys 3. However, when I load the bit file, all displays remain at 0. It seems like variables a,b,c,d; which control individual digits, stay at 0, but that doesn't happen in the simulation. Xilinx throws these warnings:
WARNING:Xst:2404 - FFs/Latches <a<1:3>> (without init value) have a constant value of 0 in block <contador10000>.
WARNING:Xst:2404 - FFs/Latches <b<1:3>> (without init value) have a constant value of 0 in block <contador10000>.
WARNING:Xst:2404 - FFs/Latches <c<1:3>> (without init value) have a constant value of 0 in block <contador10000>.
WARNING:Xst:2404 - FFs/Latches <d<1:3>> (without init value) have a constant value of 0 in block <contador10000>.
WARNING:Xst:1426 - The value init of the FF/Latch a hinder the constant cleaning in the block contador10000.
You should achieve better results by setting this init to 1.
WARNING:Xst:1426 - The value init of the FF/Latch a hinder the constant cleaning in the block contador10000.
You should achieve better results by setting this init to 1.
WARNING:Xst:1710 - FF/Latch <ca_6> (without init value) has a constant value of 1 in block <contador10000>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1710 - FF/Latch <ca_2> (without init value) has a constant value of 0 in block <contador10000>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1710 - FF/Latch <ca_1> (without init value) has a constant value of 0 in block <contador10000>. This FF/Latch will be trimmed during the optimization process.
And, if I set an initial value other than 0, it will be on the displays for a short instant before returning to 0.
I'm trying a 4 process approach:
The clock, which generates two pulses (one for the anode switching, one for the actual count)
A process which switches rapidly between anodes in order to display different numbers at the "same time"
A process to asign the value of each individual digit to the established display.
A process to do the count 0000 to 9999 and save the values in 4 digits (a,b,c,d)
This is my code.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity contador10000 is
port(
clk,reset : in std_logic :='0';
led : inout std_logic := '0';
an : out std_logic_vector(0 to 3);
ca : out std_logic_vector(0 to 6)
);
end contador10000;
architecture cuenta of contador10000 is
type display is array(1 to 4) of std_logic_vector(0 to 3);
constant DISPLAYS : display := ("0111","1011","1101","1110");
type digit is array(0 to 9) of std_logic_vector(0 to 6);
constant DIGITS : digit := ("0000001","1001111","0010010","0000110","1001100","0100100","0100000","0001111","0000000","0001100");
signal i : integer RANGE 0 to 6000000 := 0;
signal j : integer RANGE 0 to 1000 := 0;
signal a,b,c,d : integer RANGE 0 to 9 := 0;
signal q : std_logic := '0';
signal x : integer RANGE 1 to 4 :=1;
begin
process(clk)
begin
if(clk'event AND clk='1') then i <= i + 1;
j <= j + 1;
if i = 6000000 then
led <= not led;
i <= 0;
end if;
if j = 1000 then
q <= not q;
j <= 0;
end if;
end if;
end process;
process(reset,led)
begin
if(reset'event and reset='1') then
a <= 0;
b <= 0;
c <= 0;
d <= 0;
else
if(led'event and led='1') then
if a = 9 then
a <= 0;
if b = 9 then
b <= 0;
if c = 9 then
c <= 0;
if d = 9 then
d <= 0;
else d <= d + 1;
end if;
else c <= c + 1;
end if;
else b <= b + 1;
end if;
else
a <= a + 1;
end if;
end if;
end if;
end process;
process(q)
begin
if q'event and q='1' then
an <= DISPLAYS(x);
if x = 4 then x <= 1;
else x <= x + 1;
end if;
end if;
end process;
process(q)
begin
if(q'event and q='1') then
case x is
when 1 => ca <= DIGITS(d);
when 2 => ca <= DIGITS(c);
when 3 => ca <= DIGITS(b);
when 4 => ca <= DIGITS(a);
end case;
end if;
end process;
end cuenta;
AI: DONE. The reset wasn't working properly, so the 4 digit signals (a,b,c,d) were always at 0. Just by removing the reset'event and reset='1' line I was able to see actual numbers on the Nexys 3. |
H: Toroid Core Selection for Audio Isolation Transformer
I am a newbie. I have attempted to make an isolation transformer with some toroid cores and it worked, but not well. I tried using a "wide band" toroid core and it seemed to have killed a lot of the lower frequencies.
FT37-43
What is a good toroid core to use for making an isolation transformer for audio? How do I choose the right size?
I have Left, Right, & Signal Ground with my unbalanced audio signal.
Am I right in looking/targeting for 2Hz-20kHz frequency range in the toroid cores?
If the toroid core specs doesn't state the frequency, how can I figure out what frequencies it works with?
AI: A transformer doesn't pass DC. In fact, for a given design you will struggle to pass low frequencies through the transformer because, basically, the transformer primary is also an inductor that is in parallel with your drive signal. This inductor will overload your amplifier's output and make passing low frequencies a misery.
So, taking into account the core's ability to convert a given number of turns into a given inductance you calculate the number of turns needed to not overload your amplifier at the lowest frequency you are concerned with.
2 Hz is too low - for audio 20 Hz is fine but a lot of folk will decide on 40 Hz as the lowest point of the audio - you have to decide that. If you decide that at 40Hz you don't mind the impedance being as low as 100 ohms then this equates to an inductance of about 0.4 henries.
Look at the technical details of the core and decide how many turns are needed to achieve this inductance. Of note - doubling the turns quadruples the inductance.
Choosing the right size core depends on how much power you wish to pass thru it. You also need to choose a core that will work correctly (without attenuation) at 20kHz - most ferrites will easily achieve this but if using some other material then you'll need to look at the data sheet. It's probably a good idea to link the data sheets in your question.
Secondary winding is usually the same number of turns as the primary - this gives you a 1:1 transformer. |
H: What is the maximum number of bytes that can be sent through USB-to-serial COM port at one go?
Suppose someone uses hyper-terminal to send a very long ASCII string at a COM port. This COM port is created by FTDI USB-to-serial port cable. The cable used is http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232RG_CABLES.pdf.
Is there a limitation imposed by the UART driver for PC? For example, Arduino UART tx buffer is 64 bytes only.
What is the maximum number of bytes that can be sent through a PC serial port at one go?
AI: In full-speed USB, the maximum packet size is 64 bytes.
In high-speed USB, the maximum packet size is 512 bytes.
Most USB/serial converters, including yours, use full speed.
However, if you are looking at the serial output, the USB packet size does not matter, because USB packets can be sent faster than the speed of the serial line, and are buffered.
For example, if the PC sends 100 bytes, it will use two packets, but what you are seeing at the other end, on the serial line, is again a continuous stream of 100 bytes.
Similarly, if you are sending data from an Arduino, you can buffer a new TX byte as soon as some previous byte is being sent, so the size of the TX buffer does not really matter. (However, a larger buffer size allows the pre-buffer more data, which allows continuous transmission even if the microcontroller must do something else for a longer time.)
PCs, most microcontrollers, and USB/serial converters are fast enough so that the only bottleneck is the speed of the serial line, so you will never see a gap in the data, regardless of how many bytes are transmitted. |
H: Nokia 1616 LCD AVR Issue
I seem to be having a weird and frustrating issue.
I have a Nokia 1616 LCD to which I am displaying images stored on an SD card. Everything worked fine when I was breadboarding it but when I assembled the circuit on a etched PCB, that's when the trouble started.
When I power on the circuit I see the lcd backlight with normal expected brightness. However right after that (when the avr starts initializing the LCD I presume), the brightness decreases dramatically and the image shown on the lcd is all streaked with color lines and has sort of whitewashed effect. Like the image is bleeding (don't have any pics as I removed the LCD to try n solve the issue).
However at this point if I press the reset button on my circuit (reset avr) and hold it for a brief moment I see the LCD act normal with the image shown as it should be.
Googling didn't help much. A single post on avrfreak suggested that this streaking happens due to 5v signal being applied to 3.3v terminals of the LCD. I am using a bss138 to do level conversion. So to check those I wrote a test program outputting 5v on all the output terminals and as expected I got 3.3v on the lcd inputs. So that's not the issue.
Another thing I noted is that on my breadboard the circuit pulls in about 200ma but on the PCB its constantly pulling in around 350ma.
This along with the backlight dimming is making me believe that there must be a short somewhere .
Am I along the right path. Has anyone had any experience of such kind?
This is what it looks like
This is what is should look like
Thanks!
AI: Have you thoroughly inspected your PCB for shorts?
You can use a continuity tester function (or the lowest ohm range) of a multimeter to test whether you have shorts between traces that shouldn't be shorted (do this with power disconnected!).
Better if you do this test with the LCD (and any other socketed component) disconnected, so as to minimize apparent shorts due to their presence.
This, together with visual inspection using a good loupe, should give enough confidence about the presence of shorts due to the PCB fabrication or the soldering step.
Keep in mind that, since you already have some component soldered, if you find a short it could be due to a component placed between the traces where you detect the short, so you should desolder every component and test them individually, unless you spot a dead short between the traces due to fabrication residues or soldering. |
H: how to get the RGB value of a color using phototransistor or photodiode?
I'm making a color analyzer which can measure Red, Green, and Blue portions of a color (ex: 128,255,0).I'm not supposed to use pre-made color sensors and need 1% ACCURACY.
I used three LEDs - R,B & B to sequentially measure the values. When green led is on. the reflection is caught by the photo-transistor. The deviation of voltage is converted to current deviation using OPAMP's V to I circuit so that intensity of green reflection can be measured and can be calibrated to show a 0-255 value using a micro-controller.
I was successful in measuring green value of a color only if the color contained green potions. (ex [0,255,0] , [0,128,0], [0,200,0] ). likewise I can get RGB values only if one color is present. If I was given a color which is a combination of R,G,B then the voltage reading is different and wrong. For example I get a higher voltage (higher intensity) when I'm measuring white (255,255,255) than green (0,255,0). Ideally I should have got the same amount of green because those colors had same amount of green - 255.
What is the cause of the problem and how can I use an alternating method to achieve my target? Is there a method to separate the reflection in to R,G,B with high accuracy? Thanks in advance. ( I'm using a Photoshop print on a matte photo print paper as the color)
EDIT: The 3 LED's and the photo-transistor is fully covered making sure that no background light will not interfere.
AI: To understand the results you are getting you have to consider the spectral response curves of your light source, detector, and the object being measured. The final result is a combination of all these 'filters' acting on the signal. And if you want to relate that to the colors you see, then you also have to take into account the spectral response of the human eye.
I'm using a Photoshop print on a matte photo print paper as the color
A photographic print is calibrated to show correct colors when viewed by the human eye. This does not mean that it will reflect all the color components in direct proportion to the values in the digital image. The pigments or dyes used in color printers don't produce pure colors. A perfect 'green' ink (which is actually a combination of cyan and yellow) would reflect all wavelengths between 495 and 570nm ('green') while absorbing all other wavelengths in the visible spectrum ('blue' and 'red'). But practical inks do not have such sharp response, so 'green' ink won't reflect all green light, and may also have some blue and red in it.
To compensate for the color being too dark the printer may lay down less ink to let more of the white paper show through. But traces of blue and red in the 'green' could make it look muddy or washed out, which the printer may compensate for by adding black. The printer may also alter color ratios to get a more accurate hue. The end result looks alright, but is not an exact match to the digital RGB value of 0,255,0. What you are seeing is not actually pure green, but a mixture of many different colors that just look like pure green to the human eye.
Another factor to consider is the spectral output of your LEDs. Most green LEDs emit a fairly narrow band of green light, If this doesn't line up with the ink's spectral response then the output could be lower than expected. If you then calibrate to this lower value and call it '255', a pure white image could read higher than expected because the plain white paper reflects more wavelengths of green light than the 'green' ink does.
Finally, the detector's response could be distorting the results. Standard photo-transistors peak in the near infra-red, and response drops off rapidly towards the blue end of the spectrum. This could skew the response so that 'yellow' green produces a higher reading than 'blue' green.
Bottom line:- the printer modifies the image's RGB values to produce a result that looks right to the human eye, so to get a meaningful result your emitter/detector combination must replicate the spectral response of the human eye. Even then, the results won't exactly match the RGB color values in the digital image (1%? forget about it!). |
H: calculate battery voltage using pic ADC
I need to calculate battery voltage using my PIC's ADC. My battery voltage is 24V and ADC has a 12 bit resolution, the PIC operating voltage is 3.3V.
I am using the PIC's internal Vref+ and Vref- as reference voltages, ferrite bead (model 1206 ) I don't know the correct value. Why is the ferrite bead used?
How can I calculate the battery voltage using this circuit please help me with the calculation clearly?
AI: I will write this answer a little more elaborately, as you do not seem to have very much knowledge about electronics.
First of all, your circuit does not look like a voltage measuring circuit, but more like a supplying circuit. (May be for your PIC microcontroller?)
The zener-diode Z2 limits the voltage on the right side to a maximum of 3.3V. (It does so by just becoming conductive at that voltage.)
Due to this, there is a voltage drop of 24V-3.3V=20.7V over R2, leading to a total current of 20.7mA. From this, 1.5mA will flow through R13, the rest of 19.2mA will flow through Z2.
If you connect something consuming let's say 15mA at 3.3V to the right side, Z2 will only consume 4.2mA. The total current through R2 will still be 1.5mA+15mA+4.2mA=20.7mA, so the voltage drop is still 20.7V and the remaining voltage on the right still is 3.3V.
However, if you connect something consuming more that 19.2mA, the overall current through R2 exceeds 20.7mA and so does the voltage drop. The Voltage on the right breaks down, below 3.3V.
So, this circuit allows to supply a 3.3V device consuming not more than 19.2mA on the right side. But be aware that there will always be a current of 20.7mA, even if no device is connected. This will slowly drain the battery. Also, due to the high voltage drop, over 86% of the battery's power is wasted as heat! That's not very efficient.
C1 and C9 (and their values) are quite typical blocking capacitors used e.g. near micro controllers. The power consumption of a microcontroller can change very quickly, while the wires also have an inductance. This means the circuit can not fulfill the fast changing power demands, leading to an unstable supply voltage for the microcontroller. As result, the microcontroller may not work fine. That capacitors act as buffer and can provide some current until the rest of the circuit provides the full current. (If you want, it's like a pantry)
Comming to the ferrite:
A first remark: 1206 is just the physical size, not the model, nor any electrical parameter
Ferrites block high frequencies and allow low frequencies (and DC) to pass. This also means they can filter sudden spikes of current by smoothing them a little.
Let's say you have that microcontroller with its fast changing current consumption and some other circuit very sensitive to a smooth supply voltage. The current consumption of the microcontroller would cause voltage drops, which would be noticed by the other circuit. That ferrite would reduce this effect by smoothing the current flowing to the microcontroller. However, that would cause bigger voltage drops on the microcontroller side, but therefore, you have the capacitors.
Finally, you asked how to measure a battery voltage by ADC. In general, an ADC accepts a certain input voltage range. For the PIC, it is defined by \$V_{REF-}\$ and \$V_{REF-}\$ . In most cases, \$V_{REF-}\$ is 0V and \$V_{REF-}\$ can be chosen between the supply voltage (3.3V in your case) or an internal reference (see datasheet, I guess 1.25V). But it's also often possible to feed your own, external reference voltage to the ADC.
For precise measurement, use the internal reference, as it is independent from the supply voltage and very stable.
The ADC converts a voltage within that range to a number, i.e. \$n=0\$ for \$V_{ADC\_in}=V_{REF-}\$ and \$n=2^{12} - 1= 4095\$ (12-bit ADC) for \$V_{ADC\_in}=V_{REF+}\$. So, the conversion is
$$V_{ADC\_in}=(V_{REF+}-V_{REF-})\cdot\frac{n}{2^{12}-1}+V_{REF-}$$
Now, your battery voltage exceeds the range of the ADC, so you want to divide it down until it's in range. Do it so that the expected voltage to be measured will be a little below the upper ADC limit. For example, to measure your 24V using the internal 1.25V reference, use a 19kOhm and a 1kOhm resistor to divide the 24V down to 1/20, which is 1.2V. Of course, you will have to multiply \$V_{ADC\_in}\$ by 20 to get the actual voltage. |
H: Findning the magnitude of the current
Screen shot of the question is given below.
My thoughts
Since the B field into the page is decreasing, and induced current is induced in such a way to oppose that condition. So here I can find the induced E.M.F.Becasue induced E.M.F equals to the rate of change of magnetic flux .Then by that argument I find the induced E.M.F, you can find the math part I have done to find it,
$$E.M.F= B*A$$
$$E.M.F= 150*(0.1)^2$$
$$Induced E.M.F= 1.5 V$$
Therefore I can find induced current ,
$$induced current =1.5V/10= 0.015A$$
And the current drawn form the cell is equals to o.20A.
So my question is do I need to get the sum of these two values or subtract them?
Once I use the right-hand rule to detect the direction of induced current , I found it as the direction opposite to the current draws from the cell. You can see clearly see what I am talking about by looking the below image,
Let I0 be the current draws from the cell.
So what I need to do here ?
AI: I agree that emf is 1.5V but I didn't like the formula used. It should be: -
emf = B.A/t (flux density x area divided by time)
Also you have used 0.01m as the length of one side and this is incorrect - it is 0.1m. All the same you got the correct answer of 1.5 volts!!
Then you go and say the induced current is 0.015 amps - this is incorrect it is 0.15 amps i.e. 1.5 volts divided by 10 ohms.
Direction of current induced can be gleaned from this: -
The image above is for a loop getting bigger and this is the same as the field increasing linearly whilst the loop stays the same size. Link. If the loop were getting smaller, this would be equivalent to the scenario in the question and therefore the direction of current would be opposite to that shown in the diagram above.
So the induced current is subtracting from the standing current of 0.5 amps to produce a current of 0.35 amps. Or just look at it in terms of the net voltage being 3.5 volts across a ten ohm resistor. |
H: Debouncing a TTL Photodiode Detector
I am designing a photodiode sensor that will sit on a computer monitor and will output a +5V TTL signal if the screen is displaying and image and a 0V signal if the screen is not. The prototype circuit that I built works almost as expected (schematic below).
Prototype Photodiode TTL Circuit
The one problem is that the signal when the screen is turned on transitions (drops to 0V and then back up to 5V) every ~4 milliseconds (I am only recording the TTL signal at 2kHz). I tracked down the cause of this and the culprit seems to be the PWM for the LCD monitor back light. If I turn the brightness of my screen all the way up the unwanted transitions go away and the signal is a pristine 5V for the duration of time that the image is on the screen. Unfortunately looking at a monitor that is set at 100% brightness is unpleasant to say the least. Since I only need accurate TTL onset I was thinking that modifying the circuit above to include an RC-debounce circuit should fix my problem. I am wondering if the revised schematic (below) would work as drawn. The reason for the different opamp is that I am laying out a board using SMT components and ordering from Mouser instead of using parts that I could find at Fry's (that have been on the shelf since 1970). I am also aware that I have no bypass caps on my IC's and that my pinouts are a little wonky (figured I'd use actual circuit symbols instead of the rectangles that my eagle library has for the chips that I'm using).
Revised Photodiode TTL Circuit
The thought with this circuit is to replace the inverter with an OR gate and use an RC circuit to the other input of the OR gate. The idea being when the photodiode is on that the OR gate's output will be high and the inverter's output will be low turning on the MOSFET and allowing the RC circuit to charge. Then when the photdiode sees a monitor PWM event the inverters output goes high shutting off the MOSFET and allowing the RC to begin discharging. This event also causes the OR gate input connected to the opamp to go low but the other OR gate input is high because it is tied to the discharging RC circuit keeping the output of the or gate high during the the monitors PWM events. The output would only go low when the photodiode sees a sees the screen off for more then the RC time constant of my "debounce" circuit.
Am I missing anything? Will the circuit work as drawn?
EDIT:
The leading edge of the logic needs to be accurate (not delayed) but the falling edge can be delayed without affecting the use of the circuit. The output of this circuit needs to go from low to high (when screen goes from black to white) in less than 0.5ms and needs to transition from high to low (white to black) in 10ms or less. This diagram hopefully shows what I'm trying to achieve
Actual is what I see, the transition in the middle of this line is what I am trying to get rid of. I think the line marked acceptable is how the revised schematic would work.
AI: You need to transition on the screen going white within 0.5ms, transition on the screen going black within 10ms, but ignore periods of black lasting less than 4ms. This is more constraining than simple R/C circuits can provide: you need a timer.
The venerable 555 timer will do what you need. Set it up in monostable mode, with a duration of 6ms (make it adjustable), and drive the reset line from the output of your OPA141. Then, any glow from the screen will reset the timer, but if there's no light for 6ms then the output will go active. (You may have to play with the various polarities.)
An alternative would be using one of the simplest microcontrollers (e.g. an 8-pin PIC12) with an analog input. Less than $2, but incredibly versatile. |
H: Does a PCB circuit work without soldering the paste?
So the case is simple. I have to tune a Pi antenna matching network (a simple LC filter). That means I have to place and unplace a couple of pasives back and forth until I find out the right pair of values. Even if I do that operation with hot air gun, I am afraid I can damage the pad due to solder and desolder the component too many times.
I have been wondering if I can test the LC filter without heating the components, that is, I just place the L and C on the pads, as they are 0402, they stick to the pads and I can manipulate the board carefully. They do not fall unless you shake the board, what allows me to test it quickly and swap the components again without using heat.
I realized the paste is sill conductive before being heated but I don't know if the qualities of my LC network will be affected by this and so my tests will be really giving reliable data or not.
Have you people done this before?
Many thanks
Mario
AI: It doesn't work that way. Solder paste is microscopic balls of solder suspended in flux. Some fluxes are outright insulators, but none of them have sufficiently low resistivity to make a good connection. You can't count on the solder balls touching, since many of them won't.
All around this is a bad idea. |
H: Pronunciation of "Gerber"
How is "Gerber" pronounced? By "gerber" I am referring to the type/class of files generated for PCB manufacturing. I could imagine the first "g" being pronounced with a "g" as in "girl", or a "j" as in "jerk".
AI: I believe it is based on the original plotter file format for machines made by Gerber Technology I had a friend that worked there for a while and they pronounced the name of the company exactly like the baby food as Matt says, Grrr Brrr like you're growling at someone but also chilly :)
Joseph Gerber was an Austrian, hence it is a German name. There is no "g" pronounced as "jerk" in the German language, it is always like "girl". |
H: Current sense in SMPS, how does it work
I've read a couple of application notes where it is stated that measuring current to use that value in the feedback loop helps stability because sensing before the RC net takes a pole away (see http://cds.linear.com/docs/en/application-note/AN140fa.pdf page 11, figure 13). I get that. What I don't understand completely is how do you know which current value you need to have if you only know the voltage value you what to stabilize at the output but you don't know how much you are loading the SMPS.
Thanks for your answers
AI: Have a look at figure 13:
There are two control loops.
In the inner loop, the voltage across RSEN is compared with a target value to determine when to switch the PWM circuit. This is the current sense circuit.
In the outer loop, the output voltage is compared with a reference, and the target for the inner loop is adjusted to achieve the desired output voltage. |
H: Q: transistor as a variable resistor for oscillator circuits
this is my first question,
I want to ask a simple question, I searched but couldn't find proper answer, here is my situation; I want to build frequency generator circuit with op-amp oscillator topologies, but I want to control the circuit with ATMega328p's RC-Filtered PWM Analog outputs, but as you know, oscillator circuits tuned with changing R and/or L (if RL resonator/tuned circuit used) or C ( if RC circuit used for oscillation) values, it is obvious that I cannot change L or C values easily, so I decided to change R values to tuning oscillation frequency (as variable), so I think that I need to implement digitally controlled potentiometer or variable resistor, after that I came up with an idea; when using a BJT transistor at Active region, it acts as a variable resistor (ofcourse there will be some voltage drops due to Vbe)
but I cannot achieved this goal because active region needs small signal input at base, here is my question : can I set the PWM or RC Filtered Analog output's amplitude as needed for active region ( as mV scale, I think) or should I consider another way to accomplish this issue?
thanks in advance, sorry for my bad english
AI: You could use a DDS which is easy (the hard work has been done for you). Assuming you don't want to do that, read on.
For low frequencies (through the audio range) the easiest way is to generate triangle waves with a VCO which can then be shaped into sine waves if necessary. This can be done with a DAC to generate the control voltage and an oscillator made with an integrator and a comparator switching the integration direction.
For high frequencies (1MHz and up) you can easily change the C by using a varactor diode. You can phase-lock the signal to a reference signal if you want.
You can use a JFET or a lamp + LDR (light dependent resistor) to vary resistance, or as Ignacio says, use an MDAC to simulate a relatively low frequency resistor.
Or you can use a digital pot! Some are specified well enough to use them as rheostats, though they are always better used as potentiometers. Again, not so great at high frequencies. |
H: AD5933 analogs for 4-terminal measurements
I'm going to do bioimpedance measurements, and it seems that AD5933 chip (http://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf) has many useful features for this. However, every paper on bioimpedance measurement (e.g. Ishai et. al, Meas. Sci. Technol. 24, 102001) suggests to use 4-point scheme (i.e. 2 electrode for known current injection and 2 electrode for potential measurement). After examining AD5933 datasheet I find it difficult to use this part in 4-terminal setup, since AD5933 stabilizes voltage on the sample and measures current, while in 4-terminal setup it is necessary to have this the other way around.
May be there are any other reasonable chips, which are able to do 4-terminals, with the same capabilities for signal processing as AD5933?
AI: http://iopscience.iop.org/1742-6596/407/1/012019/pdf/1742-6596_407_1_012019.pdf is a paper you may not be able to get without being in a subscribing university, but you can try. They add an analog front end to do what you're trying to do. I'm including ref info and the abstract.
Interfacing the AD5933 for bio-impedance measurements with front ends providing galvanostatic or potentiostatic excitation, Uwe
Pliquett, Andreas Barthel, Journal of Physics: Conference Series 407
(2012)
Institut für Bioprozess- und Analysenmeßtechnik, Heilbad
Heiligenstadt, Germany Email: uwe.pliquett@iba-heiligenstadt.de
Abstract The AD5933 1, a specialized single chip impedance analyzer,
made by Analog Devices, is basically not intended for use with four
electrode interface. Due to electrochemical phenomena at the
electrodes connecting the material under test (MUT), especially in the
low frequency region below 100 kHz, a two electrode interface
generates considerable errors during the measurement. Thus, for most
application in bio-impedance measurement only a four electrode
interface can guarantee reliable results. Here we show how a four
electrode interface with galvanostatic excitation but also for
potentiostatic excitation can be realized by just a few external
components.
A similar arrangement is shown at http://www.instructables.com/id/Body-Composition-using-BIA/?ALLSTEPS
From the above instructables link |
H: 16 channels relay control with 3.3v pins
I'm going to buy two 16 channels relay boards from Sainsmart : http://www.sainsmart.com/16-channel-12v-relay-module-for-pic-arm-avr-dsp-arduino-msp430-ttl-logic.html
I want to control it with a SBC66EC (modtronix.com/sbc66ec.html?sef_rewrite=1¤cy=EUR) which has 32 3.3V I/O.
The relay board must be powered with an 12v alim. My question is : can i control the relay board with 3.3V GPIOs because of the Optocouplers of the relay board ? There is a lot of different theories on the web ... I'm a bit lost as i'm not specialized in electronic/electricity.
Here is the schematic of the relay board : https://www.dropbox.com/s/pm2p3q04sj65x5e/16ch%20schematic.pdf?dl=0
Thanks !
AI: Based in the schematic and pictures, that board is hardwired without the typical jumpers. Four sections. 12V in and a builtin 5V regulator. The 5V powers the optocoupler led side. It also powers the optocoupler transistor side and relay driver side. Finally the 12v powers the relay section.
Some different relay modules have a jumper that let's you disconnect the optocoupler led side from the transistor side, and then you could power that side from 3.3v instead. But the pictures and the schematic don't show that.
In this case, you can either cut a trace and inject 3.3v at the optocoupler, or use a transistor plus resistors for each input. As is, it will not work directly with a 3.3v gpio. |
H: Altium: PCB routing
I have several questions:
I'm not sure how to deal with grounds or Vcc when routing. So I have capacitors/resistors connected to the Vcc of the FPGA, so I connect it directly to the pin. But how do I make use of the planes? I know that planes are used for Vcc's and grounds routing but can't I just connect the pins directly together? how do I use the planes?
What's the recommended trace width for Vcc's and ground?
My PCB is single sided and I'm keeping it that way. Now sometimes I get stuck while routing components that don't have pads because I have to create vias to jump from one layer to the next and that sometimes occupy space with respect to the component location and the surrounding traces. I have also tried to re-orient the components in a way that it provides the easiest routing paths possible but sometimes I still get stuck. I don't know how to deal with this. Is there another way?
Sometimes after routing I move the routed component but the routing doesn't move along with it as I move the component. How do I enable that option?
AI: 1. VCC and GND routing
Best way to deal with the GND routing is using Polygon Pour. (Related question on this site.) In Tools \$\rightarrow\$ Polygon Pours \$\rightarrow\$ Polygon Manager click on Create New Polygon From... \$\rightarrow\$ Board Outline
You can prefrom this action on all layers one by one, but do not forget to connect these GND pours.
As for the VCC routing it is OK as you did on your second picture. If you want to use separate VCC plane you will have to use vias to make connection between the component plane and the VCC plane.
2. Trace widths
It is recommended to use wider traces when dealing with higher currents. There are a lot of online trace width calculators (like this and this) to determine the required trace width. (If these tools are too compicated for you, I was told to use min. 1 mm (80 mil) / 1 A as a rough rule of thumb but maybe it is a bit of exaggeration).
3. Routing using multiple layers
If you could not manage the routing without using vias you have to rearrange your components either to avoid the using of vias or to make enough space for them.
Below a part of my first PCB which I have routed manually. I used 7 vias to make the highlighted route. It was one of the last remaining route and it was quite crowded there but I could find a way to connect the pads. Some may say it is not a nice track, maybe it is not. But it is good for showing that sometimes you can find place for vias, especially when you do not want to spend another day to reroute the whole PCB.
You asked for another way, Auto-Routing could be one. I prefer routing manually and I recommend you to do as well, it is reliable I think. But I must say that it is an option too. Maybe it could do the whole routing for you, maybe just a small part and you have to finish/fix the rest manually.
4. Drag component with connected tracks
To enable this option go to PCB Editor - General page of the Preferences dialog (Tools \$\rightarrow\$ Preferences). And select Connected Tracks from the Comp Drag list.
After you set this you can drag and move componenets with the connected tracks by the Edit \$\rightarrow\$ Move \$\rightarrow\$ Drag command.
Note: when using this command and the Comp Drag mode is set to Connected Tracks, the rotate, flip and TAB key commands are unavailable. |
H: Can a PLL work with a sine signal as its XIN?
I need to generate a 150.012MHz signal. I am going to this with a PLL for RF purposes, so I am thinking to buy a 10Mhz osc with a sine output, will this work with all PLLs? as they are digital I'm not pretty sure. Or should I buy an square oscillator?
Thank you in advance.
AI: The FAQ @ https://www.silabs.com/Support%20Documents/TechnicalDocs/Si41xxFAQ.pdf
States that either a sine wave or a square wave is acceptable.
"Q: Should the reference source have a sine wave or a square wave output?
A: The reference source can have either a square wave or sine wave output. The reference amplifier has a large gain that converts the incoming sine wave to a square wave. Therefore, both sine and square wave references are processed identically."
From the data sheet the signal should be at least 0.5V p-p in amplitude and coupled with a 560pF capacitor.
kevin |
H: Calculating Fc (cutoff) of series to RC to ground on inverting input of non-inverting amplifier
Regarding the chosen answer for: How does this OP-AMP non-inverting amplifier work?
The following circuit is given, and it says that $$F_c = \frac{1}{2\pi R_1C_1}$$
simulate this circuit – Schematic created using CircuitLab
However, this doesn't seem right to me, even though I have found the same example and formula elsewhere on the web (e.g., "Non-inverting amplifier – alternative" at http://stompville.co.uk/?p=470).
To me it doesn't take into account the value of the op amp feedback resistor (\$R_2\$ in the sketch above).
Would the cut-off frequency not be based upon (\$R_1+R_2\$)? If not, why not?
My point is that the only way the capacitor can charge or discharge is through the output of the op-amp, so surely the feedback resistor is also critical?
AI: The cutoff frequency is the frequency at which the gain has fallen by -3dB over the gain at high frequencies.
(for the purposes of the below discussion, we'll ignore the high pass network R and C since the effects of R1/C1 are being examined)
If the signal was applied to C1 (rather than C1 being grounded) R2 would not matter at all- gain would be -R2/R1 for high frequencies. When the reactance of the C1 equals the resistance of R1 in magnitude you have a reduction in voltage of 1/sqrt(2) which is -3dB. R2 will determine the gain, but not the cutoff frequency.
However it's a bit more complex in this case, because the op-amp is being fed from the non-inverting input, and the gain is actually 1 + R2/R1 at high frequencies, so the frequency at which the gain is reduced by 1/sqrt(2) will actually depend on R2.
In an extreme case, if you short R2, it becomes a voltage follower and then Fc is limited only by the amplifier! |
H: Zedboard Linux Socket Application Error
After creating the linux boot image from the tutorial for the zedboard, I tried creating a socket application to talk to the computer. The Zedboard would be the server and the program in visual studio would be the client. When I try to run the program from the linux command prompt, it pops up with "error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory". When I ran a hello world program from the sd card on the Zedboard, it did not give me this error and worked just fine. Could this be a cause of the includes I am using? Both the client and server were written in C++.
AI: It's not the includes but the linker command line. If you have a dependency to libstdc++.so, then probably there is a -lstdc++ there.
First, you need to check if that library is really necessary, so remove that option from the link command. If you're still able to link the program, the problem is solved. If not, then you really need it and have to put it back.
In that case, you need to find out if there is some version of that .so in your system. In general, your program depends on the non-versioned name (libstdc++.so), and in your /lib or /usr/lib directory there are symbolic links that point to the actual version the system has (in your case apparently libstdc++.so.6). This may be another symbolic link to a more specific version (e.g. libstdc++.so.6.1) or the actual dynamic library. So you have to follow that trail and discover where it's broken, if the library does exist.
And if it does not, you have to install it somehow (usually with the package manager of your OS) |
H: Where can I find VHDL libraries? Is there a library for a PLL?
I heard in the following link that a V4 library about this topic exists, but I'm not able to find it anywere and to understand how to use it:
Look at the last reply at this link
AI: A continuous-time PLL (phase-locked loop) is an analog circuit and cannot be described in a purely digital hardware description language such as VHDL.
However, it is possible to construct a discrete-time approximation to a PLL by using an NCO (numerically-controlled oscillator, AKA "DDS", or direct digital synthesizer) as the oscillator block in a PLL. You also need a discrete-time implementation of a phase/frequency comparator.
I have done this on several projects with a great deal of success. However, the details of the design tend to be very application-specific, and I doubt that you'll find a complete, turn-key implementation in any library. |
H: Correct graph for induced E.M.F
Screen shot of the question is given below.
What I know
B field acting on the Ferris wheel is given below,
And induced E.M.F initially is zero , therefore I can neglect answer number one and two.
But how to proceed further. I am simply stuck .
AI: The EMF that will be induced in the crossbar will be proportional to the magnetic flux that is "cut" by the crossbar as it moves around the wheel. So to be able to answer the question we need to look at the rate that the flux is being cut at each instance around the wheel.
Probably the best way to think about this is looking at the wheel from the side and visualising the crossbar as a point that is moving around a circle, like the image you have added to the question.
Now to be able to find the rate at which the flux is being cut as it goes around the wheel it is important to understand that the only way that the flux can be cut is by the point on the circle (the crossbar) moving vertically, and that any movement in the horizontal direction does not cause any emf to be induced, due to no flux being cut.
You will be able to find this information by looking at the gradient at each point on the circle. Ultimately what you are doing is considering how much the point moves over an infinitesimally small distance (ds), considering the horizontal and vertical components separately (think gradient = dy/dx, it might even be helpful to think about the Pythagoras theorem)
ok so to explain this I have drawn the above image illustrating the crossbar at three particular points, and I will now explain each one separately.
A
Right at the top of the wheel/circle the gradient will be perfectly horizontal, so if the point on the circle moves the infinitesimally small distance (ds), all of that movement will be horizontally. This means that no flux will be cut and hence no emf will be induced.
B
if you then move further round the circle, say 45 degrees as shown here. The vertical component is no longer zero. Looking again at the infinitesimally small distance ds we can see this happen. in this case the point has moved an equal distance vertically and horizontally (that is dx = dy). This means that some flux will be cut and hence emf will be induced.
C
If we then move round to where the gradient will be perfectly vertical (at 90 degrees from the start) we get the complete opposite case of A, where all of the motion is part of the vertical component. So at this point more emf will be induced in comparison to B, as the value dy is larger, in fact the largest value it can be.
Now we can put this all together we can understand how the emf is going to change as it moves around the circle. We know that the vertical component increases as the point moves from 0 to 90 degrees, where at 90 degrees it will reach it maximum.
Im going to leave the rest of answering the question to you, I believe that what I have provided here should be enough for you to be able to answer the question yourself. |
H: Question about a phone wall adapter and it's current output
My phone charger (Male wall adapter to female USB) says it outputs 5V @ 2A on the back. I want to use it to plug a Male USB into.
I guess my question is; is that 2A always being output? Or is it a maximum of 2A?
I have a homemade project, that is simply 10 RGB LEDs with 5V going to the common anodes (parallel), and only the R and B are going to 200 ohm resistors going to ground to show purple light.
I tested this with the USB cable in my computer, but I want to make sure it's safe to use with this phone adapter before I plug it in. Thanks!
AI: Current is dependant on voltage.
If you have a small load it will draw a lot of current, if you have a large load it will draw small current.
The 5V @ 2A indicates that it's rated to handle up to 2A at 5V.
The other day I took an old phone wall charger (similar idea), made sure that the RGB LED's didn't go over their rated voltage and plugged it in!
If you think 5V is too much you can always add a resistor in series with your LED's.
Hope that helps!
Josh |
H: Help identifying ceramic disc capacitor
I have a blue ceramic disc capacitor and I'm trying to work out the values. On one side of the disc are the following characters, in approximately this pattern:
SHM
X 1400-
Y 1250-
E 222M
F
The other side has a bunch of logos and symbols which I can't make out. I imagine the capacitor is 22 nF, but I'm trying to work out the working voltage is.
AI: That is a South Hongming 2200pF E-grade Y5V X1(400V)/Y1(250V) safety capacitor. The symbols are the numerous safety certifications the capacitor has. |
H: Does resistance matter when charging devices
I've been searching all over the web and couldn't find a simple answer to my question. Partially because I'm no electrical engineer, so I really need a simple and direct answer.
My question is if you have a portable battery with the same output voltage as the input voltage on your device, does the amp matter?
A little more background. I'm trying to power a PAM8403. I was wondering if this battery can be used https://www.google.de/url?sa=t&source=web&rct=j&ei=YF2bVa28OsH8UIHKmJAL&url=http://www.adafruit.com/products/1566&ved=0CBwQFjAA&usg=AFQjCNF5zVB0SBjyOxSfughSyLLrkuZAVQ&sig2=t5OVPEnTbJfaZBYtfonXeQ
Would any portable batteries used to charge android phones work, for example?
Thanks a lot
AI: You're trying to match up a power source with a load.
The rated output voltage of the source has to match the input voltage that the load wants.
The rated output current of the source also matters, but it doesn't have to match the load current. It just has to meet or exceed the load requirement.
The source current (in Amps) has to be at least as much as what the load wants. If the source is rated to provide 2.0 Amps and the load only draws 1.7 Amps, that's OK. But if the load wants to draw 2.5 Amps out of a source that's only rated to provide 2.0 Amps, then the source won't be able to supply enough power, the source voltage will decrease, and the load won't work correctly (or maybe won't work at all). |
H: Is it feasible to synthesise sound with analog circuitry these days?
A friend of mine who is a layman in terms of electronics asked me to teach him how to synthesise audio with some analog circuit and how to build it. For some reason it has to be analog. Probably because that's so cool these days. I don't really get this.
The problem is that I'm not into discrete electronics either.
I concluded that there are many circuits that can produce oscillating signals and thus sound. The astable multivibrator came to my mind. However, for audio the signal cannot be just periodic. It is necessary to produce the desired shape like sine, triangle, rectangle, etc. without overtones (or at least as few as possible)
In theory for example, a simple \$RLC\$ circuit can produce a nice decaying waveform of a single frequency. But in the real world, a component is part of an electrical network that influences its behaviour.
The answer I gave was "Just use a microcontroller."
However, I received the the answer that programming is "very complicated". I have a feeling that behind this lies the fallacy that designing analog oscillators is an "easy task".
Am I on the right track that it doesn't make too much sense to create audio with analog circuits these days? I found this upvoted answer from Olin, which supports my reasoning. I don't want to be the downer and due to my own lack of experience I might be on the wrong track entirely. Maybe there are simple ways to create oscillators for audio synthesis with analog components?
AI: Yes, you can create complex waveforms without needing a microcontroller, by making use of the audio blocks such as oscillators and filters that are part of an audio synthesizer.
The document titled "How to Design and Build an Analog Synthesizer from Scratch" includes lots of schematics and theory for building these various audio blocks.
One of the comments has already mentioned a Moog synthesizer costing $35,000.
However Moog also sells many other synthesizer models in various price ranges, at the bottom end is a kit for $329 called the Werkstatt-01 which is shown below. But you don't have to buy one; you can download the schematic from their website, and use bits and pieces of their design. Combined with the document referenced earlier, you should have plenty of ideas. |
H: Can a high current trace be on outer and inner layers at the same time?
EDIT, COMMENTS:
TL;DR: Data doesn't conclusively suggest you can do this, but it seems to be worth trying.
The data from IPC-2152 (more in the answers below) is intriguing, but doesn't seem to conclusively say that what I'm proposing is possible. However, it does say that inner layer traces aren't thermally handicapped: in fact, it seems inner layer traces have lower thermal resistance than their outer layer counterparts (at least in still air).
Let's do a quick calculation to see how this would play out, using the following parameters
a common 1oz/0.5oz/0.5oz/1oz 4-layer stack-up
4 equally sized traces of a width that results in a 1 ohm trace resistance (large, yes, I know) for the outer layers and 2 ohms (since the copper thickness is half) on the inner layers.
A 10V potential across the traces
simulate this circuit – Schematic created using CircuitLab
In this case, we would see 10A on the outer layers and 5A on the inner layers. Power dissipation is then I^2R, which is 100W (10A^2 * 1 Ohm) in the outer traces and 50W (5A^2 * 2 Ohms) on the inner traces.
Given that we know the thermal conductivity of the inner traces is likely to be no worse than the outer layers, it looks like it's at least worth trying a 4-layer design, since the key worry (that the inner traces will run much hotter than the outer traces) doesn't seem to be a concern.
===================================
END EDIT
Original question:
I'm doing some high-current (40A continuous in worst case) traces on a 4-layer PCB, and I'm trying to get the space consumption down.
I've had success in the past with mirroring traces -- half of the trace goes on the top layer, and half goes on the bottom. For example, a 1" wide trace would become a 0.5" trace on the bottom and a 0.5" trace on the top.
But what about inner layers? On a 4-layer board, can I do the same across all 4 layers (e.g. 4x 0.25" traces, assuming all 4 layers are the same copper weight)?
My intuition says no -- the inner traces are much worse at shedding heat, so this may become a problem. But then again, copper has a positive temperature coefficient of resistivity, so perhaps these things balance to an equilibrium?
My question, in parts, is this:
Can I distribute power traces across outer and inner layers?
Has anyone done this and had luck/success?
Do the inner layer traces have to be thicker/thinner than the outer layer traces?
AI: My response is going to be the opposite to that of @NickAleeev.
I had similar questions in the past about trace current limits and here are my findings. I haven't done real world tests to confirm this (yet).
The standard for current capacity in a trace was established in a document (IPC-2221) which is what alot of online calculators use. The document is old and outdated. The new standard is the IPC-2152. The IPC-2221 is conservative, and if you can go that route it might be best too. If however, you are limited in space, then IPC-2152 would give you better results. Different calculators will give you different answers, depending on what standard they are basing it off. I have only found two calculators that use IPC-2152 and when I asked my fab house, they said that they can't tell me.
Also internal layers while they are sandwiched (in FR4) have a greater thermal conductivity than air. (The link below goes a bit more into it). They will dissipate the heat more to the surface, and if you have a solid plane between your internal layer and the outer layer, you have a pretty good sink for all that heat.
Have a look at a question I had asked in the past [what is the current limit through a trace? ] you can probably just jump to the end of the question and read the answer.
Some advice I got from this, was just build a dummy board, inject your current into a trace, and see how it reacts. All the, this table says this, that table says that, can't beat an experiment that you can test yourself. |
H: Output from amplifier is clipping
I have the following circuit and I want to process the output of the op-amp through an ADC. However, as you can see in the picture the signal is clipping at 1.89 Volts, rather than 3Volts. Why is it doing that? Does it have to do with the biasing of the amplifier?? The signal I applied was a 19 kHz sine wave.
Circuit diagram:
Output capture:
AI: You might need to look for rail to Rail op-amps if the output of op-amp is expected to be close to supply voltage.
Below spec is from datasheet of LM358 op-amp which tells that the difference can be upto 1.5 V from the VCC (3 V, in OP case)
Suggestion:
MCP6001 from Microchip. Datasheet here |
H: What happens to unused power in generators
I have a 7KVA generator which i use for multi-purpose. Some times i run AC on it and some times not. Will the generator consume less fuel when i utilize less power generated from it?
Thanks
AI: Yes and it will consume more fuel when you load it.
There should be some mechanism/electronics in the generator which will keep the rpm (revolutions per minute) of the engine constant or to keep the voltage constant. If you load the generator more the rmp and or voltage will drop so the engine will be pushed harder to compensate.
If this was not so, where would the excess energy go ? It would be turned into heat which is very wasteful. |
H: How do I change the frequency of this Vibrato-Circuit?
I am currently looking at an old 60's Transistor Organ (Phillips Philicorda GM752 to be exact). It has an integrated Vibrato-Unit, although the only modifyable parameter of it is the depth (amplitude) of the Vibrato. My question is: Is there a way I can integrate some sort of potentionmeter into the circuit to change the frequency of the Vibrato?
The Service-Manual (which I've taken the schematics for the Vibrato from) is available here (It's written in German, but I can help translating if you have any questions)
AI: The BJT is a phase shift oscillator and uses the three caps marked C411 to C413 to generate 180 degrees phase shift to create sinewave oscillation. You could experiment with these to alter the frequency.
This isn't the actual part of the circuit that modulates the audio but, the output should feed the modulator (the real heart of the vibrato circuit).
If you wanted more control you could use the ubiquitous 8038: -
(source: circuitstoday.com)
It has sine, triangle and square outputs and you'll get a massive range of frequencies to use. Or maybe even consider the wien bridge oscillator. This one runs from a 5V supply: -
There's also application note 263 by TI - it's a good read and has some interesting sinewave circuits. |
H: Cut Off Frequency in three phase LC filter
Good afternoon all
My question is what will be the formula to calculate cut off frequency of attached LC filter.
Its a three phase LC filter.
\$(L1=L2=L3= 6.1 \mathrm{mH}) \;\mathrm{and} \;(C1=C2=C3=29\mathrm{uF}). \$
I know formula for single phase LC filter is \$\dfrac{1}{2 \pi \sqrt{LC}}\$.
What wondering same will apply to three phase system or its different. Please Help.
Also what is doffrence between cut off frequency and resonance frequency.
AI: If I were you I'd simulate this circuit in LTSpice to see the exact relationship between filtering frequency and inductors and capacitors in this low pass filter.
See this graph for cut-off frequency and resonant frequency.
The blue curve is for a Q of 0.7071 and at the normalized frequency, the response is 3dB down compared to the value at much lower frequencies. As Q increases to 1 a small resonant peak develops at about 0.8 x normalized frequency. As Q rises higher there becomes a peak at the normalized frequency and the cut-off frequency - now the 3dB response has shifted to a slightly higher frequency.
This response is typical of an LC low pass filter and controlling what could be a massive peak is very important in 3 phase inverters. You need to ensure that the normal running frequency produced (50Hz or 60Hz) does not correspond with any peaks as shown above or the thing will rapidly get very warm and blow fuses or catch fire. |
H: Confusion around a components pins
I'm looking to use a RBO40 reverse battery & over voltage protection. I was unable to find the RBO40-40T (with 3 pins) anywhere so had to get RBO40-40G, which is slightly different, it has the middle GND pin cut and the data sheet says this goes to the TAB instead.
I'm not really up on this chip packaging, how am I meant to connect this GND when the TAB is a flat metal surface on the back of the chip?
Data sheet is here
Thanks
AI: The middle pin that is cut and the TAB are both shorted to GND. When you are placing the part on PCB create a PCB footprint for the flat surface and connect the pad to ground. This is also used to dissipate heat. The part you have is a SMT part.
If you are soldering wires, solder the GND wire to the flat TAB. You will find \$D^2PAK\$ package in the attach image below. Like the TO-220 package \$D^2PAK\$ is mostly used in power products.
If you look at page 5 and page 9 of the datasheet you will see more infomation about the package.
References:
D2PAK Outline Dimensions
TO-220 Package |
H: How to select proper capacitors and capacitance for LM78xx voltage regulators?
I want to use LM78xx voltage regulators for various projects. I want to know in general, how should I choose a correct value for input and output capacitors of LM78xx family when I want to change DC to DC (without a need to think about the reservoir cap in AC to DC applications)?
I have done a quick research and I found that various vendors and people recommend different values:
C1(uF)
C2(uF)
Fairchild
0.33
0.1
KEC
0.33
0.1
National
0.22
0.1
Texas
0.33
0.1
ST
0.33
0.1
MCC
0.33
0.1
Web1
10.0
1.0
Web2
100
10.0
Web3
100
0.1
Web4
10.0
10
What are the consequences of choosing large input and output capacitors?
I have seen some people say too big a capacitor on output has detrimental effect on transient response. But how and when?
I have also seen that people say too big an input is not able to damp oscillation if high frequency impedance of cap being too high. But What if I use a big (3300uf) low or ultra low ESR electrolyte parallel to a metalized film capacitor like 473j100? Isn't the metalized film capacitor with ultra low ESR taking care of high frequency oscillation? While the big 3300uf cap providing a reservoir?
If it is ok to use more than 100nf for output caps, and 330nf for input caps do you you think adding several low ESR metalized disk caps in parallel which lowers the ESR value further is going to make it more robust against high frequency oscillation? Assuming I don't mind wasting several bucks for caps!
I have heard that Low Dropout regulators are sensitive to too low or too high ESR. Is LM78xx considered an LDO? I think it is not. But I have seen some websites are listing them as LDOs.
Please bear in mind that I don't mind about the high losses, heat problems and other sort of problems. I only want to know about the caps value.
I'd be thankful if you could elaborate on these questions as much as you could.
Thank you in advance.
AI: Within reason, too large is not a problem. Also usually this kind of regulator will actually work fine with no capacitors (advertised as such on some datasheets) under some conditions, but I don't recommend it (maybe if you're just powering an LED). Other parts (eg. LM7905, many LDOs) are about guaranteed to oscillate without the proper output cap. Most commercial designs will use a somewhat higher values than the datasheet example (not really 'recommended') because there is no cost penalty and 0.33uF is not very common. I don't think I've ever seen the 330nF outside of hobby/internet hacks. Similarly 1uF is perhaps more common on the output these days- there is little cost penalty and it's a bit better. On the other hand, these parts are mostly used at relatively low current these days because switching parts are better suited once you get into the hundreds of mA or higher, so 0.1uF has as much effect as 1uF at much higher current.
Too big a capacitor on the output might affect startup because the regulator can only supply ~1.5A to charge the capacitor, otherwise larger is somewhat better all other things being equal. If the ESR is larger a large output cap may not be that much help. Low ESR is not a problem. A 1uF ceramic (or 0.1uF) works well and is almost free. Here's a plot of output Z vs frequency- at a few hundred kHz the output cap starts to have an effect. Below that, no capacitor is typically as good!
The 3300uF is probably there as a mains filter, not anything to do with the regulator directly. If the input voltage drops too low the regulator cannot regulate so the input reservoir capacitor has to be adequate for the lowest input mains voltage, highest load and end of life capacitance value. The input ripple also gets passed to the output to some degree (-54 to -80dB - see datasheet). For the regulator's stability purposes, a small ceramic or electrolytic capacitor close to the regulator (within a couple cm) is fine. A 47uF/50V 105°C electrolytic for through hole or another 1uF ceramic works fine. If the input voltage gets too close to the point where it drops out then performance will tend to suffer even before it drops out of regulation- 3V is good.
Low ESR on the output caps does not make the regulator more immune to HF oscillation. It will generally improve the transient response to high frequency load changes. It's not unusual to have several uF of low-ESR ceramic caps distributed around a board near various chips. Several dollars? $2.61 will buy 1,000 0.1uF 10V X5R capacitors at Digikey if you don't mind compact 0402 parts.
Yes, both some negative and most LDO regulators are sensitive to ESR range- too high or too low and some will or may oscillate under some conditions. The LM780x is not an LDO regulator- it's actually quite difficult to convince it to oscillate. The LM790x, despite the similar name and the fact it's not an LDO is very easy to make oscillate (mostly because the output is taken from the collector of an NPN transistor rather than the emitter of a PNP as it would be if it was a true complementary part). |
H: Parallel TRIACs driving same load
I am designing a series of heaters. One of them, actually, is designed for 220V and uses two resistors on series to achieve the power desired. The total current is, on peak, almost 20A. To keep the compatibility with others machines, and based on a lot of other things, the TRIAC which will drive the load will be the BT139-600E. But the maximum current its allow it's 16A.
To solve this problem I have two possibilities. First of them is to separate both resistors(doubling the effective value) and drive them on parallel (each resistor on a different TRIAC, which will limit the current on each to rough 10A).
Another possibility is to keep the connection of resistor as it has been done and put the TRIACs on parallel nor the resistors. In this scheme two TRIACs will drive the same load.
The point is:
If I use two TRIACs on parallel to drive the same load, will the system keep the currents drained by each balanced? On other words, have the TRIACs almost the same impedance at conduction? Are there any other disadvantages of the second solution compared with the first?
AI: No you should not attempt to parallel triacs as they will not share the load evenly.
As temperature increases the hotter one will hog more current so even if they were perfectly matched to begin with they won't play nicely during operation. |
H: Why is input offset voltage so bad? (op amps)
Take a typical application of an op amp - a photo amplifier:
In the circuit above, since input offset voltage is a dc characteristic, it is modeled as a dc source near the inverting pin of the op amp. This representation of offset voltage is also traditionally seen in many other noise analyses of op amps.
the output voltage V of the op amp as a function of the current i is, by KVL, KCL, and the two golden op amp rules, is
$$V = V_\text{os} + Ri$$
Which is very similar to the equation we'd get with an ideal op amp:
$$V = Ri$$
So, why not just measure the current by letting Vos be the reference voltage in our voltmeter? How about other easy ways to calibrate-out the effect of the offset voltage? Wouldn't those ways be much cheaper than buying a high-quality op amp?
A good answer would include a way to more accurately characterize the negative impact of offset voltage on a typical op amp circuit.
AI: why not just measure the current by letting Vos be the reference voltage in our voltmeter?
It's not really clear what you mean by this, but Vos is entirely internal to the op-amp, and it might be a combination of different errors in different stages of the amplifier. We only model it with a voltage source in series with the input. But there's no one physical place you could put a multimeter probe to measure it.
How about other easy ways to calibrate-out the effect of the offset voltage?
Usually you can calibrate it out, for example by measuring the amplifier response to 2 or 3 different fixed input voltages.
One problem, though, is that an op-amp with high Vos is also likely to have a higher drift in Vos with temperature.
Wouldn't those ways be much cheaper than buying a high-quality op amp?
Calibration requires additional test operations in manufacturing. These might require additional operator handling. That adds significantly to manufacturing cost. If you need to calibrate over temperature, it could add dollars (not pennies) to your manufacturing cost.
Then the calibration data needs to be stored in the device somehow, and retrieved to apply the calibration to each measurement. For some (many) products that's no extra cost, but for others it might mean adding an EEPROM and uC that weren't needed before.
If there's an error in the calibration process, or the stored data is corrupted, you get field returns, which are costly. |
H: Why is only MOV allowed for surge suppression according to IEC 60950-1
IEC 60950-1 prescribes that if a surge suppressor is used in a primary circuit it "shall be a VDR". The document informs that a VDR is sometimes referred to as a "varistor or a metal oxide varistor (MOV)".
It further explicitly states that "gas discharge tubes, carbon blocks or semiconductor devices with non-linear voltage/current characteristics" are not allowed.
Why is this? From what I've read, I'd much rather use a high voltage TVS diode. MOV's seem to have a finite life when subjected to transients.
Edit: As was helpfully pointed out by Spehro, the word is Prescribe, not Proscribe as I initially wrote :-).
AI: It prescribes VDRs, and proscribes the other stuff.
Speculation here- maybe VDRs, of the approved persuasion, are guaranteed to die a peaceful smouldering black death. Approved TVS parts are probably nonexistent and gas discharge tubes tend to arc (well they're supposed to). |
H: Circuit to solve algebra problem?
I am trying to get the hang of op amps and have a few questions about circuits that solve algebra problems. I would like to solve two problems where \$X\$ is an input voltage and \$Y\$ is an output voltage. The two (independent) equations are:
$$Y=X/10+11$$
$$Y=X^2$$
For the first, I think the answer would be to start off with a buffer of the input, use a resistor voltage divider from the buffer output and the run the result through a summing amplifier that adds 11.
For the second, I think it would be to run the input through an integrator circuit to get \$X^2/2\$ and then put that through a non inverting amp with a gain of 2.
The input would be between 0 and 5 volts for both of these.
Do op amps solve problems this way? No present access to a Sim or breadboard but can try this out at a later time.
AI: Yes, you could do something like that. The 'answer' (second case) would only be present for an instant since the integration with respect to time would continue, and you'd have to have a way to reset the capacitor (initial condition) and grab that voltage after exactly x seconds.
You could do it statically with log and antilog amplifiers (using the logarithmic property of transistors plus op-amps).
\$\frac{x^2}{2}\$ = 0.5\$e^{2 log_e(x)}\$
Easier said (or written) than done, and has 'interesting' complications if x is negative, zero or even very small.
Or use a multiplier chip (expensive).
Even at MHz you can do this digitally, so that tends to be the way people roll these days. |
H: Crystal PCB track
This is my current PCB crystal set up. The crystal run at 16 Mhz. Any thoughts/comment?
Links:
MCU - Datasheet
TI PCB guideline Tiva C - Here
AI: My comment would be, What is your total trace Length, it is looking maybe a bit long? From the PCB Guideline:
3.7.2 Crystal Oscillator Circuit Layout
The key layout objectives should be to minimize both the loop area of the oscillator signals and the overall trace length. A poor oscillator layout can result in unreliable or inaccurate oscillator operation and can also be a noise source. Ideal trace length is less than 0.25 in or 6 mm. Do not exceed 0.75 in or 18 mm. |
H: Unidentifiable cable socket
Hi looking for a manufacture part ID which matches the socket in the pictures attached.
Measurements are:-
inner black plastic diameter 12.5 mm
outer metal case 14 mm
metal screw nut (for connecting to the plug) 16 mm
It is a 3 pin connector with '1 2 3' written on the inner black plastic to identify the pins.
There are screw attachments for fixing each of the parts together. One is located under the metal screw nut. The other two are located to hold the cable grip together.
I have identified it to be a circular cable connector with an P68 SGS rating.
AI: Here is a link to this connector on newark. According to them, the manufacturer is pro-signal and the part number is PSG01589. However, it seems that they are not the only manufacturers. |
H: Is circuit design based on min/max values good practice?
Time and again I am arguing with a colleague of mine about the question above. When I design a circuit for mass production (> 10k/a) I want to make it robust against every possible variation of component parameters that I know about. This means for example:
BJT parameters like VBE, current gain etc. vs. bias and temperature
Tolerances, temperature dependences, aging and soldering drift of passives
Lifetime of components
Furthermore I consider any violation of absolute maximum ratings under normal operation conditions as unacceptable.
As I understand my colleague he just deems it a useless business to care about parasitics and the like. Just put it all together and try if it works, that's it. Put some pieces into the heat chamber, age them and if they still work afterwards you're done. He has more experience in designing commercial electronics than I do, but I really don't like such an approach. I am convinced that as an engineer I should have thought about any part of a circuit before I build it up for the first time.
Is my approach just sick perfectionism or has it something reasonable? I have already discovered that a lot of electronic designers don't care about robust design...
AI: Engineering is not only about creating robust designs, but is about creating a design that meets some specifications. Usually young designers don't fully understand that economic factors are part of the specification. The problem is that sometimes those economic factors are not well specified (that's often a management's fault), but a good designer is somewhat expected to consider also non-strictly-technical aspects in his designs, such as:
BOM-related costs: who cares if 1% of the units fail in the field if it is more economical to ship a new one to the customer instead of making all of them more reliable!
Time to market: who cares if the units are more reliable if our competitors ship their things one month in advance!
Planned obsolescence: (sad, and not environmentally friendly, but usually it goes like this): why should we want to ship units that can last for 20 years if we marketed them to be able to work for 5 (and we made a lower price point for that)?!?
etc.
All this depends on the field to which the design you are creating is targeted, of course. If you aim at a market where a single failure could cost lives (say a new defibrillator), you will apply more safety margins to your design (and you will be forced to do that, in some cases, by mandatory safety standards).
Stricter specs are good if, for example, you are designing a mission-critical board for a space probe for a ~1G$ mission to Pluto. In that case you really would want to foresee the unforeseeable and test for any darned little thing that can go wrong. But this is counterbalanced, economically, by the risk of being sued (or fired) by NASA because your crappy MCU code made all the mission go awry!
To recap, experienced successful designers know how to manage all these economic factors. Of course some of them are really smart and really understand all the delicate balances needed to bring a project to success (be it the new Apple iMostUselessMuchHypedphone or the best instruments for detecting bacteria on a comet). Some others, incredible but true, are just lucky and find the right niche where the "Does the prototype work after being mistreated a bit? Ok! Let's ship it!" mantra works well!
BTW, a good designer should always be wary of requirements he is given. Sometimes people giving you the specs don't really know what they want or need. Even the communication between the designer and the client (or the management) could be misleading. For example, if a client asks for a remotely-controllable barometric station that can work well during winter, it does matter if he is from Alaska or from Saudi Arabia! A good designer should work out the specs with the client, if he is in the position to do so, and a successful designer usually can ask the right questions to nail down the actual specs of the design to make the client happy.
I can understand that for some engineers it is compelling to work out all the details, especially for some passionate individuals that really love creating things that work well. It is not a fault in itself, but it is important to understand that the ability to make tradeoffs is part of engineering. With experience this ability will improve, especially if you work together with good senior designers.
You could also discover that you work for an employer with too low standards for your taste and this could push you to seek another job. But this should be done after you get a bit more experience and learn some tricks of the trade and make you more "appetizing" for a better employer. |
H: Understanding the CNY70 Reflective Optical Sensor
As far as I know, TM4C123 LaunchPad safely accepts voltages values up to 3.3V . I got a CNY70 reflective optical sensor and want to connect it to one of the analog input ports safely as in the attachment. (each of +5V comes from 5V AC to DC adapter)
The main problem is that I don't understand much from the CNY70's datasheet. (I couldn't find anything about the ON state resistance of the transistor, which could make things much easier for me)
Could you please explain what calculations should I do, or which figures should I check in the data sheet in order to calculate the X resistance value for safe operation.
P.S: Please keep in mind that, I'm quite a newbie in electronics
Thank you
AI: The transistor does not behave like a resistor. It's more like a current source until Vce drops to below a volt or so. The relevant curves from the datasheet (specified with a known reflectance) are below:
You have about 20mA going through the LED (a bit much for my liking), so the typical CTR is about 5% (Figure 7). That means that a typical unit will pass about 1mA through the transistor. If your resistor X is high enough (more than 4K or so, typically) then the CTR will be much lower (Figure 8). The transistor will bottom out at 100mV or so. The voltage will be If * CTR/100 * Rx.
If your application does not have the 0.3mm spacing then Figure 11 comes into play- so the voltage will be If * CTR/100 * Rx * Icrel |
H: VHDL parallel execution of statements using variables
If a, b, c and d are variables, then this does not execute in parallel:
a := b;
c := a;
But what about the following:
a := b;
c := d;
Do these statements run concurrently or sequentially?
AI: When there is no dependance between two assignments in a VHDL process, as in your second example, the synthesiser can choose how to infer the logic from the code as long as the output is equivelent and meets the supplied constraints.
In practice the two statements will be executed in parallel as the synthesiser will work out that they are not connected and create separate logic to deal with the two assignments.
The best way I find to understand how the synthesiser is inferring logic from your VHDL code is to look at the schematics representation of the tool's output after the elaboration and synthesis steps for a simple design and tweak things to see how it changes. |
H: How to prevent or detect counterfeit parts from distributors and manufacturers?
I am brand new to EE/ECE. My understanding is that, with distributors, you do pay a premium on the parts you order from them, but bundled with that premium is some kind of protection against counterfeit/non-functional parts. Whereas, with the manufacturers, you get what you pay for, and sometimes that means counterfeit or only semi-functional parts.
As a noob, this piques my interest in several ways:
What types of testing/QC do distributors do for you? Do distributors offer refunds or "we're sorry!"-type programs/services when they sell you bad parts, that manufacturers typically don't offer?
Are there any online consumer reports comparing/contrasting reviews for distributors and manufacturers? Sure would be nice to get 3rd party testimonials before I start working with a manufacturer/distributor...
What sort of recourse does one have if parts are found to be counterfeit or only semi-functional after some initial assembly/integration with other parts has already taken place?
AI: My experience is not exactly what you describe, distributors are there to deal with the small to medium customers that the factory does not want to directly service. For instance TI doesn't care much if you want to buy 1000 MSP430 chips, but digi-key might, or maybe even Arrow. So unless your volumes are large, or the factory is small you will not be buying direct from the factory, that choice has already been made for you :) If you were able to buy parts direct from the factory I would not expect a problem with counterfeit goods, just as I would not expect one from say an Arrow, Avnet, Future, Digi, Mouser, etc. Those are examples of large and franchised, or authorized distributors for various components. (I'm using factory the way buyers and distributors use it to mean the manufacturer such as a TI, or Samtec for example).
Someone may know otherwise but I've never had a distributor test parts for me, although I have had them program and test things like flash or MCUs. I suppose if I complained they would be able to charge me for such a service but I don't think that is routine. It's the factory's job to test their components before they ship them. As such if you have an issue the disti will point you back to the factory for such things. If you are a good customer, and you're angry, they may take the parts back directly and work it out with the factory themselves, but probably not.
I've never seen any online reports about distributors, they may exist. I tend to stick to people I know and I've worked with in the past such as the names I mention above. That said there are lots of smaller distributors around the world, and my only word of advice is if you suddenly find yourself getting a great deal compared to the other quotes you've received perhaps it's too good to be true :) Another thing is I prefer to try to foster a good relationship with the distributors I do use.
For the last question I'll break it in two. If you bought parts from a franchised or authorized distributor, and they turned out to be fake, that disti would have a lot of explaining to do. In that case I would expect and demand a full refund, and might even demand compensation for damages if it was serious enough. If you got them from another source, say a broker, an unlicensed distributor, another CM or god forbid ebay. You're pretty much screwed.
One of the things I've noticed lately is that large CMs are selling parts they're buying at a volume discount out the back door through various brokers or agents. In fact there seem to be whole companies that have sprung up just to support this. I personally think that's a dangerous game to play if you're worried about quality and genuine product, but it does seem to be popular.
Now what if they don't work or half work after you've assembled them? Assuming you have bought authentic parts from an authorized disti or the factory then the factory should engage you to help do failure analysis. Now your mileage with this will vary depending on how good of a customer you are, and as a small guy you may spend some time talking to the disti's support team to make sure it really is a failed part. Once it's done most people will engage you because it's in their best interest to catch and understand any field failure.
A few notes on that process, one it takes forever, you may be better off analyzing it yourself at a lab and sending them results and samples of the failure. Two there can be a lot of finger pointing, the CM says it's the factory, the factory says it's the CM, or they both say it's your design or spec. So you have to stay on it to find the answer, and of course be open to the possibility that it is in fact your fault. Finally the level of support you get here will vary based on what factory/manufacturer you are dealing with, your relationship and volumes with them, and indeed the region you are in. So while I have seen for example linear tech jump at every problem I've ever uncovered and sent their way, I would hardly expect that kind of service for the $0.10 regulator I'm buying from an overseas off-brand. |
H: Having trouble implementing a 1Hz blinking light on a Spartan 6 FPGA
I currently have a Spartan-6 FPGA in a Digilent Nexus 3 board.
I am using Xilinx 14.6 Project Navigator to write the code and program the FPGA.
My code for the top (and only) module is the following:
21 module blinker(
22 input clk,
23 output reg led_state
24 );
25
26 reg [31:0] count;
27 wire count_max = 32'd50000000;
28
29 assign count_next = (count_next > count_max) ? 32'd00000000 : count + 32'd00000001;
30 assign led_next = (count == count_max) ? ~led_state : led_state;
31
32 always @(posedge clk)
33 begin
34 count <= count_next;
35 led_state <= led_next;
36 end
37
38 endmodule
According to the Nexus 3 reference manual, the board has a 100MHz Oscillator at pin V10, and so in my User Constraints File, I mapped the V10 pin to the clk input signal of my module.
Since the oscillator is at 100MHz, I set count_max to be 50,000,000, so that the led_state should invert every 50 x 10^6 clk edges, or every half-second assuming 100MHz.
When I attempted Synthesis using XST in the Project Navigator, I get these warning messages:
WARNING:HDLCompiler:413 - "C:\Users\Public\Documents\Xilinx Projects\blinker\blinker.v" Line 29: Result of 32-bit expression is truncated to fit in 1-bit target.
WARNING:Xst:2404 - FFs/Latches <count<31:1>> (without init value) have a constant value of 0 in block <blinker>.
WARNING:Xst:2170 - Unit blinker : the following signal(s) form a combinatorial loop: n0011<0>.
However, I am still able to go ahead and build the .bit file and program the Nexus 3. The result, however, is that the LED, which I designated to by the output, simply stayed on the entire time (unless it is blinking so rapidly that I do not notice it blinking).
I thought that maybe it has to do with the Warning where the Synthesizer truncated the expression in Line 29, so I tried declaring count_next as a 32-bit vector [31:0], both as a reg and a wire, and also initializing its value. Tried the Synthesizer and I get errors instead.
Declaring and initializing count, led_state, count_next, led_next didn't work either.
I was wondering if someone can look at this and tell me what's wrong with the code. There's also a combinatorial loop for the signal "n0011<0>" which I don't recognize.
AI: The problem I see is you have declared count_max as a 1 bit wide wire and then assign a 32bit constant to it - this will essentially get truncated to 1 bit.
This will then mean you are doing additions and comparisons between 32 bit and 1 bit values on line 29, thus you get the issue of it saying truncated 32bit down to 1bit.
Then by extension your calculations optimise away to a single 1bit value (essentially it boils down to if >0, set to 0, else add 1) which will only ever be 0 or 1 and hence why your count[31:1] (notice not the LSB, bit 0) are unchanged in the always construct - because you assign them to always 0.
Also declaring count_next specifically would help - you assign to a non-existent wire, so it creates one for you. In some tools e.g. modelsim, this would be an error, in others at least a warning. The simplest way to do it would be to replace assign count_next with wire [31:0] count_next.
Finally as Brian points out quite rightly in the comments, your conditional is wrong. You use count_next as part of it's own assign statement which is plain bad. It is fine to do that with clocked registers, as there is no risk of creating a design which would oscillate at very high frequencies potentially causing damage to the FPGA. I believe what you meant is (count >= count_max). Notice I also changed to be >=, this is because your count includes zero - say count_max = 5, you would want your counter to go 0,1,2,3,4,0 - notice how there are 5 clock cycles taken to count from 0 to 4 and then go back to 0? |
H: Testing paradigms for consumer electronics
I am brand new to EE/ECE (my background is software) and I am curious about how real-world electronics testing takes place.
In software, there are many different types of tests that a piece of code should be run through to make sure it's of high quality and that it is functional/correct:
Code reviews (manual process)
Static analysis (basically automated tools that scan your code and tell you if it stinks or not)
Unit tests (small tests that are quick to run which test flow through a particular "path" in the code; essentially tests a single function/method)
Integration tests (test a particular unit of code integrating against some other unit of code, or, say, a mocked database)
Functional tests (an end user - either a human being or an automated process - actually using the software and checking for correctness at the top/system-level)
Performance tests (the software might be functional, but perhaps its slow or consumes too much memory, etc.)
Security tests (the software might be functional and fast/efficient, but perhaps its not secure and will be easily hacked)
Smoke tests (basically a subset of functional tests that can be used to make a quick go/no go decision as to whether the software is functioning correclty)
And many more!
I'm wondering what the testing equivalences are in EE-land, and what they look like. I would imagine that the unit testing counterpart would be testing all the individual parts/components (making sure the LEDs light up, that the motors spin, etc.). I would also imagine that the integration testing counterpart would be testing each individual subsystem assembly for correctness. But beyond that:
What different types of tests are typical in EE-land? How are they conducted?
What about non-functional tests? Like making sure the device works under particular humidity or temperature ranges, etc.?
Is functional testing performed on each final device, or is cherry picking/spot checking employed? If I have 10,000 units of a prroduct/device, I would imagine it would be timely/costly to conduct full bore tests on each one...
AI: I can answer this for my particular experience in ECE. Digital design, embedded design, and system design. Essentially we do all the same tests as software folks.
Design reviews
We have manual reviews of designs for digital implementations, PCBs, and analog circuits. Similar to code reviews. For embedded designs, the embedded code is reviewed similarly to software. For digital designs the HDL is evaluated the same way.
Static analysis
There is a lot of automated error checking for certain design processes. For the most part, they are the same but require a lot more design specific settings for the rules. Design rule checks (DRCs) for PCBs and design constraints for analog design come to mind.
Block tests
This probably most closely relates to unit tests. The electrical design is segmented into blocks for design and testing. The block has known inputs and corresponding desired outputs. A block test will confirm that this sub-set of the design is working properly.
System tests
The obvious next step from successful block tests are system tests, similar to integration testing. The blocks are connected in a logical sequence to ensure the entire design works as expected.
Functional tests
This would be analogous to user testing. Certain common uses are tested to ensure the sequence of use doesn't break the design.
Performance tests
Quite commonly we need to test whether the design is not drawing too much power or getting too hot through regular use. This is especially important in my field of implanted medical electronics.
Security tests
This may be a little less common. Hacking hardware is fairly common. The only test I have designed and performed here had to do with ensuring certain parts of the ROM in a MCU design could not be read externally. Otherwise things like adding that black resin over an ASIC is fairly good security to minimally protect designs.
Smoke tests
Also quite common. In fact, as you might have guessed, this test gets its name from hardware testing. Hardware can go up in smoke literally.
The final two are probably only applicable to hardware and don't have analogous testing done in software.
Environmental testing
For "non-functional" testing, we make sure the device works in the specified environment. Temperature is at least tested, humidity less often. There are lots of things in electronics with a temperature coefficient, we have to test in the range of specified use to make sure that coefficient isn't going to mess with performance or functionality.
Testing selection
This depends on the industry. For implanted medical devices we test every component as well as every completed device. For something like graphics cards, cherry picking of the final products is preferred. |
H: Confusion between register size, address size, data size
I started learning about pointers in C++ and I figured I should educate myself a bit on how memory works and is accessed. I read that when we say a processor is 64-bit, it has a 64-bit register and can access 2^64 address locations. I also read that it can fetch 64/8, so 8 bytes of data at a time, but the data bus is not the same thing as the register right? Do they need to be the same size or does that just happen to be the case usually? And is it the size of the register or the data bus size that determines what we refer to it as, such as 32/64-bit? Also is there a difference between register size and address size?
AI: When you refer to a 64-bit or a 32-bit it doesn't need to imply any register width or bus width alone. You can multiplex a bus such that it reads 64 bits in two reads or four reads etc. A CPU design can be as creative as the engineer behind the logic blocks. A good example is the 8086 with a 20 bit address space and a 16 bit data bus. The software that you write in C++ wraps on top of many layers of compilation and hardware state machines such that this is abstracted away. In RISC design you'll find that registers width and ALU width are almost always the same width, but in CISC design this does not need to be the case so much. |
H: What is the official name for these jumper wires?
What is the official name for the kind of prototyping wires seen at this link?
I noticed that on this thread the above kind of wire (with the "square" end) was referred to as a "jumper wire". Some other sources refer to the ones with a "round" end as either a jumper wire or a breadboard wire.
To make matters more confusing, the Wikipedia entry for Breadboard refers to the "round end" type as "jumper wire".
When buying these wires off some websites from Taiwan, I noticed that the sellers will sometimes refer to them as "杜邦頭跳線" (Dupont Header jumper wires). Googling for "Dupont header" does indeed show me the kind of pin header suited for the wire in question.
So is that its real name? A Dupont Header jumper wire?
AI: Dupont is a manufacturer of plastic products, much like Tyvek or Molex. The name has become synonymous with 0.1" 2.57mm headers, especially with jumper cables like these. As far as I can tell Dupont doesn't make these headers themselves.
This is similar to Molex being used to refer to computer 4 pin power connectors used for 3.5" drives, just because Molex does manufacturer them.
The real name of any part is whatever the community has de facto decided to call them. The real technical name is 0.1" Square Header on 22 awg Breakaway Ribbon Cable (with male to male or male to female or female to female or whatever as appropriate). |
H: Alber E-Motion M12 power assist: materials required to convert NiMH rechargeable 24V/6Ah circuit (20 C-cell) to Li-Ion rechargeable circuit
Below is a picture of a battery shell for a NiMH circuit for a power assist wheelchair battery. I'm taking a guess that each of the 20 batteries is 1.2V because the entire circuit is 24V. These are rechargeable.
I'd like to convert this circuit to the same voltage (24V) and same capacity (3Ah).
First, is this possible given the space you see in this wheelchair battery shell, and the circuit board in the pictures?
Second, what are the material requirements to be able to convert this circuit from NiMH to Li-Ion and the type of charger as well? What materials will I need to solder/weld the materials together, etc.. for the actual labor? I'm an electrical novice, so please ask me more questions (as comments) and I'll do my best to answer.
Note: right click image and open in a new window to make it larger!
AI: Li-ion batteries put out 3.7V per cell, while NiMH generate 1.2V. So, 20 cells at 1.2 V generate 24V. With Li-ion you will need 24/3.7 = 6.5(!) cells. This is somewhat difficult to solve... Maybe the chair can accept 7 cells? That would be the equivalent of 25.9V - a bit much, though 8% might be acceptable.
If you have the space to fit more cells - maybe the same quantity as before (20 cells), you could include a switching converter to lower the voltage to the original 24V, and make better use of the space, and have more capacity.
The pack would then have 20*3.7 = 74V, which should be convertible to 24V. But you would need to look for a charger which works at 74V which probably would not be so easy to find commercially. There are plenty of circuits for chargers around. Don't skimp - find a good circuit to avoid overheating problems!
You could also think about two sets of 7 in parallel - or 3 if you can fit the extra cell. You will have 21 cells total. More info on paralleling packs is available here.
The BQ2013H IC on the board is a controller which is for high-discharge battery packs, but is only for NiCd, NiMH or lead acid packs. It doesn't seem to support Li-Ion packs. So there is some work to be done there.
I looked up equivalents for Li-Ion, and Texas Instruments has a new one (bq34x100) which shows promise. You'll still have to redesign the board though. |
H: Is there an audio amplifier chip or circuit that amplifies certain amplitudes in a signal less or more than other amplitudes?
Like for instance, that would amplify on an exponential curve where the lower amplitudes get the maximum amplification and the highest amplitudes would get no amplification?
Is there an analog chip or circuit that could do this or is it something that would need to be done with DSP?
AI: This sounds like an audio compressor.
An Audio compressor is a device that passes a low-level signal unchanged but begins to reduce gain when the audio level rises above the threshold value.
The amount of gain reduction is expressed as a ratio: a 2:1 slope allows the output signal to increase by only by 1 dB for every 2 dB increase of input level.
When the slope approaches 10:1 or more, the compressor functions more like a limiter.
There are a lot of nuances with compressors and limiters. Slope, how the compressor behaves at the threshold point (easy-over or not).
dbx corporation used to make some of the best analog compressors on the market. The core technology has been spun off into a new company called "THAT Corporation". THAT Corporation. In my humble opinion, they make some of the best audio components available on the planet.
I've used analog compressors and limiters from a number of manufacturers: the dbx units range from good to awesomely-good and the Drawmer units that I've used were even better. Drawmer
There is now a lot of digital implementations out there. Pretty much every digital console manufacturer has decent compressors and limiters all done in the digital domain.
I'm an old-school audio person and haven't spent all that much time on various digital consoles. But they all seem pretty good: Yamaha, DigiDesign, Digico, Calrec. |
H: ATtiny861A: ADC reference voltage should be 1 Volt under AVcc?
I just faced with that ATtiny861A datasheet forcing me to use analog reference voltage to be at least 1 Volt under analog supply voltage:
Let me doubt this datasheet statement for two reasons:
ADC should (and will as I tested) work with reverence voltage equal to Vcc (this is one of the reference options available through ADC control registers).
The same table for ATmega48A shows more reasonable ADC reference voltage range: from 1.0V to AVcc:
Actually I used to believe to the info stated into datasheet. But this time I need to call this statement to question as I NEED reference voltage to be almost 5V (or at least 4.096V which in turn also out of range).
Of course one of the possibility would be to put the schematic to the real world test. But: a) if it will work under test condition it could not work under different circumstances like high temperature or slightly lower/higher Vcc b) this will take significant time for my case.
Can anyone put some words to confirm my doubts or maybe I should contact Atmel support to clarify this point?
AI: Let me start by "Small chip die has specifications X and large die from same company has better specifications" is not an argument for any manufacturer. Of course the larger, more expensive die will have better stuff in many dimensions.
But, are you using bipolar or single ended channels? The page you are looking on is the limitation for bipolar channels, possibly due to some internal stage.
Two pages higher, it says for single ended channels "Aref External = 2.0V to AVcc".
Whether an internal reference track has a certain option is also not a valid argument, as you do not know all the paths internally on the chip itself. So you cannot just say "If I have it switch over internally it can do this, but externally it can't, that's bullshit, I will just do it externally", because internally it may also switch over some stages, that work better, but need to be hard-related to VCC to be able to do that. It may not be likely, but it is possible.
So if you do try it with bipolar channels and nowhere else you can find a limitation to their use that also implies a lower Vref and this is something you want to produce more than one of, then you should still at least test it to further limits than it will ever go in the real world.
For example if you make it for -20deg C to +50 deg C, it needs to be verified to work correctly for extended periods of -25deg C to +60 deg C. As such also with main incoming supply voltage. If the board is designed for 11V to 13V, it needs testing for 10V to 15V, or some such. And not just for a minute, but at the very, very least for the better part of a day at each extreme and possibly several points in between.
And for proper testing, you should test each parameter with each possible setting for each other parameter. I.e. 10V to 15V in 1V or 0.5V increments, half a day each at every temperature between -25 and +60 at 5 degree increments, in the example above.
And that needs to be done with several randomly picked items from each production run.
EDIT:
Doing tests like that with slightly less rigour would be wise, even if you stay inside the datasheet's parameters for all parts. But then you can probably stick to "Test all voltages for a couple of minutes at a temperature below zero, one above room temp and at room temp". Unless it is a very critical part, of course. |
H: NMOS and PMOS current sources
I'm really confused with the representation of PMOS device shown in the figure. Since conventional current direction in PMOS is from source to drain, shouldn't the current source be pointing upwards(from node Y to VDD)?
AI: Simplest way to remember current direction is by the little arrow indicator on the transistor, for NMOS it is pointing out of the drain thus current flows from source to drain.
And for PMOS the arrow is into the source, so flows from source to drain.
It is important to remember that the source is indicated by the arrow location. So in the case drawn, NMOS source is on the bottom and PMOS source is on the top. |
H: 2.4GHz antenna feed routed through pcb via?
I'm working on designing a BLE device, and have settled on using a chip antenna. It seems, however, that my BLE SoC is going to have to be on the underside of the board, which might be significantly more shielded?
If that is the case, is it possible to route the antenna feed through a via in the PCB in order to have the chip antenna in a less shielded position, without adversely affecting the RF characteristics?
The PCB itself is going to be sat 4mm down in what is effectively a 15mm deep aluminium tin with no top.
AI: There are many similar questions here, such as Should there be more clearance on RF vias with microstrip?, and Calculating Signal Loss (dB) Through Vias, and How to minimize characteristic impedance mismatches caused by vias?
Essentially, they all say to either calculate the effects by hand, or try a 3D EM field solver to simulate the physical performance. OpenEMS & Octave are free for Linux, and are very powerful. |
H: Implementing a safety lockout through ladder logic
The family fireworks show has become my soon-to-be brother in law's and my "thing" over the last couple of years. We have some ideas to make the show better next year, my part is spinning up some automation hardware.
SW1 will serve as a master power switch for the entire system. The digital parts of the system will pull their power from right after SW1. SW2 is the ARM/FIRE switch. I do not want SW1 to close and power the circuit unless SW2 is open.
simulate this circuit – Schematic created using CircuitLab
It's been a long time since I've done ladder logic. This was my first thought. It satisfies my requirement of not powering on unless SW2 is open. The problem is, flipping SW2 from ARM to FIRE will shut down everything. Adding a transistor driven from a spare GPIO pin would solve that problem. I don't particularly like this solution because it puts something safety critical in the hands of software, and safety critical software is not what I do. What do I need to change to make this work with switches and relays?
simulate this circuit
AI: Something like this should work, it is just a simple seal-in circuit, which can only supply logic power if SW1 is closed with SW2 Open. Then one contact on the relay closes around the enable contact of SW2, sealing it in. Releasing SW1 will release the seal in for the relay.
Note: Both SW1 and SW2 are shown in their normal 'Non-Active' state, and SW1 is assumed to be maintained. SW2 can be maintained or momentary as needed.
simulate this circuit – Schematic created using CircuitLab |
H: How would you jerry-rig an android phone for continuous autonomous operation?
I want to use an android phone as dash-cam with GPS tracking capabilities.
It is supposed to run 24 hours a day, 365 days a year.
If the phone / app hangs, the user cannot be expected to troubleshoot it. (This is the most important requirement). So I want to have a self recovery mechanism to recover from software glitches.
I am thinking of adding a MOSFET between the positive contact on battery and the corresponding pin on the phone. The MOSFET would be controlled by a micro-controller which acts as a watchdog. Additionally, the micro controller may also pull up/down the POWER-ON pin on the phone to turn on the phone.
I am concerned that the device's life could shorten due to exposure to higher than normal levels of heat and vibration. But apart from that I don't see any reason for this to not work.
Has anyone tried doing something like this before? What are some mistakes one can avoid?
AI: One thing I'd be careful not to underestimate is how hot the inside of a car can get. I've done some previous design work on GPS systems that were typically mounted under the passenger seat of a car and during summer 40 - 45 °C days the internal temperature sensor would often read around 80 °C and stay there for a significant amount of the day.
That exceeds the maximum recommended discharge / discharge temperatures of Li-Ion batteries and while many phones might be OK with it I've owned phones that won't work without a battery present presumably because they rely on it to meet short peak current demands. If parts of the battery protection circuit cut-out under high temperature it might cause problems, of course hard to know with a consumer device where you won't be privy to the exact design so you'd really need to test that side of things.
Another issue you may have is determining when the device needs a hard power reset. Software lock-ups using a watchdog are easy enough but for example my Nexus 5 seems to lose a data connection every month or two and seems to need a reboot. In normal use I can determine whether I'd expect a data connection in the location and manually restart when convenient, but doing it automatically you might end up in a situation where you're restarting often when the only real problem is the lack of signal or other connectivity issue.
In general I'd say the idea is plausible but while the upside is having very low up-front development costs the downside to using COTS consumer devices is you'll need some extensive testing to see how it performs under a variety of conditions and try a few different devices. For temperature related tests a regular oven / temperature probe does the job pretty well but for some other aspects there won't really be an alternative to long-term testing of multiple devices.
Of course another disadvantage is that software / hardware engineering changes in new revisions of the phone in the future may cause changes in performance that you don't have control over. |
H: are sensing power supplies and switching power supplies the same thing?
What is the difference between sensing power supplies and switching power supplies? Are they the same thing?
AI: "Sensing" power supplies are generally referred to as "remote sensing power supplies" and are used to good advantage when the load is some distance away from the supply.
The way the advantage works is that a separate pair of wires is brought back from across the load to the supply, and circuitry in the supply adjusts the supply's output voltage to that voltage required to overcome the resistance of the primary wiring to the load and keep the load voltage constant.
The connection is called a "Kelvin connection" and the sense wiring can be very small diameter since it's only carrying a very low current, the sensing circuitry being a highish impedance.
So, to answer your question, it's possible for a switching supply and a linear supply to both be [remote] sensing supplies, although a switching supply and a linear supply are quite different beasties otherwise. |
H: Making LM78xx fail safe against short, open, reverese bias, flyback, etc
I want to use LM78xx for various applications. What I am concerned about is its failure modes.
1. Failure to Short
Not shorting Vcc to ground!! I mean shorting V_input to V_output.
Assume that you have a delicate and expensive piece of electronic equipment that works with 5V. You are using LM7805 to reduce voltage from 12~13VDC to 5VDC. For some reasons your LM7805 fails to short and your delicate electronic device sees the 12VDC instead of 5VDC and fries. I have seen this all around the web. How to protect against this?
2. Failure to Open
It is not as critical as the failure to short. It can happen as a result of over temperature (temporary) or permanent failure. What are the other things that can trigger this?
3. Reverse Bias & Reverse Discharge
I have seen that too big an output cap can cause reverse current going back to input. It is recommended to add reverse discharge diode protection. What else can cause this kind of reverse bias voltage?
From Various datasheets:
With the LM7805, the output capacitor should not exceed 1mf, as larger
values could damage the 7805 due to backfeeding of current when power
is switched off.
When a surge voltage exceeding maximum rating is applied to the input
terminal or when a voltage in excess of the input terminal voltage is
applied to the output terminal, the circuit may be destroyed.
4. Flyback
Does the diode on the above picture also protect against flyback current of an inductor? Or is it better to add a separate diode across the inductance load?
5. What else?
What are the other possible causes of LM78xx failure?
AI: Failure to short- crowbar + fused input (a thyristor and trigger circuit) or at least a TVS. The TVS might be able to limit the voltage to something like 8V which your delicate equipment might have a fighting chance of surviving (newer chips with 5.5V abs max supply may not live). An open GND connection will cause the output voltage to rise so make sure the soldering is solid.
Failure to open- bad solder connections, destroyed chip. Don't depend on the thermal protection as a matter of course.
D1 is unnecessary for a 7805 or 7806, only for higher voltage regulators (and only where the input voltage can be actively discharged). It provides another possible path for failure to short, so I suggest leaving it out unless there is some way the output can (say) get connected to a 12V battery and you don't have a TVS or crowbar on the output.
The power supply does not care about load inductance- the inductance will only tend to make the current continue to flow in the same direction. Any flyback voltage appears across the switch so you need a flyback diode to be placed across the switch or the load.
You might want to put a reverse-biased diode across the output in case two supplies are connected in series and one is driven negative. If you use a unipolar TVS that can serve both functions with a single part.
TL;DR: Put a polyswitch fuse in series with the input (before the capacitor) and add a TVS to the output, and lose D1 (if 7805/6). For extra points mount the polyswitch close to the regulator so it sees the heat. |
H: Of what real, practical use is electronics certification?
I am brand new to EE/ECE and am aware that companies such as UL offer a gammit of services such as:
Circuit verification (they verify your schematic does what its supposed to do and doesn't have any design smell to it)
Circuit testing (they verify the functional correctness of your circuit/electronic system)
Circuit certification (not sure how this really differs from testing, but the end result is that you get to put their fancy "certified" logo on your product)
I completely understand the value of the first two: verification gives you confidence from a 2nd set of eyes that your design is valid. Testing gives you confidence that you are in fact ready for production (or at least prototyping). But the certification service is what has me baffled. As a consumer, it would never naturally occur to me to check some new stereo, MP3 player, or remote control helicopter for a "UL" logo prior to using it. You guys might, but then again, you're EE/ECE peoples :-)
So is the certification just for establishing trust/confidence in the product? Does it have implications with regulatory bodies or insurance carriers? If so, what bodies/carriers/policies? Are there "electronics insurance carriers" that specialize in selling "Electronics Liability" policies to electronics suppliers, and perhaps they only sell the policies for "certified" products? Of what real-world, practical use is the certification?
AI: UL listing is most common in consumer goods, and appliances in particular. The reality is the consumer doesn't really care whether or not a product is listed. The people that care are the retailers and insurance companies.
Consider a Wun Hung Lo toaster with so many corners cut in design and manufacture, it's a circle. Walmart buys a shipping container at $1 per piece, and sells them for $4.99, until someone's house gets burnt down by the shoddy design and assembly. Walmart gets sued. The alternative is doing the same thing with a UL listed design. The UL listed design is insanely unlikely to burn down someone's house because it's been tested torture tested to standards to prove it won't. Retailers are glad to carry such products and insurance companies willing to insure the manufacturers because the risk is much lower.
That's not to say the UL label is a guarantee of safety. There are a lot of products coming out of China with fake certifications, including UL and CE. Just look at some tear downs of fake Apple chargers. They're criminally dangerous, but marked just like the genuine products. Only trust the marking if it comes from an authorized distributor. |
H: Running an LED blinking program on cc2530
I am trying to use the following code for blinking LED on CC2530, it would be great if someone could tell me what I am doing wrong? I know this is basic stuff but I cannot figure out what I am doing wrong! The LED is mapped to port 0 and 7th pin (06).
I am using IAR to debug the program, when I run it in steps, LED do toggle! but when I run it without stopping, LED just glows, I thought it might be because of delay being miniscule, but no matter what value of delay I use, it just glows without blinking.
#define LED1_MASK 0x40
#define LED1_PIN P0_6
int main()
{
P0SEL &= ~(LED1_MASK);
P0DIR |= (LED1_MASK);
while(1)
{
//clock_delay(10000); // i tried running empty for loops and NOP for loop too.
LED1_PIN = 1;
for(int i = 0; i< 1000; i++)
{
for(int j = 0; j< 1000; j++)
{
ASM(nop);
}
LED1_PIN = 0;
}
EDIT: This is the actual program I am running, I made a mistake while pasting before (wasn't changing value of LED_PIN in the code). I am sorry for the trouble.
AI: Based on my vast experience, I think you are not blinking the LED. Change second LED1_PIN = 1; toLED1_PIN = 0; and wait for some time.
Edit: The waiting time after the LED has turned off is so less to perceive it as off by the human eye. As @peter pointed, the delay can be made equal and huge between both turn on and turn off code segments. Congrats
! You got your code working. |
H: Make 5v 3A dc power supply
i want to make 5v dc supply so that i can run 3 dc motors in parallel having spec 5v each and max currrent rating 900ma.but i have transformer of 3amp step down transformer 220v to 12v to run lm7805 ic whose max load current is 1A. please tell required spec of capacitors and circuit. if not then tell what should i do my f=50hz and using 4 X ln4007 diodes for bridge rectifier
AI: You should:
not use 1N4007 diodes, these are for 1A only
not put diodes in parallel, one will take most of the current, they will not share the current evenly across the diodes.
use 1N540x diodes or a bridge rectifier that can handle 3 A
use a capacitor after the diodes to filter out the 50 Hz ripple, 2200 uF/25V should suffice
not use one LM7805 regulator, these are for 1A each
not use a linear regulator as you would be dissipating:
12 V - 5 V = 7 V at 3 x 0.9 A = 2.7 A => Total power dissipated
in a linear regulator = 7 V x 2.7 A = 18.9 W
Get a switched mode regulator, something like this module, it will dissipate significantly less power than a linear regulator. |
H: Placing covered vias routing signals under microcontroller termal pads
Placing covered vias routing signals under microcontroller termal pads is a good practic? I mean to reduce soldered termal pad area to center(connected with vias to gnd) and place covered(with soldermaks) signal vias in the inner corner of IC package.
AI: I would recommend against this, for at least two reasons:
The thickness of soldermask varies, but it averages about 0.5 mil (0.0127mm). This doesn't seem like much, but it will cause a gap underneath your thermal pad. You may need to open up your solder stencil aperture to make sure there is enough solder to make a solid connection.
Tented vias often are not fully encased in soldermask. I have a recent PCB where the soldermask "ran away" from the highest ridges of the tented vias. These conductive gaps would obviously cause problems under a thermal pad (or any other conductive material). |
H: what is the purpose of this device>
I have this device out of an old laptop, and I have no idea what it is. there is a tiny tag that says something about RFID, and it has 4 wires going in. There is a coil of some sort, but most of the PCB is covered by foam. The original placement was adjacent to the touch pad mouse, and there was a symbol there shown in this picture:
here is the device, removed:
and the other side:
The laptop was a Dell Latitude E6500. When I went to Dell's site, but I couldn’t figure out what the purpose of this device is. Can anyone illuminate me?
AI: As you rightly said that it has a tiny tag that says something about RFID. May be a contact-less smart card reader? You can you can login into your computer by both tapping a smart card to the icon and typing your password, offering added security.
Refer: User Manual (English), Table 22: Contactless Smart Card |
H: MOV characteristic
I am referring MOV characteristics attached as shown below:
As per it's characteristics,
"The conceptual sketch above shows the current I through an MOV is as a function of the voltage V across the MOV. Below the threshold voltage Vth, we see leakage current. Above Vth, the MOV switches to high conductance mode and the current increases significantly with only a small increase in voltage. (The incremental resistance in high conductance mode is the slope of the VI curve, or ΔV/ΔI"
As per above quote "Below the threshold voltage Vth, we see leakage current" Here, we can see in characteristics that leakage current shown and it's very close to zero.
But if we see voltage at this point, its also less till its reaches zero. At point its zero and voltage across MOV is zero. Since MOV is connected across load, at this point load is shorted and can harm our load.
Am I correct in my opinion ? How it maintains const. voltage to load when MOV is shorted for short instance?
Thank you.
AI: The MOV doesn't provide power to the circuit (that's why it's I-V curve is only in quadrants I and III of the graph). So if the voltage across it is 1 V or 3 V or 0 V, it's not because of the MOV, it's because of whatever power source (voltage source or current source) is being used to power the circuit.
At point its zero and voltage across MOV is zero. Since MOV is connected across load, at this point load is shorted and can harm our load.
If you drove the voltage across the MOV with a 0-V source, then you shorted out the load with that source, not with the MOV.
If you just connect the MOV across a load with no voltage source then the leakage current will allow any charge in the load to dissipate. This is the same as connecting a high-value resistor across the load. It's not likely to damage the load because the discharge current is going to be fairly small.
How it maintains const. voltage to load when MOV is shorted for short instance?
Say you applied a 9 V battery across the MOV (assuming you chose an appropriate MOV for a 9 V circuit) and some load. The MOV would only draw a small leakage current from the battery, allowing most of the battery's available current to supply the load. |
H: How would a device determine if it is imeresed in water
I recently bought a really cheap remote control boat. It only turns on when it is placed in water. I would like to know how it determines if it is placed in water. I could not find any sensors that detected fluid in the boat. How does a device know if it is in water and should turn on? How would it go about it?
The boat has 2 motors, each has 3 wires going to it. There is positive and negative terminals connected to the motors, and a third wire soldered directly to chassis of the engine.
AI: Water conduct the electrodes. Out of safety consideration, two electrode are usually placed on the bottom and near the propeller accordingly, to ensure motor turns on only when the boat is in the water. There may have two additional electrode, connected in parallel, on the top of the boat to deal with the case when boat is occasionally up side down.
http://www.zhangfei01035.com/index.php?m=item&a=index&id=3463
http://www.dianzivip.com/view/927/ |
H: generating sine pwm in orcad pspice
I am trying to design a PWM inverter in Orcad PSPICE where i am using a Vpulse source from library to generate MOSFET triggering pulses for H-bridge and it works fine for square waves.
But i if i want to generate sinusoidal pwm to drive the h-bridge how can i accomplish it in orcad pspice and drive the mosfets accordingly.
Previous method:
Desired PWM output in simulation
I figured out that sinusoidal pwm is generated by comparing a
sinusoidal wave with triangular wave.Is there any way we could
simulate sine pwm in orcad pspice and drive the h bridge accordingly
different switching topologies.?
I would appreciate any help or suggestions that will help me to
achieve my intended purpose of making prototype of sine wave pwm
generation like as mentioned above in picture using orcad pspice.
Thank You for your time :)
AI: Have you read this: http://homepages.which.net/~paul.hills/Circuits/PwmGenerators/PwmGenerators.html
Basically what you need is a comparator and a triangular shaped waveform. You feed the triangle to one input of the comparator and your sine wave to the other input. Then the output of the comparator will be the PWM signal you desire. |
H: LCR Meter Measurement
Good Morning All
I have a DC link Choke ( Common EI Core), When measuring through LCR meter It gives me reading (see table.). When Adding Inductor in Series ( Pic 3 and Pic 4) it Give the value that is not expected. I am referring formula to calculate inductor in series Leq=L1+L2+2Sqrt(L1*L2). Don't Know why LCR meter is showing different.
Value shown on image is measured form LCR meter. Measured on both 100Hz and 1Khz.
Pic1 :- Measure L1 Inductance using LCR
Pic2:- Measure L2 Inductance using LCR
Pic 3:- Measure Leq Inductance using LCR ( L1 and L2 in series and in phase )
Pic 4:- Measure Leq Inductance using LCR ( L1 and L2 in series and in out phase )
AI: Firstly, there is an error in the dot notation - scenario 4 provides the highest inductance yet the dot notation implies that if the two inductors were perfectly coupled, the net inductance would be 0. Because scenario 4 gives the highest value of inductance it can be concluded that it really has the dot notation of scenario 3.
Secondly, you have not considered that the two inductors may not be 100% coupled.
Next is to work out the coupling and a bit of math in my head tells me it's about 70%. Individually each winding has about 600 uH and in series aiding this rises to about 1800uH. If the two windings were 100% coupled they would produce a total inductance of 2400uH when connected in series.
So if 70% of each winding is perfectly coupled then the total inductance is: -
(4 x 0.7 x 600 uH) + (2 x 0.3 x 600 uH) = 2040 uH. OK my head-guess was a little optimistic
on coupling. 50% coupling realizes an aiding inductance of 1800 uH.
When put series opposing, 50% of the coupled inductance totally cancels leaving a net inductance of about 2 x 300 uH.
Near enough.
EDIT to explain my math
The standard formula for coupled inductors is: -
\$L_{EQ} = L_1 + L_2 + 2k\sqrt{L_1L_2}\$ and, when both inductors are the same value this results in: -
\$L_{EQ} = L + L + 2kL\$ and, when k=1 (100% coupling), equals 4L
If a fraction (70%) of L1 is 100% coupled to L2, the fraction produces an inductance of 0.7 X 4 L.
The remaining uncoupled parts of L1 and L2 do not interact and are just additive i.e. (1-0.7) X 2 L.
Hope this makes sense. |
H: Replace Transistor with Mosfet?
I am using a circuit to drive high voltage display tubes (170V DC, 3mA).
Currently, the tubes get switched by an arduino. The output pin is hooked up to a MMBT42 transistor and a 10kOhm base resistor.
I want to use a PCB, with 80 of those lamps. So I need at least 80 transistors and 80 resistors, which is is a lot of work to solder the parts.
Now I wonder, if I could replace the resistor/transistor with this mosfet because the mosfet does not need a resistor.
This BSS131 is a logic-level Mosfet, according to the datasheet.
Would this suit for my application?
AI: You haven't said what voltage you're driving the gate from, but this should work fine. If you take a look at figure 5, you can see the maximum current the FET can conduct at different gate drive levels; at 3.3v gate drive it can conduct just under 200mA.
Note, however, that unless you can guarantee that your gate will never be floating, you should include a pulldown resistor to ground on the gate. Otherwise, when the gate is floating - for instance, because the MCU it's connected to isn't initialized yet - it can take on any value, and may turn on or off unexpectedly. |
H: Can I use a transistor to switch to battery backup power when main power goes out?
I am putting together a circuitry, and I want the circuit to continue running even after main power goes out. So I was thinking about this idea of using a PNP transistor and a one-way diode to possibly wire up a 9V battery backup. My idea looks like this:
Basically: When the main power goes out: The PNP transistor (Q1) loses power on the base line: Making it close the emitter. So the battery is now connected to the circuit. While Q1 and Q2 closes, Q3 opens so that GND is closed of to make sure the electricity flows back into the cathode of the battery.
When power is restored: Q1 and Q2 opens to isolate the battery, and Q3 closes back up to connect GND again.
I have also connected a Capacitor (C1) to prevent a bigger fluctuation during the switch-over.
The problem is is that I am not very familiar with electricity, so I am a little terrified to plug this thing in and break something. Is there anything I need to be aware of, or will this not work as I expect it to at all? And when I plug the power source back in: Is there a danger it will overload, or damage the battery during transition?
AI: Yes, you should be aware of several things, and no, it will not work as you intend.
Let's start with step one: A transistor, NPN or PNP, used as a switch should always have a base resistor. If you're using simple types, stick to 510 Ohm or more. In many cases 5kOhm or 10kOhm will do fine. Because the bipolar transistor is a current amplifier and it wants to keep its base at a fixed voltage (about 0.7V away from emitter for simple types, up to 4V for darlingtons and other "specials"), so any voltage you apply will cause current to flow into the base and if that is not limited by a resistor: Poof! Transistor dead.
(An answer I wrote to design an on/off circuit using transistors, it skips a few important characteristics of transistors, but for your first experiments with NPN and PNP transistors as switches, if you have the time, you may find it interesting)
Step two is: Your 5V will always be 4V below the 9V, so with the extra resistor you have actually made an emitter follower that sort of "demands" a certain current to flow through dictated by the battery voltage and the resistor. How that works exactly is something for another time, as I expect that to become way too complex right now (more complex than the link there ^^).
Step three is: You don't need that many NPN transistors. You might need one to prevent the battery from powering something else on the 5V rail, but if your circuit is as tollerant as the LED you drew, that can be fixed differently. Current from a battery will always flow back into the battery. Current only ever goes in loops, it cannot just wander off into the world. As I said, it may "loop through other parts", but it cannot just meander off into the world through just the VCC or the GND.
The last step is:
EDIT: Assuming you want the 9V directly as backup, that is. Which you probably don't judging by the comments and their progression. 9V will kill an arduino and no fixed resistor will help you there. See below for further edited updates
simulate this circuit – Schematic created using CircuitLab
D1 prevents current from the back-up battery to flow into the main power or the other devices, but does lower the voltage for the LED a little. If you use a 1N4148 (maximum current = 100mA, keep that in mind!) it will cost about 0.7V. You can also use a Schottky diode, that usually costs between 0.15V to 0.4V depending on the type you pick and at what effective current.
It should not leak too much, so don't pick a 100A diode, or the reverse leakage could turn off your battery and cause some high-frequency oscillations. (Just assume that as a fact for now).
Now, if the Main Supply now falls off, the current into the base of Q3 will decrease to a point that Q3 turns off. Q3 was on while Main Power was there and that caused it to pull down the base of Q2, in turn turning it off. With Q2 turned off the base of Q1 was pulled high by R7, so that was off too.
If now Q3 is turned off, the Q2 will suddenly get current into its base through R4 (make sure R4 is powered by the battery, so before Q1!). This turns on Q2, which then pulls the base of Q1 low, pulling current out of that base, allowing Q1 to turn on. You then have backup power.
The balance between R5 and R6 will have some influence on when the battery will turn on, if you need it to turn on sooner because you see the LED turning off, you need to increase R5 or decrease R6. If you need it to turn on later, increase R6 or decrease R5. Try to keep R5 and R6 between 1k and 100k if at all possible.
D2 is just there as an extra protection. It should in normal cases not be needed, but because bipolar transistors can act very strangely if the battery gets shorted or reversed, it's smart to add it anyway. Better safe than sorry.
Of course, R4 will cause there to be a leakage current of 90μA at all times while the Main Power is on (because Q3 shorts that resistor to ground when the Main Power is on). If you need that leakage to be much lower further tricks are needed, but with a standard 9V alkaline, I'm betting that 90μA will not make the biggest difference on its lifespan.
EDIT: Solution as suggested in the comments, now knowing that you are powering an Arduino:
simulate this circuit
As long as the battery voltage is lower than the main power and the diodes are of the same type, you will normally be drain 99.9999% (0.0001% for leakage from the batteries) of your power from the Main Power. When the Main Power falls away you get 100% from the batteries with no delay at all, since the diodes will cross over smoothly from one source to the next.
When your batteries are at 4V-ish (not really empty yet, but it'll take some time before they get there) the supply may fall below 3.3V that the arduino likes.
If you then use Schottky diodes with a 0.1V forward voltage that'll take much longer.
You could also use a 5V fixed voltage regulator after a 9V battery, but you should then find one with a low quiescent current and all that, the 3x AA option, in all cases, is simply the easiest. Especially if you need only small amounts of back-up power and can afford to check and change the batteries regularly as should be the case with a door lock. |
H: I2S interface using LPC2138
In my application, I am using LPC2138 controller and TI's TLV320DAC3100 DAC with built in amplifier to interface audio data.
To implement I2S interface using SPI, some extra hardware circuitry needed which I found from below link:
http://www.ti.com/lit/an/slaa449a/slaa449a.pdf
From above application note, I am able to get following hardware for SPI - I2S interface.
And 5 bit counter is implemented as follows:
My question is above note is specifically for MSP430F Texas controller and I need to interface with NXP LPC2138 controller.
In that case,Is this design logically correct for interfacing I2S on SPI bus? Or LPC associated hardware will differ for such implementation.
Thank you.
AI: Oh, be careful with the NXP SPI controllers. I can only tell from experience with the LPC1768 but it seems that at least one of the two SPI peripherals are identical.
As said, there are two SPI controllers in your chip. I can't tell much about the first one (the ordinary SPI controller without FIFO). It may just work for your task, but - no FIFO, so very high CPU load.
The second one, called SPI1/SSP, is tricky because it demands that the chip-select line goes high between each transfer word for at least one clock cycle. This makes it impossible to transfer a continuous bit-stream without gaps. You will not be able to directly interface I2S in SPI mode.
You can however configure the SPI1/SSP in TI SSI mode. In this mode the chip-select line becomes a frame syncronization signal that stays low most of the time but pulses high on each least significant bit. The transfer will be continuous without single bit gaps so it interfaces nicely with your I2C codec.
You may be able to derive the I2S Word-Select signal from this using a single divider flip-flop. Deriving directly from clock like you suggested would work just as well.
I suggest that you take a look at figure 26 in the user manual UM10120: |
H: Thermal pads under IC, how to place vias without soldermask / Decoupling question
I'm looking for a good solution on how to design a thermal pad that is good for solderpaste assembly.
PCB fab that I'm using can't place any soldermask on vias like in this example:
And I'm not practic to design this pads. As I read on some documentations this vias, with solder on them, can suck solder creating problem on IC fixing and possible solder short circuits.
I tought about placing vias on the corner and with a solder stencil place solder only on the inside of thermal pad. But I don't know if it's good.
Can someone advice me a good method?
Also, I've an additional question not really related to this. I've read about decoupling (Decoupling caps, PCB layout) that every ground local plane should have only one spot to main ground plane, but in this case we have a lot of them, it can create problems?
AI: TI recommends using solder-mask-defined thermal pads without solder mask around the thermal vias. Solder going though the holes and causing voids (not shorts) is said to not be a problem if the via hole diameter is kept to 0.3mm or less. Spacing of 1mm is suggested, and of course the vias should not have thermal reliefs.
Putting vias just in the corners would degrade the thermal performance.
If cost is no object, some fabs can plug the thermal via holes with copper.
If the pad is actually used to carry significant current then the usual considerations apply, you can split the plane or do other things to control current flow, but it is not usually necessary, especially on a mostly digital board. You really can consider all the thermal vias a single connection to the ground plane for most practical purposes- an exception might be if you had some insanely sensitive amplifier very close to the thermal pad so that it caused voltage gradients in the ground plane- but that would be bad layout practice to have such things too close to each other and without some kind of isolation moat etc. |
H: Gain of filter is higher than calculated - why?
I have this circuit:
simulate this circuit – Schematic created using CircuitLab
The op-amp is being run off 15 and -15V supply rails, and I am using a signal generator to input a sine wave of different frequencies with an amplitude of 2V, then using an oscilloscope to record the output wave. I am using this data to calculate the gain of the filter at different frequencies.
For this project I am required to produce a table of predicted values for the gain of the filter. I produced this table and my maximum gain was about 1.5. In practice, I had a maximum gain of almost 2. My question is, why is the gain higher in practice than in theory? I thought that it could be other impedances in the wires, but I reasoned that that shouldn't affect the gain since the impedance of both the feedback loop and the input would increase equally.
I calculated the gain using the capacitive reactance formula as well as the formulae for resistances in parallel and in series. For example, the expected gain at 2100Hz:
\$R_f = \frac{(2 \pi * 150*10^{-12}*2100)^{-1} * 68000}{68000 + (2 \pi * 150*10^{-12}*2100)^{-1}}\$
\$R_{in} = 33000+((2 \pi * 21000 * 10*10^{-9})^{-1})\$
\$Gain = -\frac{R_f}{R_{in}} \approx -1.5\$
Why is my theoretical result significantly different from the practical result?
AI: The transfer function is
$$H(s)=\frac{-sR_1C_2}{1+s(R_1C_1+R_2C_2)+s^2R_1R_2C_1C_2}$$
and the maximum gain is
$$A_{\text{max}}=\frac{R_1C_2}{R_1C_1+R_2C_2}=2.04$$ |
H: fpga clock muxing
We are using an fpga with limited resources, the IGLOO Nano, so to implement all our functionality, we need to share a FIFO between two different vhdl components, which are using different clocks.
The functionality is as shown below:
DATA(SCLK) -->|------| |----------|
| MUX |------------->|DATA |
DATA (CLK) -->|------| | |
| FIFO |
SCLK ---->|------| | |
| MUX |------------->|WCLK |
CLK ---->|------| |----------|
SCLK=27MHz and CLK=13.5MHz are not related.
DATA is either synchronous with the SCLK or CLK, depending on which is selected in the MUX.
The synthesizer tool shows a warning: While analyzing gated clock network, ambiguities have been found on gates
My problem is that DATA is not clocked correctly into the FIFO, and the post place and route simulation confirms this. The DATA is not correctly aligned with WCLK, when arriving at the FIFO input port.
How do I constrain a design like shown above, so data is always synchronous with the WCLK ?
EDIT: additional information, the MUX select pin does not change often.
AI: I would discourage you from trying to MUX the clocks like you show. You are already seeing that there are issues of trying to use gated clocks.
My suggestions -
Find a larger FPGA that is not so resource constrained for your design. There are a lot of good choices out there that are economical.
Find a way to combine your clock domains into one so that one common clock can drive the whole design.
Partition your design to be in two separate devices with each device supporting a single clock domain. |
H: Adding 90 ohm resistors to DIY USB cable?
I just started with electrics a few months ago, but now I am obsessed but still have MUCH to learn. What I am doing is essentially trial and error.
I needed a longer USB cable to a printer so I took a USB cable I had, cut it close to each end of it and then took the thickest 4 cables I could find and connected them to the USB connectors/ends. My idea was simply the thicker the better, the lower resistance the better. But it didn't work! The computer did not recognize the printer.
I read some more on USB and then I saw something about a need for 90 ohm impedance (imped... what?). Read some more and learned that impedance is sort of like AC resistance. After that I connected a 10 ohm resistor to D+ and a 20 ohm resistor to D- (not 90 ohm I know but that's all I had). Then I tested the cable again and it miraculously worked! I was quite confused that lower resistance is not always better in a cable.
My question is if my thinking is correct when I think that when measuring a DIY USB cable with a multimeter the resistance (sort of impedance) should be as close to 90 ohms as possible?
Some additional info added after asking
Cable length is about 2.5 meters (which is less than maximal 5
meters).
I measured with a multimeter before and after the adding of the resistors and + connected to +, - to -, D+ to D+, D- to D-, so I think the "wiring" is/was correct. It is not entirely unlikely that the connection was loose though and something fell out, but not that I noticed.
My extended cable works almost all the time except that sometimes when starting the printer then a USB network card connected to the same computer (as the printer) stops working/is disconnected, so I have to remove then reinsert the USB network card and it works again (so no permanent damage ;) ). And sometimes (after a long time of inactivity) it my computer looses connection to the printer (at least it doesn't print on command) and that is fixed by switching off the printer then switching it on again.
AI: USB cables are not simply "4 wires". They have certain properties that need to be met so that the data signals can travel through the cable. Your thick wires will not have the correct properties causing the data signals not to travel properly, instead they are suppressed and reflected resulting in the USB connection to fail. |
H: Build a solar panel nimh charger
Today I found this tutorial on how to build a battery/solar power supply for an arduino here. The tutorial explains on how to use NIMH or Lithium-Ion batteries for this. Step 4 explains how to use NiMh batteries which is what I prefer. The tutorial explains I have to connect the solar panel to the battery and to put a diode between the positive wire of the battery and the solar panel. Then the tutorial explains that you have to use a power booster to get the voltage up to 5 volts for the arduino.
Now the part which I don't understand. Where do I connect the power booster? It is not visible in the tutorial (only for the Lithium-Ion battery, which uses a differenf circuit). Do I connect it together with the solar panel to the battery? Wouldn't the battery be charged and discharged at the same time then? Could someone explain this to me?
AI: I would strongly suggest you do not use the NiMH set-up that this guy shows.
He assumes the diode to make voltages compatible, but with a 4V solar cell and an average diode at rated load you get 3.1V if the diode happens to be of the normal PN type and uses 0.9V at the measely 200mA he calculates. But most diodes at such low current will be hanging closer to the 0.7V mark.
0.7V drop would give 3.3V, which is 1.65V per cell peak, which is not good. Not to mention that at a lower current where they start to fill up, the diode voltage might lower and you'd get 3.5V total, making 1.75V per cell. Which is very extremely bad.
To add to that CC-CV charging a NiMH is not the best way to get the longest life span ever recorded in history. The best, still relatively easy, way is Delta-Peak, for which you need at least an op-amp and a couple of transistors.
The reason this is all of no interest to him, most likely, is that he uses LiIon and a special LiIon charger/conditioner board for power packs.
Although his LiIon set-up isn't great either. He assumes that no defect will ever occur in the solar power collection and that the battery will thus always be recharged, but if for some reason the power drain is more over time than the sun can re-supply over that same time (in the winter, for example) his booster will keep working till the LiIon cell is 0.9V. 0.9V for a Li-Ion means absolute death.
Glossing over all those details, assuming it would be a good idea to use the NiMHs as in that Instructable (which, really, really, really, it isn't), you put the booster in parallel with the battery, so that it can always convert the voltage at the battery into the 5V you need. It doesn't matter if the power comes from the battery or the solar cell, if the sun is shining a little, maybe half comes from the sun and half from the battery, if the sun is shining a lot, all the energy will come from the solar panel and the panel will charge the batteries back up as well. When it is night all the energy comes from the batteries.
Putting the booster, solar and (PROTECTED) batteries in parallel just ensures absolutely continuous power to the Arduino (as long as the batteries are still alive, which may be years, months or weeks as the case of these instructions may be).
A diode added to the solar cell may well be important if the protection circuit doesn't take care of that, standard use-outside-solar-cells will actually often drain current away from your battery if there's no sun when you don't add some form of "one-way traffic" like a diode. Just as a small after-thought. |
H: Ceiling speaker has 3 wires
I recently bought this ceiling speaker (http://www.3acctv.com/upload/uploads/Specification/T-103C.pdf), as shown in the PDF it has 3 wires attached to it. I am no expert in this, so I was wondering if someone could help explain the difference between the 3 wires.
I do understand the concept of +/- wires and how to connect them, the fact that this speaker has 3 wires baffles me though.
Thanks!
AI: As it says in the PDf as well:
With power tabs for 3W and 6W.
And:
"Black:Com Red:1.7KΩ White:3.3KΩ"
Or drawn, its equivalent resistances are:
simulate this circuit – Schematic created using CircuitLab
You connect Black & Red for 6W at 100V, Black & White for 3W at 100V. Do NOT use the other wire in either case. |
H: Voltage drops when a signal is fed into op-amp comparator
I have a function generator SFG-2110 from GW Instek. I set it to generate a square wave with max/min of aroudn +- 1 V. And I checked with an oscilloscope.
However, when I connected outputs of the function generator to an op-amp comparator with TL972IP from Texas Instrument, voltage significantly drops, even though I DID NOT make any change on the function generator.
I think there's something wrong with circuit impedance. But I've only heard about that and have no idea how to adjust impedance of a circuit.
Why does an oscilloscope show a different voltage from a signal generator? says some generators have High Z mode. But, I can't find such a thing on my one.
Currently, my circuit looks like:
simulate this circuit – Schematic created using CircuitLab
Will this problem be solved if I put a tiny resistor between (+) and (-) of the function generator?
If I am thinking wrong that impedance is a source of the problem, please point it out.
AI: That op-amp (although it's not shown on the 'functional block diagram') almost surely has a network that looks something similar to back-to-back diodes across the inputs.
Hence the absolute maximum input voltage of +/-1V.
Also, look at this:
Putting 0V on the input with respect to the Vcc- does not damage the op-amp but it causes a whole whack of current to flow out of the input terminal.
You need to respect the common mode range of the amplifier- it is rail-to-rail on the output, not on the input, and when you go outside the input CM range or apply significant differential voltage then substantial currents can flow.
This is why it's often better not to try to use an op-amp as a comparator. If you reduce the input voltage to a few hundred mV and offset it so that it's within the input CM range (or give it a small negative supply) it should work okay. Note that if you are applying -1V you need a negative supply Vcc- of perhaps 2.5V.
Even without the quirkiness of this particular amplifier this would trip you up- even with a comparator that allows input voltages down to ground (or possibly a bit below), you should not apply voltages less than Vcc-. In the case of this particular part, you should not exceed the supply voltages- you should not even get closer than about 1.5V.
As Scott says this information is in the datasheet explicitly here: |
H: High Power RGB Led control
We have got a 20W led ,RGB from a good seller in China.
I have a few questions regarding the led (see the attached image)
Is there a data sheet to this Leds? something generic ?
How can you know where are the RGB pins, and the voltage pins ?
I tried to understand how are the control lines are working, and i was thinking that like any other led strip the control lines are only connects the RGB lines to ground, with a high current N-CHANNEL FET .
The seller told me this :
R:14-17V G:21-24V B:21-24V
R:1150mA-1400mA G:800-950mA B:800-950mA
Is it means that the control lines are with these voltages ??
Please see the attached image.
thanks very much.
AI: Just poke around with a 30V power supply with a 1K resistor in series, as Starblue suggests and you'll quickly figure it out (I suggest the resistor because the output capacitor of even a current-limited power supply could damage the LEDs conceivably)
Probably 3 strings of series or series/parallel with a common. Whether it's common anode or cathode is unknown.
Chances are the top strip in your photo is the common, and the bottom left is red and the other two are green and blue (maybe not that order for green and blue).
simulate this circuit – Schematic created using CircuitLab
You need to limit the operating current into the LEDs to less than the smaller of the rated current and the maximum allowed by the power dissipation. As in the comments if you power this up at anywhere near the claimed 20W input power it will see perhaps 18W of heating and will expire in short order. |
H: How do I increase the signal to noise ratio in a true condenser microphone?
I made a simple condenser mic as a test project for something more functional. However, when I connect my microphone I only hear the mains hum. Using a factory-made condenser I hear the mains hum except I am also getting a decent signal. I know for a fact then that my laptop has some grounding issues (the metal case always shocks me). I want to know why my circuit does not provide any audio signal what so ever. Go easy on me please, I know my way around audio equipment, but building it is a totally new field for me. Here is the schematic (adapted from John Salmon's version on YouTube):
Note: The Al foil is conductive as well as the back plate. The capacitor, resistor and power supply are functional.
AI: Condenser microphones generate notoriously low output voltages. at 5 mm spacing your output voltage will be very very small.
It is as good as impossible to obtain good S/N ratios without:
Putting a low noise preamplifier in the mike itself. (Eg. a low-noise FET amplifier). Ever seen those old, large studio microphones? They had a special amplifier in the lower part.
Running the connection over a balanced feed (I.e. a shielded, twisted pair of conductors, with a transformer at each end) to avoid unbalanced coupling of AC fields.
I'm note sure what the + and - mean at the output, there's only AC at that point... Do connect the front (outer) plate to the shield. |
H: Automatically switching from battery to DC wall adapter on insertion
I have a project that runs off a 4S LIPO battery and I want to switch to 24V wall power when I plug in an DC wall adapter. I have two designs, an inexpensive one with discretes and one with an expensive LTC4412HV IC.
I simulated both and they seem to work fine. In terms of safety since the battery is a LIPO, is the discrete design okay? Is there anything I should add other than a fuse which I already have?
Edit: The reason I use a PFET instead of a schottky diode is because the diode consumes too much power and I want to maximize battery life.
AI: The discrete design exactly mirrors Microchip's AN1149, "Design A Load Sharing System Power Path Management with Microchip's Stand-Alone Li-Ion Battery Charger". The only difference is that your design does not include battery charging capability or multiple external inputs. |
H: ADC samples half frequency
I'm using a dsPIC33F (Microchip) to sample a 555-timer signal. I've tried square, triangular, and "sinusoidal" signal shapes, but always have the same problem: the ADC samples the waveform correctly, but the result is always half of the expected frequency.
For example, my input is 440Hz, and when I plot what the ADC writes to the buffer, I get:
Without the lines it is:
On the oscilloscope I read it as 440Hz. My sampling frequency is 8kHz (which I checked with the oscilloscope by toggling a pin), and as I change it, the sampled values change to reflect that, so I'm almost certain I'm using the correct timer to trigger the ADC. Since each point represents 1/8000 = 0.000125s, the above graphs show a waveform with a period of 36*.000125=0.0045, or 222Hz.
I feel like the conversion time should have no effect, as long as it's shorter than 0.000125s. I'm confident that it is, and have tried different conversion times with no change. I know it's not the most efficient way of doing things, but to start I also convert only one sample at a time before triggering an interrupt and writing to the buffer. I'm not sure if that would matter.
If anyone has any ideas, I'd be grateful.
AI: When you toggle a pin at a certain rate, the resulting waveform will have a frequency at half of the toggle rate. So if your output waveform was a 8kHz square wave, then your ADC sample rate is actually 16kHz, which explains the factor of 2 error. |
H: How Do I Set The Bitclock in a Make File for AVR?
I'm following Chapter 2 of Elliot Williams' book Make: AVR Programming. I'm on an iMac.
I get a success message in Terminal when I input:
avrdude -p m328 -c usbasp -v -B 10
So, I know that my programmer and micro controller are working.
(If I don't set the Bitclock to 10 then it throws an error.)
My problem is working with the Make file. When I try "make flash" I get an error message.
avr-gcc -Os -g -std=gnu99 -Wall -funsigned-char -funsigned-bitfields
-fpack-struct -fshort-enums -ffunction-sections -fdata-sections -DF_CPU=1000000UL -DBAUD=9600UL -I. -I../../AVR-Programming-Library -mmcu=atmega328 -c -o blinkLED.o blinkLED.c avr-gcc -Wl,-Map,blinkLED.map -Wl,--gc-sections -mmcu=atmega328 blinkLED.o ../../AVR-Programming-Library/USART.o -o blinkLED.elf avr-objcopy -j
.text -j .data -O ihex blinkLED.elf blinkLED.hex avrdude -c usbasp -p
atmega328 -U flash:w:blinkLED.hex
avrdude: error: programm enable: target doesn't answer. 1 avrdude:
initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
make: *** [flash] Error 1
I think that the problem is that the Bitclock isn't set in the Make file, and I'm not sure how to do so. (If I have some other error, please let me know. I'm guessing.) The Make file can be found on gitHub at:
blinkLED Make File
I have set the MCU = atmega328 (which is the micro controller that I'm using.)
AI: Modify the PROGRAMMER_ARGS assignment in the flash_usbasp rule to include the proper avrdude arguments.
flash_usbasp: PROGRAMMER_ARGS = ... |
H: Why Does the And Gate have Two Transistors on Top?
Wouldn't the left-side part of the diagram function as a nand gate without the two transistors at the beginning? Why are they part of the diagram? Because in the following picture of a nand gate, it's not an issue.
AI: If the upper two FETs weren't there, then when either A or B was low there'd be no path from the output to any driving potential. The output would be in the high-Z state rather than driving a high output.
If the gate isn't meant to be an "open-drain" type, it needs to be able to have a low impedance output for either a low of a high output value.
On your edits
The BJT circuit will also work (this type is generally called resistor-transistor logic or RTL), however,
It will consume more power because the resistor will consume power whenever the output is low.
It will not be able to provide as much high output current before the output voltage sags below the minimum \$V_{OH}\$.
The low-to-high transition will be slower because any load capacitance will have to be charged through the resistor.
The low-to-high and high-to-low transitions will be asymmetric (not the same slopes), which can cause issues in some applications.
If implemented in an IC, it may be costlier because resistors generally require more die area than transistors. |
H: What is a "button load cell"?
I just came across this little gadget called "button load cell", it seems to be a sensor that can measure weight but what exactly does it do? What is its intended application? I do not even have an idea about how to install it correctly(nipple facing upwards?).
This is the one I have by the way. I am not familiar with the terms used in the description page. I have no electrical engineering background and I did not do my physics in English.
Edit: I want to know the mechanics of this gadget(as in how it works). As far as my own study goes, it seems to be measuring the change of shape to derive applied force? But in the description it says Load cells are designed to measure a specific force, and ignore other forces being applied. which makes no sense to me.
Also I would like to know the real life application of this gadget. I can imagine using it in a scale but where else can it be useful?
AI: First to begin with - that's a force sensor, which is designed to (just like you suspected) measure weight. It's intended application is wiring it to amplifying circuit, and your measuring device. You apply force to the button (or nipple, as you named it) and calculate the result basing on a formula, you can find in the datasheet for your load cell. From what I've seen, the one you have is using this one:
Measured Value[kg] = 25 * Measured mV/V + Offset
Where offset value is calculated by measuring output of the cell sensor with no load applied to it, and using this formula:
Offset = 0 - 46.335 * Measured Output
You have to remember that you need to amplify the output of the sensor, page you linked hints to http://www.phidgets.com/products.php?product_id=1046 which takes care of amplifying and measurement.
You can read more here |
H: How would adjusting the bias on an op amp effect the signal?
I am using an op amp to boost an audio signal. The bias, it appears, is typically half of the input voltage. What kind of effect would it create if the bias was to be adjusted up or down? Would adjusting the voltage up cause it to clip sooner? What if it was adjusted downward?
AI: The bias is typically set at half the supply voltage (in solutions without bipolar power supplies) because that puts it the farthest from clipping against either rail. You can adjust it up or down if you want, but the closer it gets to one rail the smaller the permissible signal variation in that direction.
Since most audio signals are symmetrical, moving it in either direction away from the midpoint reduces the maximum signal amplitude. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.