text
stringlengths 83
79.5k
|
---|
H: Why don't we see electronic devices in bathrooms failing under such high humidity?
I recently read that the relative humidity inside a fogged-up bathroom, such as during/after taking a shower, should be close to 100%. And we know that bathrooms these days are filled with all kinds of electronic devices – some of which are even explicitly expected to be used inside the shower (such as electronic shavers). But I've never seen electronic devices/components rated to be used in anything close to a 100% humidity environment – it's usually rated to something like 40% relative humidity. So why don't we see bathroom devices failing under such high humidity? Or are these devices actually designed to be fine in 100% humidity environments? If so, then how?
AI: The failure modes for electronics in washrooms are as follows;
an insulator becomes a conductor, contaminated with moisture, dust, flux etc.
an insulator becomes a bigger capacitor up to 20x to 80x greater due to the dielectric constant of water and RF or fast rise time circuits.
a conductor becomes an insulator caused by corrosion accelerated by moisture or %RH
4.a conductor bridges another conductor from corrosion.
The solution depends on the protection level desired for water-spray or immersion, but may involve conformal coating, enclosure rubber seals and ultrasonic cleaning.
Therefore consider the solder mask and conformal dips or spray to reduce moisture ingress types to improve insulation from contaminants with humidity. Most plastic is hydroscopic so choosing the right type depends on the environment.
Even good brands like Philips wet shower shavers have a limited lifespan due to moisture ingress and the reliance of good neoprene seals. |
H: How does a boost converter behave when used as a battery charger?
I'd like to use a boost converter as the primary power supply for a lipo charger. Disregarding the BMS, which will be a separate component, how does a step-up boost converter behave when used as a battery charger?
I'm looking at something like this boost converter, and my system is 28V input, up to 50.4V output (12s lipo). A p-channel switching circuit would switch source (output of converter) to load (battery pack)
A Lipo battery should be charged first at constant current and increasing voltage, followed by constant voltage and decreasing current.
Does something like the above boost converter:
Output maximum current at varied increasing voltage, then decrease current once maximum voltage is reached?
Output maximum current + voltage at all times?
Do something else entirely?
Would a single converter be appropriate, or would the system require one configured for constant current, then switch to another configured for constant voltage?
AI: This converter has trimpots for CV,CC,UVP,OCP and indicators Vin on the output UVP, OCP so it behaves exactly how you set it up and may be used to charge batteries but it does not have a shutoff for LiPo or Lithium Ion type batteries usually set to <10% of CC during CV mode. |
H: Clamping the ACS770 Hall sensor output to 3.3V
Could anyone please help me with my question?
I would like to measure DC current from 0 to 50 amps using ACS770 hall effect current sensor with STM32F745 MCU. The problem is Max limit of ADC of my MCU is 3.3v but ACS770 will output 4.5v at 50amps and .5V at 0 amps.
I saw one circuit to solve this kind of issue but would like to know the part no. of components that I can use.
Circuit is here:
3.3V ADC protection
AI: That circuitry is a voltage clamping circuitry. The output is clamped to 3.3v when Analog In is over 3.3v. So, you can safely(?) ignore unmanageable current. Meantime, "Analog In" needs a resistor in series to take the current when clamped
Instead, you may use a simple resistor divider and a buffering OP amp as needed.
Here's how to catch a fish: Go to DigiKey/Mouser and search for "rail to rail" and the rail voltage you desire, and may other parameters.
Edit
OPA choices: DigiKey |
H: Why can't I route USB lines through a relay?
I need to connect two phones with USB-B Micro ports through a relay. I need the relay because I need to control when the phones are connected. I made two USB-B Micro cables with wires on one end. One cable is configured to be the host and the other is configured to be the server. When I connect the ends of the two cables directly to each other, the phones connect to each other. However, when I route the cables through the relay, the phones won't connect. I checked the resistance of the lines to make sure that the relays are closed and they were (<1 ohm). Any idea why I can't route my USB lines through the relay?
AI: I think a relay would introduce a large enough impedance discontinuity in the transmission line to ruin signal integrity and prevent USB2 from working.
There are USB switch chips, here's an example. Focus is on low capacitance to get good signal integrity. It could also work with any low capacitance analog switch IC, but if the chip is specified for USB use, it has more chances of working.
If you want a "low-tech" solution, put a USB hub between the two phones, and use the relay to switch the hub power on/off. |
H: Figuring out the importance of each component in a circuit
This is the blueprint of a circuit that I've got to build on a breadboard, but I've a lot of questions regarding this.
In the first part of the circuit, there is a V_cc of 10V, a diode D1, a LED D2, two resistors R7,R8 and C3. I assume that the purpose of the two resistors is to drive safe current through the led D2, but what are the purposes of D1 and cap C3?
Also, the voltage measured at the node after D1 gives a value between 9.3570 and 9.3530, an oscillating waveform. Why is this so? It should have been a fixed one, considering D1's breakdown voltage were given to be 75V, and an average forward current of 0.2A.
Also, if I were to judge whether the circuit worked simply as a voltage source or current source, do I need to check the series internal resistance? If so, is it just the series resistance of R7 and R8?
Can someone help me out in these? I would like to ask other follow-up questions, I'm an absolute beginner in electronics. Thanks.
AI: D1 protects the circuit if the voltage supply is connected backwards. C3 reduces voltage ripple from the supply; giving a quieter DC voltage source for the rest of the circuit.
Diodes do not prevent oscillation. They block reverse current. Your diode has a 3 mV ripple on top of a 0.65 V forward voltage. The diode voltage and current never reverse, so the diode never stops conducting. Also, 3 mV is a very small ripple. That's not enough to turn a diode on and off even in a simulation.
I'm not sure what you mean by "whether the circuit [works] simply as a voltage source or a current source". Do you mean Vsupply and the nearby components? Current sources are usually made with transistors or voltage regulators. One characteristic of a good current source is a high source resistance. Your voltage supply has a small series resistance, so it doesn't act like a current source. |
H: behavior of a pipelined divider
Divider can be made combinational, which uses more logic gates..
Divider can be made sequential, the throughput may stay the same, i.e. use as many stages
as the width of the dividend (assuming width of dividend same as divisor), so that it can't compute multiple divisions at the same time.
Can sequential dividers be made so that they can compute multiple division at the same time with different stages of divider? what would be the input/output ports be like to accommodate such capability... I am thinking inputs are clk, reset, "dividend", divisor, and input_ready. Output should be quotient, remainder and output_ready... are these sufficient? what about the synthesizability of the code?
module divide3 ( clk, rst, dd_input, dv_input, quotient,
done, rdy, remainder );
parameter [1:0] READY = 2'b00,
BUSY = 2'b01,
FINISH = 2'b10;
input clk, rst;
input signed [`DD_LEN-1 : 0] dd_input;
input signed [`DV_LEN-1 : 0] dv_input;
input rdy;
output signed [`QLEN-1 : 0] quotient;
output signed [`QLEN-1 : 0] remainder;
reg signed [`QLEN-1 : 0] q;
reg signed [`QLEN-1 : 0] r;
output done;
reg done;
reg quotient, remainder;
reg [`DD_LEN-1 : 0] dividend;
reg [`DV_LEN-1 : 0] divisor;
reg [(`DD_LEN<<1)-1 : 0] A;
reg negDivisor, negDividend;
reg[1:0] cState, nState;
integer i;
reg sample;
always @(*)
begin
case(cState)
READY:
begin
i=0;
done = 0;
sample = 1;
if (rdy)
begin
if (dividend[`DD_LEN-1])
negDividend = 1;
if (divisor[`DV_LEN-1])
negDivisor = 1;
nState = BUSY;
A = dividend;
end
else
nState = READY;
end
BUSY:
begin
if (i<`DD_LEN)
begin
i=i+1;
nState = BUSY;
sample = 0;
if (A[(`DD_LEN<<1)-1:`DD_LEN] >= divisor)
begin
A[(`DD_LEN <<1)-1:`DD_LEN] = A[(`DD_LEN<<1)-1:`DD_LEN] - divisor;
q = q +1;
end
q = q<<1;
A = A<<1;
end
else
begin
if (A[(`DD_LEN<<1)-1:`DD_LEN] >= divisor)
begin
A[(`DD_LEN <<1)-1:`DD_LEN] = A[(`DD_LEN<<1)-1:`DD_LEN] - divisor;
q = q +1;
end
r = A[(`DD_LEN <<1)-1:`DD_LEN];
if (negDividend!= negDivisor)
q = -q;
if (negDividend)
r = -r;
nState = FINISH;
end
end
FINISH:
begin
done = 1;
sample = 0;
nState = READY;
end
default:
begin
nState = READY;
done = 1'bx;
remainder = `QLEN'bx;
quotient = `QLEN'bx;
end
endcase
end
always @(posedge clk, posedge rst)
begin
if (rst)
begin
quotient <= 0;
remainder <= 0;
A <= 0;
done <= 0;
cState <= READY;
end
else
begin
cState <= nState;
if (sample & rdy)
begin
dividend <= dd_input;
divisor <= dv_input;
end
if (done)
begin
remainder <=r;
quotient <=q;
end
end
end
endmodule
AI: Yes, you can take a combinatorial divider and add pipeline registers to increase the throughput. I've done exactly that for a few projects where I needed a result on every clock cycle @ 150 MHz. |
H: How to generate +5 V and -9 V voltages to read an Intel 1702A EPROM via Arduino?
I have some simple experience with TTL logic and Arduino, but I'm only a hobbyist and am bit stymied by my current project, which is attempting to read the data from an old Intel 1702A EPROM. The actual reading part should be simple: set the address lines and look at the data lines.
But this EPROM wants both +5 V (Vcc) and -9 V (Vdd, Vgg) supply voltages in its read mode. (Here's the data sheet.) I have a DC supply that can give me +9 V, which can power the Arduino and as a nice side effect creates a +5 V supply at the Arduino that I can then use for the EPROM's Vcc, but I'm stuck on how to find a minus 9 V supply, such that the Arduino logic and the 1702A are all relative to each other correctly.
I know this is not an advanced question, but I'd appreciate some guidance. I know I can't simply take the ground connection on the power supply (which is -9 V relative to its positive terminal) because it's not correct relative to the +5 V Vcc on the chip.
Can someone point me to some simple setup (voltage divider? zener diodes? or?) that I can use to end up with the -9 V? If my DC input needs to be something other than +9 V to make the difference work, then let me know, and I'll need to power the Arduino somehow too.
Thank you!
AI: An inverting charge pump could be appropriate here, although you'd need to provide a fairly large current (as high as 60 mA depending on the device variant) for the device. One example with enough current capacity in a hobbyist-friendly package is the LT1054, which gives an example circuit for generating your negative rail1 on page 10 of its datasheet (image reproduced below):
With everything sharing a common ground on the negative terminal of the power supply, you'll have a +9V rail (power supply positive terminal) which can feed VIN on the Arduino and VIN on the charge pump circuit, a +5V rail on the 5V pin of the Arduino (it's the output of a voltage regulator), and a -9 V rail (the -Vout of the charge pump circuit).
1 It's a much more versatile chip than just a means of generating an equal-voltage negative rail - the datasheet shows tons of other example uses. |
H: Hidden sensors to use for small grid
I'm a programmer, working on designing a project, but I have very little experience with sensors other than RFID and radar technology. After doing my fair share of research, I've found myself stumped, I can't figure out which type of sensor I'm looking for. I apologize if I'm using incorrect terminology, this is not my field of expertise.
About the project: I'm building a 1.5 foot x 1.5 foot grid system. A 324 square inch grid, if you will. I'd be looking to have an accuracy of location down to the inch, so I'm thinking I'd probably need 324 sensors spaced out evenly. The sensors will be encased in no more than a half inch of painted plastic, some under rubber, and/or some under artificial grass material laid out on a flat plain. The sensors would ideally be no more than a half-inch tall and a half-inch wide. I'd like the sensors to either detect a small electronic signal or a quarter sized piece of metal, for the lack of a better word, I will call this the target item. The target item will be passing right over the material holding the sensors or possibly a quarter-inch to half-inch above. The sensor in which the object is closest too would ideally be able to output the highest reading or some indication that the target item is closest to it than any other sensor. I'm also worried about interference of the sensors, say if a phone was sitting next to the grid system.
Any thoughts or help on the sensors and ideal target items for this would be greatly appreciated. Thank you.
AI: For any type of object, proximity sensors are your best bet I think. Like a bunch of LEDs, likely IR though may not be eye safe with so many just to provide light to reflect and then a phototransistor grid that actually picks up the light reflected off anything near enough. Then you would need to ideally get visible blind phototransistors (opaque black packaging) so they ignore ambient light and perhaps modulation to filter out ambient IR noise if there is any.
If you can magnetizing the object then you can use a grid of hall-switches instead which is cheaper and easier, not by much though since they would be wire up a lot like phototransistors except you do not need the LEDs for illumatinion. If you use hall effect sensors then you could get the position more accurately via interpolation since they will have continuous outputs rather than just binary outputs.
If it's just plain steel then you have to start getting into induction stuff where you induce stuff in the steel to pick it up and it is probably not worth it. |
H: Voltage Follower vs Half Wave Rectifier
So I used a voltage follower with an input of a sine wave signal (positive and negative cycle) . The output was half wave signal which is what I wanted. Why do people use half wave precision rectifier signal over a voltage follower. It seems a lot easier to just use a voltage follower. I am using a single power supply with Vcc- to GND.
Which is better for half wave signal rectification, a voltage follower or half wave rectifier?
AI: Why do people use half wave precision rectifier signal over a voltage
follower.
In most applications using only a voltage follower and use the rail to do the clipping will leave common mode issues (the output may not approach zero or may distort or even hit the other rail). Below is an example, the blue trace is the output of the voltage follower, when the input goes negative, the output hits the positive rail.
Vout1 is the precision half wave rectifier (with the same opamp)
(I also inverted vout1 which is the output of the precision half wave rectifier so it doesn't lie on top of the other trace). There are rail to rail input and output amplifiers that could approach the performance of the precision half wave rectifier. |
H: Designing a thermoelectric circuit
I am trying to design a circuit for 5 Thermal Electric Control(TEC)
I am given 2 power sources 1) 0-60V; 0-12A 2) 0-12.5V; 0-60A
The thermostat requires a voltage of 12V to operate and is able to deliver an output of 12V and 10A.
simulate this circuit – Schematic created using CircuitLab
Each TEC requires a voltage of 12V and a current of 4A to operate. If I connect the modules in parallel I will meet the voltage requirements but not the current requirements. and if I do it in series it will be the opposite. I thought about using transistors, to amplify the current for the parallel connections, but I don't think it will work in a real-life situation. Can anyone help me with this problem? any help will be greatly appreciated! :)
AI: First of all TEC designs are actually quite complicated, so the performance is probably not going to be what you expect.
But.. to address your question directly, if you use 6 TECs instead you could use 3 parallel sets of 2 in series. That should stay below your power supplies current limit. Each TEC would effectively see 6V and would draw less current.
You could even put them all in series. That would work and be the most efficient configuration, but it would also give you the least cooling.
TECs are more efficient when run at low voltage FYI. The cooling is proportional to the current, but the heating goes up by current^2. |
H: Waveform of induced EMF in a basic AC generator
Consider the following simple generator. A bar permanent magnet is rotating at a constant angular speed by some external means. Two coils of wire are placed in the same plane as the axis of the bar magnet. The two coils are placed in the same line. The two coils are connected together. This is shown in the following GIF image.
The magnetic flux through the coils changes in time. It is maximum in absolute value when the magnet is aligned with the coils, and zero when the magnet is perpendicular to the axis of the coils (because at this instant the magnetic field lines are parallel to the loops of wire of the coils). The flux changes sinusoidally in time. Thus, the rate of change of the flux is zero (and therefore the induced EMF is also zero as per Faraday's law) when the flux is maximum in absolute value (i.e. when the magnet is aligned with the coils), and the rate of change of flux is maximum in absolute value (and therefore the induced EMF is also maximum in absolute value) when the flux is zero (i.e. when the magnet is perpendicular to the axis of the coils).
But, the figure below shows the opposite: according to the figure, the EMF is zero when the magnet is perpendicular to the axis of the coils, and it is maximum in absolute value when the magnet is aligned with the coils.
Figure 1. Image source: The Engineering Mindset.
Is the EMF of the figure wrong, or am I wrong?
(I wasn't sure if I should've posted this question here on the Physics Stack Exchange.)
My reasoning would also explain why in the generator of the following figure, the waveform of the induced EMF is the one shown.
Figure 2. Image source: Sears and Zemansky's University Physics: with Modern Physics (13th edition) by Hugh D. Young and Roger A. Freedman.
AI: You are right.
The 'Three Phase Electricity' animation is wrong (but I wouldn't have spotted it without it being drawn to my attention).
The single loop generator is correct. |
H: Purpose of these capacitors in a DC-DC converter
I am designing a PCB using the QSC15024S28. It is an isolated DC-DC converter. This is the first time I am using an isolated DC-DC converter.
They have provided some kind of application circuit and table which has component values.
C3 and C4 should 4700pF.
Why are these capacitors used?
What are the parameters I need to consider while choosing the part numbers for these capacitors?
Can somebody help with these?
AI: Why these capacitors are used?
There's a transformer inside the converter and this transformer brings the isolation. And there's switching to make the DC-DC conversion job. So,
There's a parasitic capacitance between the input and the output because of the existence of the transformer
There'll be high-frequency (higher than switching frequency) noise at the output because of switching.
Looking at the values of those capacitors, they provide a short path for the --probably common-mode-- high-frequency noise to return to the input so that it can be filtered out by the input filter, thus increasing the EMI, specifically CE (conducted emission), performance.
If you don't place those capacitors, the noise may not return to the input because of the fact that the parasitic capacitance of the transformer is relatively low (a few tens of pF). So the output will have the noise relative to the input.
What are the parameters I need to consider while choosing the part numbers for these capacitors?
In addition to what @frr has suggested in his/her comment, I'd suggest a ceramic capacitor with an XY rating if the input voltage is higher than ELV 1.
1 ELV (Extra Low Voltage). There's no exact value defined but different standards in different regions define different values (e.g. IEC defines it as lower than 50 VRMS or 120 VDC (ripple-free)). |
H: What are the Y_TFT, C_TFT and BL_EN pins used for?
The display controller board for Philips PET 714 has a 16 pin connector like this:
What are the Y_TFT, C_TFT and BL_EN pins used for?
Reference:
Service Manual which has the schematics
AI: BL_EN is a backlight enable signal used to turn the TFT panel backlight on and off.
The Y_TFT and C_TFT do not seem to be connected anywhere so these pins seem unused - but it might be an error. Based on the name they would be the Luma and Chroma signals of an S-Video interface to deliver the picture to TFT driver board. |
H: How to isolate leaky LO and antenna for FM radio?
I am building an FM receiver. My problem is that when powering my antenna circuit or LO circuit one at a time, I get the output of those circuits appearing very strongly on my power supply lines.
When I connect both LO and antenna circuits to power, I get an extremely distorted waveform at the output of either. An FFT shows my amplified antenna frequencies, my LO frequency and a ton of large unintended peaks.
How can I electrically isolate these two circuits from my power supply and each other? Pictures of my setup are included.
AI: My problem is that when powering my antenna circuit or LO circuit one
at a time, I get the output of those circuits appearing very strongly
on my power supply lines.
Relying on electrolytic capacitors to decouple the power lines at circa 100 MHz is naïve. They will become inductors waaaay lower than 100 MHz. Use proper HF decoupling capacitors such as 10 nF. Even SMD ceramic capacitors are not that good if you choose a value that is too high: -
Image from here.
Of course, the problem might be made to appear worse by poor oscilloscope probing techniques such as loops in the earth clip. Breadboard doesn't help either. |
H: Why is there a difference between ARM 10 pin (JTAG) debug pinout and the STLINK V-2 debugger pinout?
I've just completed a custom board that uses an STM32 F4 chip and to program it I have implemented the JTAG 10-pin connecter as seen here:
Now, this works fine and I can program the chip with it using the included ST-LINK V2 on the various Nucleo boards using jumpers. To make my life easier, I decided to purchase an ST-LINK V2 clone so I can just insert the debugger straight in to the connector without the hassle of using jumper wires and remembering which wires go to which pin. However, the pinout on the ST-LINK clones is different and this is true for all of the clones I have seen. The pinout is here:
Why is this so different? Why does the pinout of these clones differ to the pinout of the common 10-pin JTAG? Is this a separate pinout standard or just something unique to these common clone debuggers?
AI: The ST-Link comes with an 20 pin connector. None of shown clones actually cloned this.
ST recommends buying the TC2050-ARM2010 adapter for the 10 pin connector. (segger has some as well)
Which has a pinout according to your diagram.
You clones don't even have SWO. And they also offer 5V and 3V, as typical on cheap programmers.
A feature that kills chips by powering them with the wrong voltage!
Don't buy clones. A genuine ST Link V2 is €30, or a V3 for €40.
To make your life truly easy, get those tag connect pogo pin cables. You don't even need an expensive header anymore. |
H: When to switch to 4 layer PCB
I'm currently designing my own 60% per-key RGB mechanical keyboard.
(60% means the keyboard only contains 60% of the keys of a regular keyboard.)
I've laid out the components, routed the switch scan matrix. I could theoretically finish the board with only two layers, but I know it's going to be a mess of vias and I've just started laying out the R, G, B traces.
The board is USB-C and designed around an ATMEGA32u4 and an IS31FL3733 led driver. The switches I'm using are cherry-MX styled, with RGB THT LEDs on each switch.
Do I really need to switch to four layers? The board is 287mm * 100mm and I can't make it bigger. It's not going to be a production board, just a hobbyist project (I say this for EMI).
And what do you think the best layer stackup would be?
I've done plenty of two layers boards but never a four layers one.
Here's a picture of my PCB just to get an idea :
AI: Generally you switch to 4 layers or more for EMC reasons. Most importantly when you want a big ground plane rather than individual traces, which is almost always the case when it comes to non-trivial PCBs.
Some of the more layout-sensitive circuits like switch regulators might also require several layers in order to keep traces short etc.
Another reason is when cadding fine pitch components with lots of connections and you simply can't route all traces in a sensible manner. In your case you've got a QFP44, but don't use all pins. In case you do, you might find it needlessly complicated to draw all 44 traces with just 2 layers available.
Regarding stack-up, it's a bit subjective. See this: The best stack-up possible with a four-layer PCB? |
H: Using 1N4148 diodes on segments of multiplexed 7-segment LED display
I'm a self-taught/hobbyist electronic engineer, and I enjoy taking apart old scrap electronics both to salvage components and to try to study design patterns (and as a challenge!). I've recently extracted a nice 1.5" 4-digit 7-segment display from an old slot machine (I'd guess from the early 1990s), but I'm having a little trouble explaining how it's wired, and I'd love any information from more knowledgeable folks!
I attach photos of the unit in question:
the markings on the LED digits themselves suggest they are OasisTek TOS-15102BE-1 (Common Anode, 2.0Vf).
the anode pin(s) of each digit are wired to separate pins on the edge connector
the segment pins are each wired first through a 1N4148 diode, and then to one of eight 3W 680Ω resistors (along with the same segment from the other digits), and then to a pin on the edge connector
I have no datasheets, manuals, etc. and a Google search for the only markings on the board came up blank, but after poking around with a multimeter, I'm fairly happy the wiring is as shown in the schematic below which looks like a fairly standard multiplexing array. But....
My question is: what's the purpose of the 1N4148 diodes placed immediately after each LED segment? They don't seem to add any value to the functionality of the circuit, and all they do is drop voltage. I can successfully drive the display from an Arduino (using a MIC5891 high-side driver connected to the digit pins, and a TPIC6B595 on the low side to sink the appropriate semgents), but with the additional voltage loss across the diodes, and the fact I'm multiplexing, means I'm having to use a 24V power supply to get anything like reasonable brightness from the LEDs. Also, I notice the chunky resistors are getting quite warm when all segments are lit (although I'm quite pleased that the brightness between segments/digits seems nicely uniform). Or can you suggest a better way to operate this display?
(to be clear, if I was starting a new design, I would do away with the multiplexing completely and just mount a TPIC6B595 to sink the segment cathodes per-digit, but I'm keen to try to use the digits as mounted, and also to try to understand the design decicion!)
TIA.
AI: You are correct in looking for the design decisions, and all the information you need is on hand.
From your schematic and an assumption that the segment currents are in the 25 mA range we can work out the voltage across the resistors.
V = IR --> 0.025 * 800 = 20V (about 0.5W dissipation)
IMO this display was used in a 24V multiplexed drive system and the diodes are necessary to protect the segments from excess reverse voltage.
All you need to do to reduce the drive voltage is to reduce the resistor values. If the supply voltage can be reduced to say 5-6V then you could short out (remove) the diodes.
However, in using high side drivers such as the MIC5891 you have significant voltage drop on the high side (about 1.5-1.8V), precluding a 5V drive. It may be best to use a FET high side drive rather than the bipolar drive in the MIC5891.
If you are using your Arduinos with a Vin raw of 7-12V it may be more convenient to use that as a drive voltage minimizing the changes to your boards. . |
H: How do receivers decode multiple GPS signals on the same carrier frequency?
I'm currently researching GPS signals and am trying to fully understand the path of a signal from satellite to receiver.
I understand that mixed into the GPS signal is a C/A code as well as a PRN which aids in the process of CDMA that the receiver preforms. However I'm a bit lost on how the receiver actually differentiates signals when it receives them.
As an example, let's say GPS signal A, B, and C are all transmitted from satellites X, Y, and Z.
These all transmit over L1 at 1575.42 MHz
The receiver now obtains these signals as a garbled mess of data oscillating at 1575.42 MHz. I understand the PRN is used to decode these satellites so the receiver/host can differentiate them, but how exactly is this process done?
AI: The system takes advantage of a couple of mathematical properties of the PRNs:
First, the cross-correlation of a PRN with itself (i.e. the auto-correlation) looks somewhat like a single impulse with some noise,
and second, the cross-correlation of a PRN with a different PRN looks like noise without an impulse.
We also note that cross-correlating an unknown signal with a fixed pattern is a linear, time-invariant function of that signal.
This allows us to construct the direct-sequence spread-spectrum system that GPS uses. The receiver detects GPS signals A, B, and C spread around the center frequency of 1575.42 MHz, plus noise N (e.g. receiver thermal noise, mixer flicker noise, etc). Each signal is the PRN sequence of its satellite, multiplied by a slow modulating signal encoding that satellite's navigation message at 50 bits per second (using BPSK for the L1C signal and more interesting modulation schemes like BOC for newer civilian GPS signals)
Suppose that the receiver wishes to obtain a lock on satellite X. It will cross-correlate the mixture A+B+C+N with the known PRN (call it V) for satellite X, obtaining V*(A+B+C+N) = V*A + V*B + V*C + V*N (where * represents cross-correlation, and we can distribute because cross-correlation with V is a linear function of the received signal).
This sum is a series of strong impulses from the correlation with signal A, plus some weak, spread-out noise from B and C, plus more spread-out noise V*N. Those strong impulses represent the modulated nav data, which can be decoded and used for the actual location-finding process.1
In the frequency domain, this also looks like a sort of "spreading" - the low-bandwidth BPSK navigation signal is spread to a wider bandwidth by multiplying with the PRN, and it can either be spread around more and kept as a weak signal by correlating with the wrong PRN, or "de-spread" back into a sharp peak by correlating with the correct PRN.
In practice, a GPS receiver will have multiple decoders, each capable of simultaneously correlating to its own PRN, allowing the device to track and decode the signal from multiple satellites.
1 This ignores the Doppler shift. As Dave Tweed points out in his comment, each signal is not only spread in frequency as a result of its PRN, but arrives somewhat off the 1575.42 MHz specified carrier frequency, reducing the cross-correlation even further, but increasing the search space. |
H: How can I match a transmission line impedance on the source side?
Suppose that I want to transmit a signal by a coaxial cable to a high-impedance load.
The signal is a single-ended TTL (3.3V) single square impulse from an FPGA output. The package of the FPGA is LQFP-144. The coaxial cable is a 50-ohm RG-174. The load is a high impedance input of an IC like an FPGA/MCU or an oscilloscope input with a 1Mohm internal load.
Also suppose that the FPGA output impedance is less than 50ohm. I have learned it from an IBIS model. Therefore in theory I can match an impedance with one series resistor on the source side.
But the 50-ohm line width on a 0.4mm FR4 is 0.73mm, and the pitch of the LQFP-144 is 0.5mm.
So, my impulse will run towards the load. Then it will reflect off and run to the 50-ohm connector on PCB, then it will reflect off from the connection of PCB line and 50-ohm connector despite any of my impedance matching actions.
Can I match a transmission line impedance on the source side in this case?
AI: So, my impulse will run towards the load. Then it will reflect off and run to the 50-ohm connector on PCB, then it will reflect off from the connection of PCB line and 50-ohm connector despite any of my impedance matching actions.
Assuming the trace on the PCB is short compared to the rise-time (or fall-time) of the pulse, then very soon after the reflection between the connector and PCB line is generated, another reflection will be generated between the PCB line and the termination resistor you added at the source.
This second reflection will be (very nearly) equal and opposite the first reflection, so the total reflection onto the coaxial cable will be very small.
If this reflection is not acceptable, then you should re-design your PCB stack-up to allow you to make your PCB line \$Z_0\$ 50 ohms with a practical geometry. |
H: How do I connect micro Molex to nano Molex socket?
I have a Molex cable that has a bigger size than its socket. My problem is how do I connect the cable to its socket?
I sent this picture about comparison cable and the nano socket exactly in front of cable. (See below)
I also sent pic of the bottom of the socket which I think is solderable.
I need best idea how to connect the cable to its socket. I'm ready to solder it if possible.
Maybe there's a cable converter to do it.
AI: You have only a couple of options:
Make an adapter board or cable which has a male Micro connector and a female Nano connector.
Replace the cable with the incorrect Micro connector with a cable that has the correct Nano connector.
Although the Nano connector on the PCB could be removed, an appropriate Micro connector will have a larger pin pitch and not fit into the same holes on the PCB.
Also, per Vir's comment, the PCB connector might be PicoBlade. If so, you might try searching for "1.25mm to 2.54mm pitch adapter cable wire Molex PicoBlade" which seemed to return some results of cable assemblies that you might be able to use. |
H: Drone ESC causes motor to twitch and beep when powered and PWM signal applied
I'm trying to make a drone from scratch, and have bought four of these ESCs and motors from Ebay. Now, I've got one of the ESCs hooked up to a 7.4V lipo battery, and the 3 pin cable running to a PIC microcontroller (specifically a PIC18F45k22, with the white PWM wire attached to the PWM4 pin).
The code running on the microcontroller should be simply ramping the PWM signal from 0-1024 and back again in a loop, and it does indeed do that as I can see when I attach an LED to the PWM4 pin.
The problem is, when a motor is attached to the ESC and I plug the battery in, the motor starts beeping loudly every second or so, and twitching.
I thought it might be that the battery was low, so I plugged it into the charger and it was pretty much full.
I presume that the reason this is happening is because I'm not properly arming the ESC, and the ebay listing does specify that this ESC needs to be armed, but it just does not specify how. Does anyone have any ideas as to how I might achieve this?
AI: Hobby ESC's expect a 'servo PWM' signal, which has a 20ms period and a 'pulse width' centered at 1500us which has variable range (but you can typically expect somewhere in the ballpark of 1000us to 2000us). That means a typical hobbyist ESC will parse an input duty of 10% at 50Hz as a request for ~100% duty cycle motor control output. Some also have arbitrary, undocumented requirements for a signal pattern on startup (ramping up from zero and then back down, then idling for some amount of time...). Error and status information are typically delivered by using the motor stator as a voice coil (beeps) and since documentation is also universally scarce, most of the time you're pretty much just expected to intuit what those beeps mean.
You didn't explicitly say this, but I'm inferring that 'ramping the PWM signal from 0-1024 and back again in a loop' (and your mention of testing this using an LED) means you've set your PWM peripheral up with an arbitrarily selected period, such that a CCPR value of 1024 corresponds to 100% PWM. This is probably putting your ESC in an error state, since you're giving it a signal that isn't compliant with the 'hobbyist standard'. You should set it up to deliver the proper signal profile, and verify with an oscilloscope if it doesn't do what you expect. |
H: Is combined footprint for LQFP and UFQFPN packages a good idea?
We are struggling to source STM32L4Q5CG chips due to global semiconductor shortage. Normally I am using LQFP48 package which allows me to easily rework PCB if necessary. But sometimes UFQFPN chips become available, and those can be installed by our fabrication house.
While looking at datasheet I noticed that outside of UFQFPN48 footprint is 7.3 mm, which is exactly the same as inside of LQFP48 footprint. Since the pinout of the chips is identical, it is theoretically possible to combine both footprints and have an option to install either chip.
My question is - could this affect the chip alignment during reflow?
I suspect the majority of alignment force comes from surface tension on the exposed ground pad of UFQFPN. And I can mask the ground pad on the stencil for LQFP to avoid blob of solder under the chip.
My second question is about that ground pad stencil. A lot of packages with exposed pad recommend splitting the hole into smaller parts to reduce amount of paste by about 10-20%. The ST datasheet does not mention this. Would it be better than one big opening?
AI: My question is - could this affect the chip alignment during reflow?
Probably not, most designs have traces connected to every pin and the pads of the UFQFPN48 are not unlike traces (the pads of the UFQFPN48 won't have soldermask on them, and that is probably the only difference and it's thermal effects would be minimal, infact having no soldermask may improve your thermal situation during solder heating because of better conduction to air with no soldermask).
Designs with lots of traces don't normally have issues (sometimes if you have a via array to ground or Vcc it can be a thermal sink, in that case the assembly may require more 'soak time' to allow the PCB to equilateral its inner planes to higher temperatures to allow solder to flow on the outer layers.)
However, if the pads are touching directly you might have an issue (it might be best if there were a bit of soldermask between footprints). Also you may want to consider different stencils\soldermask for either loading pattern, I would consult your assembler for suggestions. |
H: Help with Dummy Load Design
I'm trying to make a dummy load inspired by this one by GreatScott, and I'm using parts I have on hand. Here's the constant-current source design I'm using:
I'm hoping to test a 12V power supply with this, and only use up to 2-3A. From the datasheet of the IRF630B it can handle up to 200V/9A (I know that number is a bit inflated, but 12V/3A seems to be within the safety range).
There are three areas where I'm not sure:
I understand that MOSFETs required a V(th) to turn on, and that the IRF630B I'm using has a V(th) between 2-4V. I'm not really sure how to calculate it, or if I'm supposed to? My google-fu has yet to yield any helpful information about that. It seems like that would be pretty important for controlling the MOSFET.
The ACS712 current sensor I'm using has a zero-current voltage of 2.5V. It seems like I maybe need to correct for that, or does the current design work with that anyway? I know very little about op-amps, except they strive for balance between their inputs, so it should just "correct" (raise/lower output voltage) until the current sensor outputs the same voltage as the DAC, or am I wrong?
The input resistors to the op-amps. Is 1.5k ok for the ACS712? I'm planning to use 200 (not 2k as in the schematic) for the DAC I'm using to limit the current (25mA max). Should there be one between the LM358s? There was no max input current on the datasheet... so it should be ok without one, right?
AI: To turn fully on the IRF630B requires 10V Vgs. To start to barely turn on (250uA) it needs 2-4V. To get 10V Vgs you should have a supply voltage on the op-amp of about 12V. Somewhere in between might work too, depending on the variations of the transistor itself. Under typical conditions (which a good designer would never rely upon) the transistor needs around 5V plus whatever is dropped across that fuse (should be < 100mV at 2-3A). The output voltage of the LM358 goes to the supply voltage minus a couple of volts, depending, which implies a typical requirement of a 6-7V supply voltage, and 12V will work for sure.
If the circuit you show worked, it would give zero output for DAC voltages < 2.5V and controlled current sink for higher DAC voltages. The input voltage range of the LM358 goes to the supply voltage minus a volt or two. Safer to assume two. So you're getting a bit marginal at 3.45V in with a 5V supply. It is (just) guaranteed to work at 25°C but not over a wide temperature range. Not great. It's perfectly fine with a 12V supply (which you would need anyway as explained in 1.)
The resistors do nothing much of value here so there's nothing to calculate.
I think it rather likely the circuit you show will be unstable under load. If you build this I would suggest having an oscilloscope at hand. There is a lot of gain (both op-amps and the transistor add gain) and a lot of phase shift around the feedback loop. |
H: What's the safest way to electronically brake a PMA wind generator to prevent overspeed damage to stator?
I have a couple 24 volt 400W wind turbines on order for my 24 volt off-grid system I already have set up with 2000 watts of solar, inverter and generator.
The included charge controller schematic indicates the ability to short the three-phase AC as an electronic braking mechanism.
I see on YouTube some people are running custom setups with load resistors switched in series to provide a slight constant braking, and applying a heavy short-term load in order to brake speed down, then shorting across the rectified output to park the turbine in a windstorm.
My question is which method is safer for the windings on the stator of the PMA generator: shorting the three AC phases or the DC output of a rectifier from those same three phases?
I've seen burnt stators from 3 phase shorted braking, maybe if the turbine is still turning with brakes on is causing this?
AI: Your analysis is pretty straightforward. When your generator is in its operational range, the torque of your generator is directly proportional to the current, and the speed is directly proportional to the voltage. When the turbine is spinning and is shorted, you are instantly bringing the voltage to zero, so the generator will stop quickly. The torque required to stop the generator is not only the torque from the wind on the blades, but also the torque necessary to decelerate the spinning mass of the turbine. The generator coils will see a large peak current. A rough estimate of this peak current is the voltage present when the phases are shorted divided by the phase resistance of the coil. This will be many times the rated current of the turbine, and if it is allowed to persist it will result in the heating of the coil.
Depending on the turbine's rotational inertia, the torque from the wind, and the coil resistance, the shorted turbine decelerates and dissipates much of the energy in the windings, which can cause the overheating you have seen. The "safe" approach is to monitor and limit the applied load to keep the current in a safe range while the turbine decelerates. For turbines with low inertia and those producing limited torque, simply shorting the phases may suffice because the turbine will stop quickly before excessive heating occurs. Using an external resistance has the advantage that most of the energy is absorbed externally rather than in the coils. You might experiment with shorting the coils into a load until the turbine slows before shorting them completely. Shorting through the rectifier simplifies the circuitry as long as your approach doesn't exceed the rectifier's current specs.
Good luck! |
H: Transfer function in ideal op-amp
I am new to electrical engineering and came across one problem I could not solve:
I shall find the transfer function \$G(jw)\$ with \$G(jw) = \frac{U_A(jw)}{U_E(jw)}\$ of the ideal op-amp.
My solution:
$$U_{R(s)} = \frac{R}{(sC+R)} * U_{E(s)}$$
$$U_{C(s)} = \frac{sC}{(sC+R)} * U_{A(s)}$$
$$U_{C(s)} = U_{R(s)}$$
$$\frac{U_{A(s)}}{U_{E(s)}} = \frac{R}{sC}$$
with \$s = jw\$
The correct answer is \$G(jw) = jwRC\$.
What am I missing?
AI: Well, using the voltage divider formula we can see that:
$$\text{v}_+\left(\text{s}\right)=\frac{\displaystyle\text{R}}{\displaystyle\text{R}+\frac{1}{\text{sC}}}\cdot\text{v}_\text{in}\left(\text{s}\right)\tag1$$
$$\text{v}_-\left(\text{s}\right)=\frac{\displaystyle\frac{1}{\text{sC}}}{\displaystyle\frac{1}{\text{sC}}+\text{R}}\cdot\text{v}_\text{out}\left(\text{s}\right)\tag2$$
For an ideal opamp we know that \$\text{v}_+\left(\text{s}\right)=\text{v}_-\left(\text{s}\right)\$, so:
$$\frac{\displaystyle\text{R}}{\displaystyle\text{R}+\frac{1}{\text{sC}}}\cdot\text{v}_\text{in}\left(\text{s}\right)=\frac{\displaystyle\frac{1}{\text{sC}}}{\displaystyle\frac{1}{\text{sC}}+\text{R}}\cdot\text{v}_\text{out}\left(\text{s}\right)\space\Longleftrightarrow\space\frac{\text{v}_\text{out}\left(\text{s}\right)}{\text{v}_\text{in}\left(\text{s}\right)}=\frac{\displaystyle\frac{\text{R}}{\displaystyle\text{R}+\frac{1}{\text{sC}}}}{\displaystyle\frac{\displaystyle\frac{1}{\text{sC}}}{\displaystyle\frac{1}{\text{sC}}+\text{R}}}=\text{CRs}\tag3$$ |
H: Load while battery is charging
Short question: can I connect some load to a solar panel while it is charging a battery or the current across this load can cause a confusion in the battery load controllers?
Explanation: Maybe too smart, I'm thinking on reuse a garden light (a 10$ one that has a solar panel, battery, motion sensor and leds) also as motion alarm. The circuit I'm thinking about is:
Where left part is the power one:
a solar panel, nominal 5 V, 300 mA, 1.5 W, that, across a schottky diode (0.2 ... 0.3 V of Vf) is used to charge the battery and also to feed the load
a 18650 battery (3.7 V, 2200 mAh, charged during solar hours) and its charge controller (the box labelled "1" in the circuit). This part is based on a HY2111 IC, following manufacturer hint:
(where PB+ and PB- are the connections to the solar panel and schottky diode. WARNING: the ground reference on this schematic is not the same than in previous one).
The right part is the load:
a PIR sensor and related components (box "PIR" in the circuit). It contains an internal 3.3 V DC regulator, a PIR motion sensor and its related components. The output is 0 V when no motion, when motion is detected the output is a pulse of 3.3 V and 60 seconds duration.
the output of the PIR sensor goes to two elements. First one is used to wakeup a FireBeetle ESP board (box "FB" in the circuit) that sends a message using WiFi network
the PIR also activates a MOSFET that controls the leds. In order that leds doesn't activates during day, the box "2" contains another MOSFET that cuts the LED power when the solar panel provides enough voltage, that is, during day (warning: the first schematic contained an error on this part. fixed).
During day, the solar panel is powering the battery, the PIR and the FireBeetle. The PIR and the FireBeetle needs less than 1 mA when idle, 150 mA during 5 s (average time) when motion is detected and the FireBeetle is transmitting by WiFi. Is this current load (1 mA in idle mode, 150 mA when a trigger) a problem for the correct function of the battery controller?
ing around 300mA.
AI: can I connect some load to a solar panel while it is charging a
battery or the current across this load can cause a confusion in the
battery load controllers ?
Not if you have a solar charge controller (solar panels have a variable source impedance and to maximize the power output a special algorithm needs to be used, called MPPT to maximize the power output of the solar cell. Otherwise there could be power instability on the shared power rail)
Another problem is I see the battery connected nearly direct to the solar panel, there are two problems with this. As long as the HY2111 is preventing overvoltage and undervotlage then this will prevent the battery from failing, but the battery charging cycle will not be happening which could cause the battery lifetime to be shortened. A battery should have a charging controller and the HY2111 does not provide this function. If the design needs to be cheap, then using only the HY2111 will be ok at the cost of battery life and the design will not be robust.
Is this current load (1 mA in idle mode, 150 mA when a trigger) a
problem for the correct function of the battery controller?
The overdischarge of the HY2111 varies by model, make sure you get the HY2111-HB (200mA overdischarge limit) or HY2111-KB (225mA overdischarge limit). the standard discharge for the battery you listed is 440mA so 150mA shouldn't be a problem for the battery. |
H: Delay circuit after power on for ESP32 application
I'm using the ESP32 with a sensor connected to UART0 and I want to suppress the first stage bootloader log, since it can lead to delayed response of the sensor later on.
Therefore I want to pull the IO15 pin to GND during the first second of power being connected to the 3.3V rail. Pulling IO15 to GND during the first stage bootloader causes it to suppress logs to UART0.
After that second the pin should be left floating so I can still use it for JTAG operations.
I tried a P channel MOSFET in this configuration:
I thought this way the MOSFET conducts first and then as voltage rises by charging the capacitor it opens and leaves the IO floating but it did not work. Thanks for any help!
AI: Try it the other way around.
Use a N-Channel MOSFET. You need a low-threshold MOSFET like the Trench-Fet family.
Source goes to Ground, Drain to the pin to drag Low. Capacitor from Vdd to the MOSFET gate along with a resistor from gate to Ground. Add a signal diode in parallel with the resistor (A to ground, C to the gate) to discharge the capacitor when Vdd is removed. |
H: Create a simple radio transmitter
I have previously used the NRF24L01 to transmit data between two microcontrollers. I have also used other radio transmitters and they all work great.
For purposes of learning I want to create a very simple radio transmitter. I do not want to get into the trouble of decoding the frequency into 0s and 1s. I just want to send a frequency over the air and capture it with an oscilloscope. If I create something like this will it work:
simulate this circuit – Schematic created using CircuitLab
On the left part I have a device that generates a 1 GHz pulse. That pulse is connected to a cable and the cable to an antenna.
On the right I have an antenna connected to an oscilloscope. Will the oscilloscope on the right read 1 GHz?
Lastly how large will my antenna have to be in order to capture a 1GHz radio signal?
Note I don't mind using a 433Mhz pulse instead than 1Ghz to make it easier. I am assuming 1Ghz will be easier because I don't want to have a large antenna
Reason why I want to do this:
I want to do this for purposes of learning and also because I have a project that runs from a battery. In order to save battery Arduino wakes up for 30ms in order to listen for a command. So it awakes listen for radio packets for 30ms and then go to sleep for 2 seconds. If I want to send a command to this receiver I will have to send pules every 5ms for up to 2 seconds. The reason why it takes so long is that the NRF24L01 takes 10ms to initialize then I have to send the listen command etc everything through ISP. It will be nice if I could have control of that myself in order to sleep for shorter amounts of time.
I still plan on using the NRF24L01 to transmit data. I just want to build something that will enable me to wake up my receiver fast. If my receiver is awake all the time then my battery will not last. I need a solution where my receiver wakes up for 2ms to check to see if it needs to become awake and then go to sleep for 1s..
AI: Will the oscilloscope on the right read 1 GHz?
Theoretically, if you set everything up right (correct impedance matching on both sides, antennas have the correct polarization, you transmit with enough power, the oscilloscope can measure frequencies that high, etc) then yes you will get a 1 GHz reading on the oscilloscope attenuated based on the distance between the two antennas.
Lastly how large will my antenna have to be in order to capture a 1GHz radio signal?
This depends on what type of antenna topology you want to use. For your application it would be simpler to have an omnidirectional antenna which means the minimum length is 1/4 wavelength of the signal provided the ground plane it is mounted to is at least that size in one direction (7.5 cm). Otherwise you’ll want a half wave antenna (15 cm). Omnidirectional antennas are generally simpler and send a broadcast signal in all directions, but they have less gain than other types of antennas so your transmitter and receiver will need to be closer together.
A side note on the frequency choice: In the U.S., the 2.4 GHz range used by the NRG24L01 is an ISM band that is free to use for the public at low enough powers. The 1GHz band however is used for airplane and ship navigation which is something the FCC doesn’t want people messing with and could get you into trouble if you’re not careful. 433 MHz would be safer if you’re in the US. |
H: Pulse duration detection evaluation (opto) LT-22222 from dragino
My question seems simple but i can't find the answer on documentation. (or I don’t have enough skillz)
I have this energy meter with pulse output:
https://cdn.store-factory.com/www.compteur-energie.com/media/Ketler-KE3205-45A-MID-compteur-energie.pdf
The doc says: EN 62 053-31. (Tension 12-27V DC/ courant <27mA)
Each pulse duration is 30 ms
My inputs are on a LT-22222 from dragino:
https://www.dragino.com/downloads/downloads/LT_LoRa_IO_Controller/LT22222-L/LoRa_IO_Controller_UserManual_v1.5.5.pdf
the doc says:
The DI port of LT-22222-L can support NPN or PNP output sensor. More info page 34. I have make those input works with a simple 24 V generator.
My question is: Can they work together?
AI: IF your deice is a LT22222-L then
Interface for Model: LT22222-L: then page 7 of the data sheet says the two inputs can withstand up to 50V directly.
➢ 2 x Digital dual direction Input (Detect High/Low signal, Max: 50v, ...
➢ 2 x Digital Output (NPN output. Max pull up voltage 36V,450mA)
➢ 2 x Relay Output (5A@250VAC / 30VDC)
➢ 2 x 0~20mA Analog Input (res:0.01mA)
➢ 2 x 0~30V Analog Input (res:0.01v)
➢ Power Input 7~ 24V
In the data sheet
Page 34 shows how to connect inputs.
Page 23 shows how to set minimum trigger length
AT+TRIG2 1,10
= Set channel to input triggering on rising edge, with 10 ms minimum pulse. |
H: Synthesis output for the following verilog code
I have a somewhat stupid question as I am still a noob. So bear with me.
If I have the following statement in Verilog:
input rdy,in;
reg o;
always @(posedge clk)
begin
if (rdy) o<=in;
end
I am wondering what the synthesis output look like. Would a mux be instantiated in front of the D flip-flop by the synthesis tool?
In other words, is there a need for me to create a combinational block that take i, o and rdy as input and generate a temp signal that feeds the input of d flip flop?
AI: There are two possibilities for Synthesiser to explore which may depend on the tool/optimizations used:
The reg o becomes a flip-flop with a 2:1 mux 'in front of it'. The two inputs of the mux will be:
The input in and the output of reg o flip-flop fed back. And the mux will have rdy as select signal.
The reg o becomes a flip-flop with rdy as clock enable. And in as the D input. |
H: Eliminating DC Offset in a Class B Amplifier with a Single-Ended Supply
I am wondering if there is any way for me to eliminate the DC offset present in this Class B amplifier circuit.
The circuit is to be used to amplify music for a subwoofer and, as I understand it, a DC voltage across the speaker is potentially harmful. I built and tried a physical circuit that was almost identical (I think the resistors were 10k) that did amplify sound well but shifted the speaker's cone a noticeable amount immediately (even when no sound was playing), indicating a DC offset. The problem might be easily solved with a dual-rail supply as the output would then be centered around 0V, however, that is not possible for me to add to this design; I intend to have this circuit run off of a 12V battery. I assume there is a clever way to use some basic component to traverse this issue, but I am unsure what it might be.
My first idea was a coupling capacitor, as is used in many amplifier output stages. However, the coupling capacitor only allows the AC signal past it, making the voltage across the speaker somewhere in the millivolt range meaning that the current will be in the milliamp range. I assume this is a result of this circuit being more of a current amplifier/impdeance converter. So, I'm pretty sure that using a coupling capacitor is not at all the correct solution here, but please let me know if I'm wrong in this respect.
At this point, as far as I can see, I must maintain the same current while not having that unfortunate DC offset. Does this require an isolating output transformer? Though I was previously unfamiliar with the concept, I think I understand how a transformer can be used to make the relative voltages across the speaker terminals favorable while not eliminating any of the actual power amplification that is desired.
Additionally, is this even an optimized class B amplifier? I've tried to play around with the values and this seems to give a pretty optimal amplification, but I am not too knowledgable when it comes to the specifics of this amplifier class.
AI: My first idea was a coupling capacitor, as is used in many amplifier
output stages. However, the coupling capacitor only allows the AC
signal past it, making the voltage across the speaker somewhere in the
millivolt range meaning that the current will be in the milliamp
range.
You need to use the right value capacitor such as 4,700 μF. It has an impedance at 30 Hz of about 1 Ω and will pass current to your speaker pretty well.
Or, you can make two back-to-back push pull stages forming what is known as a bridge amplifier: -
The two push pull stages need to be biased the same but whereas one is fed an AC signal as per the original circuit, the other is fed an inverted AC signal. It also produces the potential for four times the power into your speaker. |
H: 4+E 6mm sq. better than 2+E 10 mm sq. for UK 240V?
I can get 4+E 6mm sq. and wire L,L,N,N,E.
On paper this looks better than 10mm sq., L, N, E.
But I am unsure if there is a hidden level of de-rating.
Which one is better for a long run 40A supply?
AI: Use single conductor wire of the appropriate rating.
If you use two conductors in parallel, then a break in one would be 'silent', your equipment would carry on working. However if you then stressed the link to a current that needed the full area, you would overheat the one remaining conductor.
If you use only a single conductor, any break would be noticeable.
Physics-wise, 12 mm2 will give you lower voltage drop than 10 mm2 of course. |
H: What does the term "boresight", and what do the phrases "boresight adjustment" or "boresight calibration", mean in the context of laser scanning?
I have been studying the laser scanning literature. In doing so, I often come across the term "boresight", and the phrases "boresight adjustment" or "boresight calibration". For example, see this paper. However, I have not seen any explanation of what these actually mean. What does the term "boresight", and what do the phrases "boresight adjustment" or "boresight calibration", mean in the context of laser scanning?
AI: In telecommunications and radar engineering, antenna boresight is the axis of maximum gain (maximum radiated power) of a directional antenna.
https://en.wikipedia.org/wiki/Antenna_boresight
In other words, it is the direction your radar or lidar beam is pointing. Calibration would be the process of figuring out how that axis is aligned with the rest of your system (car, plane, table, etc). This is important because you often want to overlay data over the real world (e.g. for guidance or navigation). |
H: Is this power supply universal input voltage?
I have this Playstation 2 power supply which was originally run at 110V input.
A fellow member of this forum suggested that there might be a good chance that
it could a universal input voltage and might work at 220V AC.
I have taken a look at the power supply board and I couldn't figure whether this
could be true. I'm posting the photo of my board and also the part numbers of
components that I was able to identify. I know for sure that the fuse is for 110V
but other components I'm not so sure. I tried searching for the transformer and
inductor coil datasheets but none exists. They are of Matsushita make.
Please help me determine whether this power supply is having universal input voltage
(aside from the fuse)
AI: The main bulk storage capacitor is rated at 220 volts DC: -
This means that the maximum sinewave RMS voltage that can be applied to the input power connector is 156 volts. This means that it is probably only recommended for supply voltages of 120 volts maximum. |
H: Internal differences between CPUs of the same architecture
What is the difference between, for example an Intel i3-4005U (1.7 GHz) and an Intel i3-4025U (1.9 GHz)? These CPUs are from the same generation, have the same amount of cores, cache, iGPU, and supported features with the only difference being the clock speed.
Would these CPUs internally be identical except for the clock circuit? Or would the faster one have internal improvements to allow it to run at the higher clock speed?
AI: In this case there are no internal differences aside from what clock speeds the firmware allows them to run. Within a given architecture Intel does actually make physically different CPUs though. In this case since you have a Haswell CPU, see:
https://en.wikichip.org/wiki/intel/microarchitectures/haswell_(client)#Die
Typically Intel has about 3 or 4 consumer dies split between mobile and desktop and another 3 server dies. Since taping out and then manufacturing a new die is expensive, they try and make all models they sell each generation from those 6 or 7 different dies. This also allows them to bin lower yielding dies into cheaper products. |
H: Adding LED feedback to a source selection switch
I am working on creating an amplifier with multiple input sources. I have implemented a 3P4T rotary switch to be able to select the audio source among 4 different ones : RCA, Phono, and 2 digital sources coming out of the same DAC. There is a multiplexer above the DAC to select which digital source to send to the DAC. Here is a functionnal drawing of my setup :
As you can see, the 3 poles of the switch are used for : 1. Multiplexer source selection, 2. Left channel, 3. Right channel.
Now I need to be able to add 4 LEDs, to display visually which source is activated.
Obviously, the easy solution would be to use a 4P4T switch instead, and use the 4th pole to handle the LEDs, but here comes the constraint : I need the switch to be able to be soldered directly on the board. However, all 4P4T switches I have seen have at least 2 decks such as this one, which seems to mean it's impossible to just solder it on a board, compared to a 3P4T which can, thanks to their 15 THT pins like those
Hence, my question is the following : how would it be possible to install LEDs on the output of a 3P4T when all the pins are already used ? Could I use one of the poles to perform two actions ? Or do you have another solution in mind ? I've been searching for one all day and can't seem to have a lead. Maybe there's an easy solution I have missed by being to stubborn on one idea, I don't know.
I'd like to avoid having to use a µcontroller, and I need components which can be soldered directly to the board... Else you understand that I would have jumped on a 4P4T.
Hopefully I was clear enough. If not, don't hesitate to ask for more information.
Big thanks in advance,
AI: This should do it (common on switch to +5V):
simulate this circuit – Schematic created using CircuitLab
If your LEDs are different colors you may wish to use individual resistors rather than R1 to match brightness between the LEDs. |
H: Estimating current draw for a single instruction
I am a software engineer concerned about current draw.
I am aware that there are ways to reduce the current draw of a program, for example:
using a hlt instruction which disables the CPU until the next interrupt
maybe avoiding floating point so that the FPU doesn't get jiggled
I'm wondering if it's possible to estimate the current draw of a single instruction, so that a theoretical compiler can select the instruction which will draw less power. Existing compilers can normally optimise for speed or for size, but I have never see a compiler which can optimise for current draw. Maybe no-one's considered it, maybe no-one's done the research into every single instruction, maybe it's actually impossible.
But consider for example some NMOS processor like the early 6502s. By my intuition, subtracting 0xff from 0xff would draw more power than subtracting 0x01 from 0x01 because I think the inputs to the ALU need to be precharged more or something. But knowing next to nothing about electronics I'd appreciate if someone could tell me if
a) my intuition is correct
b) it's practical to estimate the current draw of a CPU instruction if you know what state the CPU's in, so that you know exactly what the instruction is doing.
AI: While this would be theoretically possible, I doubt if it could be done in practice in a way that a compiler could use the information in a modern processor. If you only want to do an academic exercise for a trivial processor you might have a chance.
You would need to characterize the power consumption for each instruction for all possible addressing modes (immediate operand, register operand, stack operand, etc.) and for all possible data values.
You would need to measure the energy used if the instruction is fetched from L1 cache, from L2 cache, and so forth. You would need to somehow separate the energy used to execute the instruction from the energy used to decode the next instruction in the pipeline, read the instruction before that from memory, and write the result of the previous instruction. All of these are happening simultaneously.
And keep in mind that compilers don't select instructions individually, they select groups of instructions that perform some desired high-level language operation.
Oh, and the manufacturer is free to change the manufacturing process at any time as long as the processor continues to meet its datasheet specifications. A small change in fabrication parameters could change the relative importance of leakage current, ac switching current, and transistor shoot-through current. So the data for one manufacturer's ARM A9 would not necessarily be of any value for another specific part number from the same manufacturer or an ARM A9 from another manufacturer. |
H: Read three signals from MPX2102DP pressure sensor
I have an MPX2102DP pressure sensor. I have designed a simple instrumentation amplifier using the OP07 amplifier to read the output (differential pressure) of this sensor.
From the datasheet, I have found that there is a signal for each pressure. Can I obtain the reading of each pressure value alone from the instrumentation amplifier?
I have attached the diagram of the instrumentation amplifier.
AI: From the datasheet, I have found that there is a signal for each pressure, ...
I think you have misunderstood the datasheet. The sensor is available in three versions.
The single-port versions have the port exposed to atmosphere and the pressure differential is relative to the pressure in the sealed port (presumably some gas sealed into the device).
The dual port version has each side exposed to a port.
... so can I obtain the reading of each pressure value alone from the instrumentation amplifier?
No, the dual port sensor has no internal reference pressure. Imagine the use case where it is being used to monitor the pressure drop across an air filter in a pressurised line:
Port 1: upstream measurement pressure = 2 bar.
Port 2: downstream measurement pressure = 1.7 bar.
Pressure differential: 0.3 bar.
The sensor will be able to report the pressure difference but cannot give the absolute pressure (pressure above 0 bar) or the gauge pressure (pressure above 1 bar) as there is no reference signal available.
Figure 1. The sensing element appears to be a Wheatstone bridge device.
The differential signal is probably derived from a Wheatstone bridge circuit. Differential output allows the device to handle positive or negative pressure differentials while powering the device on a single rail supply. |
H: Who pays royalties to whom for the patents that form 802.11 standard
This is my first question here and it‘s not even electronics related. Shame on me!
I think it's a very important question to engineers like me who think about the idea of commercializing a device with a IEEE 802.11 based wireless interface.
In the WiFi world there are several entities involved:
IEEE 802.11 standard. Which is based on a lot of patents from different companies/universities/inventors
WiFi alliance that cares about compatibility between
WiFi products and promotes WiFi as a technology
Chipset vendors like Qualcomm, Intel, Broadcom, Mediatek who design a chip that works according to 802.11 standard
802.11 patent licensing programs from companies like Sisvel who charge around 25 Cent per WiFi device.
But there remains one specific question …
Who is responsible to pay royalties to whom when a Wifi product is designed, produced and put on the market? I always thought those royalties are covered at the time you buy a WiFi chipset from a company like Qualcomm.
But I no longer believe it’s so simple. Because then there would be no licensing program from companies like Sisvel.
AI: I will use WiFi and 802.11 interchangeably for the sake of this question.
In the context of this question, that's an extremely confusing idea: Wifi is a trademark, and protected by additional laws and licensing requirements. Let's not do that.
But it‘s a very important question to all those makers
By how I'd define "maker": no it isn't, because patents only affect commercial application of technology to begin with. If your application is not commercial, a patent can't stop you from using some method or device.
and engineers out there working on IEEE 802.11 enabled products
Yes, but notice that you are not working on an IEEE 802.11 device itself - you literally buy the device as module. Therefore, the party building that module commercially has had to have a patent license (if there were any to acquired). They will have negotiated a license with every patent holder that allows them to sell products that their customers can freely use. Exactly the same as if you went to a store and bought a USB WLAN controller or WLAN router. You, as the customer, pay for someone else to already have acquired all the licenses needed.
This changes when you start actually implementing IEEE 802.11 technology.
I always thought those royalties are covered at the time you buy a WiFi chipset from a company like Qualcomm.
You will never by a chipset from Qualcomm, they're not known for dealing with small quantity buyers (and "small" in terms of Qualcomm...). So, there'd be yet another module producer / middleman.
Even if you buy from a different entity, say Espressif, it's fair to assume you acquire licenses for all you need.
Who is responsible to pay royalties to whom when a Wifi product is designed, produced and put on the market?
Whoever applies the patent commercially. So, that would be the producer of the Wifi module as well as who takes that module and uses it in their product.
However, you'll find that the IEEE 802 standards committee will not accept essential patents¹ unless you sign a letter stating that you'll license the patent to non-discriminately anyone, at reasonable rates, under fair conditions (FRAND, if you're looking for a term to google), and these usually involve a transitive license, so that only one party in that chain needs to license that patent themselves.
Members of the standardization committee need to disclose any patent they know of (their own, but also others') that would be required to implement the standard in creation. That way, they can't "sneak" a patent into a widely adopted standard and later demand arbitrarily much for a license to use, or kill their competition by refusing to license.
Such a "letter of assurance" can be found here.
Who is responsible to pay royalties to whom
There's an excel list for that kind of thing, for each of their standards groups, at IEEE:
https://standards.ieee.org/about/sasb/patcom/patents.html
¹ "essential" means that you can't implement the standard without applying that patent |
H: 3 phase inverter circuit mosfet burn out
I've designed a three-phase inverter for a hobby project that I'm working on and have had the board assembled. I'm new to this sort of stuff so learning as I go. I've attached the schematic. Initially after powering up the board, the mosfets immediately burnt out. I eventually determined that I'd used far too high a series gate resistance which prevented the transistors from turning on fast enough to prevent shoot through. I solved this by simply removing the 4K7 resistors and shorting the pads together.
After solving that, I connected my load to the outputs of the inverter. The load on each phase is a coil in series with a 100R resistor. The coils are designed for magnetically levitating toys however, I have no data sheet for these parts and I'm unsure of their exact specification (I can post a link to these parts, if that's an acceptable thing to do in this forum?). VCC is 20V so I would not expect more than 200mA of current to flow through each phase (the transistors are rated up to 8A continuous drain current I think). I used a microcontroller to generate the control signals to the gate drivers. These were the standard phased enables used in such a circuit with a period of 1200us and a duty cycle of 50%. All of this seems to work fine, with the voltage applied to each phase correctly switching between +/- Vcc.
However, during experimentation, I decided to extend the duration of the pulses to 1200ms, again with a 50% duty cycle. Again, this caused the mosfets to burn out and I'm not sure why (I'm not sure if it was both the low side and the high side that burnt out). I think that the value of the bootstrap capacitor that I've used is too small to keep the high side transistors on for such a long period and that eventually they will turn off. However, I can't understand why this transistor turning off causes an issue. It does not seem to me that this should cause excessive current to flow and I don't think that it's an issue with the current in the inductors rapidly switching off and generating large voltage spikes but I can't be sure of this.
So, I'm at a bit of a loss to understand what the issue is here. I'm hoping that someone can help explain what might be happening here and suggest improvements to this circuit. Please let me know if any further information is required.
Andy_aka comment: Maybe a redraw of your circuit might help those on tablets and laptops: -
AI: However, I can't understand why this transistor turning off causes an
issue.
Yes, it IS an issue. As the transistor turns off (slowly) it enters its linear mode of operation (gate voltage level below the ZTC point) and will immediately be subject the thermal runaway: -
In applications like this you have to ensure that the bootstrap circuit does not sag or, you choose a MOSFET that can handle linear applications.
BTW, ZTC stands for zero temperature coefficient. Above that point (gate-source voltages higher than about 4 volts), if the device warms up, drain current falls i.e. it self-protects. Below the ZTC, if the device warms then drain current rises and the device warms more and... you get the story. |
H: Why can't I use my Half-Adder in another circuit?
Screenshot of my half-adder working like it's supposed to:
I've then saved this as a circuit to use within another circuit:
So why is this not working?
AI: Those are LED components in your subcircuit, not output pins! Meaning that in your main circuit, on the right, there is nothing to connect to.
You should instead place output pin components in your subcircuit. When you do that, there should be an actual output in your main circuit that you can wire to. |
H: Problems with over/undershoot in voltage-controlled MOSFET current sink
I'm in the process of designing an electronic load for testing batteries. The goal is to control the load current in the range of 0 - 10 A with a 0 - 1.2 V signal from a DAC.
For easy calculations and usage of common values of resistors, a 12 mΩ shunt was chosen. The problem is that in the current configuration, a large overshoot/undershoot occurs when the input is driven with a square wave.
If I reduce the gain of the current sense amplifier from 10 to 2, or decrease the value of the shunt, the problem disappears. I would prefer not to do that, because then I would have to use lower voltage control signal, which is not ideal.
Is it possible to stabilize this circuit, while preserving the current sense gain of 10 and shunt value of 12 mΩ?
I've attached a schematic and a sample waveform below. The blue trace represents control voltage, the green trace represents current.
AI: I think your expectations may be somewhat naïve. Your input changes near instantly and, because of this, the output of U1 also changes fairly instantly. Feedback of the output current through the 12 mΩ resistor is then going to take time to ripple through U4's circuit and then through the integration applied to the inverting input of U1. This all causes a significant delay that allows a period of time to exist that just cannot be kept stable.
That's entirely what you see on your o-scope shots.
If you used a much much faster device than the LTC2050 in U4's position, things would improve but, at the end of the day, you are asking a lot for the output current to follow step changes on the input demand voltage without some overshoot. |
H: Problem with the fall time of op-amp
I am designing a "simple" current source using an op-amplifier. My question is why is my fall time looking like that:
What do I need to reduce the fall time? Here is the schematic:
AI: The op-amp you have chosen cannot properly turn off the MOSFET: -
The diagram above tells you that the output doesn't swing down to 0 volts (the negative rail of your op-amp) but to about 1 volt to 1.2 volts above 0 volts. This means your MOSFET cannot be turned off that easily. Try adding a small negative rail to your op-amp -Vs supply pin.
You might also be able to improve it a little by connecting the op-amp output to the MOSFET gate via a potential divider to remove a further half volt of gate drive. |
H: Identifying transfer function by its approximated graph
Consider the transfer function which is approximated graph is:
I want to identify this function.
As far as I can tell, since we see decreasing by \$-20db/dec \$ at \$10^{-1}\$, we can conclude that the function has a pole there.
Also, we can see decreasing of \$-40dB/dec\$ at \$1\$, so we can conclude there's another pole there, and finally we see that at \$10\$ the slope increasing to be \$-20db/dec \$ and so we can conclude there's a zero there of the transfer function.
So far, I can tell that the function has the form $$ H\left(s\right)=A\frac{\left(s\pm10\right)}{\left(s\pm0.1\right)\left(s\pm0.1\right)} $$
Where \$A \$ is some constant. In order to decide whether the zeores and poles are on the right side of the plane or on the left side, lets examine the amplitude graph.
We can see decreasing by \$\pi/2\$ at \$0.1\$, so that this pole must be a left pole. In the same manner we can see decreasing by \$ \pi/2 \$ at \$1\$ so we can say that the pole at \$1\$ is also a left pole.
But then the zero at \$ 10 \$ contributes nothing? I know that a left zero contributes increasing of the phase by \$\pi/2 \$ and a right zero contributes decreasing of the phase by \$ \pi/2 \$.
I'd appreciate some help of how to examine the phase graph in a correct way and determine what is the transfer funcion.
Thanks in advance/
AI: Steps I followed
Noticing that the phase response seems to be flat at -90 deg near low frequency implies a pole at origin, as not at -0.1 as assumed by OP.
Using the pole and zero at \$\pm 1\$ and \$\pm 10\$ from OP's original post,
Trial and error to get the gain \$\color{red}{-}0.21\$.
Trial and error for the location of the zero (LHS or RHS)
% Matlab / Octave
sys = tf(-0.21*[1, -10], [1, 1, 0]);
bode(sys);
-0.21 (s - 10)
--------------
s(s + 1)
We get
note: x axis are different for both plots.
The sign of the gain and the half plane of the zero were obtained by trial and error, but could have been also found by equating
$$
\angle\frac{K \cdot 0.21 \cdot (s + L\cdot 10)}{s(s+1)}|_{s=1j,10j} \approx -140, -220\ \mathrm{deg}
$$
fa = @(s,k,l,r) sign(k)*pi + atan2(s, l*10) - (pi/2 + atan2(s, 1)) - r
for k = [-1, 0, 1]
for l = [-1, 0, 1]
result = fa([1;10], k, l, [-140; -220]*pi/180);
fprintf('%3d, %3d, %7.3f, %7.3f\n', k,l,result(1), result(2))
end
end
-1, -1, -0.012, 0.012 '<-- angles are closest for this combination'
-1, 0, -1.484, -0.773
-1, 1, -2.955, -1.558
0, -1, 3.129, 3.154
0, 0, 1.658, 2.369
0, 1, 0.187, 1.583
1, -1, 6.271, 6.296
1, 0, 4.800, 5.510
1, 1, 3.329, 4.725 |
H: Transistor with PWM vs LED driver for LCD backlight
I'd like to design a circuit that utilizes a small 1.3" LCD display with maximum LED backlight forward current of 40 mA. Since I'd like to use brightness control, I am hesitating between using a standard PWM transistor circuit or a dedicated LED driver for the backlight. I've seen both applications used in dedicated products, however I don't know which one would be appropriate in my case.
Therefore the question: What are the pros and cons of a transistor PWM circuit vs LED driver circuit for a display backlight?
Here are some examples of the two circuits:
Transistor PWM circuit:
simulate this circuit – Schematic created using CircuitLab
Using a dedicated dimming LED driver e.g. aw9364 (cheaper or more appropriate may exist, if you agree then please recommend one):
Using an LED driver e.g. ZXSC310 (cheaper or more appropriate may exist, if you agree then please recommend one):
From my perspective, I find the transistor circuit much cheaper and easier to implement. I am hesitant about any EMC issues that may be caused by the PWM, however the transistor circuit and the display will be placed within max of 1 cm of each other. The MCU will also be within same distance and definitely has a dedicated PWM output.
My application will not use a battery but a constant power supply source.
AI: The LEDs should always be driven with a constant current unless used for indication purposes (e.g. 1 to 5mA, unimportant illumination). Full stop.
The LEDs in your application are used as a backlight. So, to me, the best practice is to use a dedicated LED driver.
The typical drive current is 30mA (The need for an overdrive to 40mA depends on the brightness requirements). The boost converter that is supplied from 3.3V as shown in the OP will not work, because the input is 3.3V and the output is 3V (Vf of the LED). A buck converter would be overkill. A CV boost to get something around 5V and using a series resistor could be an option. But...
If you use a series resistor: The required series resistor will be RLED=10R and its dissipation will be less than 10mW. One issue with this technique is that the drive current will slightly increase as the circuit runs: The LED (actually, the junction) will get warm as the current flows through it. As the junction temperature increases, its forward voltage, VF, decreases. Thus (VCC-VF) difference increases and this results in a slightly increased drive current. It may not be a problem, but still is a thing to consider.
So, either design your own current source with a transistor with VCC > 3.3V or use a low-dropout linear LED driver. Again, using a buck converter would be overkill. |
H: level-shifting daisy-chained data line from 5V to 24V for long distance communication stability
I need to daisy chain several WS2811 chips with distances up to 20-30m in between.
Every unit has a WS2811 chip that drives 3 DIO5151BCD10 LED drivers to control a high power RGB led. To account for voltage drop, a 24V line runs between the units, and every unit uses a step down converter to get 5V. The other two lines that run between the units are the WS2811 communication line and ground.
I want to make sure that the stability of the communication line for the WS2811 chips is as good as possible and so I thought that level-shifting the signal to 24V for the distance between the units could help me achieve that because a higher voltage is less prone to outside interference from what I understand.
This is how I imagine it:
WS2811(5V->24V)-----(24V->5V)WS2811(5V->24V)-----(24V->5V)WS2811(5V->24)...
I have been trying to make a circuit that helps me achieve this and have tried adding a classic 1 n-channel MOSFET bi-directional level shifter on both ends but after looking at the communication line with a scope the signal looks much worse when I shift is vs. when I do not. This is the level shifter:
Is trying to shift the signal to 24V for the distances in between the units a good idea or not?
If so, how can I build a simple circuit that achieves that without sacrificing rise time on the data edges?
AI: You've gotten into a different realm here, and you'll need to do rather more than you think. Although, you might (might, I say) get lucky.
You are proposing to transmit ~400 kHz digital signals over 20 - 30 meters. You can do this, and it's straightforward, but not the way you suggest. You cannot use just any bundle of wires. Increasing the voltage will only get you in trouble. You'll need twisted pair (coax would be even better, but it's overkill here) and dedicated transmit-receive ICs. Fortunately, both are pretty cheap.
Comments have suggested, and I agree, that RS-485 would be an excellent starting point. You'll only need 5 volts, and you already produce that. A good place to start is here You'll see from Figure 6 that your data rates and lengths are perfectly fine. You can use a single full duplex chip at each WS2811 IC, one part to convert the TWP signal and drive DIN, the other to take DO and drive the next segment of TWP. You'll need to follow the termination resistor requirements faithfully. Note that, of the two wires in a twisted pair, both wires carry the signal, and a third wire is needed to connect the ground between the units.
However, there is a chance that you can get lucky. You can use what is called series termination and perhaps it will work. In this case, all you need to do is put a resistor on the DO output and drive the TWP with the other end of the resistor. It would look like this
simulate this circuit – Schematic created using CircuitLab
The resistor must be matched to the impedance of the twisted pair, and is usually about 90 ohms, so that's what I've shown. YMMV, though. 100 or 120 ohms may work better. In principle this will work just fine, but I'm not certain if the WS2811 DO output has the necessary drive to produce the speed you want. It is worth a try, though. It has the problem that, if your DO output is not quite strong enough, or your termination resistor is not quite the right value, you may have reliability problems. It also assumes that the DIN pin of the IC has very high impedance and will not load the TWP, and this appears to be true - but I make no guarantees. However, since it's cheap and simple you don't have much to lose by trying it.
EDIT - And don't try to twist your own wire. To get consistent performance you need a consistent number of twists per inch, so you'll need to buy your wire. |
H: How do I calculate the necessary resistance for a voltage divider?
I’m self-taught, and this is a little bit of a thought experiment for me to understand Ohm’s Law better.
I have a very simple voltage divider. Given a 15V DC input, each of three 4.7KΩ resistors cuts the voltage by 33%. I started doing some experimentation, and discovered that no matter what voltage I applied to the circuit, the resistors always cut the voltage and amperage by 33% each.
But let’s say I wanted to create the same circuit and didn’t know the necessary resistance?
Given a 15V input and desired outputs of 10V, 5V and 0V, how would I calculate the necessary resistance to use? Is it possible to create a voltage divder that does not have proportional drops (e.g., let's say that from this same circuit, I want 14V, 12V, 5V and 0V)? And how does that math work? I think where I’m getting stuck is whether to use input voltage, output voltage, or change in voltage as the V value.
AI: Here is one way of understanding the problem and thus arriving at the solutions you seek:
You have a voltage V applied across a "black box", consisting of a series of resistors R1, R2 and R3 in this case. The resistances are in series so they add up, thus the Black Box has a cumulative resistance of R = R1 + R2 + R3.
A voltage applied across a resistance causes a current I to flow, thus: I = V / R.
Since the constituent resistors are in series, the SAME amount of current must flow through each of them. There is no alternative path for current to flow from V+ to ground.
A current across a resistance implies a voltage across said resistance, by the same formula as above, thus: V(r1) = I * R1. That is the potential difference between the two ends of resistor R1.
Similarly, V(r2) = I * R2, and so on.
Evidently, one of these resistors, R3, has one end at ground potential, i.e. 0 volts. Thus, the voltage from there to the other end of that resistor is V(r3). The voltage at the next higher measurement point is V(r3) + V(r2), since the voltages add up, and as stated above, reference to ground.
By following this process, the voltages at each of the points of any series resistance network can be computed if either the applied voltage V (15 volts in this case) or the flowing current due to it, is known.
Now, how does one decide what resistances to use? Well, make the total resistance too small, and the current will be high, potentially burning out the resistors or the power supply, or causing the supplied voltage to droop, depending on how ideal we are assuming things to be. Similarly, use too high a resistance, and too little current will flow, thus the readings will be swamped by other noise effects that exist in practical electronics from various causes.
So pick a number that you like, and divide it in the ratio you want the test-point voltages to be. The resistances need not be equal, just as the voltages need not be at 33% each - calculate for any ratio you want.
I hope this helped. |
H: PIC16: How does one enter sleep mode using C?
The datasheet of my PIC16 refers to the "SLEEP instruction". I'm programming the PIC16 in C using MPLAB X and the XC8 compiler.
How can I execute a SLEEP instruction on my PIC16 using C?
AI: You can use this macro:
SLEEP();
This macro is used to put the device into a low-power standby mode.
If you search for the definition of SLEEP() in the header files, you'll find:
#define SLEEP() asm("sleep")
asm(); is a statement which allows you to inline assembly instructions into your C code. |
H: Can the transformer from an SMPS be used for step-up?
Problem: Stepping up voltage of a high frequency sine wave = 50 KHz to 100 KHz range.
Inside SMPS circuits I find a donut shaped transformer that I think is used to step down the voltage from the high voltage circuit plus isolate it from mains. I have read that SMPS oscillators work at frequencies in 10s to 100s of Kilocycles. From what I read transformers can be used in either direction but not equally well.
So I have a sine wave generated around 50 to 100 KHz and 0 to 5 volts can I simply use the round transformer with the connectors reversed to step up this voltage to whatever ratio that the transformer was originally stepping down?
Even if it is not a perfect solution will it work at all and what part will not work? What can I do to make it work? I do not want to use a amplifier because the amplifiers I can get are all up to 20 KHz and I do not have a 20 voltage or higher and a + - power supply or SMPS that the amplifiers need. Oh and I have many broken SMPS units I can take apart.
Thank you.
AI: A transformer will work in either direction. In each case, the open circuit voltage out the secondary will the that put into the primary times the number of secondary turns divided by the number of primary turns. The only difference is the two windings flip primary and secondary roles when you use the transformer in opposite directions.
You need to look carefully at the impedance the transformer primary presents to the driving circuit, regardles of which direction the transformer is used in. Without load on the secondary, the primary will look just like a inductor. As the secondary is loaded, the primary will look lower impedance. For a ideal transformer, the impedance on the secondary will be reflected on the primary divided by the square of the turns ratio. For example, if the primary has 100 turns and the secondary 200, the turns ratio is 2:1. The open circuit voltage will be multiplied by the turns ratio (it will be 2x of the primary at the secondary), and the impedance tied to the secondary will appear as 1/4 that on the primary.
As long as your source can drive whatever winding you choose as the primary and it does not overload the transformer, it will basically work. Of course there will be losses, but getting into that gets a lot more complicated. |
H: Powering multiple circuit boards from one wall wart
I've got two home-build Halloween props that currently run from multiple battery packs. I want to switch this to a single wall wart. Here's what I need to power: 1 arduino, 2 Cowlacious audio boards, and 1 Cowlacious Scary Terry servo board in the one prop, and one servo board in the other. 9 volts is a fine input voltage for the power input on each, and ideally I've love to use the barrel connectors on each, since it gives a nice firm connection even when I jostle the setup.
What do I need to look for in a wall wart?
Can I just rig up wires with barrel connectors on one end in parallel off the wall wart?
AI: You can use one supply and parallel all the connections providing:
All input voltages are the same.
The supply can deliver more than the sum of all items current requirement.
Since you say 9V is suitable for all items, then 1 is covered. For 2, check the maximum current rating for each and add them together. Then pick a supply that has a current rating which is equal or greater than this value (having some leeway is always a good thing, so multiplying by say, 1.2 is a good idea. Although it's unlikely all items will be drawing max current simultaneously, it's better safe than sorry - many cheap wall warts won't actually manage the maximum rating printed on them safely)
For example, if you have 5 items, all 9V, and current ratings of 50mA, 100mA, 150mA, 200mA and 300mA, then pick a 9V supply capable of at least 800mA. Multiplying by e.g. 1.2 gives you 0.8A * 1.2 = 0.96A, so call it 1A (or more) |
H: Can a CD4056BP drive an LED display
I bought some 7-segment LED displays along with some BCD-7 segment decoders. The clerk said he didn't have the exact part I asked for and instead gave me a Texas Instruments CD4056BP. He said it was compatible but now that I've seen the datasheet, I'm not so sure as it describes the device family as a liquid-crystal display driver.
The datasheet makes no mention of use with LED displays, however the presence of the display frequency input suggests the IC can drive other display types
Quoting the datasheet, emphasis mine
The 7-segment outputs are controlled by the DISPLAY-FREQUENCY (DF) input which causes the selected segment outputs to be low, high, or a square-wave output (for liquid-crystal displays). When the DF input is low the output segments will be high when selected by the BCD inputs...
With that in mind, is it safe to directly drive the LED display from this device?
AI: Without additional driver ICs the 4056BPP is unsuited to driving LED displays.
At 25 degrees C it is capable of sourcing slightly under 1 mA with a 5V supply and capable of sinking about 0.5mA per segment. While this may produce a glimmer in your displays it is far below the drive level that is acceptable for something sold to drive LED displays - you would be entirely justified in returning them for a refund.
Logic wise, if they do what you want funtionally you could add output drivers. This could be by using ag a ULN2803 or ULN2003 type darlington transistor driver array ICs, or by using indifidual driver transistors - one per segment. The cost is not especially high, and you will learn worthwhile things along the way, but it should not be necessary.
What IC did you ask for?
Usually, suppliers like Mouser are easy to deal with, respond promptly, sell in small quantities and are reasonably priced if not always actually 'cheap'. |
H: How to fight static charge/constant electromagnetic on Arduino (attachInterrupt)
I have short wires with button attached to pin 2 and ground. However, even without touching anything, the led is toggled many times a minute. Due to that (I guess) it is reacting to my button press very very randomly. It looks like the constant charge on the wires are interfering the actual button press and acting like antenna. I've tried different Arduino UNO boards, same results, so the board is not faulty.
int pin = 9;
volatile boolean state = LOW;
void setup()
{
attachInterrupt(0, blink, CHANGE);
pinMode(pin, OUTPUT);
}
void loop()
{
digitalWrite(pin, state);
delay(1000);// for debug purposes
}
void blink()
{
if (state ==LOW)
{
state=HIGH;
}
else
{
state=LOW;
}
}
Will appreciate if anyone can recommend hardware solution to this.
AI: The problem occurs due to Arduino's inputs being in high impedance state by default. In effect, they are capacitive sensors.
You need to enable pull-up on the pin you are using as input:
pinMode(2, INPUT);
digitalWrite(2, HIGH); // Enable internal 20 kOhm pull-up resistor for this pin
If this is not done, although the pins do default to inputs, they float, as you have discovered.
No other changes need to be made, and certainly no hardware changes are needed. |
H: tone() and reading data from serial are colliding
In my sketch main loop I used SoftwareSerial in order to read data from gps.
void loop()
{
while (nss.available())
{
if (gps.encode(nss.read()))
{
...
Also I have timer ISR, which is called every second or so, where I engage buzzer
ISR(TIMER1_COMPA_vect)
{
tone(8, 1000, 200);
// digitalWrite(9, 1); delay(200); digitalWrite(9, 0);
}
The problem is, when I hear the tone and at the same time there is an incoming gps data, the tone is corrupted. When data is finished the tone is clear. So somehow serial input and tone are interfering with each other.
Even without the code, that is reading data (nss.available() and nss.read()), if I just comment out nss.begin(57600); then the problem is solved.
How can I solve this?
AI: If you can settle for a tone of frequency 976.5625 Hz instead of the 1000 Hz in your code, here is the solution (assumption: Arduino Uno or Duemilanove, not sure about the Mega):
Connect your output to Pin 5 or 6 (the PWM pins) instead of pin 8.
Create a volatile global variable:
volatile int_8 tone_tracker = 0;
Change your Timer1 ISR to be called every 200 ms.
In the ISR code, count up to 4 saving the value in tone_tracker, then:
analogWrite(SPKR_PIN, 127);
Next time the ISR is invoked, set tone_tracker to 0 and:
analogWrite(SPKR_PIN, 0);
The issue should be resolved.
Why this works:
The Timer0 ISR code now just switches on and off the tone at set times, leaving the actual tone generation to the microcontroller hardware.
The Arduino default PWM frequency on pins 5 and 6 is 976.5625 Hz unless you are modifying Timer0 somewhere else in your code (or doing something else with PWM where libraries make some "invisible" changes).
Writing analog 127 to the PWM pin generates a 50% duty cycle square wave at the default PWM frequency. That generates the tone required.
In this approach, the actual tone generation is by the PWM output of the microcontroller, not through interrupt driven variable-frequency code as used in the tone library.
The jugglery with tone_tracker gives you 200 x 4 = 800 mS silence, then 200 x 1 = 200 mS of tone output. The timer ISR and the serial ISR might well conflict, but that doesn't affect the PWM generation. Thus, at worst the tone might play on for a few microseconds longer, or may start a few microseconds later, if the MCU is busy dealing with serial comms at the time - but this would not be discernible by human ears.
Of course, this won't work as easily if you need any tone frequency except 976.5625 Hz (on pins 5 and 6) or 488.28125 Hz (on pins 3, 9, 10 and 11). |
H: circuit equations derivation problem
I'm trying to derive from scratch the differential equations that characterise Chua's circuit.
Here are the ODEs I obtain from that diagram. Current is positive if conventional current goes + → .
equations http://imageshack.us/a/img822/8892/diffeqwithdim.png
This thing is, wherever I look, the IL term in the dV2/dt equation is positive instead of negative, with everything else effectively the same. (Also, beta is generally positive).
Why am I getting the sign of that IL term wrong?
AI: Why am I getting the sign of that IL term wrong?
The voltage across an inductor is related to the current through the inductor as follows:
\$v_L = L \dfrac{di_L}{dt} \$
where the reference direction for the current is into the positive labelled terminal.
Since:
\$v_L = V_2 \$
it immediately follows that
\$\dfrac{di_L}{dt} = \dfrac{V_2}{L} \$ |
H: How to connect this 7 segment LED display to Arduino?
I have the following LED display, which I want to hook up to Arduino UNO.
According to datasheet, there is clock pin. Do I have to build external clock source for it or I can feed it from Arduino?
Any practical advice on how to connect will be appreciated.
Update:
Thanks to Oli Glaser, I've created sketch for Arduino and presenting it here, just in case someone will have same type of LED display.
const int CLOCK_PIN = 2;
const int DATA_PIN = 3;
const int DATA_EN_PIN = 4;
const byte numbers[16] = {
0b11111100,
0b01100000,
0b11011010,
0b11110010,
0b01100110,
0b10110110,
0b10111110,
0b11100000,
0b11111110,
0b11100110,
0b11101110,
0b00111110,
0b10011100,
0b01111010,
0b10011110,
0b10001110
};
void loadLed(byte d1, byte d2, byte d3)
{
digitalWrite(DATA_EN_PIN, 0);
digitalWrite(DATA_PIN, 1);
digitalWrite(CLOCK_PIN, 1);
delayMicroseconds(5);
digitalWrite(CLOCK_PIN, 0);
delayMicroseconds(5);
for (int i=7; i >= 0; i--)
{
if(d1 & (1 << i))
digitalWrite(DATA_PIN, 1);
else
digitalWrite(DATA_PIN, 0);
digitalWrite(CLOCK_PIN, 1);
delayMicroseconds(5);
digitalWrite(CLOCK_PIN, 0);
delayMicroseconds(5);
}
for (int i=7; i >= 0; i--)
{
if(d2 & (1 << i))
digitalWrite(DATA_PIN, 1);
else
digitalWrite(DATA_PIN, 0);
digitalWrite(CLOCK_PIN, 1);
delayMicroseconds(5);
digitalWrite(CLOCK_PIN, 0);
delayMicroseconds(5);
}
for (int i=7; i >= 0; i--)
{
if(d3 & (1 << i))
digitalWrite(DATA_PIN, 1);
else
digitalWrite(DATA_PIN, 0);
digitalWrite(CLOCK_PIN, 1);
delayMicroseconds(5);
digitalWrite(CLOCK_PIN, 0);
delayMicroseconds(5);
}
for (int i=0; i <= 10; i++)
{
digitalWrite(DATA_PIN, 0);
digitalWrite(CLOCK_PIN, 1);
delayMicroseconds(5);
digitalWrite(CLOCK_PIN, 0);
delayMicroseconds(5);
}
digitalWrite(DATA_EN_PIN, 1);
}
void setup()
{
pinMode(CLOCK_PIN, OUTPUT);
pinMode(DATA_PIN, OUTPUT);
pinMode(DATA_EN_PIN, OUTPUT);
delay(100);
loadLed(numbers[7], numbers[8], numbers[3]);
}
void loop()
{
}
This can be optimized of course, but there is a slight problem - every fifth reset of the board will display random garbage. Tried to play with delay, set to 50 - no good. Looking for solution.
AI: The clock and data pins are for your serial input. These can be controlled directly from the Arduino, just connect each to a digital out.
For the data routine, according to the datasheet there is one start bit, followed by 35 data bits which correspond to the "Serial Input Sequence" table in your question.
Create a function in your "sketch" to control the serial loading, something like below - I haven't checked this code. You only need to call it whenever you want to update the display.
You will have to replace the set_data_pin and set_clock_pin with the correct Arduino calls to whatever GPIO pins you have attached to the clock data pins on the display (I don't use Arduino so I don't know them) Same for the delay_us (microsecond delay) which can be adjusted to whatever timing you want up to 500kHz clock speed - you can add a define for the value to save changing each one.
Each segment is shifted out MSB to LSB, which corresponds with A(MSB) to DP(LSB) for each input char:
void load_data(char seg1, char seg2, char seg3)
{
char i, temp;
char position = 0;
set_data_pin(1); // clock start bit in
set_clock_pin(1);
delay_us(5);
set_clock_pin(0);
delay_us(5);
temp = seg1;
while(i<8)
{
set_data_pin(temp & 0x80); // set data pin
set_clock_pin(1);
delay_us(5);
set_clock_pin(0);
delay_us(5);
i++;
temp = temp << i; // shift next bit out
}
temp = seg2;
while(i<8)
{
set_data_pin(temp & 0x80); // set data pin
set_clock_pin(1);
delay_us(5);
set_clock_pin(0);
delay_us(5);
i++;
temp = temp << i; // shift next bit out
}
temp = seg3;
while(i<8)
{
set_data_pin(temp & 0x80); // set data pin
set_clock_pin(1);
delay_us(5);
set_clock_pin(0);
delay_us(5);
i++;
temp = temp << i; // shift next bit out
}
// Last 11 bits - do something here if needed
while(i<11)
{
set_data_pin(0); // set data pin
set_clock_pin(1);
delay_us(5);
set_clock_pin(0);
delay_us(5);
i++;
}
}
Connections
Connect the VDD pin to +5V, and the VSS pin to ground (0V)
Connect the VLED pins to +5V also.
Connect the DATA ENABLE pin low (i.e. to ground), as it is active low.
For Bits 25-34 pins, leave these unconnected if you don't wish to use them, otherwise you can use them as digital outputs. Don't tie them high or low (i.e. don't connect to +5V or ground)
For the BC (brightness control) pin, you can use just a resistor to fix the brightness, or a potentiometer and resistor to control the brightness of the display.
To work out the value we can use the info in the datasheet:
The absolute maximum \$I_f\$ (forward current) for the display is 30mA (pg.2)
The display current is typically 36 times larger than the current into the BC pin (pg. 4) and the maximum current into the BC pin is \$550\mu A\$ (pg.5)
So with this info we can work out the best value for the pot. If we aim for a typical operating maximum of 20mA, then:
\$ \dfrac{+5V}{20mA \div 36} = 9k\Omega \$
This is the minimum value of resistance we would use (connected between +5V and BC pin)
If we want to vary the current, say from \$10mA - 20mA\$, then we can add a \$9k\Omega\$ pot in series with the resistor with it's wiper connected to one end (either end) Then the current varies between:
\$ \dfrac{+5V}{9k\Omega} \times 36 = 20mA \$
with the pot turned fully the other way
\$ \dfrac{+5V}{9k\Omega + 9k\Omega} \times 36 = 10mA \$
Note that the datasheet is not particularly helpful with details on the brightness control pin - it shows the pot set up for a varying voltage control in the diagram which confuses things a bit. I have just ignored this diagram and taken what is written to be correct. I'm also assuming the resistance to be across the full 5V (i.e. the BC pin is just above 0V), which is probably not be the case, but it's better to be on the conservative side if no details are given.
This means you may need to experiment a bit to get the brightness right - if it's too dim try changing to a lower resistance. |
H: Bjt astable multivibrator questions
I'm working on a little project(an infrared jammer) and I'm having a few issues.
Why (and how) exactly do circuits like the one below use electrolytic capacitors? Wouldn't ceramic capacitors be suitable for this?
Also in the NPN configuration, why are the LEDs placed with the collector and not the emitter?
If I were to make the frequency variable by using a potentiometer in place of the 39K resistor would the duty cycle change as well as the frequency?
(source: reprise.com)
I'd appreciate any help! Thanks.
AI: Any type of cap is fine for this circuit - it shows electrolytics in the schematic due to them being cheaply available in large values (e.g. >10uF) Previously you could not get ceramics of this size, and they are more expensive for 10uF.
It's more usual to place the LED on the collector, for NPN and PNP as you can see with both circuits. Placing on the emitter side is fine, but you have to take into account the raised base voltage to turn the transistor on (Vled + Vbe = Vled + ~0.7V) and also raised saturation voltage (e.g. when transistor is fully on, which will be around Vled + ~0.2V)
The duty cycle will change if you only use a pot in place of one resistor - to keep the duty cycle the same you would need a dual pot to change both 39K resistors at once to keep the values the same. |
H: Example circuit of fading tone?
I'm looking for a simple circuit, preferably based on the 555 in order to get continuous configurable fading tones (chimes), just like a "door open warning". It will fade in and fade out, not very annoying.
Example sound
AI: Doing this with 555 timers is possible but will require at least two and some additional analog circuitry to get "nice" sounds that aren't just amplitude modulated square waves.
A much simpler way is to use a micrcontroller. You can either keep one cycle of the chime sound in memory or perhaps synthesize it from multiple sine waves if you want it to change over time. Once you have the tone, you can multiply it by a much slower signal to get the volume envelope. This would all be done digitally and the result used to adjust the duty cycle of a PWM output. Then you only need to low pass filter that to get the analog signal you want. |
H: RGB LED Strip - Variable Voltage Vs. PWM
I am going to install an Analog RGB (non adressable) LED strip in my room and need to make a driver for it.
The LED strip specs are:
10 cm segment
12V @ 60mA max per segment
I would be using 330cm of the strip (33 segments => 2A max => 0.7A max per channel)
My initial thought was to use a microcontroller with 3 PWM channels for red, green and blue. But then I realized I could probably get away with using 3 variable resistance to provide variable voltage to the 3 channels and the color can then simply be changed by altering these resistors.
Would this way be okay ? After all PWM does the same thing ... generate analog voltage levels from digital.
The only thing i can think of is that the variable resistors need to be able to handle that much current (vs PWM solution where a mosfet/bjt would take care of it).
Any thoughts ?
AI: Using variable resistors would work, but could be tricky to implement. For example, each segment has say a 130 ohm resistor per channel. So for 33 segments in parallel this is effectively a resistance of 130 / 33 ~= 4 ohms. So to halve the current for that channel you would need a single 4 ohm resistor, able to dissipate 0.7 * 4 = 2.8W. In a quick search on element14 I couldn't find a cheap potentiometer with this kind of power rating. You could use a pot to control a power transistor, but why not just go to PWM for that effort. :)
PWM is more power efficient. Here is a tutorial on getting is running using an Arduino and PWM. RGB LED Strip - Variable Voltage Vs. PWM |
H: How to tell if a repaired laptop power cord adapter is safe?
I bought my mom, who lives in India, a Panasonic toughbook CF-W8 a couple of years back. A few days back, due to some voltage fluctuations, her adapter/power cord blew out (along with a whole bunch or other stuff in the house).
Her laptop is fine and she has used it a bit with whatever power it has remaining. I have bought a new adapter for her over eBay and it should reach her in 3-4 weeks. In the mean time my dad asked a friend of a friend to fix the adapter and now some random person has "fixed" the adapter.
Now I am a bit nervous about the state of the adaptor and have asked my mom not to use it since i don't want her to damage her laptop.
I was wondering if there is any way to test if the "fixed" adapter is safe for use? and also, I just want to confirm that it is indeed dangerous to actually try the adapter on the laptop since I have no idea if the person who fixed it knew what he was doing.
AI: The advice you already got to use a voltmeter is good.
Check that the DC voltage is correct and also make sure there isn't a significant AC component to the voltage (for reference, my third party laptop power adapter has just under 3 volts AC unloaded). You are correct that the repaired adapter could be dangerous. It's likely only dangerous in another fault condition though. I've seen people short blown fuses with a wire as opposed to replacing them. This could cause damage to the laptop or, in the worst case, start a fire were there to be another fluctuation.
Personally, if the voltage matches up, I wouldn't be too uncomfortable using the repaired adapter. Still, it might be good to get a hold of the person and ask them how they fixed it. |
H: Getting coordinates of a device in a 3d space
I want to make a device that knows itselfs x and y coordinates in a 3d space, for example in a room. I can move the device anywhere in the room but I just need x and y coordinates. Is there anyway doing this by using accelerometers and/or gyroscopes? If not what is the easiest way to do this?
--Edit--
Here is the details. The device will be a kind of electronic pen. When I draw something to the wall with that device, I want it to be drawn in my computer screen too. The wall size is fixed. So, can an IMU give me the accurate coordinates on the wall during a few hours drawing period. If yes what should the precision or sensitivity of the IMU has to be?
AI: I actually published a paper on this a couple years back. It is indeed difficult to track objects indoors with an IMU. As mentioned here previously, the only practical way to do it is with updates. I used passive RFID tags to update the position of my very low cost IMU (less than $100 prototype). The IMU works for short periods accurately but will begin to drift, all it needs is to occasionally pass near an RFID tag that has a unique ID and location associated with it. At that point not only do you know your current position, you can perform an affine transform on your previous path to get a more accurate picture of where you were. Your question is a bit vague on your application (I was tracking humans), but perhaps this dead reckoning with RFID fiducial updates would work for you. The paper is called "Indoor localization using pedestrian dead reckoning updated with RFID-based fiducials" if you'd like to look it up. It may give you some inspiration for your own method at least. |
H: career advice embedded software development?
I am a fresh BSC electrical engineering graduate and very much interested in the software side. and i have a couple of questions for people who have some know how of embedded software development.
What an embedded software development job is like? I mean how much software work and hardware work. can it be for some one who likes software more than hardware?
Can embedded software developers develop mobile application/software like android/iphone/ipad development sort of thing? (without cs degree)
Finally if i want to do masters what degree will suit me? embedded systems engineering or embedded computing or some other?
Are there any other options for a BSC electrical programming enthusiast other than embedded software development?
AI: 1) I have been a consultant/contract engineer for the last 30 years or so specializing in embedded systems. I do both hardware and software design, but my experience is that except for the smallest companies, this is usually split up and there are separate firmware engineers and hardware engineers.
Because of the nature of embedded systems work, even firmware engineers need to have a basic grasp of electronics, and be able to read schematics and use an oscilloscope, logic analyzer, and digital multimeter and maybe a signal generator or arbitrary waveform generator. In addition one needs to be able to read and understand technical datasheets, some of which run into three or four hundred pages for a complex microcontroller with lots of embedded peripherals.
So in addition to debugging your code, you will be spending a lot of time probing a circuit looking at signals.
At the beginning of a project, even if you are not directly involved in the actual hardware design, you may be asked to participate in the design of the circuit, offering suggestions where things might be changed to make the firmware easier to manage.
When I am functioning as a hardware engineer, I design circuits (digital or mixed analog/digital), enter the schematic into a schematic capture program, lay out the PCB (printed circuit board), and develop the BOM (bill of materials). When the boards come back, check out the power supplies are all working (today's circuits often require three or more different voltages or rails). Then I write firmware routines to check out all of the peripherals individually.
2) It is certainly possible to develop mobile software (or any software without a CS degree), but you will develop better and more maintainable software after having some formal education in the subject. See next answer for more on this.
3) I got my BSEE actually a few years before the first microprocessor was invented. After graduating, I was doing logic design for a large telephone company research lab. It soon became apparent to me that a lot or most of the hardware I was designing would be done by computers some day. So I went back and got an MSCS.
That turned out to be one of the best decisions I ever made. Having the combination of both hardware and software degrees has gotten me one job after another.
The original 8-bit micros couldn't do all that much and the operating systems they ran under (if any) were quite primitive. But as the industry switched first to 16-bit and then 32-bit microcontrollers, the complexity of the firmware has grown such that the two or three dollar micro today has roughly the same computing power as a mainframe 40 years ago.
I still work a lot with 8-bit micrcontrollers in addition to the larger ones. You will probably be working almost exclusively with 32-bit microcontrollers. So having a firm grounding in CS will be necessary.
Embedded systems engineering and embedded computing degrees didn't exist when I went to school, which is why I went for the traditional CS degree. The embedded system degrees are good in that you will be having lots of labs where you actually work on the little buggers. But if you pick one of the embedded degrees, make sure you are getting a good general CS curriculum too.
4) I can't think of any right now but may someone else can come up with some. |
H: More than 2 resistors in parallel
Most people know the formula for the total resistance of parallel resistors:
\$ \dfrac{1}{R_t} = \dfrac{1}{R_1} + \dfrac{1}{R_2} + {}...{} + \dfrac{1}{R_n} \$
If there are only 2 resistors, that can be easily rearranged to solve for Rt:
\$ {R_t} = \dfrac{(R_1 \cdot R_2)}{(R_1 + R_2)} \$
Is there a safe way to do that for n resistors?
AI: Of course there is, but it does not look pretty. Make the divisors equal, and add the terms. for three resistors you get
\$ \dfrac{R2 \cdot R3}{R1 \cdot R2 \cdot R3} + \dfrac{R1 \cdot R3}{R1 \cdot R2 \cdot R3} + \dfrac{R1 \cdot R2}{R1 \cdot R2 \cdot R3}\$
\$ = \dfrac{(R2 \cdot R3) + (R1 \cdot R3) + (R1 \cdot R2)}{R1 \cdot R2 \cdot R3} \$
now do the \$ \dfrac{1}{n} \$ and you get:
\$ \dfrac{R1 \cdot R2 \cdot R3}{(R2 \cdot R3) + (R1 \cdot R3) + (R1 \cdot R2)} \$
The top line is easy, it is the product (multiplication) of all resistors. The bottom line is the sum of the products of all leave-one-out combinations. For two that reduces to the pretty formula:
\$ \dfrac{(R1 \cdot R2)}{(R1+R2)}\$ |
H: Weird output Pulse in Vector Waveform in Quartus 2
I have an obscure output pulse in my output waveforms for my half-adder. Is it because that the inputs are both high at 40ns? So I should slightly delay b going high after a has gone low? The time 58ns suggests this is the case because the FLEX 10k70RC240-4 has a propagation delay of approximately 20ns.
My output looks like and the pulse is at about 58ns:
AI: What you're seeing is a timing glitch or race condition. There's a slight difference in the time it takes for the a signal and the b signal to propagate through to the output, so if they're both changed at the same time, you can see a very short pulse at the output before it reaches the final state (which happens to be the same as the initial state for this circuit).
If you delay one of the inputs, it will make this glitch longer because you'd have a short time where the inputs are, say, both 0, instead of having (1,0) and then (0,1) as inputs. You should also realize that in reality, you might not know whether the a signal or the b is propagating faster, and it might even vary in response to temperature or other environmental factors. The simulator has probably just arbitrarily chosen one of the two inputs to process first, resulting in a glitch time equal to the simulator's minimum time step.
The usual way to deal with a glitch like this is simply not clock the result in to the next flip-flop until after all glitches have settled. Meaning, design your circuit with adequate set-up time. The fact that glitches only affect a flip-flop's output if they happen at the same time a clock edge arrives is one reason designing synchronous logic correctly is much easier than designing asynchronous logic. |
H: Pro's and con's to using a pcb's middle layer (on a 4 layer board) as a heat sink?
I'm finishing up a PCB design and it has a surface mount (TO-252) voltage regulator. I want the regulator to dissipate heat as much as possible however it will be within its thermal limit with just the top and bottom layers. So I was wondering if it will help to add a solid plane on the middle layer and/or will doing this weaken the PCB overtime or cause other issues?
Thanks
AI: Large copper areas on the top and bottom layers are better for heatsinking than a plane on an inner layer, because they have direct contact with the air that is the ultimate heat sink of the system.
That said, an inner layer can reduce the thermal resistance for heat to travel laterally away from the source, and allow the whole copper area of the board to provide some cooling benefit, rather than just the polygons directly connected to the hot part.
Unfortunately the net result, how much cooler will the part be with the added layer, is difficult to predict, or at least requires an expensive 3-d thermal modelling software to predict accurately.
Ultimately it's your judgement whether a modest reduction in the part's temperature (or a modest increase in the temperature range your board can be safely operated in) is worth the expense of increasing the layer count of your board. I'd think that very few situations would justify adding additional layers just for thermal reasons -- normally electrical concerns are what motivates the layer count and any thermal improvement is just a side benefit. |
H: PIC16: Understanding the bound on the argument to _delay
My PIC16 compiler, XC8, defines a _delay(n) pseudo-function which inserts a delay of n cycles. There is a restriction however (see here, page 59):
The delay argument must be a constant and less than
approximately 179,200 for PIC18 devices and approximately 50,659,000
for other devices.
Where do these upper bounds come from? The factorisation of 50,659,000 (2^3 * 5^3 * 7 * 7237) does not seem to shed any insight.
AI: _delay is generated at compile time, so the code is not necessarily the same for all values, they can pad, or even compound loops to achieve the exact desired number of cycles.
50659000/2^(8*3) is approximately 3. So probably the core loop they are using is a 3 instruction loop (if an 8 bit microcontroller, 3 decrements are needed for a 3*8 bit variable). Since it jumps in 3's, they can pad with one or two nop to get the exact number of cycles. This requires the decrement and jump if/ifnot zero instruction to be possible (and with/without carry). |
H: Capacitive touch sensors, how do they work?
David mentions capacitive touch buttons in EEVblog #130 - The uCalc Credit Card Scientific Calculator / Computer and indeed I have read about capacitive touch buttons before like in the documentation of de kompasklok which unfortunately is only available in Dutch.
But how do they work and can I easily make my own with a little microcontroller programming (and a PCB)?
AI: You can very easily make your own capacitive touch buttons. Texas instruments MSP430 has a good code base and PCB layout considerations for you to start right away.
The way they work, as better explained by the PDF linked above is as follows,
"As shown, a PCB-based capacitor is formed between the center copper
pad and the ground pour surrounding it. The electric field is allowed
to leak into the area above the capacitor. The interaction of this
sensor pad and the surrounding ground pour (also the ground plane
underneath) create a baseline capacitance that can be measured. The
base capacitance of such a sensor is in the range of ~10 pF for a
finger-sized sensor. When a conductor, e.g., a finger, comes into the
area above the open capacitor, the electric field is interfered with
causing the resulting capacitance to change. The coupling of the
conductive finger into the capacitive sensor increases the capacitance
of the structure beyond the baseline capacitance, the capacitance of
the sensor with no touch. By continuously measuring the capacitance of
the sensor(s) in the system and comparing each result to a
predetermined baseline capacitance, the system microcontroller can
determine not only on/off button functions for each sensor element but
also “amount” of press used for more complex interfaces such as
positional sliders."
I recommend starting with the MSP430 LaunchPad and then getting the capacitive sense booster pack. You could be playing with capacitive touch for $15. |
H: How to connect USB barcode scanner to a PIC?
I've got a bog standard barcode scanner with a USB output and I'm trying to figure out how to connect it to a PIC.
Basically, the idea is that I use the scanner to scan a barcode and the barcode is then passed to the PIC which in turn uses the barcode to do either lock or unlock a solenoid lock (the lock is something I'm going to work on later).
So I've been looking at ways to try and connect the barcode scanner to the PIC with somewhat limited success. So far it seems like one way might be to convert the USB output to an RS232 output and then connect it to the PIC and try to interpret the output but I'm not entirely sure whether that will work, or even how to do it.
So I was wondering if anyone had any ideas on a simple way I could go about connecting the scanner to the PIC please. Is the idea I have so far any good and, if so, are there any good ways to go about doing it? Or is it just needlessly complicated and is there a better way of doing it?
Thanks very much.
AI: You would be better off with a barcode reader with serial or PS/2 interface. Sometimes it is as easy as swapping the cable for a different one to change the interface type, depends on your barcode scanner model.
If you really want to use the USB barcode reader, you need either
a PIC that can be an USB host like PIC24FJ256GB106 or PIC32MX420FxxxH or
a standalone USB host controller like MAX3421E
a software implemented USB host stack - I know they exist for Atmel, not sure about PIC
Even with these hardware solutions it would still take some effort to implement enumeration, the HID device class and so on.
Outside the scope of your question and probably more expensive than a serial or PS/2 barcode scanner, but there is a precompiled firmware for FTDI's Vinculum chips that bridges an USB HID device to a microcontroller's SPI interface, see USB HID to SPI Master Sample Application ROM. |
H: How does an inverter affect the computer?
I have rampant power failure in my country. So to mitigate, we have an inverter that basically converts the charge from a big lead-acid battery to AC. But as far as i know this doesn't produce pure sine AC. It is something close to sine.
The output voltage is 220V nonetheless so it is hard to find out when the power is out.
Sometimes, i use my laptop on AC. My question is, will using laptop on inverter affect the components since output is not pure sine?
AI: I assume the question is not about power efficiency differences with a system on sine-wave power versus not-quite-sine-wave power.
Recent laptop power bricks and desktop power supplies are switched mode power supplies (SMPS). An SMPS typically rectifies the power line voltage, then uses a high frequency oscillator to "chop" this DC, a small transformer to step this switching voltage down as well as isolate it from the power line, and finally regulates the output voltage to the required levels using an integrated sense mechanism feeding back to the high frequency oscillator.
An SMPS is not particularly sensitive to power line waveform, as the rectifier stage turns it all into a ripply form of DC anyway. Yes, the high voltage section immediately after power line rectification would see a difference in voltage due to waveform change, but that doesn't matter very much: Many "universal" SMPS designs are rated for 90-250 Volts 50/60 Hz operation anyway.
If the power line supply is a square wave, the higher harmonics might stress some components in the high voltage portion of the SMPS beyond their ideal design parameters. Also, there is a tiny possibility of higher-harmonic noise sneaking onto the output rails.
However, typical inverters, even the poor quality ones we have analyzed for some projects, tend to deliver at least a somewhat smoothed trapezoidal waveform rather than a square wave. Adverse impact on the SMPS is negligible in such cases.
If the SMPS is reasonably well-designed, the actual computing hardware (laptop, or desktop motherboard) will not face any problems due to non-sine power line waveforms. |
H: Manchester Decoding
Is a Phase Locked Loop compulsory for decoding Manchester encoded data? Is the PLL used so that Manchester encoding supports different data rates?
useful links:
http://www.electronicspoint.com/manchester-decoder-t68939.html,
http://www.erg.abdn.ac.uk/~gorry/course/phy-pages/dpll.html,
Note: As I gather, the bit center transitions in MED(Mancheter Encoded Data) are used for clock sync at the receiver. So for decoding, one can detect these bit center transitions and then sample after 3T/4 to decode correctly.
Another question: Can I implement an oversampling Manchester decoder?
AI: No, you don't need a PLL to decode manchester. That's only one way. In fact a PLL doesn't by itself decode anything, it only provides a clock at which you can reliably sample the manchester half-bits. If the bit rate of the manchester stream can vary, then something like a PLL that can adjust to the incoming frequency may be useful.
I have done several manchester decoders and none of them used a PLL. The first time I did this, my thought was to measure the time between edges by capturing a timer, and then decode the bitstream from there. That worked fine, but in subsequent projects I used a different scheme that allowed for higher manchester bit rate relative to the instruction rate. In these projects I simply sampled the incoming stream at regular intervals. The periodic interrupt counts how many successive samples the input is high or low and passes that to the next level up decoding logic. That then classifies each level as long, short, or invalid, which is then decoded up the protocol chain usually ending in fully received and validated packets.
Since manchester is usually used because data needs to be transmitted accross some analog medium (it's a bit silly to use manchester between two digital chips on the same board, for example), the raw input signal is often analog. Above I mentioned that I now usually sample the manchester signal at some multiple (like 8-12) of the expected bit rate. This is actually usually done with a A/D. By doing this you eliminate the need for analog data slicers.
Digital data slicers can easily be quite a bit better than analog ones of reasonable complexity. All you need to do externally is to low pass filter the signal to prevent aliasing at the fast sample rate. Since the manchester signal is being sampled around 8-12 times faster than the bit rate, such a filter won't cut into the real signal much at all. Usually two poles of R-C is good enough.
My digital data slicers work by keeping the last two bit times of samples in memory. For example, if the manchester data is being sampled 8x the bit rate, then this would mean the last 16 samples are kept in a rolling buffer. The reason for two whole bit times is that this is the minimum time for two full successive levels of opposite polarity (imagine a 101010... pattern). The data slicer computes the average of the max and min values in the buffer, and uses that as the high/low comparison threshold.
Another trick is to do a little low pass filtering on the string of A/D samples before data slicing. This is one of the few cases where a box filter is actually a good answer, as apposed to the usual knee jerk reaction of those that didn't pay attention in signal processing class. The convolution window width is simply the number of samples in a half-bit. Think of the case where the input is a perfectly clean digital signal. This signal will always have levels lasting either 1/2 bit or 1 bit time. The box filter ("moving average" for the knee jerkers) will turn the edges into ramps lasting 1/2 bit time each. A signal with a sequence of short levels therefore becomes a triangle wave. A sequence of long levels therefore a trapezoid with ramps last 1/2 bit time and solid levels between also 1/2 bit time long. Note that data slicing this signal to the average of its max and min value yields the same resulting stream as doing it on the unfiltered input.
So why filter? Because you get better noise immunity. As described above, a perfect signal isn't effected by this filter. However, a noisy signal is. The effect on the resulting 1s and 0s stream out of the data slicer from random noise added to the input samples is less with the filtering. I have implemented this algorithm in a dsPIC sampling at 9x the bit rate with a 12 bit A/D right from a analog RF receiver. This system was able to decode valid packets from RF transmissions that I could barely see on a scope by looking at the same signal going into the A/D. "Valid" packet means that no manchester violations were found, the bit stream decoded, and a 20 bit CRC checksum test passed. This stuff really works. |
H: Using a PIC to perform switch on and timed shutdowns in automotive environment
I would like to build a circuit to perform a timed shutdown, based on logic inputs from headlamp wires and ignition wires.
I have decided on PIC10F200 (datasheet) to perform the logic.
I also have many spare 7805 linear regulators, so thought I'd use those to perform 12V->5V regulation before connecting directly to PIC pins configured as inputs. Is this a terrible idea? I have added pulldown resistors so that the PIC input pins can read defined values.
Using Fritzing, i've created a circuit:
I'm still tinkering at the moment, and this being my first PIC circuit, I want to make sure I can avoid all the possible traps when working in an environment like this.
So basically, is the circuit okay, or have I overlooked things?
All and any help appreciated, please go easy on me. I'm new!
Update:
Following advice from Olin and Wouter, I now have this:
Is this ok?
Olin says making use of the weak pullups on the PIC could save on component count, yhis is how i've interpreted him:
This works in the simulator, but I've no idea if my pile of BC547 are suitable!
I also don't know which to choose, or why?
Thanks again guys.
AI: You can use 7805's this way, but as they only replace one resistor (and require 2 additional decoupling capacitors each!) I would never do it this way. My suggestions:
replace the two 'sensor' 7805's by resistor / zener-diode combinations. Use 4v7 zeners.
add two 100nF capacitors at the input and utput of the remaining 7805
add a suppressor diode over the relays coil!!
I am not sure a jellybean 7805 is a good idea in an automotive environment, there can be nasty spikes on the power line. |
H: What's the difference between consumer and pro audio equipment?
There are some diffences between consumer/Hi-Fi and pro music audio equipment, besides that pro audio equipment is bigger and louder, requires cooling fans, etc. eg. Hi-Fi uses a pre-amp, pro audio uses a mixing desk.
What's the difference in terms of the electronics? Can an electric/electronic instrument (eg. electric guitar) be plugged into a domestic Hi-Fi, or an iPod into a guitar practice amp? What are the differences in the I/O line levels and impedances, etc. for each?
AI: Before I answer this, let me tell you a little bit about myself. I'm an EE, and I primarily work in the Pro-Audio industry-- although I have also done some work for an audiophile company. I've been using pro-audio equipment for 25 years, and designing pro audio-stuff for 14 years. I mention this so that you can judge for yourself the quality of the answer I'm about to give you.
First, what @Rob said is correct in that the term "HiFi" does not have much meaning. So I am going to slightly reword your question to this:
What is the difference between consumer audio and professional audio?
Before answering this, let me point out that pro-audio is not just what you would hear at a concert or what a wedding DJ would use. Pro-audio gear is used at an airport for their paging system, or at a restaurant for their background music, or in a boardroom, or at a movie theater.
There are many differences, and I'll highlight some of them:
Purpose
Pro-audio has a different purpose that home audio does not always need. Homes rarely need an amplifier that can drive 100 speakers in parallel. They rarely need an amplifier that can drive 8,000 watts. Homes tend to switch from one audio source to another, not mix several sources together.
The connectors used are different. Amplifiers that are used for DJ's, touring concerts, etc. tend to have Neutrix Speakon connectors. Amps used for "installed sound" have screw-terminals or Phoenix terminal strips. Consumer amps tend to have screw terminals or some light-weight wire clip things. Consumer equipment uses (typically) unbalanced audio signals on RCA connectors while pro-audio tends to use balanced signals on XLR connectors.
There are literally thousands of other differences that are dictated by the intended purpose of the equipment.
Ruggedness
Pro-equipment tends to be more rugged. Especially the equipment that is intended to be used in a live or touring sound environment. They use connectors that can withstand a lot of mate/unmate cycles. The chassis are made from thicker sheet metal. The chassis are designed to be bolted into an equipment rack. Typically the equipment has been designed to withstand more shock, vibration, and temperature extremes. Some of it has been made with withstand rain, direct sunshine, fog-machine condensate, and even salt spray.
Power
Yes, pro-audio amps tend to be higher power than consumer amps. Also, the stated specs of a pro-audio amp tend to be more "real" than the stated specs of a consumer amp. When rating the power of an amp there are a lot of ways that the specs can be fudged, and pro audio amps tend to fudge them less or if they are fudged then there is usually a footnote in the manual that explains exactly how the spec is measured.
This gets even worse when you consider car audio amps. The max power for a car amp is usually rated at 10% THD+Noise. Basically they crank up the power until the output is 10% THD+N and that is the spec that they quote. Home amps tend to spec the noise at 1% THD+N. Pro amps tend to go to 0.1% or 0.05% THD+N. Of course, there will be companies that do not follow these generalizations.
Electronics
Pro-audio gear tends to be built to last. There are pro audio amps that are still running strong after 20 years of solid use. Consumer audio gear, not so much. Part of this is because pro gear is used in more hostile environments, but the other part is just liability. Imagine this, your amplifiers are powering a large concert with 50,000 people in the audience. 5 minutes before the concert an amplifier dies and happens to destroy a bunch of speakers in the process. The concert is canceled and tickets are refunded-- then the lawsuits start. Something like this could end up costing someone $1million or more.
This is one reason why pro gear is more expensive. Better components cost more. For example, decoupling caps on a +15v rail might be rated for +16v in consumer gear. But in pro audio gear they would probably use 25v or even 50v caps.
Levels & impedance
Pro-gear is usually designed to handle a wide range of signal levels. Some mic signals are only 2 mV p-p, while other gear might be spitting out 30v p-p. This is a huge variation. Of course not all equipment is designed to take in the entire range of signals, but pro gear in general can handle the wider range much better than consumer gear.
You mention impedance, but this is largely a non-issue. Old-school equipment was designed to use 600 ohm impedance signals. Modern equipment, both consumer and pro, have low impedance outputs driving high-impedance inputs. This is on the "line level" signals, of course.
For amplifiers, most consumer and pro gear can handle 4 and 8 ohm speaker impedances. Some, but not all, pro audio amps can handle 2 ohm speakers as well.
I should also mention +48v Phantom Power. Consumer gear doesn't provide this at all, while it is standard for pro gear that needs to connect to microphones. But more importantly, most outputs on pro-audio gear is designed to plug into inputs that are providing Phantom power. Consumer gear cannot withstand the +48 volts, and could be damaged if connected to a device that is providing phantom power.
Mixing Consumer and Pro Gear
There is a lot of mis-information about mixing pro and consumer gear. With a few exceptions, you can mix them just fine. The exceptions are: Phantom Power and Signal Level. As mentioned earlier, with Phantom power you can destroy gear. If the signal levels are wrong you will just get very quiet or very distorted sound but no damage.
So, go for it! Just be careful about Phantom power and you'll be fine. It might not sound as good as it could, but it will work.
Some of the mis-information that I've heard has to do with the pro-gear producing sounds (transients, etc.) that are too hard on the consumer gear. This is complete nonsense. If it is doing that, then it will sound distorted and you know to turn it down. That's all.
Disclaimer
What I wrote above is a large generalization. There are exceptions to everything. There is consumer gear that is well made, with low noise, etc. There is also "pro" gear that is terrible. And, of course, there are "crossover" products that have features of both pro and consumer gear. As with everything, your mileage (kilometerage?) may vary. |
H: Zigbee RGB control using Xbee
In order to achieve this I was going to have the following setup:
Base Station
Raspberry Pi
Xbee 2mw
Led Station
Xbee 2mw
RGB LED http://www.pololu.com/catalog/product/1222
My main questions are:
Is it possible to use the xbee to drive the tri-color driver without needed a microcontroller, arduino or raspberrypi on the led station side?
If I want to expand this in the future, can I add more LED and drivers combinations to be driven by the same xbee?
I'm new to this so any help or advice would be appreciated. Thank you!
AI: Looking at the Shiftbrite LED module page and xBee datasheet, it would seem you can do this without a microcontroller.
The Shiftbrite LED module uses 4 lines (3 if enable always active) which are:
Data, Clock, Latch and Enable (both input and output pins, so 8 pins in total)
This means modules can be chained together easily, so you can add more Shiftbrite LED modules later on if desired.
The xBee has 8 pins which can be used as digital I/Os, and configured in "virtual wire" mode, where whatever logic level appears at the Tx input pin will be output on the corresponding Rx output pin.
So, with a bit of reading to setup the xBee for virtual wire mode, you should be able to write your code as if the LED module was connected directly to the R-Pi |
H: Weatherproofing coax connections
I have coax-connectors connecting two cable runs that are subject to weather. Typically weatherproofing is done by wrapping the connection in suitable tape. This is a fairly messy solution if the connector needs to be opened.
I am wondering if somebody had an alternative solution. Are there weatherproof coax connectors for RG-58? A waterproof box to replace the tape maybe? Typical frequency: 150 MHz.
Edit 1
Somebody had added an answer about gel-filled boxes(?) but deleted it before I could read it. If the answer was at least marginally relevant, please consider adding it again. I would love to see an alternative to tape. Text of the missing answer:
[Gel Splice Closures][1] Gel-filled box Ensures complete sealing of coaxial splices Watertight...
AI: Water can get into boxes unless they have double O-ring water tight gaskets. There may be some around.
I prefer 3M Temflex™ 2155 Rubber Splicing Tape, but there is also Scotch® Super 33+ which has a PVC backing for UV protection as an additional layer.
Carefully pry away with a pointed 1-edged razor knife to easily remove it. |
H: Replacing a custom serial port connector with a Micro-USB 2 plug
I currently have a very fragile solution to connect my embedded device to a PC's serial port. This is mounted on the PCB: http://www.digikey.com/product-detail/en/DF13A-6P-1.25H(50)/H3384-ND/530681. Its companion must be painstakingly attached to the wires of an existing serial cable, and placing any sort of strain-relieving product takes too much expertise. The wires often break off. Only five pins of the six are used. I may be able to respin the board this connector must be on.
I'd like to replace it with a Micro-USB B receptacle so that I can cut open easily-obtainable Micro USB cables and mate them to a DB9 connector. Is the 5th pin actually wired on most cables? I don't know much about the USB standard. Does this seem like a decent idea?
EDIT: This port is factory accessible only.
AI: The ominous Pin #5 is usually the ID Pin and does not travel through the cable. If I remember correctly, this pin is usually shorted to ground, indicating a device device or open, indicating a host device.
In other words: This pin decides if the device which is connected plays the host or device role.
If you use the other 4 pins, make sure that no user will really use a "normal" USB cable (and they will) as your device will most likely get 5V on the power pin (which is probably not what you want).
PJCs solution is in my opinion a good one (but requires you to change the board) |
H: Pinout for an SMA Connector
I'm trying to connect my antenna to my PN532 chip using an SMA connector but I'm not sure about the pinout. I'm using the following as my sample schematic and I want to use the following SMA connector to connect to an antenna. In the schematic you can see how the two load resistors connect to two pins and then a third pin connects to ground on the antenna. However, I'm not sure how this pinout correlates to the SMA connector meaning, which portions of the SMA connector are Pin1/Pin2/Gnd. Can anyone help me understand this?
AI: First, the spec sheet and mechanical drawing for the connector are linked to directly from the page you linked to above. The pinout is very clear from that. Did you look at it at all? The center pin is the center connection, and the other pins connect to the outside of the coax. The drawings seem quite clear about this.
Second, that schematic shows 3 connections to the antenna. if that's what you really want, you can't use a SMA connector since it only has two connections. SMA is for coax, not balanced line. |
H: Combinational Logic Design, Truth table and K-Map question
This question is for logic computer designs, I hope it's okay to post it here. It's actually a very simple question I guess.
In this screenshot below, how did they implement the K-Map from the Truth Table? it's a bit confusing to me, if it was 1 output I would know where to place the 1's on the K-Map.
Note: I found this question on the internet.
AI: You have to create a K-map for each one of the outputs.
The first K-map is for the output variable A and the second for B.
You can simply divide your problem in three subproblems, one for each of the outputs. |
H: Lower the voltage
I need to lower the voltage of this 12v battery to power this board, what parts do I need?
Sorry, for more naive questions just another programmer =)
AI: You can power it directly with 12V - according to the specs in the link you give, it has a 6V-16V input range.
Looking at the schematic (p.32 of the datasheet) confirms that it uses a MP1482DS buck regulator, so efficiency will be good over the entire range (as opposed to a linear regulator which will become more inefficient at higher voltages) |
H: Differences between a FET multiplexer and regular digital multiplexer?
I need a MUX 8-1 with a very fast propagation delay; <10ns. I was searching Digikey and found a category of digital muxes called FET multiplexers, and their propagation delay is insanely fast < 0.25ns, which seems too good to be true.
What are the advantages and disadvantages between using a FET multiplexer such as the SN74CBT3251 and a regular digital one such as the CD74AC251 other than propagation delay time differences?
A FET multiplexer seems like an analog one, but it's listed under digital on Digikey...
AI: You are looking for an 8 to 1 MUX with a very fast propagation delay <10ns.
THe Analog Mux is a passive switch, is bi-directional (1:8 or 8:1) but meets your speed requirements if you can provide low impedance source and some terminator resistance (passive or active).
The Digital MUX is unidirectional 8 to 1 with complementary buffered outputs are slower.
Both have OE for a similar tri-state output.
If you are considering digital MUX's and need optimal speed, it would seem the ANALOG Mux will satisfy your requirements. THere will be glitches on the output signal during address transitions from high output impedance and capacitance, but that's normal. There will be some source loading effects when output load is connected to each input, but Ok for say low 50 ohm source and say 500 ohm terminator.
If using this for an analog MUX/DEMUX then time constants will different from specs according to difference in RC loads and transmission line effects. |
H: PWM LED dimming via constant current source
I have this idea to dim LEDs and I'd like to get some opinions if it's feasible.
Q1 and M1 form a constant current source, Q1 ensures a 0.7V drop across R2 by pulling M1 gate to ground. Q2 gets a PWM signal on it's base turning M1 off completely during positive pulse.
I'm a bit worried about M1 slamming LED hard until Q1 turns on, my guess is that a capacitor from gate to ground would slow it down, am I right?
Does anyone see any other problems in this design?
AI: Looks workable.
I doubt that you'd have major issues with the FET turning on substantially faster thahn the bipolar unless Q1 was a seriously low Ft part. If the LED current gets even say 20% above nominal then Vbe will be seriously high compared to normal (if 0.7V usually then = 0.84 V at 120%) and at +50% current Vbe = 1V+ and the transistor is trying very very hard indeed.
1 kHz is OK for many things but depending on duty cycle you MAY get effects that some people can see and if you are moving the LED, and depending on what it is illuminating, you may get motion artefacts. eg if you move the LED at 1m/s then in 1 mS it move 1mm so you have the lighting effects of 1 PWM cycle spread over 1mm. Fairly fine - you may see surface patternin. At 5m/s and 5mm/frame you can probably see the PWM patterns as dark / light sequences on an illuminated surface.
A base capacitor is probably a bad idea. If time constant is of the order of a PWM frame period or longer you start to get mean DC at the gate and the FET may run in partially on semi linear mode. A bit smaller Tc you round the pWM corners and slow the transitions and add heat to the FET. Exact effects depend on how hard Q2 is driven. Turning a transistor on across a charged capacitor tends to create undefined results and high current peaks unless specifically designed. |
H: What direction to place electrolytic caps for AC coupling?
If using polarised electrolytic caps in an amplifier circuit as shown below,
Does it matter which way round I place the caps? If so, why?
AI: Use of electrolytic caps makes about no sens for Ci1 and Ci2 and only for Co if your Vcc is hundreds of volts. ie the leakage characteristics of an ecap will trash any precision you may hope for (and quite a lot that you don't hope for.)
And, 0.1 uF is such a small value for an ecap that you probably need a special licence these days to buy one, if anyone stocks them.
BUT
Ci_connected_to_Vin (components should have unique names) will have net unipolar noisy DC applied as long Vin < Vcc /2 so it is not seeing true AC so a polarised cap can be used, although why you'd use one there is a mystery.
Same applies to Ci_upper but more so.
Co also see a signal always above ground so can be an ecap if you must.
In all cases the ground referenced side should be negative because in use it will always be more negative.
The design of the 741 opamp ocurred a serious fraction of my age ago and they should only be handled with well insulated barge poles.
If ground was half supply instead of V- as shown- as it may be in soime versions of this circuit - then polarised caps would not be suitable at all. |
H: Choosing a transistor and resistor for PIC input pin protection from Car Power
Further to my previous question,
Using a PIC to perform switch on and timed shutdowns in automotive environment
I've been pointed at zener diodes and voltage dividers, but I'm now confused by the PICs builtin weak pull-up resistors (and if I check the datasheet, values are TBD... I assume something like 10k?)
So the PIC input pin protection circuit I think I have understood is this:
But using weak pullups, I think I could do this:
But all this does is swap a resistor to a transistor.
Update
Further to comment from @PJC50, I now think the circuit utilising the PIC's pullup resistors would look like this:
It's now clear why I should do this and how it reduces component count.
How do I choose a resistor and transistor that are suitable?
Is the voltage divider circuit correct?
Is the circuit that uses the weak pullups correct? (i think not)
Why would I use pullups over normal voltage divider?
So my new circuit looks like this:
Update 2:
I've tested the circuit with pull ups, and I think I'm getting closer to real solution, any further comment/critique welcome!
AI: If you are using the NPN method as I described in #4 of my answer https://electronics.stackexchange.com/a/47250/4512, then you don't need a zener diode. The B-E diode of the transistor will limit the voltage by itself.
To clarify, here is how you can use two resistors and a zener diode to safely drive a 5 V PIC input from car power:
With 12 V in, the resistor dividers by themselves would drop the output to 6 V. However, the zener will clamp that to a bit below 5 V, which keeps the voltage safe for the PIC. Even if IN momentarily went to 50 V, for example, the zener will limit the voltage at OUT to a safe level.
The transistor method looks like this:
The B-E junction of the transistor will limit the voltage accross it to around 700 mV, so there is no need to protect the resistor. In this case I set the voltage divider so that it takes a few volts on IN to turn on the transistor. If the base is about 600 mV when the transistor first turns on, then there needs to be about 5 V on IN for that to happen. This gives you better noise immunity than just connecting a resistor to the base of a transistor without a pulldown there.
When IN is high, the transistor turns on, pulling OUT low. Since the transistor can only pull down or not pull at all, you need something to pull the line high when the transistor is off. This can either be the deliberate R3 as shown, or it can be a pullup resistor built into the PIC. In the latter case, you don't need R3 and you just tie the collector directly to the PIC input without any additional parts. |
H: PIC24E writing address and increment for ICSP programming
I am trying to program my Microchip PIC24EP512GU814 in ICSP mode. The resource I'm using to do this is the Microchip dsPIC33E/PIC24E Flash programming Specifications (70619B) and the Microchip dsPIC33EP/PIC24EP Data Sheet (70616g). So far I've programmed an Arduino to enter ICSP mode, and erase everything on the chip, but I am currently stuck at writing on the chip.
Section 6.6 has a table 6-5 on page 31 which shows steps on how to write onto the chip. Step #6 has the following snippet:
MOV #DestinationAddress<15:0>, W2
MOV #DestinationAddress<23:16>, W3
In context: these instructions are to be executed once 128 instructions have been inputted into the write latches. This snippet define the location in the code memory into which the instructions from the write latches are copied.
I currently can't figure out which address I should start with, and how much does the address increment by for the next 128 instructions?
I've looked at the Section 4.1, Figure 4-1 of the Data Sheet (70616g) and Section 2.3, Figure 2-2 of the Programming Specifications (70619B). Is the code memory the same thing as the User Program Flash Memory in these figures? As such, should the destination address in the above snippet start at 0x000200?
Since this establishes a write for 128 instructions, does it increment by 128 = 0x80? Or does it increment by the number of bits written (24x128= 3072 = 0xC00)?
AI: You'd start at 0x0, because the stuff there (IVT, etc) are part of what you want to upload. PIC addressing is always confusing because of their insistence on weird architectures with 14 or 24 bit words, but I believe the destination address would increment by 0x100 for 128 instructions -- this is supported by the comment in 5.2.9 of the programming spec, "The destination address should be a multiple of 0x100", as well as the flow chart shown in figure 3-4. |
H: Why do some transformers hum less or not at all when lightly loaded?
It can be observed that large power transformers hum more under load. For example, when some devices are powered up, there is brief "twang" sound: a loud hum that quickly decays as the filter capacitors charge. Increased continuous hum from a transformer can indicate that the filter capacitors are leaking.
This question isn't about why transformers hum, but why do they hum less, or hardly at all, when not loaded. How is the electro-mechanics playing itself out to reduce the hum? After all, the fluctuating magnetic fields are there whether or not there is a load on the secondary winding.
AI: The humming is primarily caused by magnetic forces, which are proportional to current. Less loaded transformers have less current thru them, so hum less. |
H: Easiest way to create a USB HID device
I am working on hacking an RC remote controller I own. What I intend to do is open it up, and tap into the potentiometers. I want to read the analog values delivered by the potentiometers, and send the signals to my PC. Essentially, I want to re-purpose it to work like a joystick with the HID USB interface. Of course, the HID interface is not necessary, but I believe it is the best way to go about this.
I am quite familiar with the AVR microcontroller family, so I initially though I could try something like V-USB with an ATMega8. At the same time, I began to think that it may become unnecessarily difficult. Is there any easier way to achieve such connectivity without breaking the bank?
AI: The dead-simplest way is to buy an Arduino Leonardo.
I actually just did what you are talking about. In my case, I was converting an old arcade-style game controller to USB.
See the writeup I did here.
Anyways, here are my modified files you would need to turn your own leonardo into a joystick. These files support an 8-axis joystick, with two hat-switches, and 32 buttons.
If you want fewer buttons/axes/whatever, you can either just ignore the things you don’t need, or modify the HID descriptor yourself. As it is, for everything the HID descriptor currently specifies, it only needs 12 bytes per PC-update, so I’m not too worried about the extra axes causing issues or slowing things down. |
H: Atmega32 + LCD displays nothing
I'm trying to write a program in C to display text on this LCD, for some reason it displays nothing at all. I followed this tutorial on youtube and used my schoolbook (I recently started studying electrical engineering), but even after exactly copying what was there (except for the ports and stuff) it still didn't not work.
I was hoping someone here could have a quick look and spot what's going on. I don't know what to do anymore.
#include <avr/io.h>
#include <util/delay.h>
//These are the DDR and PORT associated with the 8 bits data send/received
#define LCD_DDR DDRC
#define LCD_PORT PORTC
//LCD_COMMAND_DDR if you will, so with the three pins Enable/RegisterSelect/ReadWrite
#define LCD_CMD_DDR DDRD
#define LCD_CMD_PORT PORTD
#define LCD_CMD_RS PIND0
#define LCD_CMD_RW PIND1
#define LCD_CMD_E PIND2
#define LED_PIN PIND7
//Just some defenitions to make it easier for me
#define LCD_CLEAR_DISPLAY 0b00000001
#define LCD_CURSOR_HOME 0b00000010
//Enable display/cursor/blink
#define LCD_DISP_ALL 0b00001111
//Set it to 8 bits mode
#define LCD_SET_MODE 0b00111000
// Set Auto-increment noshift
#define LCD_SET_AI_NOSHIFT 0b00000110
void initializeLCD();
void commandLCD(unsigned char d);
void putcLCD(unsigned char c);
void checkIfBusy();
void switchEnable();
int main(void)
{
initializeLCD();
putcLCD(0x41);
putcLCD('A');
putcLCD('L');
putcLCD('L');
putcLCD('O');
}
void initializeLCD()
{
LCD_DDR = 0xFF;
LCD_PORT = 0x00;
LCD_CMD_DDR = 0xFF;
LCD_CMD_PORT = 0x00;
_delay_ms(200);
commandLCD(LCD_SET_MODE);
commandLCD(LCD_DISP_ALL);
commandLCD(LCD_CLEAR_DISPLAY);
commandLCD(LCD_SET_AI_NOSHIFT);
}
void checkIfBusy()
{
//Set LCD DDR to input
LCD_DDR = 0x00;
//Set RegisterSelect low so the 'inner registry' is selected (not the characters on the screen)
LCD_CMD_PORT &= ~(1 << LCD_CMD_RS);
//Set ReadWrite high so I can read data
LCD_CMD_PORT |= 1 << LCD_CMD_RW;
while(LCD_PORT >= 0x80)
{
switchEnable();
}
//ReadWrite back to low so I can write to it again
LCD_CMD_PORT &= ~(1 << LCD_CMD_RW);
//DDR back to output
LCD_DDR = 0xFF;
}
void switchEnable()
{
//Enable high
LCD_CMD_PORT |= (1 << LCD_CMD_E);
asm volatile ("nop"); //delay a bit (tried it also with _delay_ms(200);
asm volatile ("nop");
//Enable low
LCD_CMD_PORT &= ~(1 << LCD_CMD_E);
}
void commandLCD(unsigned char d)
{
//delay untill busyflag is off
checkIfBusy();
//put command to the port
LCD_PORT = d;
//set both RegisterSelect and ReadWrite low
LCD_CMD_PORT &= ~((1 << LCD_CMD_RS)|(1 << LCD_CMD_RW));
switchEnable();
// Clear the port
LCD_PORT = 0x00;
_delay_ms(2);
}
void putcLCD(unsigned char c)
{
//see if we're done
checkIfBusy();
// put character to port
LCD_PORT = c;
//Set ReadWrite low
LCD_CMD_PORT &= ~(1 << LCD_CMD_RW);
//Set RegisterSelect high
LCD_CMD_PORT |= (1 << LCD_CMD_RS);
switchEnable();
LCD_PORT = 0x00;
_delay_ms(2);
}
After answer below:
int main(void)
{
LCD_DDR = 0xFF;
LCD_PORT = 0x00;
LCD_CMD_DDR = 0xFF;
LCD_CMD_PORT = 0x00;
initializeLCD();
putcLCD(0x41);
}
void initializeLCD()
{
_delay_ms(15);
initCommandLCD(0b00110000);
_delay_ms(5);
initCommandLCD(0b00110000);
_delay_ms(100);
initCommandLCD(0b00110000);
_delay_ms(100);
initCommandLCD(0b00111000);
_delay_ms(100);
initCommandLCD(0b00001000);
_delay_ms(100);
initCommandLCD(0b00000001);
_delay_ms(100);
initCommandLCD(0b00000111);
_delay_ms(100);
}
void checkIfBusy()
{
LCD_DDR = 0;
LCD_CMD_PORT |= 1 << LCD_CMD_RW;
LCD_CMD_PORT &= ~(1 << LCD_CMD_RS);
while(LCD_PORT >= 0x80)
{
switchEnable();
}
LCD_DDR = 0xFF;
}
void switchEnable()
{
LCD_CMD_PORT |= (1 << LCD_CMD_E);
_delay_ms(2);
LCD_CMD_PORT &= ~(1 << LCD_CMD_E);
}
void initCommandLCD(unsigned char d)
{
LCD_PORT = d;
LCD_CMD_PORT &= ~((1 << LCD_CMD_RW)|(1 << LCD_CMD_RS));
switchEnable();
LCD_PORT = 0;
}
void commandLCD(unsigned char d)
{
checkIfBusy();
initCommandLCD(d);
}
void putcLCD(unsigned char c)
{
checkIfBusy();
LCD_PORT = c;
LCD_CMD_PORT &= ~(1 << LCD_CMD_RW);
LCD_CMD_PORT |= (1 << LCD_CMD_RS);
switchEnable();
LCD_PORT = 0;
}
AI: I had to disable JTAG at the top of my main:
MCUCSR = (1<<JTD);
MCUCSR = (1<<JTD);
It works now, my code is good, I don't need to initialize my LCD manually. Just clear the screen and optional commands.
Final Code:
#include <avr/io.h>
#include <util/delay.h>
#include <math.h>
#define LCD_DDR DDRC
#define LCD_PORT PORTC
#define LCD_CMD_DDR DDRD
#define LCD_CMD_PORT PORTD
#define LCD_CMD_RS PIND0
#define LCD_CMD_RW PIND1
#define LCD_CMD_E PIND2
#define LED_PIN PIND7
void initializeLCD();
void commandLCD(unsigned char d);
void putcLCD(unsigned char c, unsigned char c1);
void checkIfBusy();
void switchEnable();
void putsLCD();
void lcdNewLine();
void resetLCD();
int currentLine = 0;
int currentChar = 0;
int main(void)
{
MCUCSR = (1 << JTD);
MCUCSR = (1 << JTD);
LCD_DDR = 0xFF;
LCD_PORT = 0x00;
LCD_CMD_DDR = 0xFF;
LCD_CMD_PORT = 0x00;
initializeLCD();
while(1)
{
putsLCD("Printstuff");
_delay_ms(3000);
}
}
void initializeLCD()
{
_delay_ms(15);
commandLCD(0x01);
commandLCD(0b00111100);
}
void checkIfBusy()
{
LCD_DDR = 0x00;
LCD_CMD_PORT |= 1 << LCD_CMD_RW;
LCD_CMD_PORT &= ~(1 << LCD_CMD_RS);
while(LCD_PORT >= 0x80)
{
switchEnable();
}
LCD_DDR = 0xFF;
}
void switchEnable()
{
LCD_CMD_PORT |= (1 << LCD_CMD_E);
_delay_ms(2);
LCD_CMD_PORT &= ~(1 << LCD_CMD_E);
}
void commandLCD(unsigned char d)
{
checkIfBusy();
LCD_PORT = d;
LCD_CMD_PORT &= ~((1 << LCD_CMD_RW)|(1 << LCD_CMD_RS));
switchEnable();
LCD_PORT = 0;
}
void putcLCD(unsigned char c, unsigned char c1)
{
if(c == '\n')
{
lcdNewLine();
return;
}
if (currentChar >= 20 && c != ' ' && c1 != ' ' && c1 != '\0')
{
currentChar = 0;
putcLCD('-', ' ');
lcdNewLine();
}
if (c == ' ' && currentChar == 1)
return;
checkIfBusy();
LCD_PORT = c;
LCD_CMD_PORT &= ~(1 << LCD_CMD_RW);
LCD_CMD_PORT |= (1 << LCD_CMD_RS);
switchEnable();
LCD_PORT = 0x00;
currentChar++;
}
void resetLCD()
{
checkIfBusy();
commandLCD(0x01);
currentChar = 1;
currentLine = 1;
}
void lcdNewLine()
{
char line = 20;
switch(currentLine)
{
case 1:
line *= 2;
break;
case 2:
line *= 1;
break;
case 3:
line *= 4.2;
break;
}
line += 0b10000000;
checkIfBusy();
commandLCD(line);
currentLine += 1;
currentChar = 1;
}
void putsLCD(unsigned char *s)
{
checkIfBusy();
resetLCD();
int maxCount = strlen(s);
int i;
for(i = 0; i < maxCount; i++)
{
if(s[i] == '\0')
break;
char arg2 = ' ';
if(i + 1 < maxCount)
arg2 = s[i + 1];
putcLCD(s[i], arg2);
}
} |
H: How to determine the total number of charges a portable charger can supply for a phone?
According to can a 3000mAh portable charger charge a 1500mAh battery?, it was mentioned that a 3000mAh Portable charger can only charge a 1500mAh phone's battery 1.33334 times.
So, how do we determine the total number of charges that a Portable charger can supply to a battery given the following parameters:
X mAh Portable charger with output of Y volt and Z Amp.
P mAh phone battery with input of 5 volt (almost all phone is using 5 volts due to USB Charging) and Q Amp.
The reason for asking is that according to the article, it mention that there is a 20% inefficiency (which I do not know if it is true for most portable charger), so a 3000 mAh Portable Battery charger can only charge a 2400 mAh battery.
If that is the case, the 3000 mAH Portable Battery charger can charge the 1500 mAh battery 1.6 times instead of 1.33334 times. I was thinking why it was stated 1.33334 times and not 1.6 times and I believe that there must be a way to calculate the number of times a Portable charger can charge a phone battery until it have no more electrical charges.
Added Information
Also, according to a user, it mention the following:
As posted above, with voltage conversion there is just 80% capacity of portable charger's battery pack available for your phone.
While charging, your phone needs power for stand-by, so in my experience, you'll have just 65% capacity.
And by industrial standards for batteries is +/- 20% tolerance admitted with capacity.
So, your portable charger might have just 45% of its 3000mAh available for to charge your phone.
So, can one use the magical value 45% as a gauge for portable battery charger? (Meaning that a 5000 mAh battery charger can only charge a 2250 mAh phone battery one time.)
AI: I believe the answer can only be empirical, not definitive.
To examine some of the figures mentioned:
there is a 20% inefficiency (which I do not know if it is true for most portable charger)
A portable charger that is itself charged from USB (5 Volts) would need a boost converter to be able to supply 5 volts at its output. Boost converters commonly mention efficiency of 65 to 85%. TI's TPS61030, TPS61031 and TPS61032 state 96%, and Maxim's MAX8815A states 97% efficiency.
These figures do not account for possible efficiency loss due to external components (ESR of capacitors for instance) or temperature variation. Thus, treat that "20%" number as indicative at best.
your phone needs power for stand-by, so in my experience, you'll have just 65% capacity.
That would depend on whether the phone is kept powered on while charging, what power intensive tasks (e.g. WiFi, social media polling software) are running on the phone, and even the current draw of the phone in the nominal "powered off" state - Some smartphones do not actually power off completely unless the battery is pulled out.
Thus, that 65% number is also indicative at best, though varying it somewhat is within the user's control.
by industrial standards for batteries is +/- 20% tolerance admitted with capacity.
That number would be defined in the datasheet of the specific battery in question. It would also vary widely by age / charge cycle history of the battery, temperature, contact oxidation and possibly several other factors.
So, while the number is a reasonable guesstimate, it is not definitive.
Note that this last figure is applicable to both, the cellphone battery and the portable charger battery.
So, can one use the magical value 45% as a gauge for portable battery charger?
Clearly not. The only numbers that can be used, even as a rule of thumb, are those empirically measured for your particular situation and use pattern. Even so, the percentage will change widely over charge cycles, season and time of day (temperature factors). |
H: Trying to find a touchscreen that will be compatible with a microcontroller
I was wondering id anyone knows or have experience with building something that is controlled by a touch screen? I want a 3x3inches touch screen , that will be controlled by an "fairly-easy" to program micro-controller, maybe Arduino?. Where to buy it and what do you guys suggest? etc. any help would be appreciated.
AI: Square touchscreen displays are not common; search for 4.3" touchscreens to obtain approximately the same screen area, typically in a rectangular 4:3 or widescreen format.
If you are not experienced in microcontroller programming, a serial touchscreen (SPI or I2C connection) would be easier to use than one designed for parallel data.
Also, touchscreen and LCD display panels often communicate via a flexible plastic connector, which is not trivial to connect up if you are not experienced at soldering small pitch connectors.
More suitable to your purposes would thus be a serial touchscreen module that comes pre-fitted on a PCB with standard 0.1" pin-out connectors. For instance, the $38 iTead ITDB02-4.3, a 4.3" color LCD plus touchscreen, which also contains an SD card socket that might find use in your project. (This is not a recommendation, merely an example product)
Arduino programming support for this module is available through the UTFT Library, saving some effort in just getting the device to work. The same library also works with a variety of other touchscreen and LCD devices, so changing to a different device in the future is an option.
For even simpler connectivity, look for an Arduino compatible touchscreen shield. These shields just plug right onto the Arduino board, so no fiddling about with jumpers or getting things wrong. Of course, there is a price premium for the convenience: EUR95 for this example. Cheaper ones do exist, with varying levels of library support and performance.
If you look at smaller touchscreens, or go with monochrome, the price drops significantly. There are often monochrome serial touchscreen modules on eBay for really low prices. Watch out for the connector the device uses, though. FPC would require that additional step of soldering up a very small pitch connector, typically 0.8 mm pitch with up to a dozen traces to be soldered.
Sites like Adafruit and SparkFun may also be worth a browse, not the least because they cater to the hobbyist community, so devices sold there are supported by an active community reporting successes or problems. This in itself might be the biggest help in getting your touchscreen project up and running. |
H: Can I use an SMPS to power a audio TDA7293 power amplifier?
I have been gifted a couple of these TDA7293 Power Amplifier boards, and I need to give power to them. Description says
*DC power supply: positive and negative 25-45V
*The power of the transformer: 100w-200w
The DIY Audio forums talk about using a huge transformer + rectifier board for these amps. Can I use SMPS instead? The SMPS will be lighter than the transformer.
If SMPS can substitute the transformer, I must use two SMPS and connect back to back or a single SMPS with + and - is available? And is the current rating different for SMPS or same as transformer? Thank you.
AI: As long as it meets the voltage/power ratings, you can power it with whatever you like.
A transformer by itself is not a "power supply", an SMPS uses a transformer too, just at a higher frequency which makes it more efficient/smaller. What they are referring to on the DIY Audio forums is a "linear supply", which is more basic but easier to make less noisy than an SPMS so often used for audio. Ratings work the same for either type.
An SMPS can come with whatever voltage outputs you desire, there are plenty of dual rail (positive and negative) supplies out there.
If the SMPS is a good quality and quiet (check datasheet) then there is no reason you can't use it to power your amp.
The TDA7293 can supply up to 100W into 8 ohm. These boards specify 85W however so stick with that rating (or below). To find out the average current needed into 8 ohms for this wattage, the formula is sqrt(W/R) = sqrt(85/8) = 3.26A. The amplifier is not 100% efficient though so you need a higher input wattage to reach this level of output.
What supply depends on how hard you want to drive the boards, but something like they recommend is a good idea, e.g. +/- 30V 150W supply. |
H: Controller that supports multiple LCDs, ideally up to 5
Are there any controllers that support multiple LCDs? Ideally I'd like to connect up to 5 LCDs to a single controller. The sort of LCDs I'm mainly interested in are smallish units around 320 x 240 such as this one.
It would be even better if the controller was compatible with the .net Micro Framework but that's not essential.
AI: I'm assuming when you say controller, you mean a microcontroller, the confusion only arises because LCDs themselves have controllers.
The answer is yes, the STM32F103RE would work for what you want to do. It's compatible with the .net micro framework and it has plenty of options to run serial displays on, be it SPI, I2C, or asynchronous serial. Perhaps a display like this one.
Whichever display you go with, try to find one with onboard memory, you'll save yourself some headaches that way. |
H: Are external hard drives designed to be protected against electrostatic charge?
Looking at the conditions in which external hard drives are used, do the drive makers make them with protection against electrostatic charge? Does the outer casing protect it against electrostatic charge?
When my external was shipped, it was shipped in a simple clear plastic bag and a cardboard box. So i guess it is a yes but not quite sure.
AI: Being in an enclosure it will have as much protection against ESD as any other enclosed electronics, from your laptop to your DVD player.
The only chance of damage through ESD will be via the USB (or FireWire, Thunderbolt, E-SATA etc) port, but due to the design of these ports, it is pretty much impossible to come into contact with the data pins, making the chance of ESD damage negligible. |
H: The Vdc Specification of a transformer
When looking at a transformer datasheet, I want to know if the Secondary AC output voltage which is specified is the \$V_{pk}\$ or the \$V_{rms}\$.
From this Triad FS12-090 datasheet, does 12.6V mean \$V_{rms}{ }\$ or \$V_{pk}{ }\$ ?
AI: Transformers inherently put out AC, not DC. The DC component coming out of a transformer is guaranteed to be zero.
Voltages for transformer windings are RMS voltages unless something else is specifically stated. This transformer has a split primary so that you can put the two halves in series to drive it with 230 V AC or in parallel to drive it with 115 V AC. A similar thing is going on with the secondary. When the primary is driven as described, each secondary winding puts out 6.3 V. These can be combined in parallel to get twice the current or in series to get twice the voltages.
Let's say you configure the secondaries to get 6.3 V, which is RMS. Assuming a sine wave, the peak will be sqrt(2) higher than the RMS level, or 8.9 V. The output will therefore swing between -8.9 V and +8.9 V. How that maps to "DC" depends on the circuit that does the conversion. If you connect this to a full wave bridge, for example, then you get the absolute value of the AC wave minus two diode drops. If the full wave bridge is 4 normal silicon diodes, then figure each diode drops 700 mV for a total loss of 1.4 V. The DC output will therefore peak at 7.5 V twice per cycle.
Even that is not the final answer. If you put a cap on the output of the full wave bridge but leave it otherwise unloaded, then it will go to 7.5 V and stay there. However, if you use that as a power supply and draw some current from it, then the current will come from the cap in between when it is charged to 7.5 V at the peaks of the AC waveform. If your input power is at 60 Hz, then these peaks will occur every 8.3 ms. How much the voltage on the cap drops during the 8.3 ms interval until it is recharged again depends on the amount of current that is drawn and the size of the cap. The effective average DC voltage therefore depends not only on the transformer but on the size of the cap and the current load. |
H: The intuition behind RS flip-flop
I'm struggling to wrap my mind behind the concept of RS flip-flop. For me, the diagram seems very non-intuitive.
Whenever I accept, for example, that Q is HIGH and follow signal route (is it even correct to say so?) I come to a logical contradiction (say, NOT Q being also HIGH).
Could you please share some knowledge and enlighten me?
AI: I think that your confusion comes from treating the output identifiers Q and /Q literally.
As Curd says, if both S and R are held high (in Oli's diagram), both Q and /Q will be simultaneously low. So from a purely logical perspective, the assumption that the outputs are Q and /Q must be wrong.
It is better to label the outputs of two-gate SR latches as Q and Q', with Q' = /Q except when S = R = 1. |
H: How does memory wear out?
I know that after time due to writing/re-writing memory wears out, and I was reading about a microcontroller from TI which uses "wear leveling" to insure the longest life of some EEPROM that the chip used.
I can infer that this will try to write to all of the bits on the chip in some sort of cyclic mechanism so it's not constantly writing/erasing some subset of bits at lower addresses and wearing them out faster.
What I'm really curious about is how does this "wear" happen? What components that make up memory are actually wearing out? My very rudimentary understanding is that computer memory uses latches, or caps, or some such component to retain voltage. If that's correct, do they "just stop" holding voltage after a time?
AI: http://searchsolidstatestorage.techtarget.com/definition/NAND-flash-wear-out
Failure mode of FLASH memory
This problem is specific to Flash memory. It relies on using a higher than normal voltage to punch electrons across a thin insulating layer into what is effectively a capacitor on the gate of a MOSFET. The insulating layer is extremely thin and eventually this process burns a hole in it. |
H: Development desk - power solution
I've got a pretty...awkward project, to try to simplify my life with the great many devices being plugged/unplugged, the clutter of cables around my desk, and the general awkwardness of it. The theory is simple: bind as much as possible into the desk.
The first step, and possibly the most important one to reduce the crazy number of power cables, would be to try to build the power sockets for various devices into the desk. This is where my dilemma comes in:
I'd really like to reduce the size of the power plugs from the UK standard to something preferably smaller. Obviously, I want to keep all three separate pins, and I'd prefer a connector that is as easy as possible to find (as I'll have to strip quite a few plugs bare). The desk will still have the odd UK socket due to devices that come with a wall converter, but I'd ideally like to have as few of those as possible. What kind of connector pair would handle 220V with up to 6A current draw?
I'd like to digitally control the supply of power to the said sockets. Arduino programming is not an issue - soldering is not an issue - heck, anything electronics is not an issue. What would be the best solution? Thinking solid state switches but I don't think that this is the best approach for it.
Is there anything obvious in terms of safety barring me from possibly doing this?
Any input on any of the three points would be more than appreciated. There are a few other things planned for it (homebrewed KVM) but this should not be an issue.
AI: In terms of sockets, for price then you can't beat IECs (kettle leads). They are cheap, but not very secure and might fall out easily. You can also get multi-outlet panels, as seen on the back of UPSs.
If you want something a bit more secure and easy to terminate, have a look at the powerCON from Neutrik. These will take 16/20A and are locking, so very secure. The only issue is cost, with each connector being a few quid each, depending on where you get them from. |
H: How to print gerber files? (mac)
I'm currently using circuits.io to create a very simple circuit. However, before ordering the board, I would like to print it in order to see if it's the right size and/or the elements fit in my own designed footprints.
Since circuit.io only lets you download gerber files, is there a simple way to print those gerber files? Maybe if someone can point me to the spec for the gerber files I could craft a simple script to convert the file to something that I could actually print.
AI: gerbv - A Free/Open Source Gerber Viewer, part of gplEDA, does what you want. Specifically it is at http://gerbv.geda-project.org/. |
H: Measuring Current rating
I am looking for some information on how to measure the current output of a power supply that I took out of an old DVD player. On the PCB there are multiple outputs from 3.3V to 24V, but it doesn't mention anything about the current rating/output.
Basically I need to drive four 12V motors each with a current rating of 400mA, so presumably I need no less than 1.6A output?
Anyone know how to measure the current capabilities of this PSU?
Thanks
D
AI: Well the suitable way would be to have the PSU connected to the old DVD player innards so that its normal operational load could be running. You would then simply insert a current meter (DMM in current measure mode) in series with one output at a time and monitor the current consumption into the normal load. This will give a good picture of that that power supply was nomimally expected to deliver.
If the "old DVD player" is junked out and not available to be used for a nominal load then you have a harder job on your hands. One method to determine capability of the supply would be to put the thing on the test bench and connect resistor loads to the outputs. You want to utilize high wattage resistors for this so that they do not get hot and cause a change in the reistance of these load resistors. For this type of test you will need to simultaneously load all the outputs that you would like to use on the PSU. The idea is to start with relatively light loads and then interatively increase the loads to more and more current while monitoring the output voltage across each resistor and periodicaly checking the temperature of critical components on the PSU board. As you get to heavier loads it also pays to check each output with an oscilloscope to check each output for amount of noise and ripple.
When you reach load sizes that start to cause the PSU to get hotter than a nominal working value, increased ripple beyond more than 1 or 2% of the voltage levels of the output, or the nominal output voltage sags more than 4 to 5% then you know you are reaching the design limits of the power supply. From this check the current flow into each load resistor and you will have a close idea of the supply capacity.
For sustained usage of the supply it is recommemded to back off on the limits determined above. Also make sure to use the PSU in no worse enclosue space than it was in when in the DVD player. For exwmple if the original application had a fan blowing air over the PSU then make sure to provide as good or better environment in the re-use application. |
H: Is it safe to use the cable used in Portable Battery Charger and connect to the phone via the PC USB?
Every portable battery charger have a cable. That cable is usually connecting the PC USB port to the Portable Battery Charger so as to charge the battery inside the Portable Battery Charger.
So, is it safe to use it to connect the PC USB Port to the phone directly? (The reason that I asked is because each cable have resistance levels, which I am concern if it will affect the charging of the phone if used in this way and will it cause damage to the phone or the phone battery or the cable or the PC USB port.)
AI: It's very likely completely fine. You should be getting 5V on the non-PC end of the cable and your phone will limit current appropriately for charging. The only issue I can see is some companies will make cables proprietary by adding voltage dividers to the data pins, perhaps this is the resistance levels you're talking about? However, this will only mean your phone will not charge, it won't be damaged. This, of course, is all assuming the connector is correct. |
H: Voltage regulation threshold
I am designing a 5V digital circuit and I want to make it generic so the user has some flexibility in the VCC input limits. The problem is, since the MCU has to run at 5V, I have to ensure it will get the 5V, and to do so I can place a LDO or a Linear Regulator (I am avoiding switching regulator because they require more components, and usually not small SMD ones), but both of them CAN NOT be driven at 5V since they have a minimum voltage that has to be greater than the regulated voltage.
Is there a way to still have a regulated VCC input and if the user connect the voltage I just want I wont have any problems?
To be more clear, this will be used in R/C (Remote Controlled), which already have a shared 5V wire, but some R/C use 6V, which could be fine for a LDO, but not if the user connect a 5V directly.
If you need more details, please let me know.
AI: Working on the assumption that the MCU in question will operate down to 4.7 volts or so, the simplest option is to use a LDO with a very small headroom requirement, e.g. the LP38691-ADJ/LP38693-ADJ (250 mV at 500 mA output).
Your circuit would be designed to work at 4.7 volts, and the LDO would be adjusted for this voltage. Input voltage can then range from 4.95 volts through 10 volts.
In practice, if the MCU in question can cope with Vcc of 4.5 volts, that provides you a better margin of reliability: Trim the LDO for 4.55 volts, and things will remain stable even if the input 5 volt line sags down to 4.8 volts, as it might under motors or other load.
Another approach is to switch over to a 3.3 Volt MCU, and suitable level translation logic running off the unregulated 5-6 Volt line for those parts on the board which absolutely can not work with 3.3 volt logic. Often 5 volt logic parts accept 3.3 Volt input fine (check the datasheet), and there are 3.3 Volt MCUs (PIC18F45J10, MSP430F51x2) which are 5 Volt tolerant on selected GPIOs. |
H: Relay contact voltage rating
I was looking through to buy a few relays and found the nominal DC contact voltages (~30v) are much smaller than the nominal AC contact voltages (250v). What is the reason for such a large difference?
Relays from newark.
AI: When opening a contact on DC, the arc persists until the gap is large enough. With AC, because of the frequent drop to zero, the arc naturally extinguishes at smaller gaps than for comparable DC. Therefore you need a larger gap between contacts for high voltage relays, especially DC. |
H: Arduino & JY-MCU Bluetooth module
I've got a bluetooth module from dx and connected it to my Arduino UNO R3. It was working just perfect but after a couple of hours of work it just stopped sending data.
I think, the problem is with RX,TX pins voltage. Arduino sends 5v on TX pin, but I can't figure out, which voltage does BT board receive on it's RX. I think, I've burnt this BT and don't want to do the same with the new one.
There were no docs with the board. There is a doc only for the main board(not for the breadboard), and it says, it operates with 3.3V levels of RX and TX pins. All over the net people say, that the breadboard from DX works with 5 volts too... But I've the negative experience...
Any help appreciated!
AI: I have one of these modules here somewhere (works fine, once you find the right documentation)
IIRC it has an on board 3.3V regulator, so you can feed it 5V (range 3.6V - 6V) on the VCC line okay.
However, the TX and RX lines are 3.3V, so you must use the same level logic here. If your Arduino pins are 5V logic you need to level shift them accordingly to avoid breaking the new module. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.