text stringlengths 83 79.5k |
|---|
H: Power consumed by an LED in a simple circuit
I am in the very beginnings of studying circuits and am a little confused on calculated Power.
If I have a 9V Battery, 4 x 10k Resistors and a single LED, how would I calculate the power consumed by this LED?
I have measured current of the circuit and voltage measured at the LED anode/cathode.
If I am reading my book correctly, is it really as simple as P=V*I?
simulate this circuit – Schematic created using CircuitLab
AI: 9V Battery, 4 x 10k Resistors and a single LED, how would I calculate the power consumed by this LED?
You have to know the forward voltage of the LED. A typical number is somewhere between 1.5 and 3 V. Let's say it's 2 V.
Then there is 7 V across the 40 kOhm resistor, so the current flowing is 0.175 mA.
0.175 mA x 2 V is 0.35 mW.
(Note that typically the forward voltage is specified with 5 or 10 or 20 mA flowing. With only 0.2 mA, the actual forward voltage through a real device will be lower, and so the power will be lower. To get a more accurate estimate would require a more detailed model of the LED behavior)
is it really as simple as P=V*I?
Yes. |
H: What is the purpose of the 10K resistor that is connected across the input and the supply?
I was checking out some transistor amplifier circuits online when I came across this one.
Now my question is what is the use of 10 kilo-ohm resistor that is connected between the power and the input terminals? What happens is this particular resistor is removed? Please explain.
AI: It applies a bias current across the microphone. As the microphone is of the type that changes resistance in response to sound. Thus forming a voltage divider that is connected to the base of the transistor via the decoupling capacitor. |
H: Should I have had a resistor before my transistor?
I've recently started playing with an Arduino and learning about circuit's. I was trying to learn a bit about using some transistors as a switch and I think in the process I ended up ruining one of the pins on my Arduino. When set to HIGH the pin only outputs 0.5 now rather than the 4.6ish the rest of the pins do.
The circuit I built involved two transistors. One to control a 12v fan via a PWM signal off the Arduino and another to act as a switch for turning on/off an ATX power supply which I used to provide power for the fan.
Here's an approximation of the circuit. I'm not really sure how to properly diagram it.
simulate this circuit – Schematic created using CircuitLab
To try and explain a bit, The Arduino was powered via the USB connection to the computer. Pin 11 is setup as a PWM output to control the speed of the fan. Pin 12 is setup as a HIGH output to switch on an external ATX power supply when the Arduino board turns on. I use one of the 12v rails on the power supply to power the fan, and have it's ground connected to the Arduino's ground.
Not shown in the diagram is a simply push button to increase the speed of the fan and a 7-segment led display showing a number representing the speed. I don't think these are related to my pin problem and I'm fairly certain it was all wired up correctly.
After doing a little more research I think the main issue which caused my pin problems is I should have had a current limiting resistor in between the Arduino pin and the base of the transistor. Is conclusion accurate?
Any additional comments/criticisms welcome.
AI: Yes, your conclusion is correct. Just insert a 1K resistor in series with the base. But first try with a 10 K resistor and then keep on reducing it by 1K. For a more accurate value of the resistor, use this formula:
$$ R_{base} \approx {h_{FE}} \times \frac {V_{OH} - 0.7V} {I_{FAN}} $$
Where
hFE is the transistor's current gain,
IFAN the fan current as measured when connected to the 12VDC source and
VOH the microcontroller's output high level voltage. |
H: Differences between LM317, AMS1117 and L7805
I am trying get a 5V to power up AVR microcontroller. The power will be supplied either from 5V USB power adapter or from motorbike battery (about 11-13.7V).
I have one piece of both 7805 and LM317 voltage regulators, but I don't have any AMS1117. I would like to know the advantages and disadvantages of using any of these parts.
AI: They all work the same way. They limit the voltage to 5V and convert the rest to heat. While the LM317 can be adjusted to every voltage, the 7805 is fixed to 5V. If you need 5V then take the 7805 (less components needed).
Linear regulators (like the ones you suggested) are a poor choice if you want to be power efficient. In your case (11-13.7V) they will convert more than 50% of the energy to heat. Much more efficient are buck converters, but they are a little bit more complicated to handle, more expensive and produce more noise. |
H: Component keep-out on particular layer in Altium
I'm making a heat sink footprint for TO220 in Altium. I think route tracks under the heat sink is not a good idea. So I want to give the footprint a keep-out, but the keep-out region on Keep-Out layer applied to both top and bottom layer, though my heat sink sits on the top layer. So any methods to add a keep-out region only applied to the layer where the footprint sit on?
AI: Create a region on top layer and check the Keepout checkbox:
The traces on other layers are not affected: |
H: Is it good to route PCB tracks under a heatsink?
A heat sink is a piece of metal. If the solder mask on a PCB track is broken, it may be dangerous, right?
Below is a small heatsink for TO220, seen from bottom.
AI: A heat sink is a piece of metal. If the solder mask on a PCB track is
broken, it may be dangerous, right?
If in doubt, use an insulating spacer: -
For heatsinks like these: -
I use small fibre washers like these over the solderable legs: - |
H: Is 3D printing of PCBs possible?
I just saw this picture about PCB 3D printing on a website, can it work in real life?
It's would be so cool, if it could useful in the real life.
AI: It can work. I have recently seen an entire speaker built using a multimaterial 3D printer. In the future, it will certainly be possible to print 3D circuits and electromagnetic components (motors etc.) inside products without planning for any openings. A real breakthrough for applications which pay a lot of money for seals, for example. It may also replace the flex-rigid circuits which allow you to have PCBs with bends (to wrap a camera with PCBs for example).
However, nowadays parts made of multiple materials require either a 3D printer which automatically switches between materials (we are talking hundreds of thousands of dollars), or which stops and allows the material to be changed before proceeding with the rest of the part. Note that you cannot even use any material: although plastics and resins are dead-easy, and metals require different techniques (e.g. powder fusing using a laser) generally but can be done very reliably if you throw the money on the table, I am not aware of any proven method (other than very early prototypes) to print fiberglass or polyimide therefore your PCBs will have to be thicker than existing PCBs, will not handle temperature as well or will have a lower breakdown voltage (and therefore a higher creepage distance at high voltage) for example. On top of that, there is the plating to improve the mating of connectors and the soldering. You may not realise this, but existing laminates are very advanced, and use materials which are not ready for printing yet. It is not necessary in all industries and certainly not for domestic use, though.
Property of materials are one thing, and precision is another. The current process to build PCBs is EXTREMELY accurate. Even the cheap PCB houses out there can do tens of 12-18um layers, perfectly round vias of 0.1mm in diameter, tracks as thin as 0.1mm and spaced y 0.1mm, with shapes so accurate you will never see any difference with your CAD view zoomed 10 times and a microscope of the same magnification (I've never had any acid traps issues). It may sound like overkill, but it isn't. You may not need tens of layers, but 0.1mm spacing is very common in dense circuits including surface mounted components and you don't want your 45° mitres to short with adjacent lines.
Finally, I expect the build time to be higher. Photolithography, acid etching etc. form a relatively quick process and the assembly lines are laid out such that the throughput is very high: dip tens of PCBs in a bucket, move it over to another one, while another panel takes its place. Time is money when it comes to production. I would not buy a cutting edge 3D printer that builds 25 PCBs in 3 hours when I can build hundreds in the same time using widespread machinery and chemicals.
When that technology is ready, it will be very good news to many applications (though I suspect, not all of them). In the meantime, it is just not worth it. |
H: Industrializing a PIC micro-controller
I want to replace some timers with a PIC16F887 micro-controller. The problem is that the input voltages to the I/Os is going to be 24V which is too much. For the output part I was thinking about using a relay module. I'm stuck on the input part. How can I use the 24V as a input to the micro-controller?
The application is simple. When a input pin goes high the output will be enabled after a certain period of time (When 24V is received from the input the output will send 24V in other words). The time will be adjustable trough some push buttons. The times will be displayed on a LCD.
This question is tied to a different question I asked from the forum before. A user recommended a similar cheap solution which is already made but I want to build one just for a personnel project.
AI: I don't know why you're using such a ancient PIC in a new project, but there is no reason it shouldn't work.
Scaling 24 V signals down to 5 V is as easy as a resistor divider. Something like this should work:
The resistors attenuate 24 V to about 5 V. The zener guarantees the voltage into the PIC is within what it can handle because stuff happens. The zener will also clip negative spikes, but to one diode drop, which is right about where the PIC starts misbehaving.
If you are really worried about negative spikes, then you can put a Shottky diode across the zener just to clip negative voltages. Or you can break up R2 into two resistors that attenuate a bit after the zener, and use a bit higher voltage zener to compensate.
There are lots more things you can do. It depends on how much you want to protect against. More protection will add complexity and cost, but robustness to ever less likely abuse. Only you can decide what the right tradeoff is. |
H: Syncing 50+ wireless sensors
I am creating a set of 50+ remote imu sensors. They will all be in a small distance from one another. Less that 3 meters. Each remote board will have a on board sd card for logging the imu data and a led that flashes when the imu begins its sampling. My remote board needs to be small, around 25mmX25mm all up. But the smaller the better!!!
The problem is that i cant figure out a reliable solution to send sync wireless from one master unit to these remote imu sensors. These sensors all need to be in sync so the data logged is valid and usable. The sync pulse will be between 24Hz and 120Hz and generated from an external source.
I have been looking into BLE because of the very small modules available with build in antennas and that i can talk directly to the imu. But i can only have up to 8 slaves connected to a master. I could use the broadcasting features and broadcast message to all modules that are listening, but im just not sure.
AI: By the sound of it the IMU units don't need to transmit back, they just log locally?
Use one 433MHz transmitter, and a reciever on each device. These are small and cheap. Transmit a continuous stream of timestamps. Each will need a checksum, preferably bit error recovery (reed-solomon), and framing/sync bits around the data. |
H: How to determine low and high threshold levels of a Schmitt Trigger for a known input?
Imagine I have a pulse train input which goes into a Schmitt trigger for getting sharpened. Imagine the HIGH of the input pulse train is around 8V and LOW is around zero volt.
So what should one select the lower and upper threshold voltages in this case? Does that depend on the desired HIGH output voltage? And what is the logic behind determining these threshold levels?
I found this calculator which one needs to decide about the low and high tresholds: http://www.random-science-tools.com/electronics/schmitt-trigger-calculator.htm
AI: Select an upper threshold which is below the minimum high level of your signal. In other words, a level which you are certain that your input signal will exceed on each pulse. Similarly select a lower threshold above the low level of your signal. The difference between the upper and lower level is the hysteresis. The larger the hysteresis the more immune to noise your circuit will be. If this is for a production job, make sure you take account of component tolerances when choosing the threshold levels. You may also need to take into account the affect of timing skeu
Note that t2 > t1 due to level difference. Also note that the noise is ignored. |
H: Extracting footprint existing PCB in Altium
I'm in the process of designing a carrier for an existing PCB. The upper layer of the carrier should contain pads to connect to the holes on the side of the original board.
I can re-create the lay-out by hand, but this is an awful lot of work. Can I extract the lay-out of the pads as footprint to a new PCB? I've tried to make a library out of the current board with Design -> Make PCB Library, but this doesn't provide an end result.
Can I somehow use the IPC tool to create a package out of the current board including a footprint?
AI: Go to your board.
Select what you want to get. (Use Shift+S to set only the current layer visible and selectable)
Ctrl+C (and don't forget to mouse-click an origin after, or nothing gets copied - make it the new component origin if you like planning ahead like I do)
Go to the PCBLibrary (or make a new one)
Tools -> New Blank Component
Ctrl+V
Click where you want your pads.
Edit the component properties and 3D model as required.
Ctrl+S
Done.
EDIT: Following our chat
For posterity, to quickly select a group of objects with same or similar properties, you can use:
Right-Click on object: Select "Find Similar Objects"
In the menu find the properties that are unique to the group of objects and select "same" from the dropdown.
Select Apply and then Ok and you get a listing for all the items matching your parameters, while they also become selected. (Technically usually only Ok works, but it may sometimes give the dreaded DLL based pop-up of doom, while preceding it with apply never gave me that).
To select on part of a parameter you can use an Asterisk (), like selecting all objects with a name that starts with JP, you can select "same" in "Name" and type "JP" and all JP1, JP101, JP2938, etc will become selected. |
H: Measuring display brightness decay
Our device is specified to have a display brightness of 500 cd/m² and it must not decay to less than 50% brightness in 50,000 hours. Now, I can't wait for 5.7 years for that test to finish.
I guess that this issue has been solved before. How is decay in brightness measured?
I know how to measure the brightness at a point in time, e.g. with a Gossen M504G.
AI: The normal way people handle this is to devise a model for how the degradation rate varies with, say temperature, input current or luminosity, parameters that would reasonably be expected to influence the failure rate.
They then test this model, by driving devices to failure at high temperature or 200% rated output, and seeing if the graph of failure time versus aggravating factors follows the predictions of their model. This is known as 'accelerated life testing'.
Then having confidence in the model, they extrapolate from it to predict what the failure rate is expected to be with less severe conditions.
Obviously, the validity of this approach depends on the quality of the model. The key word that should ring alarm bells is 'extrapolate', is it still a straight line fit in the region you haven't made any measurements? You can boost public confidence in your predictions by publishing the model, and in particular, the activation energy you derive from any power laws that you manage to fit. It's only after many years have passed that you'll see whether your model was correct or not, if you are still doing and observing the appropriate experiments that is!
Look on wikipedia for 'accelerated life testing' and 'Arrhenius plots', to see how this sort of approach tries to model temperature dependence, and to see what I mean by activation energy.
A difficulty in your particular case could be that I would expect there to be a dependence separately on both operating temperature and luminosity, which will complicate the construction and verification of the model. |
H: Why do Schottky diodes have two anodes?
I was looking for a SMD diode to add reverse-polarity protection to a circuit I was designing, and the PMEG3020CPA looked like a good fit with regards to my current and voltage needs.
What confused me is why the data sheet shows two anodes, so I have a few questions about that:
Are the two anodes meant to be connected? E.g. the two internal diodes would be in parallel. Or should only one be used?
Are the current and voltage ratings given for each of the internal diodes, or both together?
Why is it designed or diagramed like this?
I ran into this question about three-terminal diodes but that seemed to be one diode and a floating third pin, which isn't really relevant.
AI: It's a dual diode. There are two diodes in one package.
You can parallel them if you want (connect 1 and 2) but there is no matching characteristics given, so you can't really depend on the rating to be much better, and the leakage will definitely double.
The characteristics are for each device, however they are (obviously) tightly thermally coupled so the total power dissipation will have to be taken into account. |
H: Charging phone battery from DC supply
I am planning a project very similar to the one seen in the following gallery. (https://i.stack.imgur.com/FMecg.jpg) I like the idea of having my phone plugged into the same unit for charging. My only concern is I only want to have one power cable being attached. The power cable needs to power both an Arduino Micro, some LEDs, and charge the phone, so I will likely be using a 5V wall wart or something similar (high enough power rating).
My big concern is making sure the battery is charged properly and is not over charged. I don't want to just plug it into a constant 5V-1A circuit, and ruin the battery. I have seen a few charging circuits online (like this one), but did not know if this was a safe option.
Any suggestions would be greatly appreciated. I am looking for a package that is relatively easy to use/solder and is reliable/safe. There are plenty of charging circuits, but are not exactly user friendly for small-ish hobby projects.
For what its worth, it is an iPhone 6 that needs to be charged, so it is a 3.8V 1800mAh lithium ion battery.
AI: Charging lithium batteries is handled by the charging circuit found inside your phone , this circuit handles undervoltage and overvoltage protection of the lithium battery for safety concerns and battery life.
The charger you plug into the wall ( AC mains ) contains mainly a transofrmer and rectifing diodes.
So simply plug 5v into the phone is safe and no need for any circuit. you can just use usb connector and connect only the power pins leave everythng unconnected and you are good to go. |
H: Transistors: Explain the key differences between SMALL and LARGE-signal analysis
I'm in an electronics class and I feel like this portion of the lecture was covered in a vague manner. I'm not really sure what the purpose of doing either a large or small signal analysis is, and what the difference is as applied to transistors.
Thanks in advance!
AI: This is going to sound somewhat like a circular argument, but here goes: You need to do large-signal analysis whenever you need to account for the nonlinear effects of how a transistor operates. For example, when you are calculating bias points, you need to account for the relatively fixed voltage drop across the B-E junction.
However, when dealing with "small" signals, where "small" means that over the range of the signal voltage or current, the characteristics of the transistor do not change significantly, you can use a much simpler, linearized model of the transistor that simplifies most of the calculations. But you need to be aware of when this model no longer applies, such as when the transistor begins to approach saturation or cutoff. When that happens, you need to go back to the large-signal model in order to get an accurate analysis of the circuit's behavior. |
H: Understanding dielectric readings - Water vs Apple Sauce (for example)
I thought asking this question here might be the easiest way to get an answer. I'm not looking for an exact answer, just an explanation of why this is the case.
I used a Chirp! sensor connected to an Arduino Uno. The reading in AIR was 209, at 22 degrees C. In tap water the reading was 488 at 19 degrees C. In Apple Sauce the reading was 499 at 13 degrees C. I did warm these items up as well, and the differences were similar.
For reference I tried distilled water was well and the readings were lower the both the tap water and apple sauce.
So what is the theory behind this? Why are the results this way? I thought water would be the highest, but that wasn't the case.
Thanks in advance.
Dave.
Edit: Chirp! Sensor is a capactive sensor http://wemakethings.net/chirp/
AI: chirp! is a capacitance sensor, not a dielectric measurement. The designer/author of the writeup seems to have made a slight error when they spoke of the water in the soil changing the dielectric. Rather, the sensor appears to have its own dielectric coating, using the soil/water/applesauce/milk as the second "plate" of the capacitor. As such, generally speaking, electrolytes with a higher dissolved ion concentration should register a higher capacitance, due to the "double layer effect" created by the ions (similar to that used in modern EDL supercaps).
This would explain why milk/applesauce (high ion concentration) had higher readings than tap water (low ion concentration), distilled water (very low ion concentration), or air (extremely sparce in both matter & ions)
EDIT: see https://en.wikipedia.org/wiki/Electric_double-layer_capacitor for more info on ionic double-layers & effect on capatance. |
H: capacitor ripple current in buck converter
I'm designing a step-down buck converter and I'm a little bit worried about ripple current which flows through the output capacitors.
In my research on the internet I found that ripple current is given by Vrms_output/ESR. If Ι have 3.5A maximum output current and I want transient responce this mean, 0A to 3.5A = 3.5A ripple current. But this value (transient step), Ι think isn't my normal ripple current.
In my calculation corresponding to equation above if I want a ripple 10mV and select ceramic capacitor which gives me low ESR (< 5mΩ), this is equiavalent to 2A ripple current and I think that isn't normal!
If that is true, can a ceramic capacitor handle this magnitude of current?
Is this amount of current (ripple current, Irms) identical with Inductor ripple current of regulator?
AI: I'm not sure I'm following your line of thought, but it sounds like you are attacking the problem backwards from the usual way.
Normally, you'll first set a limit on ripple current (\$\Delta{}I_L\$), and choose an inductor to meet that requirement.
Then you will choose your output capacitor to achieve the ripple voltage that you want.
For idealized components, you will have
$$\Delta{}V_{out} = \Delta{}I_L \sqrt{R_{ESR}^2 + \left(\frac{1}{8 f_{sw} C_{out}}\right)^2}$$
So the lower the ESR and the higher the capacitance, the lower the ripple voltage will be.
This ripple voltage is ripple due the inherent transients in each cycle of the switching circuit, when operating with a constant load current.
Ripple or ring due to load transients is more due to the voltage control loop than due to these considerations. So to minimize that you need to model your control loop and ensure you have sufficient phase margin to avoid an unwanted ring response to load transients.
Is this amount of current (ripple current, Irms) identical with Inductor ripple current of regulator?
Yes. If the load current is constant (or near enough) then the deviations of inductor current from the average value (which is the load current) have nowhere to go but in and out of the output capacitor. |
H: multiplexing control signal on speaker cable
I need to put an alarm siren close to the location of one of my audio speakers. But I don't have a dedicated cable towards this siren. Because the alarm control unit is close to my speaker amplifier I want to use the speaker cable for transmitting a trigger signal for the siren as well.
At the alarm-control-unit/amplifier side I can use an audio relay to connect the speaker cable either with the amplifier or with the siren signal based on whether the alarm is armed or not. (When armed, I don't need audio.)
But on the speaker/siren side I also need to drive a relay to switch between siren and speaker connection. I was thinking on using an Arduino to detect a DC signal on the speaker cable for this purpose, via one of its analog input pins.
Any suggestion for the electronics to use, in particular on the speaker/siren side? Or other cheap and simple mechanisms to multiplex the siren trigger signal on the audio signal?
My first thoughts:
Reduce the siren signal level via a voltage divider to a lower level that still can be detected by the Arduino but does not cause a "plop" on the speaker.
And a diode in series with a zener diode in order to clip the AC audio signal between 0 and 5V, before feeding it to an analog input pin of the Arduino?
AI: Nutty application, but here goes ...
simulate this circuit – Schematic created using CircuitLab
Figure 1. Carrying DC current on speaker pair.
Figure 1 shows one way of doing this.
In normal operation audio is passed through (large) capacitors C1 and C2 to the speaker. L1 and L2 present a high impedance to audio frequencies and prevent the audio getting back or loading V+ and prevent it reaching the relay coil.
When SW1 is pressed the DC current rises (hopefully slowly enough to be inaudible) and shows up on the relay coil.
D1 freewheels when SW1 is opened and allows the current to drop gradually.
I'm not working out component values for you! |
H: Output data from computer to light up LEDs
I'm a complete newbie at this, but the idea is to have a circuit board with, say, 10 LEDs, connected via USB to a computer running Linux. This will periodically (e.g. every second) send data to the board telling it which LEDs to light up. What the lights represent will be flexible, decided by the computer.
I'm considering using an Arduino, but I'm also open to another route if possible.
Any recommendations on where to start? Thanks!
AI: An Arduino is surely a great choice if you are new to electronics in general.
You could also use an AVR/PIC micro controller with a USB to UART bridge (FTDI makes such devices, just google FT232 for example) to accomplish your task.
But I think for the first start I'd definitely go for the Arduino because of the following reasons:
It is incredible easy to use.
There are lots of pre-made libraries.
Great community and support.
Lots and lots of tutorials.
Well tested and established.
Easy and fast prototyping (you don't have to design your own PCB for example)
and... an Arduino is always handy to have regardless of experience level: it's a quick and easy way to test something out.
BTW
To give you a little start help:
You can use the pre-made Serial library to send and receive data from your computer.
Happy testing. |
H: Class AB Amplifier Frequency Response
I have designed an AB Audio Amplifier, but even though the gain is acceptable, the frequency response is terrible.As seen in the schematic, there is a feedback/preamplifer stage and an output stage, I have used MULTISIM to perform AC Sweep of the only the preamplifier stage, and the frequency response there is acceptable, but the response at the output isn't.
What can I do to improve the frequency response while allowing only a reasonable fall in gain?
Below are the input and output stages respectively.
AI: The basic answer to this is to start by making sure all the signal paths have only high pass filters with rolloff no higher than 20 Hz, and low pass filters with rolloff no lower than 20 kHz. There will still be some uneveness in the frequency response, but it shouldn't be drastic. Take a close look at what filters are formed by any caps, and make sure they meet the above criteria.
Then make the open loop gain about 10x or more of what you want the closed loop gain to be. That leaves room for some negative feedback to do its job. Don't go crazy with gain, as too much gain will make it difficult to keep the amp stable, and too much feedback to get to the desired gain introduces transient intermodulation distortion (TIM).
Then put feedback around the whole amp. Again, this hopefully doesn't need to be more than 20 dB or so. |
H: What does the waveform for a Digital Addressable LED Strip look like?
I want to use this Digital LED Strip but with my own controller (i.e. NOT a raspberry Pi).
The link has sample code but I want to be able to understand clearly in terms of hardware waveforms what does the Clock IN (CI) and Data IN (DI) pins correctly look like?
Here is the spec of the IC, but it does not show the waveforms either. What protocol is used here? How do I go about finding that?
AI: EDIT 3 : It was pointed out by commentors that this is not a true SPI. After looking further, I can see this information, which I missed in original :
The strips basically implement a large shift register, like SPI, but with a small trick to allow use of only 2 signals – data and clock, without a separate reset or latch signal. Each LPD8806 implements six 7 bit PWM controllers, but six daisy chained 8 bit shift registers (effectively a single 48 bit register). With a 1 metre length, and 32 LED/m, that gives a total of 32 * 8 * 3, or a 768 bit shift register.
DELETE THIS : The Digital LED Strip that you are using communicates via Serial Peripheral Interface (SPI)
In your particular device, the data transmission is one way only. Meaning you only send signals and do not receive signals.
Other than the power and ground, your data transmission uses SCLK (clock) and Dout (data you are sending). Dout is often referred to also as MOSI (master out, slave in), where your controller is the master, and the LED is the slave.
CS (chip select) doesn't seem used on your LED string, but is normally used to select a particular slave to talk to.
The frequency of your SCLK will be determined by your controller software.
EDIT 1 : Adafruit says the LED strip uses the LPD8806 controller. Data sheet for LPD8806
EDIT 2 : Further information on data transmission This page here |
H: Separating Two High Speed Digital ICs
Previously, I've designed a PCB incorporating this ADC chip. It has a digital bus of 10 signals some of which are 40MHz.
Right now we have a four layer PCB and the ADC is connected directly to a Spartan-S6 FPGA with ~1.5" traces, running over a ground plane. The system is working well as is, despite my 0 knowledge of high-speed digital layout.
Now, however, we need to separate the ADC and FPGA into two separate PCBs. So we are going to need 10 digital signals (some 40 MHz) travelling 10". I would prefer to minimize radiation from the cable. The high-impedance ADC inputs are already shielded, but I think EMI is important to continuously consider.
Questions:
What type of connector/cable assembly to use? The world of connectors is overwhelming to me. Are IDC ribbon cables sufficient at 40MHz? Do I need 50-ohm transmission lines? Those fancy mini-coax ribbons? Can I use something industry standard that's pre-assembled, and won't cost a fortune?
Will my FPGA (and especially the ADC) even be able to drive the 10" cable? The logic is 3.3V levels. The ADC data sheet I'm pretty sure doesn't even mention drive strength. However in the timing section they specifiy 100Kohm load outputs.
Do I need to modify the design other than simply replacing the direct connection with a longer cable? How much do I need to know about transmission lines in order to solve this problem? For example, I've heard people talk about the termination of FPGA signals being important.
I know SE hates broad questions... but I'm still coming up in my EE education -- so far this is the most complicated thing I've worked on.
AI: 40 MHz corresponds to a wavelength of 7.5 meters. So long as you limit your driving rise and fall time to avoid exciting high harmonics, you should be able to transmit over 10 inches (~25 cm) without thinking too much about transmission lines and controlled impedance.
Are IDC ribbon cables sufficient at 40MHz?
For this distance, I'd say yes. Provide as many ground lines as you can afford to to avoid cross-talk between lanes and reduce radiation and interference.
Will my FPGA (and especially the ADC) even be able to drive the 10" cable?
You can work out the capacitance of the line and check it against the FPGA datasheet to see.
Or you can just buffer with a 74LVC244 or other logic buffer part and you'll be good. I would provide a location for a series resistor at each output to allow you to increase the rise and fall times if needed.
However in the timing section they specifiy 100Kohm load outputs.
In this case (for the ADC outputs), buffering is probably a good idea. |
H: Why is inductance negative in this triphase mutual inductor?
Suppose I have a threephase circuit with a mutual inductor on the first and second phase (V2 and V3). One way of solving the circuit (ie finding the phase currents) would be the following: convert the mutual inductor in the corresponding Y inductor and then solve the threephase circuit as you normally would do. Suppose you are given the following parameters for the mutual inductor:
simulate this circuit – Schematic created using CircuitLab
$$L11 = 10mH$$
$$L22 = 20mH$$
$$Lm = 12mH$$
where Lm is the mutual inductance. By appling the suggested transform method:
simulate this circuit
$$\begin{pmatrix}
L1+L3 & L3\\
L3 & L2+L3
\end{pmatrix} = \begin{pmatrix}
L11&Lm\\
Lm&L22
\end{pmatrix}$$
I obtain the following. (Note the negative inductance, which in turn gives a negative reactance, not ok in my opinion).
simulate this circuit
Now, by solving the circuit everything looks fine, the results are EXACTLY as the solution states (that would suggest that my steps are correct), however it does not seems ok to me that the inductance L1 is negative! Why is this happening, what am I missing?
AI: A negative inductance would imply that the current is dependent on voltage varying with time but also negated. (i = -Ldv/dt instead of i = Ldv/dt ). No one can build a physical inductor that will automatically flip the voltage coming into it, but it makes for an easy analysis. A circuit representation is a way to model the physical world.
With models you can get results that are not physical, that model the system of interest just fine. An important part of electrical engineering is being able to model systems, but also realize the differences between the model and the real world. There are also no ideal circuit elements, there are no capacitors, inductors or resistors that have don't have parasitics.
For most things the parasitics don't matter (do you really care if your resistor has a few nanoHenries of inductance when your creating a voltage divider? No, but you will if your trying to run a GHz signal through it). |
H: How to make an .sof upload to an Altera Max10 stick
I have a Max10 dev board with a 10m08 chip on it. I made a simple counter to blink the LED's. My counters have asynchronous resets, and my asynchronous reset has a circuit to keep it low for two clock cycles and prevent metastablity. I reset the fpga and it the counters stop (they all go to zero), it only starts counting when I upload a new flash to the dev board. If I power down the FPGA and power it back up I get the same result. This leads me to believe that its not my reset and its more of a flashing problem. Is there some kind of setting to make the flash stick? or should I go back to debugging. How do you make the flash persistent, I don't see an option for that in the programmer, do you have to configure the user flash?
AI: I answered a question here that details some of the different types of FPGA file formats: FPGA: Bitstream vs. SRAM Object File
Basically, right now, you're flashing just the SRAM with the SOF (SRAM Object File) -- this is volatile, and will be lost at power down or reset. SRAM FPGAs generally load their configuration from a configuration memory on-board, or a microprocessor that configures it (via ISP or similar).
In your case, your MAX10 dev board has a built-in USB Blaster device that should be able to program the on-board configuration memory. See page 4-4 of the user-guide and how to generate and program a POF instead of a SOF. This will keep your configuration on the flash memory device, and it will get loaded at every power-on.
I believe the Quartus II programmer can download a small executive to the FPGA (via JTAG) that then provides access to the SPI memory. It then uses that temporary executive to flash the SPI memory, and then resets. |
H: Power transformer dual secondaries connection
I am new to electronics and want to build simple circuit.
I bought Radio Shack Power Transformer which converts from 120 V to 12 V or 6 V, it says on the back that if I connect two yellow wires it will be 12 V and if I use black and yellow it will be 6 V. My question is, can I use both at the same time to power up two devices one 6 V and one 12 V?
Thanks
AI: simulate this circuit – Schematic created using CircuitLab
Figure 1. Multiple transformer configurations.
If there are four secondary wires then you have two independent 6 V secondaries. This is quite flexible and you can configure them in a variety of ways as shown in Figure 1.
0 - 6, 0 - 6 gives you two independent 6 V windings.
0 - 6, parallel gives you one 6 V output but with double the current.
6 - 0 - 6 gives a 'centre-tapped' output. This is used in some dual rail power supplies. Normally the centre-tap would be grounded.
0 - 6 - 12 is the same but the bottom terminal would be grounded.
You want the 0 - 6 - 12 arrangement. Because the current from both your circuits will return on the bottom winding it must be able to handle the sum of the currents. Post details in your question if you have further questions.
simulate this circuit
Figure 2. Wiring 6 V and 12 V loads. |
H: state-space model of non-linear system?
This is the equation for which I have to make a state-space model.
$$m\ddot y(t)+b\dot y(t)+k_1y(t)+k_2y(t)^3=u(t)$$
For my A matrix I have
$$\begin{bmatrix}
0 & 1 \\
? & \frac{-b}{m}\\
\end{bmatrix}
$$
where
$$ \begin{align}
&x' = Ax + Bu\\
&x_1=y \\
&x_2=x_1'
\end{align}$$
Where I put the question mark, I have
$${(-k_1+k_2 \, x_1^2)\over m} $$
However, how can I fit the \$x_1^2\$?
Normally A matrix is only using numbers...
AI: This is a non-linear differential equation, so linearize via the Jacobian.
[Also note that derivatives are wrt time, so you can't differentiate the cubed term to get a squared term] |
H: Calculated resistance of an LED
I am working on some circuit lab homework this week and am a bit stumped by something I just can't seem to find anywhere in my Circuit Analysis I book.
The lab has me construct the following circuit on my breadboard:
simulate this circuit – Schematic created using CircuitLab
I then mark down the ammeter and voltmeter readings, taking away one resistor each time until down to one. Using this information, my worksheet asks:
When the LED has current flowing through it, a voltage can be seen across it. Thus, the LED will have a resistance. Calculate the resistance of the LED for each of the four cases and record your results in Table III
My first thought is R=V/I. But the result just doesn't seem right to me.
Example data I have measured from this circuit with all 4 resistors: 1.586V, 186.2 microAmps. Using these measurements, the LED has a resistance of 8517.72 Ohms? That can't be right can it?
AI: Well, you're on your way to finding out that the resistance of a diode is not linear! But you have the right equipment and know the right formula R = V / I (ohms law). Measure the voltage and the current and then calculate the resistance of the LED. You will find that it changes!
Remember - if you replaced the LED with a fixed resistor at that calculated value, you should get the same current and voltage reading. |
H: Power Factor - What is it a characteristic of?
I always thought it was a characteristic of a powered device, rather than the power source.
A generator (whether it's a station or a small petrol powered one) does not have a power factor. I've been told that the power source has a PF.
Is this correct? Does the PF change depending on the load (type of device)?
AI: Yes, power factor is a characteristic of a load and how close it is to being purely resistive (current and voltage in phase). Power factor correction is generally a feature of a load (a computer, lighting system, etc.) that helps bring that load's current and voltage into phase alignment. |
H: Pulse Low on High Signal
I am trying to build a circuit that disconnects the output for a brief time when power is connected. However I want the circuit to remain connected after power is removed.
I can achieve the first bit with a RC circuit connected to the base of an NPN transistor pulling the gate of a p-channel mosfet to GND. This works well because my input power is a clean vertical uptick. Meaning the voltage is at one instant zero and at the next 5V.
I have tried keeping the circuit connected using two NPN Transistors connected to the gate of the same p-channel mosfet. The two transistors are in the form of a inverter(not gate) signaled by the input power. This works well if the signal quickly goes from 5V to GND. My signal however has a gentle downward slope to zero. I have tried using a voltage divider and a comparitor to speed up the signal but neither has been fast enough.
Is there any way I can briefly disconnect my output when the input goes from LO to HIGH but ignore the change from HIGH to LO? This would leave my circuit connected at all times except for a brief moment when power is connected.
Edit:
Thanks to @EM Fields I was able to figure this out. I slightly edited the circuit Fields provided.
Here is the Spice simulation,
It shows the main input and the main output.
AI: Try this:
and here's the LTspice circuit list if you want to play with the circuit:
Version 4
SHEET 1 880 680
WIRE -320 64 -432 64
WIRE -272 64 -320 64
WIRE 48 64 -272 64
WIRE 128 64 48 64
WIRE 176 64 128 64
WIRE 272 64 176 64
WIRE 432 64 368 64
WIRE 48 80 48 64
WIRE -320 112 -320 64
WIRE 176 112 176 64
WIRE -272 176 -272 64
WIRE -240 176 -272 176
WIRE 48 176 48 144
WIRE 48 176 -16 176
WIRE 432 224 432 64
WIRE -320 240 -320 192
WIRE -272 240 -320 240
WIRE -240 240 -272 240
WIRE 176 240 176 192
WIRE 176 240 -16 240
WIRE -320 304 -320 240
WIRE -272 304 -272 240
WIRE -240 304 -272 304
WIRE 288 304 288 112
WIRE 288 304 -16 304
WIRE -432 320 -432 64
WIRE 176 336 176 240
WIRE 288 336 288 304
WIRE 128 368 128 64
WIRE 128 368 -16 368
WIRE -432 448 -432 400
WIRE -320 448 -320 368
WIRE -320 448 -432 448
WIRE 48 448 48 176
WIRE 48 448 -320 448
WIRE 176 448 176 400
WIRE 176 448 48 448
WIRE 288 448 288 416
WIRE 288 448 176 448
WIRE 432 448 432 304
WIRE 432 448 288 448
WIRE -432 512 -432 448
FLAG -432 512 0
SYMBOL Misc\\NE555 -128 272 M0
SYMATTR InstName U1
SYMBOL res -304 96 M0
SYMATTR InstName R1
SYMATTR Value 1meg
SYMBOL cap -304 304 M0
SYMATTR InstName C1
SYMATTR Value 1µ
SYMBOL voltage -432 304 R0
WINDOW 123 0 0 Left 2
WINDOW 39 0 0 Left 2
WINDOW 3 24 104 Invisible 2
WINDOW 0 7 105 Left 2
SYMATTR Value PULSE(0 12 1 10m 100m 10)
SYMATTR InstName V2
SYMBOL cap 192 336 M0
WINDOW 0 -37 30 Left 2
WINDOW 3 -34 60 Left 2
SYMATTR InstName C3
SYMATTR Value 10n
SYMBOL res 160 208 M180
WINDOW 0 47 73 Left 2
WINDOW 3 35 45 Left 2
SYMATTR InstName R2
SYMATTR Value 100k
SYMBOL pmos 368 112 M270
WINDOW 0 25 1 VLeft 2
WINDOW 3 73 95 VLeft 2
SYMATTR InstName Q1
SYMATTR Value FDS6575
SYMBOL res 416 208 R0
SYMATTR InstName LOAD
SYMATTR Value 100
SYMBOL cap 64 80 M0
WINDOW 0 -37 30 Left 2
WINDOW 3 -41 60 Left 2
SYMATTR InstName C2
SYMATTR Value 100n
SYMBOL res 272 432 M180
WINDOW 0 47 73 Left 2
WINDOW 3 35 45 Left 2
SYMATTR InstName R3
SYMATTR Value 1000
TEXT -424 480 Left 2 !.tran 15 startup |
H: How do you calculate the resistor value for a bicolor led
R4 and R5 have equal values. For both LEDs the forward voltage is 2V and the forward current is 30mA.
I know how to calculate the correct resistor for a single LED. However in this case I am using a voltage divider to create a 2.5V line so that the bi-color LED can show red or green when LOGIC is 0V or 5V. I am confused as to how to calculate the correct values for the two resisters.
I would appreciate a formula explaining how, and an explanation as to why it is that way.
Datasheet for the LED
AI: We need a source that provides 30mA with 0 or 5V. The voltage at the divider output will be 5V - 2V = 3V ( or 2V if 0V is applied). So we have a 0.5V variation for 30mA. The equivalent source will be 0.5V / 30mA = 16.7 ohms. Each resistor must be 33.3ohms to give parallel combination of 16.7. This will only work if the micro source impedance is low. |
H: Currents when converting voltages down
Okay, so I have what could be considered a silly question I should've probably learned when I started working electronics way back when, but I just now thought of it and haven't really needed to ask it until now.
I noticed on a AC-DC adapter yesterday that the ratings going in were 1.5A @ 120V, and the ratings coming out were 6A @ 12V.
So if I was to convert down to 5V, would I be able to squeeze out even more amperage still? Is there a mathematical formula?
I've just never pondered this before or had it explained
AI: It depends on how the conversion is performed, and broadly there are two options:
linear converters have approximately the same input and output currents,
switching converters (and transformers) act like gearboxes, providing a different voltage/current ratio (which is like a torque/speed ratio) but still being limited by conservation of energy.
A linear converter drops the voltage across a semiconductor (transistor of some sort), therefore that transistor will dissipate a lot of heat. If you have a 5V linear regulator supplied from your 12V 6A supply, then it too is capable of only 6A output and the regulator will dissipate $$P = (V_{in} - V_{out}) * I_{out} = (12-5)*6 = 42W$$
and that process has an efficiency of $$ n = P_{out} / P_{in} = (5*6)/(12*6) = 41.7\% $$
For small voltage drops like 1-3V this is a reasonable approach. For larger drops though, you can see it becomes very inefficient because the efficiency is the voltage ratio. Say you converted 120V to 12V linearly, that would be 10% efficient; the power supply would dissipate 9x as much as the load!
With a switching converter, conservation of energy means that $$ (P_{out} = V_{out} * I_{out}) \le (P_{in} = V_{in} * I_{in} )$$
Your 12V 6A supply has extremely poor efficiency: $$ n = (6*12)/(1.5*120) = 40\% $$
which leads me to believe that the 1.5A rating is for inrush current, not steady-state operation, or that the supply has very poor power-factor. It's probably a transformer+rectifier+capacitor arrangement instead of a switching supply.
Anyway, say you had an 80%-efficient switching DC-DC converter, which is not unreasonable. If you're powering it from a 12V 6A supply and want 5V from it, then:
$$ P_{out} = V_{out}*I_{out} = n * P_{in} $$
$$ P_{out} \le 0.8*12*6 $$
$$ I_{out} = P_{out} / V_{out} \le 11.52A $$
So yes, you can get more current out by converting down to a lower voltage if you use the right kind of conversion.
Edit: if you're mechanically inclined then think of a voltage = torque and current = speed equivalence.
$$ power = voltage * current = torque * speed $$
An efficient voltage conversion process is just like a gearbox in that it allows you to have higher torque at lower speed or vice versa.
Edit 2: a linear conversion is like applying a brake. It reduces the available output torque (voltage) by dissipating a bunch of power as heat, and doesn't change the speed (current) of operation. |
H: Convert USB3 to WIFI
What methods could be used to convert USB3 communication to WiFi, when there is no access to the device's OS?
AI: Buy a USB over Ethernet box and plug that into a wifi router/access point. Or get a small single-board computer with a wifi card. These are basically the only two options. However, you will not be able to get full USB 3.0 bandwidth over wifi; it doesn't have sufficient bandwidth.
Edit: take a look at http://usbip.sourceforge.net/ . |
H: How do you block a signal with a tank circuit?
I have a signal generator outputting 60 hz AC. I've connected the output to a capacitor (922uf) and inductor (0.0076H) which are in parallel with each other creating a tank circuit. These two values will have resonance at approximately 60hz. However by the loud squeel my signal generator is making, I can tell it's shorting out. I also connected two parallel diodes in series to the tank to indicate if there is current going through and it lit up like Christmas. Isn't it supposed to have a net current of zero??
Here are my sources:
http://www.deephaven.co.uk/lc.html
http://www.allaboutcircuits.com/textbook/alternating-current/chpt-6/parallel-tank-circuit-resonance/
Can someone explain how to make the tank circuit work? I want to achieve a net current of zero by blocking out the 60hz signsl from my signal generator.
Thanks.
AI: A 60 Hz tank circuit will need a much bigger inductance and a much lower capacitance in order to achieve a decent Q. With the value you have, it resonates at 60 Hz but the overall impedance of the circuit is very low.
Feeding the tank from a 100 ohm source and sweeping the frequency I see a 25 dB attenuation at the peak of resonance and this is equivalent to an impedance of about 6 ohms i.e. 6/106 = 0.057 = -24.9 dB.
If you had an inductor that was 76 mH (3.16x the turns and 5 ohms) and a capacitor that was 92.2 uF, the attenuation at 60 Hz is now only 4 dB or a reduction in signal to 63%. This is more like an impedance of 170 ohms at resonance.
Just take note that the quality factor of a tank circuit is proportional to \$\sqrt{\frac{L}{C}}\$ so making L ten times bigger whilst reducing C by ten times increases Q by 3.16 times (all other things remaining fixed).
Also, I'm concerned that you may be using an electrolytic capacitor - this is a polarized capacitor and may have really poor performance in a tank circuit. |
H: Are there double sided servos?
I see servos a lot on robots that seem to be connected from both ends. Are there servos where the shaft are on both ends of the servo?
AI: Yes, They are sold as 'robotic' servos. Look in the Hobbyking or towerhobbies catalogues.
I got mine as part of a camera 'pan and tilt' bracket, but you can get them individually. One side drives, the other is often just a hub and bearing.
Not all 'robotic' servos have this feature. Sometimes the term 'robotic' simply means metal gears and high torque.
Look at the individual descriptions, specifications and pictures in the catalogues. |
H: Strange op-amp circuit FM radio
I am working on a simple FM radio receiver. Built the circuit and it works very well. Learned few new things, and got some questions, especially the output stage. The Op-amp 2822 is a dual op-amp, but the output is only mono. One of the op-amp output is connected to one side of the speaker and other output to other side. The speaker doesn't connect to the ground in this setup, Very strange. there is Also a 10u electrolytic capacitor connected to the inverting inputs of these 2 op-amp. will a normal 104 ceramic cap works? and also what are the purpose of C11, C12, C14 and R6?
Another thing is CF2 and CF1; Are they ceramic resonators? but one has 3 leads while other only 2. and do they have polarity?
last very interesting thing is from the input stage. There are 2 resistors connected to the collector of the 9018, and there is a biased resistor 150k connected in between. what is the benefit of this setup? (instead of using one collector resistor and connect the biased resistor to the collector directly. )
AI: there is Also a 10u electrolytic capacitor connected to the inverting
inputs of these 2 op-amp. will a normal 104 ceramic cap works?
C16 couples the inverting inputs of the audio amplifiers together for AC signals. Yes you can use a ceramic cap also as long as it is also 10 uF.
and also what are the purpose of C11, C12, C14 and R6?
All these Caps have one pin to ground, the other to the signal node so they for filtering high frequency noise out of the signal.
R6 has probably to do with the volume adjust. Not how R6 is 10 k but the potmeter is 50 k. Maybe the potmeter is not a logarithmic one like you would normally use for audio. Then a cheap trick to fake a more logarithmic behavior is to load the potmeter with a relatively low resistance, R6 in this case.
Another thing is CF2 and CF1; Are they ceramic resonators?
CF1 (3 pins) is (probably) a SAW (Surface Acoustic Wave) filter. It behaves lika a bandpass filter but with much narrower bandwidth than you could easily get from an LC filter. Note how the bottom pin of CF2 is actually connected to the positive supply rail, the other pins are input and output.
CF2 (2 pins) can be either a crystal or a ceramic resonator. Since it has a 330 ohms resistor in series I conclude it's a resonator. Crystals are more expensive and placing a resistor in series with a crystal deteriorates it's properties. I think here this resonator is used as a filter for the detector output, see the CD2003 datasheet.
"There are 2 resistors connected to the collector of the 9018, and there >is a biased resistor 150k connected in between. what is the benefit of >this setup?"
It's a CE stage (Common Emitter), part of the output signal is fed through that 150k resistor back to the input. This provides (local) feedback. It reduces the gain of that stage but improves linearity and bandwidth. Exactly the same way as when using feedback with an opamp. |
H: How to turn a 200~Khz AC voltage into a proportional DC voltage that does not exceed 3.3V
now, I have an induction heater, which runs at 200 Khz, and near the coil of the induction heater is another coil, now, if they coil is near the IH's output, currents will be induced into it, yes?
Now, if we have a 3.3 volt ADC, and we connect the output of that coil to the ADC, and say, the voltage in the coil can get pretttty high, even in the thousands of volts, if it gets near enough to the coil of the induction heater, how can I make such a variable high-frequency voltage take form of a 3.3 volt signal proportional to the voltage on the coil? I have thought of using a transformer, which would have a specific turns ratio, but, if the voltage gets high enough on the coil, then the transformer will output more than 3.3, frying our ADC, therefore some sort of protection is required.
What is an elegant solution to this? Also, I need to be able to calculate the actual voltage on the coil.
The ADC is 12-bit.
Now, to make it clear, I only want to find the voltage in the coil, if you have an IC or something I can connect via SPI/I2C and measure it directly, I don't mind that, all suggestions are welcome.
AI: Why measure voltage or current at the primary of an IH?
a) You need to study the voltage and current academically.
You will get a reading from the coil you propose, but it will not be accurate. Different loads, load positions and temperatures will influence the readings due to mutual inductance changes and Curie temperature effects.
A Separate VT, CT, shunt, hall sensor or other instrument is advised in this situation
b) You wish to tune the heater frequency.
This is probably the most practically beneficial application
The absolute measure is not required, you need to pick up the phase change and tune for 90 degree phase shift.
Richie Burnett explains it nicely with bode plots and practical advice and a great discussion. Here's another site. Google "Induction Heater control Bode Plot" for some academic articles. This one looked good when I scanned it - kept it to read later as it has the maths.
Your method will work for current measurements.
For best results, try to keep the measurement coil away from the influence of the load.
Voltage Measurements
The voltage of the primary is relatively easy to measure using a VT or potential divider, some signal conditioning and protection.
Provide protection to both rails using Schottky diodes in a bridge.
Protect the rail with a TVS or Zener in case your power supply cannot absorb the voltage spikes being fed into the rail.
Search your favorite supplier for an Instrumentation Amplifier that works at 3.3V and gives rail to rail outputs- there are many to choose from.
Current Measurements
In order to measure the current, treat the solution you describe as an air cored CT that measures amps rather than volts. Provide a shunt to contain the voltages and quantify the current.
The phase relationship between current and voltage is probably the most interesting parameter you want to measure and control.
Burnett describes the entire process and provides practical advice needed to implement the instrumentation and control you require.
I've considered, but never tried or seen anyone using a Hall sensor. There are many to choose between.
They measure the magnetic field directly from which the current can be deduced.
There are two varieties
- sensors with built in op amps
- switches with built in comparators |
H: Who opens pipes in USB communication?
I just need to know who in the USB communication must open the pipes. Endpoints are already configured, descriptors was sent and now there should be a process of pipes opening (between correct endpoints). Who opens these pipes?
AI: This is all in the USB spec, of course.
In USB, pipes aren't really "opened". During configuration, the device tells the host what endpoints it can talk what protocol over. Then host then sends data to or request data from endpoints as it sees fit.
For details, read the USB spec. |
H: Shielding effectiveness system
I've been working on a Shielding Effectiveness system of 120dB according to IEEE299-2006 standards. The frequency range covered is 9kHz to 40GHz.
I've designed it using an analog signal generator, power amplifier, antennas (varying antennas for varying frequencies), pre amplifier and spectrum analyzer. I would like to know how to choose a cable for the system. I figured RG213 would be a good choice, however if it necessary to use it through out the system all the way from signal generator to spectrum analyzer.
Any ideas or suggestions would be good. In fact, guiding the way on how to select an appropriate cable that would meet the aim of 120dB for the frequency range of 9kHz to 40GHz would be much appreciated.
AI: RG213 is a badly shielded low cost cable for a few hundred MHz at most.
For your application you'll need 086 size rigid coax, just over 1 mm thick.
Rigid or semi-rigid coax has a solid braid, so up to 100 dB screening. (but probably not at 9 kHz). At 40 GHz you'll need very thin coax, which is unfortunately very lossy.
Brace yourself for the price of 40 GHz connectors, hundreds of dollars each. You can't use N-type above 10 GHz or so.
You might consider separating your whole system into different frequency bands. The antennas and amplifiers will already be quite band-specific. Then you could use 141 or 250 size rigid coax for the lower frequencies. |
H: How do I decouple ground planes?
I have designed and built a motor controller circuit. The circuit has a microcontroller on which gets commands from a PC using an FT232R. Currently the FT232R is powered from the board's +5V supply. This +5V supply is generated using a regulator which converts the +24V power input to the board. The +24V input also powers the H-Bridge which drives the motor.
Everything works fine, except when it doesn't - sometimes, whilst stopping and starting frequently under a heavy load, the PC blue screens. I think this has something to do with the ground level rising due to heavy load on the motor - which the USB end of the PC doesn't like very much.
My solution is to first switch to USB bus power (the only thing it needs to run is the FT232R) to eliminate any fluctuation in the supply.
I also want to protect the USB ground from the main board ground, however they still need to be linked. I was thinking of using an inductor to connect the power planes to prevent spikes from the stop start action.
Is this a good idea or is there a better method?
I have decoupling caps (1u and 100u) on both the power input and regulated +5V as well as 10n and 10u on the major IC's and 10n and 100n on smaller IC's. The question is asking how to connect a noisy power plane to a quiet one with out making the quiet plane noisy.
AI: I would strongly suggest that you must completely isolate the ground of your FT232 from the power stage, before you destroy the USB port that it is connected to. There should be absolutely NO ground (or other) connection between high power circuitry and your control IO; do not stick random inductances in as they will as likely make things worse as better.
The slowest, simplest connections in your design (i.e. the easiest place to make a separation) are probably the serial lines between MCU and FT232, so put opto-isolators in there. Power the FT232 from the USB port and power the MCU from its own regulator.
Better yet, consider isolating the MCU from the power stage, e.g. using a 24V-5V isolated DC-DC converter to power the MCU. Opto-isolators might work for the motor-control signals depending on the frequencies you're dealing with, otherwise you can use other, faster, galvanic isolators.
If your MCU is isolated from the power stage, you don't need to isolate the FT232 from the MCU anymore. |
H: RS-485 Idle Failsafe Is it really needed?
I'm planning on setting up a sensor network around my house using a Cat5 Cable as both the power source and the signal line for the sensors, I'm planning on using RS-485 Transceivers and and Arduino's for the sensors.
From reading through many application notes and whatnot from TI and Maxim they all talk about having a failsafe so an Idle Bus goes to a known state.
If I use a master/slave setup why is this needed? If the master assumes that no slave will transmit unless requested to, and the slaves are constantly listening for their own address. It seems like this could be expanded for quite a bit of redundancy, without worrying about the state of the line when it's turned on.
Is there something I'm missing?
AI: Normally the master device controls the bus, and has its output driver enabled so it can drive the bus to an "idle" state when there is no traffic. When the master sends a request to a slave it must immediately release the bus (by turning off its output driver) so the slave can reply. It will take the slave a finite time before it can enable its output driver, which may be just microseconds or milliseconds. During this time the bus could float to levels which look like a logic 0, ie a start bit, which may confuse the master which is looking for a start bit. By having failsafe biasing of the bus you eliminate this possibility since the bus is always pulled to voltages which represent an idle condition.
Note: a lot of newer RS485 transceivers have the failsafe biasing built in. |
H: Feedback Control: Unexpected result for block diagram simplifications using matlab
I made some simple calculations regarding block diagram algebra. The problem is that I don't get the same result using matlab.
Here is the system with it's corresponding blocks:
$$H_1 = z+2$$ $$H_2 = \frac{1}{z^2+2z+1}$$ $$H_3 = \frac{z}{z+2}$$
This simplifies to the following according to the block diagram rules:
$$H = \frac{H_1*H_2}{1-H_1*H_2*H_3}$$
After some simple math I get:
$$H = \frac{\frac{z+2}{z^2+2z+1}}{1 - \frac{z+2}{z^2+2z+1}*\frac{z}{z+2}} = \frac{\frac{z+2}{z^2+2z+1}}{\frac{z^2+2z+1-z}{z^2+2z+1}} = \frac{z+2}{z^2+z+1}$$
Now if I try to get the same result using matlab it results in a system of order 5 and a system of order 3 after reducing it using matlab's minreal command:
% initialization
z = tf('z',0.1);
H1 = z+2;
H2 = 1/(z^2+2*z+1);
H3 = z/(z+2);
H_ = (H1*H2)/(1-H1*H2*H3)
H_ =
z^4 + 6 z^3 + 13 z^2 + 12 z + 4
---------------------------------------
z^5 + 5 z^4 + 10 z^3 + 11 z^2 + 7 z + 2
Sample time: 0.1 seconds
Discrete-time transfer function.
H_ = minreal(H_)
H_ =
z^2 + 4 z + 4
---------------------
z^3 + 3 z^2 + 3 z + 2
Sample time: 0.1 seconds
Discrete-time transfer function.
Only using Matlab's built in feedback command yields the correct result after evaluating minreal:
% calculate system transfer function using matlab's feedback command
H = feedback(H1*H2,-H3)
H =
z^2 + 4 z + 4
---------------------
z^3 + 3 z^2 + 3 z + 2
Sample time: 0.1 seconds
Discrete-time transfer function.
%
H = minreal(H)
H =
z + 2
-----------
z^2 + z + 1
Sample time: 0.1 seconds
Discrete-time transfer function.
Could you please guide me what I am doing wrong using the straight forward calculations for H_. Why do I get a system of order 3 after using minreal and not the same result as done by hand (or using feedback command)?
num = minreal(simplify(H1*H2))
den = minreal(simplify(1-H1*H2*H3))
H_nd = simplify(minreal(minreal(num/den)))
num =
z + 2
-------------
z^2 + 2 z + 1
Sample time: 0.1 seconds
Discrete-time transfer function.
den =
z^2 + z + 1
-------------
z^2 + 2 z + 1
Sample time: 0.1 seconds
Discrete-time transfer function.
H_nd =
z^3 + 4 z^2 + 5 z + 2
-----------------------------
z^4 + 3 z^3 + 4 z^2 + 3 z + 1
Sample time: 0.1 seconds
Discrete-time transfer function.
AI: You need to add the tolerance to your minreal function.
This is taken from mathworks website:
"minreal(sys,tol) specifies the tolerance used for state elimination or pole-zero cancellation. The default value is tol = sqrt(eps) and increasing this tolerance forces additional cancellations" |
H: IC specification
I am pretty new to this, and I am trying to learn about what specifications I should be looking for when doing a chip replacement.
For example, lets say I know 100% sure my BIOS chip is broken. And I would like to replace this broken chip with a blank chip, which I will later reprogram.
How do it know what empty chip to order on-line, cause there are many different specifications with every chip?
Lets say my original iMac uses this chip: MX25L3205D.
Does it mean that any blank chip which has 25l32 in it can be used?
AI: When doing chip replacements like that, your #1 best bet is to find the exact matching part number and use that.
Barring that, it gets complicated based on the part in question. Using this as an example, we're looking in the general class of SPI flash memory devices. The MX25L3205D is a 32Mbit CMOS Serial Flash. To find a potential replacement, I would look for:
Matching pinout (there is a pseudo-standard for SPI memories like this, so you're probably fine)
Matching size (32Mbit) and organization (sectors, blocks, etc.)
Matching package (PDIP, SOIC, etc.)
Matching supply voltage / power requirements
Matching command-set (i.e. is 0x06 still WREN. Also kind of a pseudo-standard)
A hope that in traditional Apple fashion, this was not a custom chip made for them that has secret authentication / other data on-board
Even after matching all that, there's no guarantee it will work with an alternate -- perhaps the new chip is on a smaller lithography with much, much faster rise/fall times and the PCB layout isn't up to snuff in terms of impedance control or routing (this is a common failure mode for designs that move to die-shrunk SPI/DDR chips after the first design revs).
I bet you could find a compatible part within a hour or so of digging through the usual flash vendors' product lines. No offense though, I might have one of your EE buddies go find it for you in exchange for a six-pack or something. |
H: Creating a robust power MOSFET switch
So I have been researching about protecting a MOSFET. I have used MOSFETs for basic on/off switches but never really thought about fully protecting them. I have used them for on/off switches to engage relay coils. The only thing I did was place a fly back diode across the the inductive load.
Then I came across Self Protected MOSFETs. Here is a link to a diagram:
https://www.google.com/search?q=self+protected+mosfet&espv=2&biw=1920&bih=955&source=lnms&tbm=isch&sa=X&ved=0ahUKEwiY7M3j0MrKAhVIVT4KHWQvD_kQ_AUIBigB#imgrc=uUMrOVnQMAn6oM%3A
I am only really interested in the ESD and Over Voltage protection sections to implement in my own designs. If I were to make a robust design to drive, say, a DC motor, here are my thoughts:
Protect The Gate:
I would place a series resistor of about 100 ohms to prevent too much charge the gate layer to puncture.
Ensure MOSFET Turns Off:
I would place a 100k ohm resistor between the gate and source (assuming source is tied to circuit ground or battery negative) to ensure the MOSFETs gate capacitor like behavior discharges so that if the input floats, the MOSFET turns off.
Vgs Protection:
I would place a TVS diode before the 100 ohm resistor so I could catch transients. Whether it is uni or bi directional I think depends on the gates tolerance for these voltages. I am going to assume that Vgs should only be positive and thus use a unidirectional TVS. And pick it so that the clamping voltage is not beyond the absolute maximum of Vgs for the MOSFET. Reverse voltage should clamp right away.
>>>Vds Protection:<<<
This is where my confusion arises. Do I need this? Most MOSFETs have a body diode and should protect from voltages due to inductors being switched off quickly. I don't like taking risks so I would use a faster diode or maybe even a TVS across drain and source and place a flyback diode on the inductor. But in the diagram I linked to, the TVS is across drain and gate. Why?
If I assume a large voltage builds up on the drain, the TVS would conduct (before max Vds I assume of the transistor), go through the gate resistor, and go to both the postive rail driving the gate and through the 100k ohm bleed resistor to ground? But doesn't this also turn on the MOSFET? This is where things get murky and despite researching the answer on the internet, I couldn't find a clear answer.
Update:
Here is a circuit diagram of what is in my head per request from user.
AI: By placing a zener diode (or similar) between the drain and gate, the gate voltage will be forced to rise if the drain exceeds the breakdown voltage of the diode. You are correct in thinking that this will turn the MOSFET on. This is how that protection method works. To see why you have to understand MOSFET avalanche. The body diode of the MOSFET will break down at some voltage like a zener diode (or avalanche diode to be strictly correct). A power MOSFET is made up of many cells in parallel with each other. Depending of the processing of the transistor, these cells may or may not share the avalanche energy well. Also the place within the cell where the avalanche energy is dissipated is not quite the same as where normal conduction dissipation occurs. For this reason some MOSFETs have a limited amount of energy that they can safely absorb in a single pulse of avalanche. This energy may be much less then they could take in a pulse of normal conduction. It may be zero. On the other hand, some MOSFETs have avalanche energy limited only by thermal considerations, in other words they can take any amount of avalanche energy as long as the die does not overheat.
By turning the MOSFET on before the drain-source voltage exceeds the avalanche point, the energy is dissipated by the normal conduction mechanism. This allows a MOSFET which cannot take high avalanche energy to safely dissipate a transient, for example from and unclamped inductive load. You still have to ensure that in your design the MOSFET cannot be exposed to a transient that is too large from a thermal point of view, the energy will heat the die up just the same and you must not exceed Tj max.
You have to be careful adding diodes to the gate terminal. In some circumstances diodes connected directly to the gate can result in very high frequency oscillation of the MOSFET. This results from parasitic inductance and capacitance in the circuit causing a feedback path at VHF. A diode can rectify this and pump up the DC level on the gate resulting in a stable oscillation maintaining the device in a partially on state when trying to turn it off. This is mitigated by adding a suitable gate resistor.
If your circuit topology ensures that the MOSFETs will never see excessive voltage, or if they can withstand any transients by avalanche then you may well not need to provide any protection components. This is a good solution because there can be more problems introduced by the protection devices (too big a subject to cover here). Decoupling the supply rails near to the output devices in power stages helps. Ensuring that devices in bridge configurations cannot cross-conduct is also very important. |
H: Find dBm and watts of the attenuator?
The question says "A signal of 40 dBm is passed through the first attenuator. The first attenuator has a gain of 1. The second attenuator has 20 dB output. Find the dBm and watts
This is what I tried doing:
40 dBm = 10*log(Pout/1mWatt)
Pout = 10 W
10 W/Pin = 1 gain
Pin = 10 W
20 = 10*log(Pout2/10 W)
Pout2 = 1000 W
Pout2 = 10*log(1000 W/.001 W) = 60 dBm
is what I did correct?
AI: There is no need to convert from dB to Watts and back again. This can be done, and is in fact easier, to do everything in dB. You can then convert to Watts at the end.
However, the question is ambiguous, at least as you have transcribed it. It is not clear what "The second attenuator has 20 dB output" is supposed to mean. If it's a attenuator, then presumably it's passive. In that case it can't increase the power coming out relative to what is coming in. It can't have a gain of 20 dB. Perhaps it is supposed to say a gain of -20 dB, or maybe it is supposed to say that the output is at 20 dBm, but just "20 dB output" in this context makes no sense.
Note that the first "attenuator" does nothing, since it has a gain of 1, which can also be expressed as 0 dB. Let's assume the second attenuator actually has a gain of -20 dB. The output signal is therefore:
(40 dBm) + (0 dB) + (-20 dB) = 20 dBm = 100 mW |
H: How to calculate or should I measure impedance for 1/4 Wave monopole?
I have this odd design that I'm trying to improve the antenna on. It has a mother board and a radio board above it, and it's densely packed with components. My idea was to try a monopole in the middle of the board and bring a feed line over to it with some tiny coax. What I don't know is how do I figure out the impedance of this setup so I can adjust the matching network. Do I measure it with a VSA at my frequency of interest (900MHz)?
I assume the impedance comes from how well it couples to the various surrounding GND planes and that it would change based on where I position the antenna. How far above the plane for instance.
I'm also thinking this would be hard to accurately simulate ahead of time with all the different components involved.
AI: A Vector Network Analyzer is the instrument normally used for this task. The VNA will give you one port s-parameters (S11) that you can use to synthesize a matching network.
However, if your ground plane is significantly "large enough" you can use an analytical approach and assume a feed impedance of 1/2 that of an equivalent dipole antenna.
Simulation accuracy varies from bad to very good depending on how well you understand the problem and the limitations of your simulation method. Like any FEA simulation, you still need to have a good intuition for the problem to get the most out of it. Most EM sim packages (HFSS, CST Microwave Studio, FEKO) are quite expensive, so I would suggest avoiding them unless you have very specific requirements that can't be met by prototyping.
That said, FEKO has a mesh size limited free version that would probably serve you well for a basic sanity check sim - monopole above a finite ground plane simulation. |
H: How to place "Power On" indicator lights?
I'm working on a replacement board for an old system. I have two terminal blocks.
Terminal Block 1 (left) is the input from the power supply to the board. This is the primary power supply to the board and rest of the circuit. Pin1 = +, Pin2= -, Pin3 = -.
Terminal Block 2 (right) is the input from the battery and charger. Battery
Charger datasheet The battery system is to come into use if the power from the factory was to go out. Pin1 = +, Pin2= -, Pin3 = -.
Here's my schematic I'm working on at the moment.
Is this the correct way to add indicator lights to the inputs? I want to be able to tell when the board is receiving power (INPUT) from the power supply and when the Battery is in use. I'm pretty sure that the Battery LED (BATT) is going to be on all the time since it's being powered from the input. Is there a way to single this out?
I was going to initially put the resistor and LED in line with the "+" trace on both circuits, but I don't know if that's would effect the charging circuit on Terminal 2.
D1 is to protect against backwards connection to the power supply. Can I place one at the same location for the battery supply? Will this effect the recharging ability?
Edit: "Truth Table"
INPUT LED - On when Terminal 1 is supplying power (IE outside system, such as a factory main line, is able to provide power). Off when outside system is loses power.
BATT LED - On when the battery is used to power the system (IE power from Terminal 1 is no longer being supplied and the system needs to run off a battery). Preferably off when Terminal 1 is in use.
Edit 2 - Full Circuit
AI: Your post is a little garbled and a block diagram of your setup (use the built-in schematic editor) would be a big help. I don't think your wiring scheme is correct.
Figure 1. UPS block diagram from AltechCorp.com.
The UPS + and - terminals are both 24 V DC input (while mains power is on) and output when mains power has failed.
The power supply shown in Figure 1 should be 24 V DC nominal.
Indicator lamps can be wired from the 'DC OK', 'BAT FAIL' AND 'BAT DISCHARGE' relay contacts.
simulate this circuit – Schematic created using CircuitLab
Figure 2. LED indicator schematic.
How it works
Let's assume that the mains power supply is giving out 24 V.
D1 provides a 0.5 V drop. (See BAS70 datasheet page 7).
When mains is on D2 lights with 24 V on the anode and about 24 - 0.7 (D4) - 2 (D2) = 21.3 V on the cathode. Because of the three two diodes in its circuit D3's anode voltage will be lower than D2's and will glow dimly if at all.
When mains fails D2 turns off and D3 will now light.
D4 is required to protect D2 from high-voltage reverse bias.
D5 is required to give the same voltage drop as D4.
D6 ensures that the voltage difference between the two LEDs is high enough to work as intended.
I haven't tested this. |
H: Change slope of Magnitude plot in 2nd order system
For the second order PLL with equation:
$$1-\dfrac{2\zeta\omega s + \omega^{2}}{s^{2}+2\zeta\omega s + \omega^{2}}$$
I used Matlab and obtained a Bode Magnitude (with zeta = 0.3, 0.5) like:
In the book "Phase Lock Loops and Frequency Synthesis" by V. F. Kroupa, the author has a plot that looks like this (for a 2nd order system found on page 14 of the book):
How can I get my slope, that is 40dB/decade, to match his 20dB/decade? Thanks.
AI: You have a 2nd order system, it will always be 40dB/decade. The figure is for a 1st order system (it says so in the caption), so it is 20 dB/decade. |
H: Bulletproof ESD Powersupply Inputs
I have a power amp that is essentially functions like a benchtop supply, and you can connect banana plugs into it. I would like to protect it against ESD, but also protect the amplifier. People in our manufacturing floor are stupid and sometimes connect things like batteries to the supply up backwards, I really can't prevent that, and if they do they will blow the diode right out. Is there a good way to protect the diode also? These are the ways I could protect it that I don't necessarily like:
I could fuse it but there would be no way to know if the fuse was blown and then you still have no diode and no protection and nobody on our floor would replace it.
Resistor in series, I don't like this idea because it makes the diode less able to sink ESD and protect the input. 8kv (human body model) across a 1ohm resistor is 8000V
Placing a resistor anywhere from the amp to the terminal will be bad, too much current.
simulate this circuit – Schematic created using CircuitLab
AI: If you use bidirectional TVS diodes instead of unidirectional TVS diodes and spec them above the possible battery that could be connected this would protect your output.
simulate this circuit – Schematic created using CircuitLab |
H: Why cellular modems (still) need a SIM card?
I'm designing an embedded system that will require a cellular modem (3G). I never used one but the designs I came across with they all use a SIM card slot.
I understand that this may be convenient but isn't there a way to avoid it? Why and how? What are the challenges of storing the information stored in a SIM card in any other kind of memory such as the internal memory of a microcontroller?
Thanks
AI: The cellular modem is designed to interface with the SIM card, using the SIM card signal levels and protocols, primarily to provide cellular-phone features - i.e., ability to switch SIM cards for different users / accounts, secure identification, secure SMS storage, association of saved data to account, etc.
Because the SIM is a secure storage device, as far as I know, it is required by design, and cannot be replaced with any other storage type.
That said, it is possible to source surface-mount SIM devices (called MIM) for permanent installation instead of the 2FF or similar "cards" which require a socket. However, these are difficult to source in small quantities. But the short answer is, yes, you need one, and no, there is no way around it.
If this is a problem, then look into the other wireless services and technologies available in your area. Or consider, if you have several of these devices, could they just "RF link" to each other using any standard RF transceiver module and relay information to only one device with the desired capability? This may be far easier to implement than a creating a "cellphone from scratch." |
H: Is it okay to use a power supply that provides slightly more voltage and amperage than what's rated?
To preface; I am aware that there are a lot of questions that are similar to mine. But I am finding mixed signals as well as jargon I don't understand; and I was really just hoping somebody could give me a yes/no because I'm really paranoid about plugging it in based off of my reading
I have an LED sign that says that it takes "Class 2, 18VDC, 2A" from a wall adapter with "100-240VAC, 50-60HZ, 1.2A"
I lost the adapter, and it's surprisingly difficult to buy a new one that matches those specs. I did find an old laptop power supply that has these ratings:
Input: 100-240VAC, 50-60HZ, 1.2A
Output:19V, 3.42A
There is a weird symbol between the 19V and the 3.42A, but I have no idea what it means.
Here is a picture of the sign:
And here is one of the laptop power supply:
AI: The weird symbol indicates its a DC output. This laptop adapter supplies an output voltage of 19 V and a maximum output current of 3.42 A, well above your original adapter's 2A maximum. This doesn't mean your device will consume 3.42 A when its powered with this adapter; it is only an indication of the maximum current that can be drawn through the adapter by any device that it is connected to, above which the adapter gets damaged. Any device will only draw as much current as it needs, so long as its power source can supply it.
However, the laptop adapter's voltage is a full volt above the specified 18 V; this will cause more current to flow into your device, since the voltage has been increased. Whether this difference is significant enough to destroy your LED sign is a matter of how much tolerance was built into it; the 1-volt increase may merely increase the brightness of the LEDs or burn them, if 19 V is outside the device's range, or have no noticeable effect at all (if the 19 V is being stepped down further within the device).
TLDR, don't try using this adapter unless you are willing to risk damaging your device from the extra current. |
H: Transformer output connected to another transformer. Measuring 'Real Power' at input of first transformer
I have a watt meter connected to the primary of one transformer to measure power. The output of this transformer is connected to the input of another transformer.
The watt meter is measuring the inductive load of the primary of the second transformer, as 'real power'. I figured I have to add a capacitor in parallel to the primary of the second transformer to filter out the current at the given frequency but I am not sure.
If I connect a load to the secondary of the second transformer, the reactance of the primary of the second transformer will change, in turn changing it's ability to filter out the frequency with the parallel capacitor.
Is what I am describing true? Or does it work differently? How are power lines avoiding experiencing 'real power' dissipation from transformers of appliances in our homes. I know transformers are inductive and give power back to the source. But in the double transformer test I describe the watt meter was measuring the 'apparent power' of the primary of the second transformer, as the the 'real power' in the 'eyes' of the primary of the first transformer. so if I measured voltage and current at the primary of the second transformer, I would multiply them to get an apparent power of 20VA. The watt meter would show 20Watts (real power) at the primary of the first transformer.
I hope that is clear. Thank you.
AI: The real power that you measure when there is no load connected to a transformer is the "iron losses" in the laminations consisting of hysteresis and eddy-current losses. The reactive power is due to the magnetization of the core. There will be a small copper loss in the primary due to the magnetizing and core loss current.
The total losses for one transformer feeding another will include some copper losses in the first transformer due to the total current supplied to the second transformer. The real and reactive power of the second transformer should be reflected unchanged in the measurements made on the primary of the first transformer.
Here is something to compare your results with:
I measured the no-load losses for a 150 VA transformer with a 120 V, 60 Hz primary. At 122.2 V, the input current was 0.13 A, the power was 5.3 watts, the apparent power was 16.6 VA and the power factor was 0.31. The data was taken with a Kill-A-Watt. The transformer weighs about 6.5 lbs and has a 3-3/4 X 3-1/8 X 1-7/8 inch lamination stack.
Data for a transformer rated about 100 VA was 3.1 W and 9.1 VA. A transformer rated 25 or 50 VA measured 3 W and 10.4 VA at no-load. The two larger transformers were for industrial products sold to paper mills and auto manufacturers. I believe the small transformer was used in a consumer product.
Comparison of Kill-A-Watt data with data taken with other meters leads me to believe that it is accurate within 1 to 3 percent.
If the meter indicates "lots" of power with nothing but the transformers connected and they aren't burning up, there must be something wrong with the meter or your use of it. My Kill-A-Watt has a Watt/VA button that toggles the display between Watts (real power) and VA (apparent power).
Here is a Kill-A-Watt meter showing watt and VA readings for a CFL lamp. |
H: Solar Power Watts/Volts/Amps
I have a 12v battery that is rated at 220ah.
I have solar panels rated at 500 watts total.
I'm using a MPPT charge controller rated for 12/24 volts
I only have a rudimentary understanding of electricity, so please forgive the elementary nature of these question that I hope you can help me work out:
Assuming we start at zero, and ignoring real-world inefficiencies...
If this is a 12v panel and it produces ~41 amps, would it take roughly 5.3 hours to fill up the battery?
If this is a 24v panel it produces ~21 amps, would it take roughly 11 hours to fill up the battery?
That seems counter-intuitive, but if "amps" = "the amount of electricity" I'm getting lost as to why that isn't true.
Is there any difference in usable power generation between 12 and 24 volt panels as long as they are at the same wattage?
Finally, if I have some amount of "amp hours" I'm trying to replace in a battery (let's say I ran that 220ah battery down to 110ah remaining and I want to recharge it), what's the formula for figuring out how many hours of sunlight I would need, if I have X watts worth of solar panels?
AI: The key to understanding your photovoltaic system is thinking in terms of energy and power. The battery capacity is measured in Ampere-hours, but this measure only tells you how many electrons can flow trough the battery before it discharges. How much energy each electron carries is determined by the battery voltage, so less Ah does not always mean less energy. To calculate the energy storage capacity of a battery (Wh), you multiply the capacity (Ah) by the nominal voltage (V) of the battery. In your case the battery has an energy storage capacity of 220 Ah * 12 V = 2640 Wh = 2.64 kWh.
The MPPT charge controller contains a DC/DC converter which allows it to step the fluctuating solar panel voltage up or down to match the battery. For example, if your 24V panel outputs 10A (240W), the charge controller steps it down to 12V and 20A which is then fed to the battery (still 240W of power, minus any conversion losses). The charge time difference between using a 500W 24V panel or 500W 12V panel should be neglible.
To calculate the charge time, divide the energy by the power. For example fully charging a half discharged battery would require 220 Ah / 2 * 12 V = 1.32 kWh of energy. If your panels output 500W, this would take 1320 Wh / 500 W = 2.64 h = 2 h 38 min. If the charging efficiency is say 90%, it would take 1.11 times longer still. |
H: Discharge / Bleeder resistors
I need to size and build a bleeder resistor network or could be as simple as two bleed resistors....im not sure but I have an application where a we have a step up transformer from 120VAC single phase to circa 1200VAC on the O/P side. When we power up the line, and the line could be anywhere from 5 to 120km with cross sections ranging from 6mm to 25mm for each of the conductors, ie L(6mm) and N(6mm) for application 1 and L(25mm)/ N(25mm) for application 2 they obvious act like a capacitors ie when we switch the power supply off, there is still a residual charge in the line. We then have to "dump" that to earth before we can work on it or you get a shock. So, question is, where to put the bleed resistors in the circuit, on the 120VAC "input" side of the XMFR or do they have to be on the O/P side? If they have to be on the output side, how do i connect them so they are not in circuit when the transformer is on but when it is switched off they are activated? Finding relays / contactors etc for 1200VAC rating is difficult. Also, We would need to bleed the circuit within approx 5 to 10 mins, so how do we go about sizing the resistors? The 1200VAC power supply is approx 2.5kVA rated.
AI: Because the residual charge would be DC, anything on the 120V AC mains side of the xfmr can't very well bleed it. However, if a slight loss of efficiency if acceptable, you could place a 1Mohm to 1.2Mohm resistor from L to G on your output. it would only bleed about 1-1.2mA of current (about 1.2-1.5W) during operation, but your 5-10 minute "powerdown time" gives 300-600 seconds for that "trickle" resistor to discharge the line significantly.
Alternatively, if you can source/afford/build an inductor with a similar resistance at your AC frequency, your efficiency loss would be similarly minimal (attaching the inductor from L to N, same as resistor), but would appear as nearly a "dead short" to 5he stored, capacitive DC charge, and most likely discharge the capacitance below 1V in >0.25sec after mains input power is cut. |
H: Distributing Ground and Clock Between ADC and FPGA on Separate PCBs
This question is in reference to my previous question where some suggestions were made that went somewhat off-topic.
Basically I have a built a system with an FPGA and very sensitive ADC (sensitive to picoamp currents) which is working well, but now it has to be separated into two PCBs.
Major questions are
How to properly share GND between the two boards in order to minimize ADC noise/error at all costs?
How to properly buffer the CLK and serial signals in and out of the ADC?
My proposed solution:
Concerns I'm having:
I know the ribbon should have GND in between each signal (since some are 40MHz) but should GND be connected to both planes on either side?
It was suggested to buffer the ADC I/O so that the ADC doesn't have to drive a lot of current, but where do the buffers get their power and ground from?
Here I have signals traveling over the edges of ground planes, which I've heard defeats the purpose of having a ground plane.
Since the PCBs are already getting a GND connection at the power supply, doesn't also having GND in the ribbon create a loop?
AI: Using isolators is the most straight forward way to couple boards like this while avoiding grounding and noise headaches.
For an isolated design to function, you need isolating buffers for all the digital input and outputs as well as an isolated power supply, although the later can be ignored if the power ground acts as the "star point" for your daughter board and you do not require isolation on the sensor part (e.g. a 'floating adc').
Conceptually this can be imagined by the following diagram
simulate this circuit – Schematic created using CircuitLab |
H: Using MOSFET as switch
I am new here so I apologize in advance for any mistakes in the way I am going about this. I had a question regarding a project that I am working on.
I am trying to use a MOSFET as a switch that I am able to control using the digital pins of the Arduino. The switch is meant to control a valve, so I would send HIGH to an Arduino pin and the valve would open. A diagram is below:
Sorry if my diagram is unclear but I will try my best to explain the issue. The supply on the left is meant to represent an Arduino digital pin. The valve is an 8W 12V DC valve that has very simple operation. If its terminals are connected to a 12V DC supply, it opens otherwise it stays closed. Now in this schematic Vdd is 12V (positive terminal of supply) but when I set the Arduino pin connected to the gate to HIGH, nothing happens. I have done the exact same setup except with a LED and it works fine, I can set the pin to HIGH and the LED turns on as expected and turns off at LOW. But this is not true when I use the valve
The MOSFET model and datasheet is here: http://www.mouser.com/ds/2/149/FQU1N60C-246709.pdf
This exact same setup works with a LED. I am wondering what is the issue when I use the valve?
But was unable to use the info there to figure out the issue. I am wondering if it has something to do with the amount of current going through the valve, if that might be too low but I am not sure.
Thank you very much for all your help!
AI: According to the mosfet's datasheet that you linked, the mosfet has a minimum S->D resistance of 11.5ohms (at 10V G->S). That, in series with the (calculated) 18ohm load of the valve: 12/(8/12), gives only ~7.3V across the switch, which could only push ~3W of power through an 8w switch, under "best case" conditions. In order to accomplish what you're wanting, you'll need a transistor with a lower saturated resistance, or you'll at least need to parallel >=2 of your current MOSFETs in order to lower the effective resistance. |
H: Is it possible that my UV LED is emitting white light? If so, how would I filter out the white light?
I recently purchased a 365 nm UV LED, and set up the proper circuit. When I turn the power on, the LED lights up very dimly. Is this white light (that's the color I saw) being emitted from the LED? If so, are there any methods (preferably inexpensive) for blocking out only visible light?
The specs for the UV LED can be found here:
http://www.mouser.com/ds/2/228/LZ1-00UV00-257812.pdf
AI: Figure 5 of the linked datasheet shows there is a small amount of emission in the >380 nm range.
I digitized the spectrum and computed how much relative radiant flux there is greater than 380 nm.
\begin{gather}
\Phi_\text{visible} = \frac{\int_\text{380 nm}^{\infty} \Phi_{\lambda} \text{d} \lambda}{\int_{0}^{\infty} \Phi_{\lambda} \text{d} \lambda} \approx 0.087
\end{gather}
So a bit under 10 % of the radiant flux is being emitted in the visible spectrum. I don't know what color this would look like in practice, though I suspect it might be have blue-violet hue since about 88 % of this is in the 380–400 nm range. Assuming 1050 mW total radiant flux, this means there's about 92 mW emitted in the visible spectrum.
You can find "reasonably priced" (~30 USD) shortpass and bandpass filters which transmit UV while blocking visible wavelengths, for example this one. This would reduce the visible radiant flux to about 10–30 mW (eyeball estimated). If you have more money available, there are of course better filters. |
H: Capacitors in parallel without resistance
For the following circuit, at time 0, the switch switches from A to B, figure out the voltage wave form at B.
The question I am concerned with is whether the voltage across the capacitors will change instantaneously or not? Will the output waveform at B be a step function? (0 for t<0 and C1/(C1+C2) after t>0).
AI: Ideally, yes. In reality, no. The impedance of the wires will slow down the transfer of current, making the output waveforms resemble the normal R-C curves (albeit very shortened). |
H: Amperage limit of lead pencil resistor
What is a safe amperage limit for a homemade lead pencil resistor? I made a 25 ohm resistor with a regular wood pencil and would like to know what current it will take without getting hot to the touch. Anyone play with this and know?
AI: 2B or not 2B?
The 'lead' is a mix of graphite and clay. The harder pencils will have more clay and will probably be higher resistance. If you've got 25 ohms then 1 A will generate \$P = I^2 \cdot R = 1^2 \cdot 25 = 25 W\$ and on a 15 cm pencil that will be \$\frac {25}{15} = 1.6 W/cm\$. You should notice a rise in temperature.
Beware of any funny effects where the resistivity changes with temperature. I can't think of any but there may be some weird temperature coefficient and if it's negative the current may escalate ...
Report back! |
H: A conceptual question about voltage multipliers
Imagine a micro-controller's pulse output is coupled to a voltage multiplier with many stages such as in the case of a Dickson voltage multiplier. We then can increase the DC "voltage" level of the pulse this way..
But since we still use the micro-controller as supply, unlike in amplifier case we are limited with the micro-controller's pin's max current output right??
So we have a situation where we can increase the voltage but we are still limited with the max current can be driven by the load.
If I understood it right in my above paragraph, what can this be used for? Any useful applications?
AI: The output of the voltage multiplier will deliver less current than the circuit driving it. If your multiplier can draw 30mA on the input side then it will never deliver 30mA on the output.
Voltage multipliers are used to generate high voltages from lower voltages - duh! You use that kind of thing when you need high DC voltages. The ouput of a voltage multiplier is DC even though it starts with AC or pulsating DC.
Wikipedia gives an explanation of how they work (with diagrams) and also names some uses - extremely high voltages for physics experiments being one use.
Another common use is (was) to generate the high voltage for cathode ray tubes - that's the old fashioned TV tubes in monitors and TVs. They needed several thousand volts DC to operate.
A good reason to use a multiplier is that it can be difficult to rectify high AC voltages. That is to say, you could use a transformer to get the needed high voltage, but then you'd have to convert the high AC voltage to DC. High voltage parts are more expensive and/or harder to get. Using a multiplier lets you use parts rated for lower voltage to generate the high voltage. Your parts only have to be rated for the difference in voltage between each stage of the multiplier rather than for the whole voltage range from low to high.
In answer to the questions in your comment:
It is a bad idea to drive anything directly with the output of the processor's output. Use the output from the processor to control a transistor that drives the multiplier. This protects the processor and allows you to have a higher output current.
Frequency limits wil be given by the diodes and the capacitors you use. Diodes all have an upper limit to how fast they can switch. The capacitors can only charge as fast as the available voltage can make them, so you are limited there as well.
Do read the Wikipedia article and the information in the external links. |
H: RC circuit with two capacitors
Figure out the Vout wave form of the following circuit: ( assume the name of the 9u capacitor to be C2 and not C1)
Is there any way to intuitively plot the waveform by understanding the behavior of the circuit? Assume that initially all the capacitors are discharged.
My attempt at the problem:
C1d(Vin - Vout)/dt = C2 dVout/dt + Vout/R
For t<0,the output voltage remains zero.
For t>0, the input voltage remains constant resulting in an equation
-C1 dVout/dt = C2 dVout/dt + Vout/R
or (C1+C2) dVout/dt = - Vout/R
Solving this equation,
ln (Vout) = - t/[R(C1+C2)] with initial condition of Vout being zero which poses a problem with the logarithmic function. Am I making any mistake in my analysis?
AI: If by intuitively you also mean qualitative, yes.
Considering both capacitors are ideal and initially discharged, you have a mathematical discontinuity in front of you if the input impedance coming at Vin is zero, and that should ideally be tackled with Laplace transformation.
Now considering the expected capacitors behavior, both capacitors will charge (the 1u cap faster than the 9u) and stabilize at certain in-between voltage.
If you want actual waveforms, you can solve the maths using Laplace transform (which is the correct way, but I will not be troubled to doing it), or take a wild guess as to what is the voltage after the discontinuity in each cap is and draw some exponential assymptotes - with a discontinuity peak at t=0 and exponential decay/growth to final voltage.
Edit: correct answer, thanks to user1582568
The voltage Vout after the discontinuity can be calculated by the divisor rule [C1/(C1 + C2)]*Vin = 1V. The final voltage is zero, and the resulting waveform is an exponential decay with time constant T = (C1 + C2)*R. |
H: Can I charge a lead acid battery with a lithium ion battery?
I am asking specifically about automotive 12V lead acid batteries but I suppose the principles may be universal.
If I were to connect a fully charged 15V Li-ion battery to a discharged 12V lead acid battery (at around 11.5V), would the Li-ion battery charge the lead acid battery?
My theory is that since the potential at the battery terminals is about 14.7V when the car's alternator is running, attaching a 15V battery will have the same effect. Is this correct or will it result in some horrible acid flinging hydrogen explosion?
AI: Yes you could charge a 12V battery with a 15V battery. Since you can not control any parameters when charging this way (arguably you control voltage) it is not optimal, but a constant voltage charger is probably good enough for a lead acid battery but possibly harm your lithium ion battery. With other technologies you probably would like to control the current and possibly the charge cycle.
There are many modes of charging. I include this link after a quick google search where you can read the section "Basic Charging Methods" on this page http://www.mpoweruk.com/chargers.htm. |
H: Is it possible to use a MOSFET for Li-ion reverse polarity protection when protecting a charger?
I've made a simple charger out of 4 TP4056 modules and 4 18650 sockets. These modules have overcharge, undercharge and overcurrent protection included, but I also want to know how simple it would be to make it also reverse-polarity protected since that condition is much more likely as the above 3 combined, given that I'll swap batteries often and am bound to be mistaken once in a while. I'll also likely build some chargers for other people for their needs and this could be a nice feature. Could I just use the MOSFET trick to make reverse polarity protection for the charger or is there something I'm missing?
AI: The p-mosfet trick won't work as both sides supply voltage. You could use a latching circuit (P-mosfet + npn bjt) but it would only work for the first battery you charge, unless you power cycle the circuit every time you change the battery. A further improvement would be to use a microcontroller to check the battery status before turning on a MOSFET, but at that point it is getting stupidly complex.
The cheapest and easiest method would be to use a diode and a fuse as protection.
simulate this circuit – Schematic created using CircuitLab
If you were to add the battery in backwards, the diode would protect the charger IC from the bulk of the current while the fuse would disconnect the battery. Don't use a 1N4148, (they are low current signal diodes), I forgot to remove the name. A >2A schottky diode would be ideal.
EDIT:
The latching circuit previously mentioned would look like this:
simulate this circuit
When initially given power, R1 pulls the gate of the MOSFET close to the source, keeping the mosfet from turning on. Once a lithium cell to be charged is added, current from the cell flows trough R2 to the base of Q1, turning it on. Q1 then pulls the gate of the MOSFET low turning it on. If the battery is connected backwards Q1 never turns on and the MOSFET never conducts. D1 is there to protect the base of Q1 from the negative voltage of the battery.
The problem is that even after removing the cell the MOSFET stays on, allowing Q1 to stay on and keep pulling the gate low in a positive feedback loop.
Now that I think of it, the latching circuit would work after all: If the MOSFET is on when adding a cell the wrong way, the charger IC goes into short circuit protection which causes the charger output voltage to fall below the threshold voltage of the MOSFET switching it off, and interrupting current flow. |
H: Termination resistors usage
My doubt pertains to the usage of termination resistors. This is a continuation of the discussion I saw in this link - Termination resistor.
I understand that any transmission line can be simulated using a set of LC components (viz a number of tank circuits).
When it says a transmission line, it can also mean a microstrip, right ? Because a microstrip can also send a high speed signal, right ?So, does that mean I will need a termination resistor even in a microstrip ?
AI: A microstrip is a variant of a transmission line. Just like a piece of Coaxial cable it a variant of a transmission line.
A transmission line transports a signal (from A to B) without affecting it (except for some attenuation) but only when used properly.
How to use a transmission line properly ?
At the input side use the proper source impedance when applying the signal.
At the output side use the proper termination impedance to ground.
If these conditions are not met, you will get signal reflections.
For example, if you do not place the proper termination at the end of the transmission line, part of the signal reflects back and distorts your signal.
When the proper termination resistor to ground is present, it will appear as if the transmission line "goes on for infinite length" and there will be no reflections.
This also applies to a microstrip line so yes, you need to terminate it properly. Unless you want or you can tolerate to have signal reflections of course ! |
H: Waterproofing a wire for fish tank
My fish at a part of the insulation on my filter. What is the best way to fix the insulation and also make sure that it remains waterproof?
The best option I came across is silicon gum. Can I apply it directly over the naked wire and pray for it to work?
AI: You can apply "aquarium grade" silicone directly to the wire and (after curing fully) it will work, BUT: If your fish already ate insulation from one section of your wire, maybe the better question here would be: How do I keep my fish from eating more insulation off of my filter wire(s)?"
Any fix you use can only be as good as your ability to keep the fish from simply chewing off the original insulation from another spot. A possible solution to that may be to slit a piece of aquarium air tubing lengthwise; then push the vulerable part(s) of the wire (after repairing current damage) through the slit so your wire's insulation is now "armored" by being wrapped in the harder-to-chew air tubing. |
H: Testing voltage continuity using a beeper?
I have a 48v rail and i wish to plug it into an audible oscillator to check for continuity when i am rattling the system under duress. What is the simplest circuit that i can plug into 48v to hear the voltage accurately?
I want an always on buzzer that makes a sound when it is running on 48v and that stops if the current is briefly interrupted.
AI: The simplest I can think of would use a relay, push-button switch and a buzzer. If you can't find a suitable 48V relay and buzzer, you may need a voltage regulator.
Push SW1 to start the buzzer. That will latch the relay on, unless the voltage drops out. Then the buzzer will stop until you re-start it with SW1 again.
simulate this circuit – Schematic created using CircuitLab |
H: Why is analog "voltmeter sensitivity" is defined as ohm/Volt?
What is the motivation to define a sensitivity of an analog voltmeter as ohm per voltage?
AI: Because the meter movement has a full scale deflection at some specified current. A series resistor is used to turn it into a voltage measuring device. The value of this resistor will be V(for full scale) / I(full scale). So the impedance of the meter will be 1/(I full scale) ohms per volt (FSD). |
H: Is a screw or push-in terminal better for vibrating environment?
I need to decide what connector to use on my PCB to connect low power wires. Among the available options on Farnell/Mouser etc. The price and size are almost similar.
I wonder if using a screw terminal or a push-in terminal would be better for a vibrating environment?
AI: Push-in or 'cage-clamp' terminals have been around for several decades now and are a reliable solution for connections in general and vibration-proof contacts in particular. Some of the electricians where I work still prefer the hand-tightened screw terminal but some of our machine builders have switched to cage-clamp, where possible, to eliminate problems with terminals vibrating loose during road transportation.
Cage-clamp terminals are made by many companies.
Figure 1. Wago cage-clamp terminals.
Some of the terminals require a 'just right' screwdriver to release the cage properly. (Some screw terminals require the right tool too.)
Figure 2. Cage clamp and wire showing excellent contact area.
(Photos used previously in my answer to another question.) |
H: What is the impedance limit for using 10X probes with oscilloscopes?
I thought 10X probes are only used for impedance matching at high freq. circuits.
But I read in a text that they are also used in high impedance circuits to prevent loading. But isn't a scope's input impedance already huge? I mean what is high impedance in this case and how can 10X help the situation?
AI: A typical scope input impedance is 1Mohm + 20pF. This is not huge, even with a 100k source I get 10% error DC and 20pF is only 8k impedance at just 1MHz. A 10x porbe makes the input 10meg + 2pF, much better. It also allows for tuning of rise times by trimming a small capacitor in series with the R in the probe. |
H: How to determine sinusoidal steady state response from bode plot
I'm given a problem by the following:
Find the sinusoidal steady state response (in the time domain) of the following systems modeled by transfer function, P(s), to the input u(t). Use the Bode plot (in Matlab bode.m) of the frequency response as opposed to solving the convolution integral of the inverse Laplace transform.
$$
P(S) = 11.4/(s+1.4), u(t) = cos(5t)
$$
I'm a bit confused by the question because I thought bode plot is the definition of steady state response, but it's asking me to find it in time domain. Is such thing possible? Anyways plotting this in matlab gives me the following:
$$
Y(S) = P(S)U(S)
$$
where from laplace transform
$$
U(S) = s/(s^2+25)
$$
Y =
11.4 s
-------------------------
s^3 + 1.4 s^2 + 25 s + 35
Continuous-time transfer function.
>> bode(Y), grid
This doesn't look like a typical bode plot either (Maybe because output is third order?) What can I infer from this representation of bode plot?
Edit: So this is a bode plot for just P(s)
At w = 5, it seems like the phase of -75 degrees and magnitude of 7db
Since magnitude in db, the final steady state response in time domain is
$$
Y_sss(t) = 2.24cos(5t - 75^{\circ})
$$
Really? This simple?
AI: Firstly, the bode plot you are interested in is NOT the bode plot of Y, but of P. You have probably misinterpreted the problem's objective. Plot it and add resulting images to your question.
Then what you want to do is check your input signal nature. In your example, it is a pure cossine with angular frequency 5 and unitary amplitude. When looking at bode plot of P, check for the amplitude (A) and phase (theta) at such frequency. Your response Y will then be A*cos(5t + theta). [yes, easy like that]
Since you are working with a linear system, this concept can be extended to other types of input signals through proper decomposition of input by fourier series. For example, if U were a square wave, it would have all odd harmonics leading to infinity right? With the bode plot of P, I can check the gain and phase shift for each harmonic component of the resulting wave Y!
There are many others analysis to be made from bode, such as group delays and system stability. But I hope this answer leads you through the right way. |
H: Boost converter for high side Mosfet
I recently came across an article explaining how to drive a high side MOSFET using a "separate isolated power supply whose ground and the ground of the MOSFET-based circuit are isolated". However after reading this article I still do not completely understand the driver circuit and had a number of questions:
Why is it necessary to use an isolated power supply rather than a non isolated power supply that will simply boost the gate voltage to able 12V higher then the voltage of the "main supply" in this case 12V higher than +24V with reference to ground?
the isolated power supply shown in the figure is represented by a battery, how can I instead replace this with a boost converter? (should the input to the boost converter be +24V and ground, with the output negative connected to the source of Q1 and positive terminal where the positive terminal of the battery was)
what effect does having the negative terminal of the isolate power supply connected to the source of Q1 have?
is there an isolated boost converter that you can recommend given the small current required to drive the gate.
if applied to a H-bridge will i need 2 seperate isolated boost converters (one for the left high side drive and one for the right high side drive?)
The circuit suggested by the this article is below:
AI: An isolated supply makes things really easy. You can easily get isolated DC-DC converters that will output 12V. By using an isolated DC-DC converter, you can treat the output just like the battery in your circuit. There is less chance for interaction between your isolated drive and the rest of your circuit. Starting at $3-4, it would probably be worth your time for a one-off or low volume solution.
This is why you do not "simply" connect a boost converter to do the job. You could probably have the input 12V power supply be your source, and then have it run in a discontinuous mode. Voltage regulation of your gate driver supply is a significant concern, as you would probably need something like a zener diode to limit the maximum voltage. Past that, you'd also need a current return path for the boost charging loop, which may be an issue if your load decreases significantly or is disconnected. Even then, I'd probably start from a bootstrap topology and hack in the boost converter.
Your gate driver, when connected to the source of Q1 with an isolated supply, is setting the gate to source voltage directly. It sets the gate-source voltage to either (Vsource + 12V) or (Vsource). Otherwise, you need to know what the source voltage is in order to drive the gate safely. If 36V is applied across your gate-source terminals, your MOSFET will probably be destroyed.
Digikey/Mouser/etc... has a wide assortment of isolated DC-DC converters that generate a fixed output voltage. An "isolated" boost converter does not exist (because it would be called something else). You're probably on your own if you want to make your boost converter idea work.
Yes. |
H: PT1000 2 wire probe. Can I add third wire?
I'v got 2 wire (81 cm) PT1000 probe which I want to utilize in a project.
I would like to use current source and couple of opamps to make the measurement through ADC (uC) just like described here: link1.
The point is I need to reach measurement spot which is 5 meters away. I will measure added wire resitance by multimeter and substract it in uC.
As I understand from link1 PT1000 3 wire probe has been used there (first image on the top). Can I modify somehow the schematic to use my 2 wire probe or can I attach third wire [link2 in comments] (I understand disadvantages of this setup)?
AI: Sure you can add the extra wire. Just bring it out to the element.
It should be noted that this is not a proper 3-wire RTD scheme and the extra wire only halves the error. A proper 3-wire scheme will reduce the error (in theory) to zero, or at least to the mismatch in resistance between wires.
Here is an example of such a scheme:
simulate this circuit – Schematic created using CircuitLab
To see how this works, consider equal resistances RL in each line. The voltage drop from ground to the lower end of R1 is \$(Ix-2\cdot I_X) \cdot R_L\$. The voltage drop from the top of the element to Vsense is \$+I_X \cdot R_L\$. The voltage drop across the element is just \$I_X R1\$.
So the voltage at Vsense relative to ground is:
\$-I_X \cdot R_L +I_X \cdot R_L + I_X R1 = I_X R1 \$
And the line resistances (if matched) don't have any effect on the measurement. |
H: LED's flash with music
I am wanting to put have a few LED's flash with the intensity of my music. I don't need a color organ, but just want the LED's to flash in sync with the music. I am amplifying the signal with a LM368 chip and playing music from a 4ohm 3W speaker and it's sound quality is great. The problem is my LED's don't turn on at all..
I am using the configuration that many people claim works well but its usually done with a TIP31 transistor and not a 2N3904. I tried inserting an opAmp with a gain of 10 before the base of the transistor with no success.
Does anyone see a problem with my circuit or know of a reason the LED's arn't turning on? Any advice would be appreciated
Thanks
AI: Odds are that Q1 is smoked. You forgot to add a current limiting base resistor to limit the current.
You should probably add a reverse diode on the base (after the resistor) to protect the transistor. The diode is recommended because you are feeding the base with an alternating voltage that swings above and below zero volts. When it swings negative the base-emitter junction is reverse biased. It will probably survive given that you are operating on a low voltage but it's good practice anyway.
Test the transistor with your multimeter diode test function. You should get 0.7 V b-e and b-c with + lead on base. You should get high reading when leads reversed.
simulate this circuit – Schematic created using CircuitLab
Figure 1. Modified circuit.
When you get Q1 going again the next problem will be that you'll probably smoke the LEDs. You have no LED current limiting resistor in your schematic. You might get away with it if your supply voltage is low.
Edit: I couldn't read the supply voltage. I now see it's only 5 V. That won't be enough for four LEDs. As others have suggested, try them in parallel pairs. |
H: What is the purpose of a "BUF" in Xilinx ISE schematic?
I'm working on a schematic for a Xilinx CPLD using ISE. The schematic has a triangle symbol labeled "BUF" before every output, and also between some other nets. I can't really tell why some connections have "BUF"s and some don't. I read the documentation (Page 72 of this pdf) and it just says "This element is not necessary and is removed by the partitioning software (MAP).". So if it isn't necessary what is the purpose of adding them to the schematic?
AI: One purpose on the CPLD schematic is that it allows two nets with different names to be tied together. |
H: Using a relay switch to switch power to solenoid
I'm fairly new to electronics, so I'm hoping I'm not so misguided that I am wasting all of your time. Basically I need to power a solenoid which in turn controls a gate valve, and the solenoid requires 24V DC. The manual for the whole thing describes very little, and I don't have any info like inrush current, which I'm worried about since any searching so far has had people providing that. The solenoid just has 2 black wires coming out of it, and is marked 24V DC.
To power the thing, I am going to use a 24V AC/DC power supply (here). I want to be able to control the whole setup remotely using a computer, so I immediately thought to use a relay controlled by USB. However, any time I've used this sort of stuff in the past, I've just been going off of Arduino tutorials or something, so I just bought what was recommended there.
I want to make sure I have a proper understanding of how to use these. What exactly is the difference between requiring 5V vs say 12V to power the relay? Can 12V handle more current passing through them, and that's the main reason to use a stronger one? If I were to say purchase this relay board, would that work? Under relay parameters it states 5V/72mA, 15A/24VDC, 10A/250VAC. The 5V I would understand as the potential I need for the relay, but does 15A/24VDC mean it can pass up to 15A/24VDC, meaning this would work for my application here? Or am I really misunderstanding this? Is there an entirely easier solution that I have no idea about? I currently envision connecting the power source to COM, then the solenoid to NO and switching it when the solenoid needs to be powered.
Additionally, bonus question, the relay will be very far away from my pc (guessing 60-70? feet of wire), should I worry about power loss by powering from USB? I just grabbed a USB powered one from a search, powering at the location and controlling via usb is perfectly fine, but usb powered would be convenient.
Thanks for your time and any help you can provide!
AI: There is no real difference between the 5V and 12V relays. It's mostly a convenience depending on the supply voltage you have. A 5V relay is more convenient for USB. This voltage refers to the switching/coil voltage.
The 15A 24V DC does mean that, it's the maximum switched load can be supported. If this is good for your solenoid depends on its current. If you don't know the inrush, assume 2 to 3 times the stated current. Your solenoid is 4.5 Watts, at 24 Volts means 180 mA typical. Rule of thumb rounding, assume 1 Amp for the power supply and relay supported load voltage.
Usb has a max of 16 feet without a hub or booster. Keep it near the computer, and extend the 24 Volt side, at 60 feet (120 round trip), with typical 18/2 AWG cable, you shouldn't see any significant voltage droop. The solenoid should still trigger at a lower voltage anyway.
Alternatively, think about using a remote relay. Wifi, or RF. Or ethernet. Or if you already have the USB relay, use a small computer to drive it. Something like the Raspberry Pi with a wifi usb stick or ethernet. |
H: Frequency Shift a Bode Magnitude Plot
for the 2nd order response of $$1-\dfrac{2\zeta\omega s + \omega^{2}}{s^{2}+2\zeta\omega s + \omega^{2}}$$
I get the plot shown in blue. How do I go about getting the plots shown in red and green that is basically frequency shifted?
AI: The term \$\omega\$ (natural resonant frequency) needs to be lowered in value. It should be as simple as that but you may also want to tweak the \$\zeta\$ term to modify the peakiness of the filter. |
H: Why can people touch high voltage?
So I know that you need a certain current flowing through you to die, I've heard from some people "its the amps that kills you", and from others "Its the volts that drive the amps" and I realize that these are true according to ohms law v=ir or i=v/r.
But I was watching this video:
https://www.youtube.com/watch?v=ubZuSZYVBng
A guy touches a constant 200kv and i've seen a similar experiment in real life, assuming that his body has 100Kohm of resistance which is generous, thats 2 amps flowing through his body if you use ohms law, and realistically way more as there would be less resistance and it would decrease after it makes a circuit. How is this possible without him dying?
AI: A Van de Graff generator can only deliver microamperes of current continuously, so the voltage was no longer 200kV or whatever after he touched it. It was probably less than 1 volt.
If you want to look at it more technically, the generator is like a constant current source of something like 10-50uA (wild guess) feeding into a capacitor and some leakage to ground (corona discharge) that occurs at high voltage. Discharging the capacitor of (the hemisphere at the top has some capacitance) and you're left with just the microamps of current, which is not remotely enough to be dangerous.
simulate this circuit – Schematic created using CircuitLab |
H: How to use a LM1117T-3.3 voltage regulator to convert voltage
I am doing a project where the components require 3.3v input instead of 5v, but my arduino pro mini can only supply 5v. Thus, I bought a lm1117t-3.3 voltage regulator to regulate the voltage, but the output from the voltage regulator is not 3.3v, but around 1v. This is the way I connected the voltage regulator, please give me some suggestions to overcome this problem, thank you.
AI: This is how a typical LM1117 3 Pin Fixed Regulator is shown in circuit schematics:
This is symbolic/logical, NOT! Physically.
This is how they are typically physically wired, text side forward:
If you physically wired it as you show, Vin-Gnd-Vout, that will not work, and may have damaged it.
Of course, not all regulators use this pin out. The LM780x series does use Vin-Gnd-Vout. Always check the data sheet for your part's manufacturer.
Additionally, the LM1117 series requires a 10 µF Tantalum output capacitor. It may also need an input capacitor depending on how far the power supply is. It also has a minimum output load to be stable. 5 mA or so should be enough. A Led + Resistor would work. |
H: Programming MSP432P401R on a custom PCB
I got a MSP432P401R LaunchPad and wrote/ran some applications with it.
What if I want to use it in a real life application. How can program the MCU when I design my own circuit and place it on the pcb. My guess I need to connect programming pins of the mcu to some pin headers and connect an external programmer to those pins, when the code is uploaded the pcb will be ready to work.
My question; what is the minimum connection I need to do between the programmer and the MSP432P401R, which pins are the programming pins and what kind of external programmer I would need?
AI: See the schematic in the data sheet for the MSP432 Launchpad
And Section 2.3.4. Jumper Header J103 (unpopulated, on the left hand side) is used for external targets. Set the S101 switch to external, remove the Isolation Block jumpers. Only SWD is used, so the debugger needs to be set to that. Since the UART is only required for user defined communication, not debug, all you really need is SWDIO, SWCLK, Reset, and Ground. The 3.3V VCC Target if you want it to power the target otherwise you have to provide your own power to your target board. That's it.
2.3.4
The XDS110-ET emulator on the LaunchPad can interface to most ARM derivative devices, not just the on-board MSP432P401R target device.
This is not a common use case, but for users who want this functionality, there is a way to enable it. Connector J103 was added to expose all the necessary programming and power signals. J103 is a 50 mil spaced 7-pin header. By default it is not populated, so the user will have to populate a connector or directly solder in wires.
When using the XDS110-ET with a different target, the jumpers in the isolation block should be removed, and switch S101 moved to the external debug position. This will disconnect the XDS110-ET from the MSP432P401R target and enable debug of an external device. Because only the SWD signals are exposed, the user needs to set the debugger settings to SWD (without SWO) in the IDE. See the IDE specific MSP432 user's guides for more details on this setting.
To debug other external devices, there are many options in the ARM debugging ecosystem including the XDS100v2/3 and XDS200 from Texas Instruments. There are many other options including IAR I-jet, Keil ULINK, and Segger J-Link. |
H: How does this wall-wart switcher work?
UPDATE
I've provided a full outcome report in one of the answers below with an updated schematic and description of the operating principles as I've come to understand it.
I'm studying switching converters to feed a strange craving to understand how
they work. I'm just getting to the part about off-line AC-DC converters in the
books, but being a practical sort, I thought I'd open up one I have handy and
see what I could explain so far.
Here's what it looks like after opening:
And here's the schematic I reverse-engineered from it:
[click to expand]
Here's what I think I understand so far. All component labels are as printed on
the PCB:
C1 gets charged to roughly 170V DC by the line bridge rectifier and supplies
the input current.
B1 is the transformer (no idea why it's not T1). B1P12 is the primary winding
terminating at pins 1 and 2. I believe this is the main primary
inductor/winding.
R3, C3, and D7 comprise a snubbing network for the main inductor. The "R1A"
designator signifies a "rectifier-style diode, about 1A in size". I'm not
able to see the markings without desoldering it, which I wanted to postpone
for now. Also, given the provenance of the other parts, I'm not sure I'd
discover much.
R6 provides base current for U2, the main switching transistor (a TO-220).
U1 is a base driver for the main switch, shunting base current when turned
on. This is a TO-92.
Moving to the output, D10 (LED) and R11 provide indication when output
voltage (nominally 12V) is present on the output.
C8 is the output capacitor.
B1S (secondary) is the only secondary winding and pulls current out of the
negative end of C8 during the off stroke, providing the output energy. D9
blocks reverse current through the secondary.
Here's what I don't understand yet:
There's no clock/oscillator. How the heck does it switch periodically? The
only thing I can think of is some resistor and capacitor make up an RC
circuit or something.
What does B1P34, the second primary winding (on pins 3 and 4) do? I've heard
of these being used to power a \$V_{CC}\$ rail, but there are no ICs in the
circuit to power. Maybe it provides bias current for the opto and base driver
or something?
I expect that D11 is a zener, maybe 11.5 V or something. I can't tell by
inspection; it just looks like a signal diode package. But it makes sense to
me in that location to turn on the opto when \$V_{out}+\$ goes above 12
V or so. I don't get what R10 does though.
I also don't get what C5 or C7 do, but I've probably asked enough.
Can a more experienced eye help me decode some of this?
AI: Well done so far.
R6 is too big to provide all the base bias to U2 in normal oscillation, but it does 'tickle it into life' at start up.
There is no clock because it's self-oscillating. That's what the B1P34 winding is for, through components like D5,8 and R2. This network is disabled when the opto turns on.
When U2 starts to turn on, the feedback is such that it turns on harder. It stays on with the current growing steadily in B1's inductance. Eventually B1 becomes saturated, when two things happen. U2 collector current increases rapidly as the transformer inductance collapses, and the feedback voltage starts to drop for the same reason. U2 comes out of saturation, and the collector voltage rises rapidly. This is fed back and U2 starts to turn off. The feedback now turns it off harder. U1 takes part in this as well by shorting the BE junction to remove the base charge rapidly. This flyback phase ends eventually when the core has transferred its energy to the secondary. I haven't analysed it completely, but I suspect it's the R6 bias that restarts the whole conduction cycle.
R10 is to pre-bias the zener. Zeners don't have a sharp turn-on curve, they can draw quite a few uA at volts below their rated voltage. R10 keeps the zener well into conduction, so the turn on of the opto is better defined.
This doesn't answer all your questions, but may redirect your investigations. Try redrawing the components around B1P34 to emphasise their feedback role.
Bear in mind that some components' function may not be obvious, if they've been added to reduce EMI for instance. |
H: MCU External Interrupt False Triggering
Above is the picture describing the configuration outside the MCU.
Vin is 0 to 5V Peak to Peak square wave which may have 0 to 50 KHz frequency, or even higher.
The MCU is supposed to handle interrupt every falling OR rising edge(configure as either one of them, but not both) of the /INT port.
In order to not jam the MCU with interrupts in case of very high frequency VIN, I
added a simple low frequency filter in front of MCU port.
The problem is that I am seeing false trigger of interrupt, If i set up as rising edge trigger. Everything works fine if i set up interrupt as falling edge.
How I know that Interrupt is false triggering is that I am measuring the time between each interrupts, as I am feeding the certainly known signal(from calibrator, observed with oscilloscope).
The problem goes away if I remove the 10nF capacitor.
However, in my application, I have used up all the timers, so I cannot use timers to limit the interrupt frequency, which forces me to limit it outside of the MCU
The cpu is PIC32 series.
Is there any ways I can achieve purpose of preventing external interrupt from firing too frequently?
AI: Your input setup has a time constant of 10 microseconds, a huge amount of time when looking at MCU ports.
When the input transitions, it will spend significant time in the input indeterminate region - the range of voltages between Vil(max) and Vih(min). This will result in the input pin sensing something and quite possibly changing states multiple times for a single input transition on the output of the input buffer, thereby resulting in multiple 'phantom' interrupts.
In addition, this appears to be a CMOS input, and slow rise / fall times risk damaging the input buffer structure.
This application note from TI explains the issue.
Removing the capacitor allows the signal to move through the indeterminate region cleanly, minimising the possibility of metastability as these pins are asynchronous inputs.
I see the port pins have a Schmitt trigger available, but the 'peripheral input' buffer does not. If you can select the Schmitt trigger input, then the capacitor should have no effect (other than reducing the number of interrupts you may have per unit time).
The datasheet I have shows a mixture of trigger and 'ordinary' input pins, but the list will vary by device, so check your specific pin tables. |
H: Launchpad vs Development kit
Whats the difference between a Launchpad and a Development Kit? Many launchpads like the TI's Stellaris/Hercules launchpads even support In circuit debugging capabilities via USB. This eliminates the need of purchasing a JTAG debugger.
AI: "LaunchPad" is the name given to TI's development kits that support expansion via "BoosterPacks". So in short, practically nothing. |
H: Problems involved in going from 0805 to (say) 0402 surface mount?
In order to reduce the size of a PCB I will probably have to use smaller SM components. I currently use mostly 0805 passives, and am thinking about going to 0402 or smaller. Apart from power dissipation considerations, any pitfalls I should be aware of when making the transition?
The assembled boards will be made by a specialist contractor
AI: 0402 obviously is harder to hand assemble. I am young (<30), moderately near sighted (-4.5) and have a reasonable steady hand. I can hand assemble 0402 boards without magnification, but it is very tiresome to do them for hours on end.
If you need to get them assembled by machine; make sure that:
1) Your assembler's pick&place machine can even handle 0402 at a good rate & yield. Some assemblers may charge more because they are forced to run the boards through one of their more modern machines.
2) Double-sided load. Some boards just need this assembly step, like BGA often puts decoupling caps on the bottom of the board. However some assemblers have trouble with 0402 components on the bottom side of the board. They may force you to keep it at 0603 or greater. The risk is that 0402 components will slip of the board in a 2nd reflow cycle.
3) Electrical properties. Obvious one is of course power rating of resistors. Voltage rating is also likely worse, because of the physical smaller dimensions.
But also consider the voltage bias degradation effect of ceramic class 2 capacitors; for smaller packages in same voltage/capacitance this effect may be worse.
On the other hand, some properties like lead inductance is lower. In addition sometimes you can put capacitors right at the chip pins for QFP style packages, while routing signals underneath the chip. In effect the loop area for the decoupling capacitor is much much smaller than a larger size capacitor that may be placed further away to comply with signal routing. |
H: Meaning of infinite self inductance
I am reading about the characteristics of an ideal transformer and it is mentioned that self inductance of each coil is infinite. Could someone help me to understand the physics behind it? When self inductance goes to infinity that means that the voltage across the coil goes to infinity and I have a large magnetic flux and current. I was wondering if this is a right conclusion.
AI: If self inductance is infinite, then any rate of change of flux would generate infinite voltage, but look at it the other way. Any amount of back emf can be generated with infinitesimally small rate of change of flux. When we apply a voltage to the primary of a transformer (with no secondary load), an equal and opposite back emf is initially generated and no current flows. In order to maintain the back emf, there must be a rate of change of flux, which requires an increasing primary current. The larger the self inductance, the smaller the rate of current rise required to maintain the emf. As self inductance approaches infinity the rate of rise of current approaches zero. So in the ideal transformer one could apply a voltage to the primary for ever with no current flow. The voltage across the socondary will be the primary voltage times the turns ratio. The current in the primary will be the secondary current / turns ratio. |
H: SPI using one wire
I need to communicate between a transmitter and a receiver using visible light therefore i have only one communication channel. so i was wondering if SPI interface can be implemented using one-wire only? if not, what is the alternative that can reach high rates?
AI: The moment you implement the data transmission over one wire it ceases to be a SPI.
You could use another serial protocol like one wire or UART (if you send commands only one way).
The difference between SPI and UART is, you need a to have clock for SPI, where for UART you don't send clock as a separate signal, but then you need to implement a clock recovery on the receiver end.
I recommend you use something that has UART communication, if your devices/ICs already have a SPI, use SPI to UART converter IC. |
H: Is resisting DC motor bad for it?
If I keep the shaft of a DC motor in place while it is running does this harm it in any way? Is it bad for it at all?
AI: In general, yes, because the stall current for a motor can greatly exceed the rated current, and exceed the continuous current rating of the motor's windings, brushes and commutator, and burn out the motor.
In some motors it won't instantly kill the motor but heat it - the motor will survive short overloads but can't dissipate the heat from a continuous overload. If you've been making heavy cuts with a saw or a drill it's often good practice to run the motor unloaded for a minute afterwards so the built-in fan blows cool air through it.
This excessive current under heavy load is a necessary consequence of keeping the winding resistance down to keep the motor's efficiency high under normal (high speed) operation.
Cheap motors tend to have incomplete data but for a reasonably complete specification see this datasheet and note (the first column)
"Maximum continuous current" 6A. (The nominal rating for 100% duty cycle)
"Starting current" 105A. (This is also the stall current).
Typical motors like the Mabuchi RS550 are designed for lower efficiency so the stall current may only be 6-10x the rated current (here 83A vs 10.8A at max efficiency, max continuous current is not specified).
In neither case should you mistake the stall current for the rated current : the RS550 surely cannot survive 83A at 9.6V (about 800W) for very long!
However, in your case (a motorized fader) the motor is small, low powered, probably has quite a high winding resistance and low efficiency, and may be able to survive a fairly prolonged stall. This is a deliberate design choice to limit its stall torque rather than injure a sound engineer's fingers! Alternatively its drive current may be deliberately limited. Over and above that, its controller apparently detects its drive current to detect stall or manual override, and cuts off the power before any damage can be done. It is completely safe to stall this motor by hand. |
H: Integral non linearity in ADC
I am trying to understand the parameters in an ADC datasheet. The precise parameter being the INL(integral non linearity). Now, I was going through this website INL website.
.
Now, there is another website that shows the ADC error of a 12 bit ADC as 0.00024.
The other website.
.
In the former it is in terms of percentage so I understand. But why a factor of 0.5 or 1/2 is present ?
The ADC I am using is the ADS62P15. In page 5 of the datasheet I see the INL defined (typical) as +/-1 (LSB). Now, is this a percentage value ?
AI: You are mixing things up.
There are multiple errors in AD conversion. Differential nonlinearity error, gain error, offset error, etc.
For this example i'm making up a 2 bit ADC, max Vin 4V.
Quantitization error: Always +/- 1/2LSB.
This makes your translation function in shape of steps. Our ADC has 4 codes, 00, 01, 02, 03. If the voltage is between 0 and 0.5V it will always return a 00, for voltage between 0.5 and 1.5 it will always return 01. LSB in our case is 1V (25%).
2.Integral nonlinearity error makes the ideal straight line transfer function bend. This means that some bits are larger voltage "steps" then other. One bit covers more voltage if it is lower, than if it is higher.
So in INL tells you "how much does the Quantitization error" increase over the whole range of input voltage. Your datasheet says +/- 1 LSB for INL. If we say the conversion at 1/2 of the voltage range is with out error, This means you get an extra error of 1LSB at 0V and at maxV. If you don't compensate that it may induce an error of one 1 LSB.
So you can't rely on the last bit. If your error is +/-1LSB in 11bit system this means 1/(2^11) or 0.048%.
Your error all together (only quant. error and INL) is 0.054%.
Read more about the errors here. |
H: Why does a relay have a minimum applicable load?
I am trying to find relays for my application and I read a data sheet which looks fine but specifies
Minimum applicable load: 10mV 10µA
In my circuit, it is expected that the relay closes but no voltage and current is applied. You can think of it as 2 relays in series where one is open and one is closed, so there is no current. This sounds like something I'd do since I was at school.
Why would a relay require a minimum voltage and current on the load side? Is it allowed to operate that relay under my conditions or not? What could possibly break in a relay if I don't respect this requirement? What does "minimum applicable load" mean? When and how do I need to consider this value?
AI: The primary reason that almost all relays have a minimum load requirement is that the mechanical action of closing coupled with an actual current flow are required to 'whet' the contact and break through a layer of oxidation that invariably builds up.
That is one reason that small signal relays generally use expensive contact alloys which resist oxidation, but as the phone company found out decades ago, even pure gold contacts can have issues in a high humidity environment. While oxidation doesn't affect the gold contacts, repeated cycles of moist/dry air would deposit an insulating layer. |
H: Microcontroller Interface with Modbus Serial
I'm a beginner and I'm trying to acquire data from a microcontroller with Modbus serial protocol in order to create an interface with LabVIEW. I'm using a Prolific Technology USB-RS232 converter and Windows 7 as OS.
I can't read data from the micro. I know that read only varibles are in registers from 100hex and 1FFhex and read/write variables are from 200hex and 2FFhex.
How does the memory of micro need to be used? How do I define holding registers and input registers?
Thanks in advance for any advice.
Andrea.
AI: Here are a few basic Modbus Commands you need to know:
0x01 - Read Coil Status
0x02 - Read Input Registers
0x03 - Read Holding Registers
Holding registers are READ ONLY registers. They typically hold values that the microcontroller measured or calculated. Input registers, in my experience, are Read/Write and are used to give parameters to the controller.
You should download a Modbus Master program from the internet, there are hundreds. The program will use the 232 port to send the modbus commands to the controller and wait for a response.
A typical Modbus Master message looks like this:
Read Holding Registers 100-105:
Device Address Command 1st Reg Number of Registers Checksum
100 0x03 0x64 6 CRC
(our starting
register + 5) |
H: Car DRL Led wiring beginners question
I bought this relay (http://www.ebay.co.uk/itm/400972235163) and this LED DRL lights (http://www.ebay.co.uk/itm/400757922989).
The questions are:
Can I attach 2 led lights to this relay (as it only has one red and one black wire) ?
If (1) yes, can I splice that red and black wires to get 2 red and 2 black wires?
If (2) yes, can I just solder and protect the ends of two red wires to the one from the relay ( a same for black ) ?
If (3) yes, can I use this cable (http://www.ebay.co.uk/itm/321770426302) to extend everything? Relay says 12V 5A and mentioned cable says 12V 8A.
Image attached ( that's what I have in plan )... is that all right?
AI: 1: Yes, you can attach any number of LEDs (or pretty much anything else you like) to the relay, so long as you ensure that there is never more than 5A of current drawn through it. CAVEAT: The LED lights you linked didn't have a listed wattage or amperage. Without knowing how much power they draw, we can only guess as to whether or not the pair of them could take more than your relay's max 60W/5A.
2 & 3: Yes, and for vehicle wiring, soldering or crimp-on connectors are the preferred attachments as the vibrations can cause other connectors (like wire nuts) to work loose.
4: Yes, any wire rated for at least 5A/12V should be safe to use with that relay.
Image: Yep, that's how to do it. |
H: SD Card Reader with LPC43xx
I am trying to implement an sd card reader on lpc43xx devices. For this I can make use of the LPCopen examples that use the ROM based drivers. However for some reason the ROM based driver example states that it only supports sd cards up to 4Gb.
So now I probably have to port the outdated LPCUSBlib drivers in order to implement the sd card reader. Of which a specific bug discussed in this question:
SDXC Card Reader with LPC1822
In this question it is replied that the LPCUSBlib version only worked up to 4GB initially as well. And a fix is proposed to accept sdxc cards of up to 64GB. (However it seems like in his pre fix code it should already accept up to 32GB) So I am confused whether this same fix was used to solve the initial issue of only supporting up to 4GB.
My question is, does anyone know the exact bug fix that got it working for >4GB. And would this solve the same problem for the ROM based rivers? The reason for asking is to prevent me from porting the LPCUSBlib drivers and then finding out that it only supports up to 4GB as well.
Thanks a lot.
AI: This is speculation, so don't hold it to high standards :)
Difference between SD and SDHC is the fact that addresses are no longer byte based (32-bit number gives you the 4GB limit. Sandisk's website [1] says 2GB is the limit, but I vaguely remember 4GB cards in both variations), but 512B sector based.
As for 64GB, those are supposed to be SDXC, but as far as I can see the difference is just the filesystem change (exFAT vs. FAT32), which seems a bit silly, since the SD interface addresses blocks of raw data. I can't find a reference explaining any other difference, and would appreciate it. I've only used SD and SDHC on microcontroller, so my SDXC understanding could be wrong.
To actually answer: No, it definitely won't be the same bug fix (support for different commands and sector vs. byte addressing). I guess the upside is that a bugfix might not be needed at all.
[1] http://kb.sandisk.com/app/answers/detail/a_id/2520/~/sd%2Fsdhc%2Fsdxc-specifications-and-compatibility |
H: converting 3.3v to 1.2v
I have a electrical problem that I hope to get some help with. Let me first start of by saying that I'm quite a noob in this field (I'm a IT guy), but I hope to learn something.
The problem I have is this: I have a sensor to monitor the humidity of soil.
When I power it with 3.3v I get a output of 1.9v when it is fully submerged in water and a output of 3.1 v when it's dry.
For my project I actually need a output value between 0.2v and 1.2v
To achieve that, I've created a voltage divider (my first ever) using a 1k and a 2k resistor. When I power it with 3.3v I get a output of 1.04v, which is pretty close to what I want (Close enough I thought).
My schema looks like this:
I measure at points A and B
I powered the sensor with the 1.04v (so at point B), so the connections look like this:
I was hoping to get a well scaled value out of it. Unfortunately the results are not quite what I wanted. When it's fully submerged, I now get 0.71v, and when it's fry I get 0.86. It seems I'm now losing a lot of resultion, so I'm guessing there must be a better way to do this.
This is by the way the sensor I'm using: Link
The reason I need a value between 0.2v and 1.2v is that I want to hook it up to a ESP8266 Wifi module / microcontroller.
Any ideas?
AI: Simple Solution, limited range
Well your close but not quiet there. In the description of the sensor on the webpage you linked it says that the operating voltage is 3.3v to 5v. So while you may have been able to only use that 1.04v as Vcc I would suggest just using the 3.3v source.
What you want to do is have the voltage divider on the output of the device. I have the circuit shown below
simulate this circuit – Schematic created using CircuitLab
Now here is how I got those two values.
First off you have stated that the high voltage for the output was 3.1v. You want this value to be only 1.2v. Using the Voltage divider formula shown below you can almost get all the values you need.
$$V_{out} = V_{in}*\frac{R2}{R1+R2}$$
V_out is the disried 1.2v, V_in is the 3.1v of the sensor. Now I simply picked R1 to be 10k and solved for R2. Now using these values to see what the lower voltage will be you end up with 0.67v. While its not wonderful its the best you will get with a simple voltage divider.
Harder solution, better range
Alright, So I'm going to keep this as simple as I can. In short you have two problems you have to solve. First you need to 'subtract' a voltage of 1.9 from the output of the sensor to shift it, then your range will be 1.2v down to 0v. However this new output has a total range of 1.2v, not 1v. To correct this you need an amplifier with a gain less then one. Now for simple things like this a LM741 is a pre-built amplifier IC. It has 4 pins, a Vcc(+Power), Vss(-Power), Inverting input, and non-inverting input. Operational amplifiers like the LM741 can do many, many different things but I'm only going to cover your application. They can be used as amplifiers(duh), voltage subtractors, voltage adders, comparators, level shifters and the list goes on. However for this application we will be using the voltage subtractor and amplifier properties. The circuit you need is below with an explaining following. I encourage you to read all of it, op amps are used in tons of applications.
simulate this circuit
In this circuit the inverting input will have a constant voltage, which will 'subtract' a voltage from the voltage on the non-inverting input. The gain on the non-inverting input can then be adjusted to give you the scale you want. Now I'm going to direct you to this link, this site is very helpful for new people and I still refer to it when I don't feel like re-deriving equations for common circuits(why re-invent the wheel?). I'm just going to hop to the end where it has the equation I'm going to use. Keep in mind my subscripts are not the same because my resistors are labeled differently.
$$V_{out}=\frac{R_4}{R_3}*(V_2-V_1)$$
Now the high and low voltage of V2 is known, the voltage output that we want is known. Now I'll be assuming R4 is 10k again, since if you don't there will be technically an infinite number of solutions. The equations below show the equation with the numbers pluged in. First for the high voltage you want, second for the low voltage you want.
$$1.2=\frac{10k}{R_3}*(3.1-V_1)$$
$$0.2=\frac{10k}{R_3}*(1.9-V_1)$$
Now when you solve this you get that R3 need to be 12k and V1 needs to be 1.66v. V1 can be obtained by a voltage divider. There's an example further up so i'm going to skip that.
Note 1: Since you are connection this to a microcontroller you may want to add in a zener diode to limit the upper range range of the voltage, with either circuit if the sensor does go above 3.1v, you will go over 1.2v on the output, which if the microcontroller can can only go up to 1.2v, you can damage it. A simple way to do this is with a zener diode. Below is breif circuit of how to do it. You can do homework to understand how it works.
simulate this circuit
Note 2: Many micro-controllers will have a analog to digital converter(ADC) built into them and the input range of the ADC is from the Vcc of the micro-controller which is commonly 3.3v down to 0v. So you may not even need to do this and instead just attach the output of the sensor right to the micro-controller. Then you can use the ADC to get a number representing the voltage and do whatever you want with it. |
H: Monitoring Lithium Polymer Battery Voltage from Microcontroller
I am working on a project in which a microcontroller (specifically an RFduino) is powered by a LiPo battery and the microcontroller needs to monitor the voltage of the LiPo. Five of the RFduino pins are already being used for sensors so I only have two pins available for power management. If possible I’d like to use one pin to detect when the battery is charging and the other to measure the voltage.
Currently this device is using the MCP73871 chip for LiPo charing/power management and a 3V LDO voltage regulator to regulate the voltage powering the RFduino. I can run the power good signal from the MCP73871 to one of the two free RFduino pins - as seen in the diagram - to detect when the battery is charging. I would like to use the remaining free pin on the RFduino to measure the battery voltage.
Unfortunately I can not measure the battery voltage directly on the RFduino because the LiPo goes to 4.2V when fully charged and the maximum voltage the RFduino can handle is 3.6V. I was hoping to be able to uniformly shift the voltage below 3V using diodes or a voltage divider but from a couple google searches it looks like current fluctuations would make that impossible. I am not an electrical engineer and I’m way out of my element at this point. Is there a way I can modify my existing circuit to monitor the LiPo voltage on the remaining free pin? I’m out of ideas and any help is greatly appreciated! Thanks!
AI: I was hoping to be able to uniformly shift the voltage below 3V using diodes or a voltage divider but from a couple google searches it looks like current fluctuations would make that impossible.
That sounds like BS, do you have a source on that? A simple resistive voltage divider can be used to linearly scale down the voltage:
simulate this circuit – Schematic created using CircuitLab
This would drop the 4.2V maximum voltage down to 2.89V, well within the range of the input. The divider output has an impedance of 69KΩ, which should be low enough for the analog to digital converter but I could not find the ADC specs anywhere in order to make sure. |
H: Is program code copied to SRAM from flash on microcontroller?
On PC, program executable is read from hard disk, and loaded into RAM to execute it. On microcontroller, program is stored on flash.
Is it loaded into SRAM when microcontroller starts up?
If yes, then STM32F103 document says, flash is 64KiB, SRAM is 20KiB. Program doesn't fit into SRAM. (Same for other microcontrollers as well).
If you will say that not all flash content is loaded into SRAM, what purpose does the remaining data on flash serve to? All operations are done on SRAM already in program codes.
AI: Most 8, 16 and 32 bit microcontrollers execute the program directly from flash. This is true of the STM32F103 range. Most microcontrollers are capable of executing the program from RAM, but only relatively specialised programs actually do this. For this reason, most microcontrollers have far more flash than RAM.
There are some microcontrollers that have lots of RAM and little or even no flash. It may even be possible to get an STM32 like this. These parts rely on storing the program off-chip in a physically small and cheap serial flash chip such as a Micron MT25Q.
True microprocessors (where the RAM and flash is in separate IC's, such as the ARM 7 and similar parts) can and often do copy the program from flash into RAM and execute it from RAM. The main reason for this is that RAM is usually much faster to access compared to flash, so the program will run faster. Fast processors often run the Linux operating system which usually works this way. It also gives Linux the ability to store the program in other types of storage memory, such as SD cards and serial interface flash (serial flash).
Linux can be made to execute the program directly from flash (it is termed Execute-in-place) but this usually suffers a performance penalty. |
H: How much binary data is transmitted across a physical wire in one clock cycle?
How much voltage change, what I'm calling binary data, can be transmitted over a wire at one time in one clock cycle? I understand, I think, binary data is what we call it and the wire doesn't really send out a one or a zero. It is conceptual.
I've been reading the question and have a measure of understanding, but not great. I understand there is a frequency at which voltage is transmitted and represented by us visually/logically as binary data. But how much "data" can be transmitted over a wire in one cycle? Is one cycle one voltage transmission (a bit) across a physical wire? Like Morse code but with computers it ends up being really, really fast (Ghz).
AI: Actually, the answer to your seemingly simple question is more complex than you'd readily believe!
The short answer is that one signal at a time can be passed through a single signal wire, in one cycle. The amount of data that symbol represents depends on the protocol used.
The long answer is that:
2-state protocols, like OOK (On-Off Keying), pass only one bit (on or off) per cycle;
1-dimensional multi-state protocols, like FSK(Frequency Shift Keying), PSK(Phase Shift Keying), FM(Frequency Modulation), or AM(Amplitude Modulation), can transfer a few bits of data at once;
Multi-dimensional multi-state protocols, like QAM(Quadrature Amplitude Modulation), can transmit fairly huge amounts of data in a single cycle (I've seen QAM 512 {9 bits per cycle} advertised). |
H: Battery charger output power higher than input?
i would like to ask about battery charger i saw at work :) the plate on charger says:
Input voltage 3 phase ac
Min 400v
Nominal 400-415v
Max 456v
Input current
20A
Output
110v DC 9kW
28v DC 3kW
Now if we do simple math with no losses input is 9012W. How can be output 12kW?
Or the manufacturer gives these readings as separate? When we charge only one kind of battery?
AI: There's a factor of \$\small \sqrt 3\$ for three phase |
H: Attiny85 water plant with mini water pump
I`m new to electrical engineering, so it's probably a newbie problem.
I'm using a wall power supply(5V-2A) to power the DC Motor and the Attiny85.
A C1 470uF to make the power more stable. I don't know if it is necessary, but it helped.
A D1 green led to show if it's on.
A reset button connected to ground to reset(Duh).
One relay(833H-1C-C) connected to the digital pin 0 of the attiny to turn the motor on and off.
Two rotational potentiometer connected to two analog pins(2,3) to decide how much time the mini water pump will be on(0-1023 to 1s-30s) and the other to compare to the humidity sensor to decide how dry the soil will need to be to turn on the motor.
And one humidity sensor.
#include "kPot.h" // my library, just analogReads
#define HUMIDITY_PIN 1 //humidity sensor
#define LEVEL_PIN 3 //rotational potentiometer
#define TIMER_PIN 2 //rotational potentiometer
#define MOTOR_PIN 0 //connected to the relay switch
kPot humiditySensor = kPot(HUMIDITY_PIN, 10); //(pin, average of 10 reads)
kPot levelPot = kPot(LEVEL_PIN, 10);
kPot timerPot = kPot(TIMER_PIN, 10);
int humidity = 0;
int level = 0;
int timer = 0;
void setup() {
pinMode(MOTOR_PIN, HIGH);
humidity = humiditySensor.Read();
level = levelPot.Read();
timer = timerPot.Read();
}
void loop() {
humidity = humiditySensor.Read();
level = levelPot.Read();
timer = timerPot.Read();
timer = map(timer, 0, 1023, 1000, 30000); //1s to 30s
if(humidity < level){
digitalWrite(MOTOR_PIN, HIGH);
delay(timer);
digitalWrite(MOTOR_PIN, LOW);
}
delay(300000); // 5min Update
}
The problem: The mini water pump turns on and won't stop.
I removed the reset button to make sure that wasn't resetting, didn't help.
Maybe the motor is taking too much current and reseting the attiny?
I probably have to put a diode somewhere, but as I said, I'm a newbie, so...
thanks.
AI: Ok, not sure this will fix everything, but it should at least improve several problems (and avoid some component damage).
Try adding 2 diodes, a transistor, and a decoupling capacitor to your circuit like this:
EDIT: Updated schematic to include decoupling cap. |
H: Why is my VHDL clock signal so far off from what I thought it would be?
I'm new to FPGA and VHDL. The following code was supposed to be 5MHz but I'm getting 4.167MHz on my scope.
The FPGA board I have is a Mojo v3 that has a 50MHz clock.
What am I doing wrong?
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity clock is
port (
clk_50mhz : in std_logic;
rst : in std_logic;
clk_out : out std_logic
);
end clock;
architecture Behavioral of clock is
signal prescaler : unsigned(4 downto 0);
signal clk_out_i : std_logic;
begin
gen_clk : process(clk_50mhz, rst)
begin -- process gen_clk
if rst = '1' then
clk_out_i <= '0';
prescaler <= (others => '0');
elsif rising_edge(clk_50mhz) then -- rising clock edge
if prescaler = X"5" then -- (50_000_000 / 5_000_000) / 2
prescaler <= (others => '0');
clk_out_i <= not clk_out_i;
else
prescaler <= prescaler + "1";
end if;
end if;
end process gen_clk;
clk_out <= clk_out_i;
end Behavioral;
AI: 50MHz/4.16666MHz = 12.
You are counting to 6 twice, not 5 twice as you think you are.
The classic off-by-one error :)
If it seems muddled, try simulating your code, and that ought to clear things up. |
H: Why is wiring some LEDs in series better than wiring them all in parallel?
I noticed a lot of guides for making an LED array or matrix prefer to wire their LEDs in series first and then wire strips of leds in series in parallel. What is the benefit of this Vs wiring them all in parallel aside from energy usage, since in series, each LED would be dimmer. Is it to do with current balancing ?
AI: It highly depends on the Source Voltage vs the Forward Voltage of the leds. A 3.3 led on a 12 volt source will be wasteful if a single led + resistor compared to 3 3.3 volt leds + resistor on the same 12V source. Mainly, the lower voltage that a resistor has to drop, the better.
Assuming 20 mA and 12 Volt Source, one 3.3v led requires a 435 ohm resistor, dropping 8.7 volts at 20 mA, or 0.174 Watts. If we change that to 3 leds, the resistor drops 2.1 volts at 20mA or 0.042 Watts. Out of 12 Volts. * 0.02 Amps or 0.24 watts, the 3 led string results in a more efficient power usage. You are wasting less power in heat through the resistor.
If it was three leds in parallel, each with its own resistor as suggested, then the power wasted would be 0.174 watts * 3, or 0.522 Watts. Compared to 0.024, that'd what, 2000%?
Wire wisely or kill your battery. Or wire wisely or waste your power supply. Use Ohms law. (V - Vf) * I |
H: Solder paste stencil application
I am trying to do reflow soldering with a stencil for the first time. I have done some reflow soldering before, but every time I manually applied the paste using a small syringe + needle. These attempts went well and I was able to solder some QFN and 0603 components. In my newest PCB I am using 0402 passives, a 0.5mm LQFP64 IC, an LGA IC, a BGA IC, and overall significantly more components. As a result, I'm trying out using a stencil for the first time.
I had double-sided, 4-layer boards made by OSH Park and 5 mil Kapton stencils made by OSH Stencils. I am using Chip Quik lead-free solder paste , which is the same as I used in my previous run, but a fresh batch . I am using the lead-free version because the BGA is lead-free and am trying to reflow it at the same time as the other components.
The problem I have run into is that during solder paste application, the solder paste doesn't seem to want to stick to the pads. I am doing the following steps:
Clean board and stencil with IPA, let both dry
Align stencil and pull flat (Kapton stencil has curvature, I'm guessing they cut it from a roll)
Apply solder paste (small amount was dispensed cold and left for ~3hrs to warm up) to stencil using a needle, making sure to cover each aperture.
Press plastic card at ~45deg angle, scraping the excess paste off the stencil with 1 swipe
Gently lift stencil starting from one side, trying to keep it from moving in areas that haven't been lifted.
The problem becomes apparent at step #5. When I lift up the stencil, some of the paste is applied (mostly on the larger pads), but a significant amount of the paste is kept in the stencil apertures, most notably on the fine pitch components. Right after scraping off the solder paste, I have checked to make sure that all the apertures are filled with gray paste. The paste is definitely inside the apertures before I lift up the stencil (before starting step #5) and it stays aligned on the pads. I designed the paste layer to be ~80% of the area of the pad with a rectangular aperture shape.
Does anyone notice any glaring errors with my procedure or have any hints on what I can do to make the paste stick to the pads better during stencil removal?
AI: First, for these small apertures, a 3-mil stencil thickness would work better than the 5-mil. OSH Stencils offers both. The extra thickness adheres more to the solder, lifting it from the PCB. Also, even when it works, the thicker stencil can leave too much paste on the pads.
Other than that, I recommend a few things:
Surround your pcb with other material of the same height. Other blank PCBs are good for this. This keeps the flexible stencil from bending down around the edges, lifting away from the surface of the board.
Tape these supports to the table with masking tape or Kapton. Tape the PCB to the supports. Tape the stencil to the supports. Tape, tape, tape!
Make a thick line of solder along the left side of the board. This assumes you are right-handed and will drag the squeegee from left to right. Don't bother putting paste down near each hole.
Drag the paste across the board in one motion. As you go, make the angle of the squeegee more and more acute. Start around 45 degrees and end up at 25-30 degrees. This forces more solder towards the holes.
Peel off the stencil.
If you end up with a few holes unfilled, I would remove the stencil anyway and apply paste manually with the syringe. Swiping over the stencil again often messes up the previously-good solder deposits.
Also, if your board is small, you might find that a utility knife blade makes a better squeegee than the supplied plastic card. |
H: about grounding on different circuit board
I got a STM32 development board, which is used to control another board for DDS output. The STM32 board send digital signal (TTL) for output control on the DDS chips. The STM32 board and the DDS board are powered in different supply. I wonder in this case, do I have connect the STM32 board and the DDS board in common ground so to make it work?
AI: Yes. TTL signals need a common ground reference. If you need isolation, you can optically couple the signals. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.