texts: Mutual Inductance - Self Induced Voltage

texts:
When constructing mesh equations for each loop where two coils are linked, I know how to determine the polarity of the induced voltage by use of dot markings, but I need some clarification on the self induced voltage...

If I take the current as clockwise in each mesh, then \$Ldi/dt\$ for the self induced voltage will be positive where the current enters the inductor (like a resistor), right?
So it'll be positive in both equations.

simulate this circuit – Schematic created using CircuitLab

I saw an example taking it as negative which is really bugging me. Is it a mistake, or...
(The example had the same configuration as above.)


texts:
I'm taking a module at University that involves MPLab. I'm trying to get it setup at home and so far its been a little tricky. I've got my files from University which I've attached below - if there any help in regards to finding out what language toolsuite I need to use, then that would be great. If it helps, when I use the Project Wizard the device that it gives me is: PIC24FJ128GA010

Version: MPLAB IDE v8.87

My current issue with MPLAB

Each time I try build my files that I've attached, all I get is Build Failed. For my debugger I'm using Proteus VSM 7.8. I believe it's a compiler error - I don't believe I've got the correct compiler setup, or even setup a compiler at all.

Test Files: https://www.dropbox.com/s/sekuzv92jsjpaht/testFiles.rar (these work fine on the University computers but when I try build from home it just fails).

I'm sorry if this is a little vague but I'm very new to MPLAB but I'd like to learn more of its features so I'm trying to get it working at home. I apologise in advance if I've not included the correct information and/or missed anything out, if I have, I'll add it as soon as possible. Many thanks.


texts:
I have been looking around for an easy way to convert 12V to 5V. I have seen some people saying that a simple resistor is all that is needed.

$$ Volts = Ohms \cdot Amps $$
$$ Amps  = \frac{Volts}{Ohms} $$
$$Ohms  = \frac{Volts}{Amps}$$

So applying a resistor will diminish the voltage of the circuit. That should mean that an appropriately sized resistor could simply be placed in the path of a 12V circuit, converting it to 5v.

If this is the case how would one reduce amps?
Would series vs parallel make a difference in this area?

I have seen designs that include a regulator IC and some capacitors, but if a simple resistor/fuse/diode setup will do the trick, I would really prefer that.


texts: Does outrush current exist? If so, how do I handle it?

texts:
I recently bought a car vacuum that came with 12V car power supply (the smoking sign connector). I used the vacuum for about a minute. I noticed that the power supply cable was warm, but still, it held up. As soon as I turned off the appliance, I heard a strange clicking sound.

What I suspected ended up being true, the 9A car fuse for the circuit I had just used had been blown. I found this very odd, since it clearly happened when I turned off the vacuum. I know inrush current, when turning on machines, is a real and serious problem, but I have never heard of an 'outrush current', where there is a spike in current when switching off. Could this be it?

If so, how can I limit this current?


texts:
I am designing a system that incorporates an FPGA, a few ADCs, and a few DACs. I am curious as to what my best options may be for grounding in my system.

The FPGA is on its own daughter board, but digital signals coming from it could be up to 25MHz. The ADCs will be clocked by this 25MHz signal. The signals going to the DACs will not be any faster than 5MHz. The DACs themselves are connected to a chain of op-amps, which are being used to generate a high-voltage (between 65V and -65V) DC signal. This DC signal will not change any faster than 500kHz.

From the research I've done, it seems that there's no One Good Way™ to connect analog and digital grounds in a sensitive circuit. That being said, I'm hoping someone with more experience than me can weigh in on what grounding technique may be the most effective for my application. Initially in my schematic, I separated analog and digital grounds and planned to follow a "fenced" design, where a long slot would separate the analog and digital ground, and they would only be connected in a few places. Some of the analog components share power rails with each other, but none of them share a power supply with the digital components.

Based on the types of signals and frequencies I'm operating at, is what I'm thinking considered overkill? Not enough? Any advice is appreciated.


texts:
I am designing a circuit containing two Atmega328p. First chip will drive TFT screen with 3.3 V linear voltage reg.

Second one will drive BT module, couple of relays, two sensors, SD card module, and will pass data do first chip to display.

The circuit will be powered by wall charger. Is it okay to use LM2596 buck converter module to get 5 V needed for microcontrollers or should I go for the linear voltage regulator. I am worried about the noise that SMPS can cause, but I am concerned about power consumption as well, since circuit will be ON 24/7. Only TFT will be powered on occasionally.


texts: Can negative feedback in OPAMP be applied at not inverting terminal?

texts: In figure 1 is the feedback regenerative in nature and if yes can I apply virtual short to solve it.


texts:
I'm a completely new to electronic circuits and such and am currently learning to pull of this project where I'll be testing how temperature affects a battery's life.

Testing using a camera on time lapse recording 4 different AA battery powered light bulbs and seeing how long each will last. First dependant variable is of course the the time it takes for each bulb to stop,  it I'm not sure for the second.
Professor has suggested to me to try and find out the power(in watts) of each bulb, but not so sure about that one since I'm not too knowledgable. Anyone have any ideas of a other dependant variable that I can test? Assume that I have a voltmeter or ammeter
Btw this is year 10 project


texts: Simplest way to connect a proximity sensor to a PC

texts:
I want to interface a PC with a proximity sensor. The one I've been thinking about is this one.

I can see that the output is "NPN, 3 wire, NO" which I'm kind of unfamiliar with. I also see it outputs a signal of 300 mA. Will a 4-20 mA analog input be fried if I connect this one? Could some input relay (if they exist) be the most appropriate solution here? An RS232 connection would be optimal.

As you can see, I'm not an electronics expert. If you have other simpler suggestions for proximity control with a PC I'm all ears :)


texts: Understanding an RF Level detector circuit

texts:
I am using a satellite finder as an RF level detector for a sort of "microwave camera."
It works, for some definition of "works,"  but it doesn't seem to work like I would expect it to.

This is a schematic of a similar device:

The RF sections are different, but the low frequency section (around and after the detector) are the same - mine uses more SMD parts and some of the values are a little different, but the circuit is the same.

VR1 (lower right corner) is on the front of the device and has markings to suggest it is a gain control (marked dB from -6 to 6.)

I do not understand the section from D2/D3 to pin 7 of IC1 - that is the detector and the first amplifier stage.

I assume D2 and D3 together with C19 and C20 form a fullwave rectifier.  If it is not fullwave, then I don't know why there are two diodes.

R8 and R9 are voltage divider to provide ~6V to the positive inputs of the 4558, forming a sort of "virtual ground."

R12 and C17 and C18 form a low pass filter to keep sudden changes in the RF level from slamming the meter too fast.

Now we come to the parts that I don't get at all.

VR1 is in series with R8 and R9.  For the "virtual ground," this makes the lower half of the voltage divider a bit higher resistance, resulting in a slightly higher voltage for the positive inputs to the op-amp.  That is fine, but what in heavens is the voltage from the wiper used for?  It goes to the RF side of D2 and D3.  Is it providing some kind of variable biasing for the detector?

What does VR1 really do?
Does the voltage there provide some kind of biasing to D2 and D3?
Does this result in some kind of thresholding effect?
What effect does VR1 have on the gain of the first amplifier stage?


texts:
I would like to build a hardware encrypted (at least AES-128) pen drive for myself. Which micro controller and which storage technology do you recommend?
I've been experimenting with a PIC32 and a 2GB SD memory, but the reading/writing throughput is not good.

Any suggestion would help.

Thanks in advance!


texts:
I am stuck trying to determine the applicable formula for the load current. I have used $$I_b = \frac{V_{\text{in}}-V_{\text{be}}}{(\beta+1)R_{\text{e}}}$$ and then $$I_{\text{L}}= \beta I_\text{b}$$
The problem is I can't find a proper relationship for why the current drops or increases as \$R_{\text{L}}\$ changes. Can someone please just point me in the right direction? I want to solve it myself, just need to know what I'm missing.


texts:
A seemingly simple question that has a myriad of answers all over the web.

Goal: I am trying to design a device that is able to read analog audio and extract frequency distribution. I do not care about absolute amplitude, only relative amplitude, i.e. I am only trying to compare the intensity of certain frequencies in a given audio signal.

Why the other answers don't cut it: All the answers that I have found don't seem to address the issue of differing peak to peak voltage  device to device and volume setting to volume setting. My device is going to sit between source and speaker, so it needs to be able to recalibrate when volume is changed. It will also be used with at least three different devices: my desktop, laptop, and phone. The P2P voltage at max volume on the headphone outputs of these 3 devices varies from hundreds of mV to 4V. My understanding is that there exist other devices with P2P voltages as high as 12V. I would like to design with those devices in mind as well.

I intend to use the ADC on my MCU with range 0-3V3.

If it wasn't clear already, I am by no means an electrical engineer and my understanding is fairly limited and I have not been able to devise a way to make this work. The issue the way I see it is that I need a circuit that will adjust gain and dc offset appropriately based on the source.

My thoughts so far: My current solution is to use two opamps as a peak detector and use that to add a dc offset to the signal using another opamp as an inverting amplifier. The gain of this amplifier will be adjusted using a digital potentiometer that is being controlled by the MCU. The amplifier starts at max gain and keeps stepping down until the peak of the signal is less than 3V3. The solution has the benefit that with a push of a button, I can reset the peak detector and instruct the MCU to begin recalibration. I am not at all married to this solution (I am asking how to best solve my goal, not how to fix the solution).

However, I'm unsure how to protect my MCU from being damaged by input voltages greater than 3V3 (since the calibration method relies on starting above 3V3 and coming down).


texts: I want to measure the current of a +15/-15 digital signal, non-sine wave

texts:
I have a digital signal, similar to RS232, but at +15/-15. It is a non-sine wave and is used to also power DC motors and other devices (address coding, information, and power). I want to measure from a very low 10ma to a max or 3-4A.

I do not want to use a hall effect coil as that uses expensive real estate on the PCB and tends to be bulky and requires the user to wire it into the circuit during construction vs adding it in at a later date. Also, if a device fails, being hardwired into a circuit would require more work than a device cut into the circuit being monitored.

I have attempted to use the ASC712 (hall effect IC), but get a very large swing in output voltage along with "noise" being present even though there is no current flowing. Also, the output voltage is centered around 2.5v, which limits the sensitivity of the output to the ADC to 511 steps. The voltage swings may be cured using RC to smooth out the output?

I have also tested using the ZXCT1021 device from Zetex, with unsatisfactory results. I have attempted to place 1N914 diodes between the sense resistor and the sense inputs so I only measure the +15 volt side. This does not work. The output is very noisy and read fluctuations even though there is no current draw being applied.

I have been looking at the LTC1601 in a dual direction configuration using the same sense resistor. This give me two outputs, one for each direction. Maybe the outputs tied together as shown in the design. Should I have diodes in line and maybe RC for smoothing?

Anyone have experience in measuring the current flow this type of signal?

Here is an example of the 3 different wave forms. The first is easy to measure as it is DC. The second is AC and measuring it is also well documented. The last waveform is what I am working with. It is more of a pulsed form.


texts: In high voltage but low current measurement

texts: I made some research but couldn't find my answer which fit my question well. First of all, I am looking for circuit design or a brilliant idea that can be applied a high voltage(app. 40kV). For this voltage all, I want to measure the current which max. 20 microampere. If my line goes higher than 20 microamperes I want to cut the line. In conclusion, I want to control my line with 40kV and 20 microampere.


texts:
I tried to make this as thorough as possible. I have a 4p4c socket + cable here. As there is no manual for german wiring I had to measure each wire against each other wire while hearing the "ready to dial" tone to find it out, but I am still clueless.

This is what I got

12--0.4V-DC
13--4.2V-DC
14--0.2V-DC
21-0.37V-DC
23-0V-AC
24-0.1V-DC
31-0.4V-DC
32-0.001V-DC
34-0.2V-DC
41-0.2V-DC
42-0V-DC
43--0.2V-DC

Explaination:

1 means white
2 green
3 yellow
4 brown
First number is one of the colors I put the mass of my oscilloscope to.
Second number is the color/wire I put the signal of my oscilloscope to.
one "-" is meant for separation
Then the value follows
Then the unit follows
one "-" is meant for separation
then there is the type of voltage/current measured

So for instance

43--192mV-DC

means

GND to brown, signal to yellow, result: -192mV, type of voltage/current measured: DC

or

42-5.7mv-AC

means

GND to brown, signal to green, result: 5.7mV, type of voltage/current measured: AC

Please tell me, which cable go to speaker and which to microphone. Also, do I need additional circuitry? In the english wikipedia there is a 500 ohms resistor. Do I need this, what is it for and where to put it?


texts: 9V battery and resistor are connected in series - the voltage across the resistor is < 9V. Why?

texts:
I am taking my first steps into learning about electronics as a hobbyist and I am struggling to understand something about resistance.  I have read about Ohm's law and it seems fairly straightforward so I set up a simple circuit on http://123d.circuits.io.

This circuit consists of a 9V battery and a single resistor (10 Ohms) with its leads connect directly to the 9V battery.

simulate this circuit – Schematic created using CircuitLab

When I place the probes of their simulated voltmeter across the leads of the resistor, it reads 7.83V.  I can't make any permutation of Ohm's law produce that result.  What would be the expected voltage across the resistor?  Based on other posts on this site, I would expect the voltage to be 9V.  I don't know how that simulator (123D) calculates its values or how it simulates the circuit.

I am sure that I am missing something fundamental but so far I haven't figured out what.

Is the 123D circuit simulator right?  Should there be only 7.83V across that resistor?

I set up a similar circuit (using CircuitLab) and it seemed to show that the voltage would be 9V.  So I am confused.  Is this just an inaccuracy of the 123D's simulator?

Can someone help me to clear the fog?


texts:
I'm going to connect an electret mic (WM-61A) to my computer's "mic in", and am very confused on the reasoning behind a couple different diagrams/schematics that could possibly be used to do this with.
The first one is from a thread on Head-Fi and seems to be the standard that everyone uses there:

This is good to me, but then when I did a search for a couple different options, I found this:

There's also another schematic using an AD654 op-amp specifically for phantom power. The one above claims to provide a "Phantom Ground"; what exactly is this compared to the first schematic and compared to a virtual ground? Could any of these be used for my purpose?

Please and thank you for any guidance given!


texts:
I'm trying to derive the overall Z-transform for the K-path sampling system shown below from Baker's CMOS Mixed-Signal Circuit Design. I numbered some of the equations that I'll reference. The full document is publicly available from the author here.
I don't think I understand going from equation 3 to equation 4. I understand that \$\frac{V_{o,i}(z)}{V_{in,i}(z)} = H(z)\$, but why is \$\frac{V_{o,i}(z^{1/k})}{V_{in,i}(z^{1/k})} = H(z)\$? Does this follow from equation 1?


texts: Can I make a non-polarized cap from 2 polarized caps with different values

texts:
So I need a 1uf non-polarized electrolytic capacitor for a circuit I found. But I don't have one. I found on the internet that you can make one by placing 2 caps with the same value and the same polarities touching each other (pos-neg-neg-pos or neg-pos-pos-neg) and the total capacitance will be half of the capacitance of one of them. So I figured I need 2 2uf caps, but I don't have those either :(. Can I make one with different caps values? Like a 68uf cap placed in series with a 2.2 uf cap makes a 0.9uf cap which is close enough.
Thanks!


texts: Which Board Should I Use For High Frequency GPS?

texts:
This is a very general question, hopefully with the amount of information I provide you will be able to steer me in the right direction.

I am trying to build a very versatile GPS receiver, with variable degrees of accuracy and receiving frequency. So far I’ve only planned out what I need it to do, and have done some search of 50Hz GPS chips, there are two chips I have in mind so far, one is Venus838FLPx and another S1216F8 but this one is absolutely impossible to find and they never emailed back to me. (This is not the end of my search because I would ideally like to find 50Hz which also capable of L2C and L5C)

Worst case scenario: I’ve calculated (roughly) that at 50Hz, logging for 24 hours would create a log file ~200MB, which could become a challenge for the CPU if I am using the board to log the data independently of a cellphone app.

My goal is to transmit the high rate data over a WiFi hotspot, and if it’s only up to 10Hz — use the low power Bluetooth protocol which Apple for some reason enforces.

That said, I want to be able to control the output data on the DYI GPS I make, and I basically want it to have a very variable setting, and insanely simple interface (maybe with small OLED display to show basic info like old style GPS devices)

I need the board to be able to:

Provide higher accuracy high power demand mode down-converting 50Hz to 1Hz, 2Hz, 5Hz, 10Hz, 20Hz, 25Hz by taking averages of the incoming data.
High accuracy medium power - setting the chip to collect at 10/25Hz, and down-converting that down to 1/5Hz by doing the same averaging.
Normal accuracy high frequency 50Hz mode with no averaging
Super low power and normal accuracy 1Hz mode.
All those modes should be internally loggable and transmittable, maybe even at the same time if allowed by the CPU.
(There may be a barometric sensor but I have not thought about it yet)

My question is, which style of SBC board would be able to handle these calculations and transmissions. Would Arduino handle it or would Raspberry be better? Should I look at more powerful SBC’s? I plan on using full size boards for prototyping, then probably moving to the tint versions if they are powerful enough to make as small of a device as possible, pocket size would be ideal. It would be used for various logging including light racing.

Update: I will work on narrowing down my question and will resubmit a new one in the future.


texts: My design is not meeting timing. What can I do?

texts:
I am using the Altera Quartus II software to compile Verilog for a Cyclone IV FPGA. In my case, the FPGA is fixed; I cannot get a faster one.

Now one isolated module in my design, which deals with relatively fast clocks, is not meeting timing. I have spent some time trying to simply the code, and understand how the compiler interpreted my code with the "RLT viewer" and "Technology Map Viewer".

Despite that, my design is still not meeting timing by a little. What should I do? Are specific techniques/tricks I can try? Can I ask Quartus II to really try its best to optimize the specific module?


texts: Cost-effective storage of solar & wind generated power for home use

texts:
What would be a cost-effective means to store power obtained from solar and wind generators for home use?

Batteries are very expensive, and I'm looking for alternatives; e.g.: a (hare-brained?) idea is to use series of elevated water tanks that get's filled when surplus power is available, and then used to gravity-drive a generator in dark&windless times. What other means are available?


texts: Is it safe to separate the power supplies for sensor, buffers, and ADC?

texts:
In the LT1054 datasheet it talks about needing a bjt to avoid pulling the VOUT positive with respect to GND (datasheet page 5 Vout (Pin5): http://www.linear.com/docs/2309).

Now I am powering an external sensor (here: http://www.bartington.com/Literaturepdf/Datasheets/Mag-03%20DS0013.pdf)
that requires +/-12-17V so I was going to use the LT1054 to power it.  I know I have to employ the bjt method to power the sensor, but I am hoping everything else can be powered safely via a seperate power source?

I will bring in the sudo-differential (gnd, and signals x,y,z) into 3 different buffers (AD8275) and then into an ADC (AD7176-2).  These buffers and ADC will be powered by a seperate regulator as Vss+ connected to 5V and Vss- connected to GND.

can I safely do this without affecting the substrate on the LT1054?

Thanks!


texts: What happens when the motor torque is constant and the load torque suddenly decreases?

texts:
It is a situation where the load torque (Ta) suddenly decreases while rotating the shaft with a motor(PMSM) at a constant motor torque (Tm).
In my opinion, the rotational speed of the shaft (I-moment of inertia) and motor will be instantaneously increased by the torque difference, and then more power is consumed in proportion to the shaft speed, right?
Tm - Ta = I*wdot

before load decrease : Power = Tm * w
After load decrease :  Power = Tm * (w + wdot * dt)


texts: Would this protection and limiting circuitry work with 5.1V zener diode?

texts:
I have a small project for part of an experiment where a PWM controlled DC fan speed will be controlled by a -10/+10V function generator's analog DC output. So basically the chain will be:

Analog voltage------>PWM------->Buffer------>PWM TTL input to the FAN

To convert analog input to PWM I use Arduino Nano as a micro-controller board. I map 0-5V analog input voltage at A0 pin to a PWM pin duty cycle where I set the PWM freq. to 25kHz. I might not need the transistor buffer actually but I don't want to risk the uC.

Below schematics diagram shows the plan in my mind:

Left-click to enlarge

I want to power the Nano through its Vin pin by a 12V power supply named as PSU circuit in the diagram above. 5V linear regulator provides power to the buffer.

But since people will use the function generator as input, I need to protect the analog input A0 of the Nano from reverse polarity and maximum limits. For reverse polarity a 1N4148 D2 in the diagram is used. 1Meg R7 resistor is for preventing floating in case there is no input connection. And for limiting the max input voltage I plan to use a 500mW 5.1V zener Z1 in the diagram along with a 220 Ohm series resistor R1.

The Nano uses ATmega328P. I couldn't figure out the maximum analog input the uC can handle. If there is no other fundamental problem, would a 5.1V zener be fine for the analog input pin?

Edit:

I needed to make an edit with a new alternative after Jack Creasey's answer:

Edit2:

Inverted


texts: Using a nucleo board as ST-link for STM32F722RET6 (Error: ST-LINK error (DEV_TARGET_CMD_ERR))

texts:
we have disconnected the ST-link from the nucleoboard and prepared it correctly for its use. we connected it back to the nucleoboard, and everything worked like it should.
We want to use this ST-link to make contact to the MCU of a flight controller that we have designed. the connection goes as follows:

ST-link:
 1. VDD
 2. SWCLK
 3. GND
 4. SWDIO
 5. NRST
 6. SWO

Flight controller:
 1. GND
 2. SWCLK
 3. SWDIO
 4. SWO
 5. NRST
 6. VDD

NRST goes to NRST, SWO to SWO etc.

When we connect the ST-link to STM32CubeProgrammer, the ST-link appears as a usb unit and we get contact with the program. we get an error though:
ST-LINK Firmware version : V2J29M18
Error: ST-LINK error (DEV_TARGET_CMD_ERR)

Does anyone have an idea whats wrong?


texts: The circuit that gives the higher-voltage one of the two input signals to output

texts: I need a circuit that behaves as the box with the question mark in the graph I drew. I tried to design a few circuits with op-amps but I couldn't get an output as I wanted.


texts: This post is very helpful, but I'm still a little unsure about my crystal layout.  This is a 4-layer board with top_signal->ground->+5V->bottom_signal stackup.  The crystal is a 32.767KHz tuning fork which is used by an Atmel ARM M0+ processor to produce 48MHz bus via the DPLL.  I have a local ground around the crystal which is connected by a trace to a local ground plane under the processor.  The single via under the center of the processor connects the local grounds to the main ground plane.  I have no cutout in the main ground plane.  Is this setup ok?


texts: Error while implemeting D_FF from JK_FF in Verilog

texts:
I'm designing a D_FF from JK_FF.

The circuit I'm implementing is , as shown in the figure :-

Verilog Module Code :-

`timescale 1ns / 1ps

/* Conversion of a JK Flip Flop to a D Flip Flop
    Connections are "J = D" and "K = ~D"
*/

module d_ff_from_jk_ff (q,qbar,rst,clk,d);
        output reg q;
        output qbar;
      input rst, clk;
      input d;

 wire d_n;              // Inverted version of D input //
 assign d_n = ~d ;

 jk_ff d_converted(q,qbar,clk,rst,d,d_n);

endmodule

/******************************************* JK Filp FLop Module ************************************/

 module jk_ff(q,qbar,clk,rst,j,k);
          output reg q;
          output qbar;
          input clk, rst;
          input j,k;

          assign qbar = ~q;

always @(posedge clk)
    begin
          if (rst) q<=1'b0;             // Synchronous Reset //

          else
            case ({j, k})

                2'b00: q<=q;            // Previous Value //
                2'b01: q<=1'b0;
                2'b10: q<=1'b1;
                2'b11: q<=~q;           // Toggle //
         endcase
end
endmodule

Testbench Code :-

`timescale 1ns / 1ps

module testbench;

    // Inputs
    reg rst;
    reg clk;
    reg d;

    // Outputs
    wire q;
    wire qbar;

    // Instantiate the Unit Under Test (UUT)
    d_ff_from_jk_ff uut (
        .q(q),
        .qbar(qbar),
        .rst(rst),
        .clk(clk),
        .d(d)
    );

    initial begin
    clk = 1'b0;
    rst = 1'b1;

#10  rst=1'b0;

end

always #5 clk=~clk;

    initial begin

        d = 1;
        #50;
        d = 0;
        #50;
        d = 1;
        #50;
        d = 0;
        #50;

#100 $finish;

    end

endmodule

In the simulation output, the value of Qbar is changing as expected, but the waveform of Q is constantly held at a "X" (don't care) condition.

Can anyone tell me where I've gone wrong and what correction is to be made ?


texts:
I am referring below circuit, where I am using P781 opto-isolator.

H1G is I/O pin from LPC2138 controller.( VCC for LPC is 3.3V )
J24: 12V,6W Heater

Link for opto datasheet:
http://www.mouser.com/catalog/specsheets/TLP781_datasheet_en_20080117.pdf

For above opto, what is minimum If for LED to glow and therefore to conduct  transistor at o/p side. I am checking min If in datasheet but couldn't get it.

For 2V or say 3V at H1G pin can transistor conduct?

Thank you.


texts: Calculating capacitance required for a pulse duration of time T using a class AB amplifier

texts:
Firstly I apologise if this question is similar to another one I asked a while ago. But, as you will see, this is question is slightly different.

I have an amplifier which is a common emitter driving an AB push pull stage using MJE340/350 transistors.

I am using it to amplify a signal of 250kHz. The (unloaded) output voltage at 250kHz is 145.6 Vpp. This amplifier must be able to drive a signal for a time T.

I want to use it to drive a load with impedance Z = 669.2Ohms.

From V=IR, I can see that the current requirement is 0.21757 A. The power supplys I am using are R12-100B's which, from the data sheet, provide 50 mA each, So the total current provided is 100 mA (I added them because I am working with the peak to peak voltage, so both halves of the wave).

This leaves me with a current deficit of 0.1176 mA. To supply this excess current there are two capacitors. The value of the capacitors is 3.3 uF rated to take 450V. These are decoupling the supply rails which are at +/- 120 V. So essentially I have one 6.6uF capacitor charged to 240 V.

From Q = CV I know there are 0.001584 coulombs of charge stored. I also know that 1 Amp is defined as is 1 Coulomb of charge passing a point in 1 second. For this I can say that if   A = C/s then C/A = s.

So to calculate the maximum time T which I can transmit this signal for I divide the amount of charge by the current deficit. This gives me a value of 13.47 mS which the signal can be transmitted for.

Now I know that as a capacitor discharges the voltage across the capacitor decreases so this method is not quite correct as this is not taken in to account.

So my questions are:

1) How much (if any) of my calculations are valid?

2) How should I take into account the voltage drop as the caps discharge (I assume I just a bigger value...)?

3) Should I use a few smaller caps because of the high frequency being used?

4) The voltage output was measured (using a pico scope with a probe on *10) with no load applied, will this value still be valid when the amplifier is loaded?


texts: Li-Ion charger IC leakage current confusion

texts:
I'm currently building a Li-Ion battery charging circuit which has a 5V/2A input. It should implement load-sharing in order to keep the output alive during charging.

For charging, I found the BQ25606 IC from Texas Instruments and it seems to fulfill all of my requirements. However, one aspect confuses me when looking at the datasheet. It states "58-μA Low Battery Leakage Current with System Voltage Standby". The leakage current is only mentioned at the front page and I've had a hard time thinking of what it might refer to.

Does that mean that when the charging cycle is terminated a continuous current flow of 58μA slowly discharges the battery? The Li-Ion battery I want to use discharges less than 5% per month. Do these two discharging processes add up? Or am I totally mistaken and the 58μA refer to something completely different?


texts: Is this a cheap Chinese fuse or a current shunt?

texts:
I got this cheap DT-830B multimeter as a bonus when ordering stuff from a Chinese internet shop.

I opened it up and was wondering if this is a fuse or a current shunt?
Since the multimeter works out of the box I assumed there must be a fuse in it, as I did not expect it to function without a fuse, but that weird thing is all I can find on either side of the PCB, it has two white lines under it. Also there seems to be contacts on the side of the PCB that I usually associate with a fuse.

Help a confused soul!


texts: How can I estimate what will blow first - PTC/TVS protection combination or my IC

texts:
I want to protect an IC output (MOSFET driver) that the vendor says can survive V_cc +0.3V on the output pin from an accidentially connected overvoltage of about 35V on the plug. Problem: my V_cc is only 5V!

One approach I found here at StackExchange EE was to use a combination of TVS and a PTC.

My assumption is, that the 35V will create a current trough the highside switch to V_cc of the MOSFET Driver or through the lowside switch to GND.

1) How will I know if the IC can survive the time that the PTC needs to become highly resistive? Can I look for hints in the IC datasheet?

2) I always thought TVS are meant for ESD or surge protection (short time and high voltages) and not for longer durations of moderate (35V) Voltages. Can they also be used for these things?

3) Whats a good starting point to understand these time related questions concerning PTC and TVS? Are there other solutions you can point me to? I have a bad market overview on what's available.


texts: How do I drive 12 strings of 12 leds each?

texts:
I would like to drive 144 leds with a battery power supply. I want to drive all the leds all the time. 12 leds in series on each string.  The Led specs are:

PD 100 mW Max.
VR 5 V
IAF 25 mA
IPF 85 mA
VF at 20mA 1.8 Typ, 2.1 Max
IR at 5V 100 uA

Where do I start for something with a low cost?


texts: How does a microwave oven modulate its output power?

texts:
My microwave has multiple power settings, ranging from 500 watts to 1500 watts. My question is how is the power reduced/modulated?

I can think of a few options (but I don't know which one is correct/most common):

Is the microwave constantly switched on and off with different 'duty cycles' (similar to PWM) (different on/off times with longer total 'off time' when the microwave is set to a lower 'power level') in order to create lower power output?
Is the electromagnetic frequency of the photons being emitted by the microwave altered resulting in more or less energy per photon? *
Is the amplitude of the waveform (in other words the amount of photons per second) altered resulting in more total energy per second? *

Have I made any wrong assumptions in the three options listed above? Are all three options above theoretically possible in order to achieve modulation of the microwave's power output? Are any of these options used in a microwave oven in order to handle the modulation, if so which is most common?

According to this forum post photon energy is determined by a photon's electrical frequency and a waveform with same frequency/wavelength and different amplitude has more photons being emitted per second.


texts:
I have set up the STM32F4 discovery to generate audio with on-board codec using I2S and all is well when using the HSE external 8MHz crystal and ST clock configuration utility Excel tool.

The weirdness happens when switching to the internal HSI clock.

According to data sheet the internal clock is fixed at 16MHz suggesting that the only significant change to PLL and dividers is the PLL_M  divider should be /16 for HSI instead of /8 when using crystal(HSE).

The rest of the clock settings should be the same.

After generating the system Init code with the tool the sample rate is now 83kHz not 48kHz as it is with external 8 MHz XTAL.

Is the stm32f4 internal clock 16MHz as it says in the data sheet or some other value? The only way I can get it down to the correct sample rate is use /25 for PLL_M.

I can't find any discussion on this because I imagine most users are sticking with the XTAL but I want to design my own board and wanted to reduce parts count by using internal clock. Anyone else tried to use internal clock?


texts: Interpretation of EN 61000-4-5 Surge requirement on a DC Power Port

texts:
I am trying to understand how to treat the DC power port on my industrial device (read:  will be used in CNC machine shops and industrial processing plants and the like) should be tested according to EN61000-6-2 for the surge test specified in EN 61000-4-5.

Table 3 in the standard calls out the tests required for DC power ports.  Line 3.2 calls out 500V surge testing applied between line to ground and also between line to earth.  So far there is nothing confusing.

However, note (c) is called out under "remarks" for surge testing, and it states that surge is not applicable under certain conditions.  Most of the conditions don't apply to my situation, but the final line of the note states "DC Ports, which are not intended to be connected to a DC Distribution network, are treated as signal ports".

So now the question is - what is a DC Distribution network?  My device is intended to run off of either 12 or 24 V DC power, but it's unclear to me if a voltage regulator on the same CNC machine or process equipment as my device is considered a "network", or if it must be some centralized regulator that is run throughout a plant, or some other definition.  Can anyone here provide a working definition or clarity on what this means?

If I can treat the DC Power port as a signal port, it would greatly simplify my transient protection scheme.


texts: what happens when voltage is in indeterminate region?

texts:
For example, 0 is ground or 0 volts and 1 is VDD or 5 volts

what happens if the voltage is 4.99 volts? or 3.2 volts?

Is it 0 or a 1??!?


texts: Closed-loop system with two cascaded P-controllers produces error increasing with time

texts:
The task:

I control desired angle \$\theta_{d}\$ with two cascaded \$P\$-controllers, the outer is for desired angular velocity \$\omega_{d}\$ and the inner is for desired angular acceleration \$\dot{\omega}_{d}\$.

\$\dot{\omega}_{d} = K_{\omega}(\omega_{d}-\omega)\$

\$\omega_{d} = K_{\theta}(\theta_{d}-\theta)\$

The plant and control loop are as follows:

Where \$I\$ is MoI, \$\dot{\omega}\$ is angular acceleration, \$M_{d}\$ is moment applied to the plant.

The problem:

Actual \$\theta\$ does not converge to the \$\theta_{d}\$ and the error is increasing with time.

The question:

What should I add to the control loop to make \$\theta\$ converge to the \$\theta_{d}\$ ?


texts: What options do I have to measure directly impedance change (ohm) or deduce it indirectly from S-Parameters?

texts:
Basically I want to measure how impedance (Ohm) relative to Z0 (50 Ohm) waveguide is changing by varying a parameter. I currently measure the reflection coefficient S11 in a 1-port setup. Our VNA can store complex S11 parameters, but also magnitude (dB or linear) and phase.

As far as I understand it's not so easy now to get from S11 to Ohm and Smith Chart was designed for that reason. A webpage says:

  In order to convert S-parameters to impedances, you must specify Z0.
  Usually it's 50 ohms, sometimes 75 ohms.

  The calculation to get from S-parameters to impedances is more
  complicated than, for example, VSWR. This is one of the reasons the
  Smith Chart was invented, you could enter coordinates either way and
  the graph would solve the equations for you. Here's one form of the
  equations, sent by an alert engineer named Steve:

REAL=(Z0*(1-(MAG*MAG)))/(1+(MAG*MAG)-
(2*MAG*COS((ANG/360)*2*PI())))

IMAGINARY=(2*MAG*SIN((ANG/360)*2*PI())*50)/
(1+(MAG*MAG)-(2*MAG*COS((ANG/360)*2*PI())))

  He sure like brackets! Here's the input and output impedance, with
  real and imaginary parts plotted separately. Ideally the real part is
  50 ohms, and the imaginary is zero.

So with REAL and IMAGINARY R and X in Z=R+jX are meant here or this again real and imaginary numbers of the S11 parameters?

As I recorded now some data where only the S11 real and imaginary pair numbers where stored, I'm wondering if I can deduce from S11 the magnitude to get with above formulas to Ohm, so I don't have to measure again? I'm using origin for post-processing the data, also matlab. Both have tools to plot smith charts and read VNA data to my knowledge.

Thanks for your kind help


texts: Determine which wire goes to which connection?

texts:
I am repairing a pair of headphones that had one earpiece come out (poor workmanship sadly...). They have two wires and two connections to solder them to, but I don't see an easy way to tell which goes to which.

Is there a way I can do so easily without trying one and having to redo it if it's wrong?  Is it possible they can go to either one?  One wire is red, one is gold, but I don't see any differentiation on the connection on the earpiece.

Also, should I attempt to remove the old solder (or even melt it and reuse it?) or is it okay in this kind of situation to solder over it?


texts: Why is it not advisable to fuse the neutral

texts: I have been doing some research on this question. The answer I get most of the time is that this is for safety reasons. That there can be no current in the neutral that didn't come from the live. If anyone has a clear answer, please tell me.


texts: How do MCUs and RAM wire up for programmatic access?

texts:
I am new to electronics and microcontroller programming and need either confirmation that my understanding on a few items is correct, or I am in desperate need of correction on them!

I have a C-based server that requires about 2GB RAM to function properly. I am interested in seeing if there's any way to flash this program to an ARM-based MCU, such as the Raspberry Pi or the STM32. If my understanding of MCU componentry is correct, the Raspberry Pi simply cannot handle this RAM demand, because its a Broadcom/ARM chip affixed to an SoC with fixed memory ICs.

However, it is also my understanding that non-SoCs such as the STM32 can be wired up to any kind of memory chip. I found these 4GB memory cards, and am wondering if it is possible to place one of these on a PCB alongside an ARM-based MCU, thereby allowing the ARM chip to actually run a very large program on it.

So I ask: is this possible to do? If not, why? How are they incompatible with each other? If so, how are they typically wired up? Does an engineer look at the datasheets for both chips and figure out the wiring/IO between them?

I guess at the end of the day, I'm wondering why there aren't more MCUs out there with crazy big memory; and I'm thinking it's either because most embedded/MCU programs don't need that much memory, or its because - for some reason - they can't.


texts: Electrolytic capacitor manufacturing process and the effect on the environment

texts:
I'm wondering about all the wet Aluminum electrolytic capacitors,
that uses Ethylene glycol as solvent, and whichever solute it use to form the electrolyte.

Are there any harmful chemicals produced from the manufacturing process?

What about wastes produced when you dispose them? Via incineration at above 800C?

Is the production and recycle process of electrolytic capacitor waste free and zero impact on the environment?

*Recent capacitors that does not contain any PCB.


texts: Li-Po/Li-Ion solar charger and 3.3V stabilized output

texts:
I'm working on a project with ESP8266 and I want to power it with solar panel and a Li-Ion/Li-Po backup battery. I searched on google and I found a buck/boost regulator is required to stabilize battery voltage to 3.3V, because it can be higher or lower than that.
While searching online circuit I found usually are chargers only, buck/bost regulators only or both but with 5V out.

I need 3.3V and ~300/400mA max.

So my question is: does anyone have a simple and well tested schematic to achieve that?

I'm planning to embed it into the final PCB, so if possible I prefer pure schematics instead of ready-to-use PCB (like Adafruit, SparkFun, etc).


texts: Driving 60v switch with 3.3v (800ma max)?

texts:
I'm relatively new to working on hardware projects, albeit I have years and years of software experience. I've started retrofitting an electric bike I have to make it "smart". It uses a 60v battery and the entire system is 60v, including the key'd on/off switch. I'd like to start simple by just figuring out how to drive the on/off switch with my 3.3v microcontroller that is rated at a max output of 800ma. Is this possible? I've started reading about MOSFET's for this situation but it's all a little blurry. I've done a lot of work in automotive electrical systems so an obvious solution for something like this seems like it'd be a relay of some kind that uses 3.3v to close the 60v circuit but this seems like too big of a difference for any relay I can find?

Any help & pointing me in the right direction for where to look & learn to drive this switch with low voltage would be extremely helpful. Thank you!


texts: Power of a capacitor when is connected to a battery

texts: According to definition of power ( current times voltage) since there is no change in charge, the power stored in a capacitor connected to a DC voltage is zero. Since energy is power times time, Energy stored is Zero too. But we know in a transient period the capacitor gets charged up when it is connected to a DC voltage and there is energy stored. if I discconected the charged capacitor and connect it to an inductor for example this charge get discharged. So how come there is stored energy but mathematically it is zero?


texts: The chance of a lightning strike - reduced or increased?

texts: If I connect the receiver and TV body to the earth, does it reduce or increase the chance of lightning strikes the dish antenna?


texts:
I'm currently dealing with a circuit for communication between a Microcontroller and an e-ink Display. It uses an SPI-Bus. The display is from PervasiveDisplays, and at the bottom of this website http://www.pervasivedisplays.com/kits/ext_kit there is a download containing gerber files for the kit including the circuit for the extension board. The part I'm struggling with is the following:

To me this is a mosfet switch that conducts the microprocessor signal when the gate-source voltage is positive. The problem I'm having is that this input is connected to the drain. If it was connected to source (Drain being output), I could see the MOSFET conduct and put the drain pin on a low-voltage if the source is low, whereas if it was high, it would be pulled to 5V by the resistor. However, it's the other way around and I can't really wrap my head around how this part of the circuit works. Any help is greatly appreciated.


texts: Is it possible to drive a power piezoelectric in lower frequency than its own frequency?

texts:
I am driving a piezo transducer simply by an inductor series with piezo.
the resonant frequency of the piezo is about 40KHz and I designed a 20KHz transducer.
I'm giving a pulse voltage (using a class E driver) to drive this series circuit
and by turning the value of L(inductor), I force the piezo and L to resonate at 20KHz frequency and get a high voltage on piezo electrodes.

My questions are:

Why does nobody mention this method to drive a power piezo?
Is this method damages the piezo?
Without considering the efficiency, is it alright to drive a piezo in other frequencies?


texts: How do I find the second order transfer function from this step response diagram?

texts:
I have the following diagram of a system's step response:

I'm having trouble understanding how to calculate the system's transfer function, given this diagram. Specifically, I don't understand how exactly I can calculate the natural frequency and damping ratio.

Nothing I've read on this has helped me get a clear picture of what I should do. Can anyone help me understand step-by-step how to think about this problem?


texts: BJT Transistor (NPN and PNP ) Power Supply Monitoring Circuit

texts:
I am Understanding the Behavior of the following circuit with the help of simulation.

Following Circuit Gives High signal at the opto coupler output when the supply voltage goes (V3) below 13.68 V.

Now if i remove the R1 , R2 , R3 and Q2 i Still gate the same result .

then whats purpose using  Q2 here if the circuit behaves same with its absence   ?

Kindly help me understand the functionality  of Q2 .

I believe this is not current limiter circuit for power supply ( V3 ).

Fig 1 Actual Circuit

Fig 2 Without R1, R2, R3 and Q2

Thank you in advance


texts:
When trying to calculate the Thevenin resistance, I end up with the following circuit:

When I measure the resistance at Terminals A and B in multisim, it is reporting a value such that R1 is in parallel with R2 + R3. When I look at the circuit, to me it appears that all three resistors are in series. Can anybody help me understand why R1 is in parallel with (R2+R3)?


texts:
I'm looking at the KX023 and it seems to have a 64 counts/g sensitivity.

Its datasheet specifies the following

What I don't quite understand is why there're two sets of figures. The top set goes up to 16k counts/g whilst the bottom goes up to 64 counts/g. 64c/g would seem very low when others like MMA8452 supports 1024 c/g.

How come "Buffet 8-bit mode" gives so much lower sensitivity?

Thanks


texts: Replacing a mechnical switch with a digital one

texts:
I have a circuit which allows me to manually (physically) switch between two VGA inputs (PCB push switches) to feed one VGA output (a standard commercial KVM). I want to be able to switch between the two inputs digitally - ie. from an output of my arduino.

I'm happy with everything I need to do from the arduino side of things, but I don't know how I should go about replacing the mechanical switch with a transistor (or even if that's the right thing to use!)

How should I go about making this swap? Thanks!

EDIT: Some photos of the KVM for your viewing pleasure!


texts:
Why to Enable and then why to immediately Disable
at the following piece of program?

void GPIO_DeInit(GPIO_TypeDef* GPIOx)
    {
      /* Check the parameters */
      assert_param(IS_GPIO_ALL_PERIPH(GPIOx));

      if (GPIOx == GPIOA)
      {
        RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_GPIOA, ENABLE);
        RCC_AHB1PeriphResetCmd(RCC_AHB1Periph_GPIOA, DISABLE);
      }


texts:
I have a MAP(manifold absolute pressure) sensor, which has 3 pins: 5V, GND, OUTPUT. It acts like potentiometer and output's voltage varies between 0(0 bar pressure) and 5 volts(2.5 bar pressure). I would like to make the simplest possible circuit to limit the output voltage from the sensor to 4.5 volts, instead of 5v:

INPUT - OUTPUT
0.5v  - 0.5v
3v    - 3v
4.5v  - 4.5v
5v    - 4.5v

What circuit should I be looking into?


texts: Circuit to switch power when detecting current (40mA/12V)

texts:
I am looking for a way to supply power to some consumers (sensors) only while another consumer (datalogger) draws power. All consumers run from the same 12v car battery.

The datalogger wakes up periodically and probes the sensors. To conserve power, I would like to run power to the sensors only while the datalogger is up, at which point it draws at least ~40mA. All devices together draw 500mA max.

No EE engineer, so bear with me please... From my (internet) research so far, this might be possible with a shunt resistor (plus something along these lines) and a transistor as switch. First, is this a reasonable approach, or are there better ways? If so, could you give me some hints as to the selection & dimensioning of components? Any other pitfalls?

Thanks in advance!

EDIT:

OK I tried to put something together of what I am thinking about at the moment, hope it helps. It might also be completely off..

Here is a link: schematic and below is the schematic: -

Not sure about the AD8217, maybe I do not need it if I get a transistor of the correct dimension?
I realize I need to know the power draw of the datalogger when idle. Have not yet been able to measure it.


texts: Confusion regarding control system of a Mars rover

texts:
I am studying Modern Control Systems, 11th edition, by Dorf and Bishop.

In its fourth chapter, it discusses design examples and one example is of a Mars rover. In that example, I am confused by the highlighted sentence (The vehicle is controlled from earth by sending it path commands).

I am confused, because the round trip communication time to Mars is approximately, on average, more than 20 minutes. How will the rover, then, respond in a scenario where immediate action is needed (for example a sudden dust storm, or any other issue where delay cannot be tolerated)?

So why is the rover not fully (approaching 99%) autonomous, so that it makes all its decisions on its own immediately and transmits only the readings/observations/measurements results to Earth?

 in attached photo


texts: What is the meaning of |H(jw)| concerning the transfer function

texts: Noob question here but my books talks about the magnitude of the transfer function |H(jw)| a lot but I don't understand the meaning of |H(jw)| itself.  Because of this I can't interpret the meaning of Bode plots of filters as it is the Y-axis of these Bode plots.


texts: How to send message in websocket connected to my server from Quectel EC20 through AT Commands?

texts: I made a Websocket connection from Quectel EC20 after opening TCP connection by giving IP and PORT and after that I sent GET req where header upgrade to websocket through AT Commands but I am not able to send anything after that as I want to send JSON message to my server but not able to send anything so please help me I got stucked in this...


texts:
I have an DME60B motor (DC) with 24V and 490 RPM.
I want to turn it on every 8 am Daily and to work for just 5 min.
if we want to change the dirction of the motor after 2.5 min to work reverse?
what I shoud use of electric parts and how ?
should I use timer or what?

In general, how can make a simple controler to conrtol this system?

Please, explain it as if you're talking to a 6-year old kid, I'm not knowledgeable in this field but I want to know the concept.


texts: How can I find mutual inductance and coupling coeffecient of coupled inductor knowing turns ratio, primary and seconday inductance?

texts: Trying a simulation in PSIM I have turn ratios and primary and secondary inductances but don't know how to find mutual inductance and coupling coeffecient of coupled inductors


texts: Increasing the Bandwidth of Differential Amplifier

texts: I am working on the second stage of an operational amplifier which involve a BJT differential amplifier. I am trying to increase it's bandwidth (parts of the requirements) and was told by a TA that a simple cascode should increase the BW. I am running simulations and It seems to me me that the cascoded version actually decreases the BW. I have tried to change the biasing voltage with no success and cannot find any source about cascoding increasing the bandwidth.


texts: what exactly is single cycle instruction architectures?

texts:
I got the following text from lab work 2 of CMU's computer architecture course. I am actually trying to do this lab myself out of own interests and I am in no way a student of CMU.

  The machine has a single-cycle microarchitecture: every instruction
  takes exactly one cycle to execute. Aside from correctness (as dened
  by the architectural specications), this is the only constraint that
  we are placing on the machine's microarchitecture. As long as these
  two constraints are satised (i.e., correctness and single- cycle),
  you are free to implement the microarchitecture in anyway you want. To
  guide you along the way, we provide an abstract description of the
  single-cycle microarchitecture as we discussed in class.

  The architectural state of the machine (excluding memory) is stored
  in registers: the program counter and general-purpose registers
  There is a global wire called the \clock" that is connected to all
  the registers.
  When a register sees a rising edge on the clock, the register
  captures the instantaneous \snapshot" of the values on its input.
  From then on, the register holds the captured values and feeds them
  to its output.
  The output from the register(s) are fed into a combinational circuit
  consisting of logic gates (e.g., ADD). In turn, the output from the
  logic gates are fed back as input to the register(s).
  At the next rising edge on the clock, the register again captures
  the values on its input

.

My doubt: It asks me to implement single cycle architecture but the points numbered from 1 to 5 doesn't seem to be single cycle.

Assume the instruction ADD R1, R2, R3. According to the steps from 1 to 5 this will take two clock cycles and not 1 clock cycle.

At the pos-edge of a clock cycle, the address (address in register
file)registers R1 and R2 will be latched and the values in these
registers will be sent to ALU for addition.
In the next pos-edge, the output of ALU will be written back to regiSter R3.

So it is actually taking two cycle right? EThen why is it called as single cycle instruction?


texts: VHDL: enumeration types in entities of submodules?

texts:
I have a top level module and an enumeration type declared there. Now I created several submodules (with an IN port of the that type) and instantiated them. However, resolving the enumeration type in submodules fails.
Is it possible to reuse the enumeration type and if, how?


texts: ISR won't modify a global variable (IAR)?

texts:
First, some background on what I'm working on.
I have a custom board with ATmega324A that I designed as part of a project I'm working on. Originally, software for the uC was written for GCC in Atmel Studio. Now I need to port it from GCC to the IAR compiler. I'm using IAR Workbench with AVR toolchain.
The board uses UART to communicate with a Bluetooth module embedded on the board (irrelevant here).
There is a button on the board which is HW debounced with a LPF and a Schmitt-Trigger so the ISR triggering signal is clean (checked over oscilloscope).
Triggering signal is connected to PB2 (INT2) of ATmega324A.
What is the issue?
I have a global variable (set as volatile) that is being changed by the ISR from 0 -> 1 everytime the input changes state (0 -> 1 or 1 -> 0). I have an if statement in main() that checks the value of the variable and does something if its set to 1.
This works fine in GCC and always has... for me at least.
However, something strange seems to be happening when the code is compiled with IAR compiler.
The global variable is set to 1 inside the ISR but never changes value inside main().
Ok, let me add the code so this will be more clear.
Setup code for ports and interrupts:
#include <ioavr.h>

void Sys_Init(void)
{

  DDRC |= (1<<DDRC5) | (1<<DDRC6) | (1<<DDRC7); // LED pins set as output
  DDRB &= ~(1<<DDRB2); // pin set as input (interrupt pin)

  EICRA |= (1<<ISC20); // interrupt triggered on both edges
  EIMSK |= (1<<INT2); // enable interrupt on INT2

}

Code:
#include <ioavr.h>
#include <intrinsics.h>
#include "init.h"
#include "bluetooth.h"
#include "uart.h"

volatile unsigned char edge_level = 0;
volatile unsigned char btn_trig = 0;

int main(void)
{
  __disable_interrupt();
  Sys_Init(); // initialize ports etc.
  USART0_Init(7); // sets UBRR value for 115200 baud rate
  __enable_interrupt();

  while (1)
  {

    if(btn_trig == 1) {
      btn_trig = 0;
      PORTC ^= (1 << PORTC6);
    }

  }

  while(1); // makes sure that main is never exited

}

#pragma vector=INT2_vect
__interrupt void INT2_interrupt(void) // interrupt routine triggered by button press
{
  edge_level = PINB & 0x04;
  btn_trig = 1;
}

So, for some reason, this isn't working in IAR but works fine in GCC.
However, if I move:
  if(btn_trig == 1) {
    btn_trig = 0;
    PORTC ^= (1 << PORTC6);
  }

... inside the ISR, the program works fine and the LED turns ON or OFF.
#pragma vector=INT2_vect
__interrupt void INT2_interrupt(void) // interrupt routine triggered by button press
{
  edge_level = PINB & 0x04;
  btn_trig = 1;

  if(btn_trig == 1) {
    btn_trig = 0;
    PORTC ^= (1 << PORTC6);
  }

}

Looks like the btn_trig is changed inside the ISR but not outside of it...
What is going on here?
Thank you for your time!


texts: Misra C or other code standard compliance in TI CCS

texts: If I need to do Static Code analysis of my code or check for Misra C compliance for my code in TI's CCS for MCU RM57 then how can I do that? I can see 'Code Analysis' in the project preferences but I don't know if these will comply to which standard?


texts: Level shifter to Interface Microcontroller A/D channel

texts:
I need to interface speed monitoring signal to Micro controller A/D channel
. I am measuring speed by Electro Magnetic method.The frequency range is 100 HZ to 600 HZ and Amplitude is +/- 2V to 4V (Peak to Peak). I want low pass filter with level shifter single supply (5V)
op amp circuit.
Can any one help me suggest good solution?


texts: What is the maximum rated power of a flip-flop?

texts:
This is the link towards the D FF datasheet I am working with: SN74LVC1G80
My ambient temperature of working is 100C. Operating temperature for DBV package is -40C to 125C.

Junction-to-ambient thermal resistance = 243.4 C/W (for DBV package).

Intention is to find the maximum rated power of the device, following is the method used:

Range from ambient temperature to maximum operating temperature = 125C -100C = 25C.

Maximum rated power = (Above Calculated Range)/Junction-to-ambient thermal resistance = 25C/(243.4C/W) = 102.7 mW.

Kindly confirm or correct the above method used to calculate the maximum rated power calculation.

Or how to do the maximum rated power calculation if there is no rated power information in the datasheet.


texts: High voltage power supply for nixie-tubes

texts:
I want to design a power supply for 8 IN-14 nixie tubes. The tubes are controlled by a raspberry pi which needs a 5V supply voltage. I found this nixie power supply kit which converts 9V to about 180V. So my current setup consists of a 9V AC adapter, an L78S05C linear regulator, and the nixie supply kit. With my advanced temperature sensing method (using my finger), I have found that the L78S05C is getting really hot and other parts of the supply (MOSFET and Inductor) get moderately hot. I am not sure if the temperature of the nixie supply is a problem or not.

I think the linear regulator should be replaced by a buck converter. Is this the right way to go about it? Or should I try to start from 5V and convert that to the required 180V? And how would I go about that? A flyback converter or two boost converters in series?


texts:
My simple EEG circuit is not working. For a simple test I built my EEG circuit on a breadboard and wanted to see if it works before adding filters and moving it to perfboard. I used an AD620AN and a TL082CN.

The gain is 50 * 50 * 50 = 125000. As alpha and beta wave amplitudes have a range of about from 10 uV to 40 uV, output should has a range of about from ±1.25V to ±5V.

Purple wires are connections to electrodes. There is also a voltage divider (R1 = 2k2 ohm and R2 = 1k ohm) connected to OUT/2 to decrease 0-18V to 0-5V. Voltage divider output is connected to an Arduino.

But the circuit is not working. There isn't even some noise on the output. Arduino is reading about 380 but no / very little movement. I even changed the AD620 and TL082 with new ones but it didn't work also.

It is really strange that this simple circuit doesn't work.

What can be "the problem"? I'm out of ideas.

Thanks in advance.


texts: I've written equations of the circuit in the picture with reference to nodal Analysis. Not sure if I got the equations right.


texts:
I'm trying to build a constant current 2A amplifier using a TIP 127. To be honest, I have a lack of transistor knowledge.

I decided to analyze a few existent circuits with a TIP127 and the datasheet.

One of circuits mentions a voltage drop of 1.2 v between Emitter–Base, Is this a common sense value (2 transistors x 0.6 v drop) or this is an exact value variable per transistor? I'm looking in the datasheet and I cannot find the Emitter Base voltage drop.
A resistor between a Vin and the emitter with a specific voltage applied in the base will regulated the current passed to the collector? Is my interpretation correct or there is another away of explaining? I'll provide more details on point 3.
For a 2 Amp constant current on the collector:

VIn = 12
R1=0.3 ohm
VBase = 10.2 v
EB voltage drop (point 1) is 1.2 v
I R1 = (12-10.2-1.2)/0.3 = 2A

Is this correct?

I'm not feeling confident due to lack of knowledge interpreting the datasheet.

Can someone provide a theoretical/educational explanation?


texts: I am a beginner at electronics and I am trying to solve my first problems with diodes and opamps. I have to find and draw the output voltage uο related to the input voltage ui knowing that the voltage drop on the diodes is 0,7V when they conduct. It is also known that opamps are ideal so i guess that no currents flow in or out of the inputs and the difference between the inverting and non-inverting terminals can be considered to be zero. However, i am bit confused with the diodes. How do i start solving a problem like this?. Do i have to assume first that ui is positive and then that ui is negative? Any help is appreciated!Thanks in advance.


texts: What is the most efficient way to prevent reverse polarity to an opAmp?

texts:
Above is a part of a circuit which is a Schmitt trigger.
As you see 24V DC Vcc and Gnd are the power rails.

I will set up this circuit and some other people are going to hook up input output and power connections each time they need.

My concern is, if someone connects the power connections reverse.
I mean if one connects the power supply's plus to Gnd of this comparator and similarly power supply's minus to Vcc of this comparator, the circuit might damage because of the reverse DC voltage.

What could be the safety solution to eliminate a possible human mistake. I thought a diode connected on Gnd rail of the comparator might work.
But Im not sure about the voltage stability of the comparator if I use that.

What is the most efficient way to prevent reverse power connections to an opAmp?

A figure or a diagram illustration would help.


texts: Battery setup to power UVC bulb with 12 V DC at 1 A

texts:
So, I'm looking to power this UVC bulb kit:

The device size overall needs to be pretty small. (I'm trying to mount the bulb in the top of a cup-shaped housing. Ideally, the battery supply would be small enough to fit on/in a device about the size of a large solo type cup. (Actually, it would be acceptable to mount the battery pack externally, but this would have to be on the wall where the device is going to be mounted, with about a 3 foot distance.)

Cost is an issue as well, so nothing crazy.

I saw the option of using a 8-pack holder for AA batteries in series to get 12V. Will these support 1A? What kind of lifespan could I expect from such a configuration on this bulb?

Are there any other, better options?

EDIT: Manufacturer's website link, so you can view the specs and more info if needed:

Manufacturer's website


texts: Transformer model in Power Systems VS Coupled Inductors model

texts:
I know 2 models for a transformer one is to treat it as Coupled Inductors and the model will be:

In this model if there are no flux leakage the coupling factor is k=1 and therefore $$M=k\sqrt{L_1L_2}=\sqrt{L_1L_2}$$
But In power systems analysis, there is another model where series reactances stands for flux leakage and shunt reactance stands for the effect of finite permeability.

If the two models represent same thing we should have:
$$X_{l,p}=L_1-M,\quad X_{l,p}=L_2-M,\quad X_m=M$$
but it seems that this is not true since in ideal conditions we should have:
$$M=\sqrt{L_1L_2},\quad X_m=\infty$$

Are these two models represent same thing? Is the mutual inductance, omitted in power systems' model?

Link:Difference between a transformer and a coupled inductor

Edit:
I'm trying to compare the model presented in the book "Solid State Radio Engineering" with the above second model:

By the answer posted by Andy aka I think the model should be something like this:

I don't know why in the power transformer model they omit L-1,L-2 and M!?


texts: Why do high voltage power lines hiss when it's raining?

texts: I noticed when walking home the other day that the high voltage (200kv I believe) lines running through here were hissing in the rain. What is causing them to hiss?


texts: Why does this rising edge detector using a capacitor and a resistor work?

texts:
So in this video from Ben Eater he makes a rising edge detector using a capacitor and a resistor like the one below.

simulate this circuit – Schematic created using CircuitLab

In the video Ben said that the circuit would produce a quick pulse whenever the clock signal switched to high. I simulated the circuit and found out that the circuit produces a positive voltage when the clock signal switches to high and a negative voltage when it switches to low. Here's an image of the simulation.

In the video the circuit worked as if the negative pulses were nonexistent. Why did it work? In the video the circuit is connected to the pins 4B and 3B of the chip SN74LS08. Could be something with the chip?


texts:
I'm doing a project using SIM800L ebay module.I can send & receive SMS & calls.

The problem is, on workbench its working, but in actual site environment when the GSM signal is low & it disconnects & it won't connect to the network.

After I restart the module's power it works again and then disconnects aain. When I dial from my mobile to the GSM module it says "not reachable."  Is there any way to make the module ready all the time without disconnecting when in low signal areas?

Power supply = 4V/2A.

When power up I only set the below AT commands.

ATE0 //echo off
CMGF=1 //SMS format text
AT+CNMI=1,2,0,0,0 //Command to receive live sms
Wait for button press to send SMS or wait for incoming call.

I use the spiral antenna which comes with the module.

See the below link.

https://www.ebay.com/itm/Smallest-SIM800L-GPRS-GSM-Module-Card-Board-Quad-band-Onboard-TTL-Port/254096096686?hash=item3b294ebdae:g:SrwAAOSwotZcoWjt


texts: 3 phase circuit, 3 x single-phase (hot-hot) loads: what ampacity?

texts:
I'm not an electrician (thus the question), but I'd like to know what is possible from a specification standpoint.

Let's say we have a standard 3 phase power supply for a commercial building. We want to supply a sub-panel with 3 phase power and the sub-panel is supplied from a 3 phase 100A breaker.

We want to supply 3 dedicated single phase 208V loads, so we'll be building effectively a "load triangle."

What is the maximum ampacity for each load?

It's confusing to me, because each leg is supplying two loads "half way." So does that mean it's "ok" to use 3 100A two-phase breakers in the sub-panel (assuming the loads are correctly distributed)?

Don't worry too much about the nature of the loads. In fact, they will be EVSEs (electric car chargers). This means they'll have a fairly reasonable impedance match, but be continuous draw (which means they'll actually be derated from 100A by 20%).


texts:
I am trying to connect a SMD micro USB to my ESP chip using a USB to UART bridge.  The schematic being followed is attached below.  But there are a few things on the diagram that I find confusing, the bridge chip shows several I/Os connected that are not labeled anywhere else in the diagram.  The second attached picture shows the connections I am unsure about.  Does anyone know what these I/Os might correspond to?
Unlike the diagram, I am using CP2102N-A02-GQFN28R for USB to UART Bridge.  I believe I/Os are identical though. bridge datasheet
Lastly, I am not sure what is being accomplished in the third attached picture.  I understand how to wire this, but what is the purpose?


texts: Lithium coin cell battery showing randomness in voltage

texts:
I have a CR2032 coin cell battery and using that I am operating a BLE 4.1 module. When I connect a fresh battery in to the module the voltage shows 3.3 V, and after continuous communication with the mobile application after a few days the battery voltage becomes 1.8 V which is the minimum value required for the BLE radio for communication.

When I get this voltage I remove the battery and insert a new one. Now the problem is when there is no load condition obviously the battery shows a higher voltage compared to a load condition. After a few hours, when I checked the voltage of the battery I removed, it shows 2.9 V-3.0 V (which is almost 99 %) of the battery. Why is it so? Why does the voltage from 1.8 V get to 2.9 V without charging the battery?


texts:
I disassembled my HP DV7-3057NR (product #VU151UA#ABA) recently, in order to clean out the dust from the fan.

Anyway, I put it back together and now the 2 USB ports on the right hand side don't work any more. I took it apart again to investigate and found that the connection where the flat power cord running from the USB drive to the motherboard was loose. I eased the cable out and found that this piece where it connects to the motherboard is broken, so obviously no power is getting to the USB drive.

Does anybody know the specific name for this piece? And if it is replaceable without buying an entirely new motherboard?


texts:
I am designing a USB hub that has a 2.0 upstream connection (pc is only 2.0). To one of the downstream ports I am connecting a Ethernet to USB IC capable of USB3.0 speed and Gb ethernet.

My question is...does it make sense to have a USB3.0 hub IC or a 2.0 will be more than enough ? Will I get any boost in performance with a 3.0 hub ic ?


texts:
This question is a result of several bad decisions compounded by rush implementation. It is similar to this question, unfortunately the answers there provide only explanation, not the solution.

I had to add isolation to the UART port on already assembled boards. Luckily, the boards had small patch of unused holes just for this kind of contingency. I ordered and installed cheapest isolators (SI8422AB-D-IS) and DC-DC converters (PDSE1-S5-S3-S). It is only when I found 3.75V on the isolator I realized that the converter has unregulated output. It needs at least 150 mA load to drop to rated voltage, and isolator draws no more than 5 mA. So, I added LDOs (MCP1700-3302E) to the mix.

Now there is a stable 3.3V with insignificant ripple. However I also found "minimum output current 30 mA" in the converter datasheet.

Question: Should I leave it be as it is? Seems to be working fine.
Is adding 150 Ohm load resistor before or after LDO a bad idea?

simulate this circuit – Schematic created using CircuitLab

Note that these boards will be used mostly for software development. The final product will have a single ISOW7821 chip.


texts: Does reset do the same thing as shutting off the power to this device and turning it back on?

texts: I am trying to control a serial dataflash memory through an mbed. It is an AT45DB021B and the datasheet is here. It has a reset pin that I have wired to the mbed so that a software reset can be done. I heard that a software reset makes things easier so that a hardware reset, i.e. shutting off power and turning it back on, is not needed. I noticed that when I do a hardware reset, whatever is in the buffer is overwritten by random values. However, when I do a software reset, the buffer is unaffected. Nothing seems to change on a software reset. Is this normal?


texts: How to build a noise generator based entirely on logic gates?

texts:
I would like to build a noise generator based on logic gates. It could be white noise generator or a random bits generator that sound similar to a noise source. I need a circuit recommendation or an idea how to make it.

Updated: The purpose is to make an electronic music device. Any kind of noise can be interesting for me.


texts: Variable power supply using xl4015 module

texts:
I am planning to make a variable bench power supply using a 12 0 12 5 amp step down transformer.
While using full wave rectifier br1010 to rectify and capacitor to filter, I get 42 v at no load. I was planning to use a xl4015 based buck converter to control the voltage. The max current that I will be needing off this power supply will be 5 amps. But the buck converter is rated for 32 v max input.
So in order to get around this, can I use the center (0) tap of transformer in half wave rectification configuration ( this gives me max 20v at no load at capacitor) but that is not sufficient for my application - I need atleast 30 volts to be able to run a dc motor or minimum 3.5 volt to run my trimmer, hence the need for buck converter (the minimum voltage on the boost converter is 10v). So if I use a boost converter https://www.electronicscomp.com/150w-dc-dc-step-up-boost-converter-10-32v-to-12-35v-adjustable-power-supply-module-india
To boost voltage till say 32 volt and then pass that as input to buck converter to be able to get 1-32 v output. Will this lead to current loss? Is this setup feasible.
I have attached pic of my setup currently this is full wave configuration. But if this works I'll modify it for half wave setup


texts: Bistable and astable 555 IC interfere with each other

texts:
I am currently toying around with electronics and read Make:Electronics which is a very fun book.

In one experiment (19) I came to a deviation in behaviour of my circuit compared to the expected behaviour described in the book.

The following image contains two different 555 IC configurations (sorry for the schematic, I am a beginner)

Here is the schematic

The left one is a bistable configuration (with the omitted reset button) that is responsible to start the left 555 IC and therefore trigger the red LED.

The right one is in an astable configuration that, when powered, causes the green LED to periodically blink. The period is very long and implemented with a 470k resistor combined with a 3.3microfarad capacitor.

Both parts are basically copied from the book and behave predictably when executed independent of each other (by removing the one and then the other IC).

The above configuration however has some oddity for me, which I do not understand.

When powered, the green LED begins their cycle but when the green LED is off and I start the bistable 555 IC, the red LED is turned on. And this is the part I do not get. I would expect that the red LED stays on indefinitely but the next time the astable IC turns the green LED back on, the red one is turned off. And even vice versa, when the green LED is on, pressing the push button on the bistable one, turns the green LED off and the red on.

My assumption is some voltage drop but I do not see what could cause that. I suspected the discharge pin 7 but since there is a 10k resistor between VCC and pin 7 I am not sure what actually happens.

Any hint would be wonderful.


texts: Programming Differences between a Microcontroller and a Microprocessor?

texts:
So I often see books/tutorials and references when programming in assembly to a microprocessor.....then I see some refer to it as a microcontroller.

For instance the Atmel ATtiny2313....i saw some tutorials on, some call it a microprocessor, some call it a microcontroller?

Which is it? and is programming them (basically) the same? (in assembly)


texts: How to dissipate energy/heat in solenoid valve + flyback diode circuit

texts:
A simple device that I didn't make uses solenoid valves (driven by relays) and I have to deal with the EM spikes they generate when turning off as this interferes with other equipment in my lab.  The valve manufacturer recommended a connector with MOV they sell, but it didn't help: the spike is still present, e.g. it pops in my speakers.  When I tried a flyback diode (I had a 1N4004 lying around), it quickly overheated.  I haven't found how to deal with that, as most circuits that explain this simply show a diode, or sometimes with a resistor, or a Zener to speed up the discharge.

I've calculated the energy as 0.5 * 8.15 mH * (0.45 A)^2 = 0.8 mJ, and the initial discharge power as 0.9 Ohm * (0.45 A)^2 = 0.18 W.

What is the recommended way to dissipate this energy/heat safely?  If I add a resistor, seems to me it would get the heat instead of the diode so it would be the same problem.  Is this right?  Do I need some big component(s) with heat sink?


texts:
I'm building an electronic musical instrument, using piezoelectric contact microphones as inputs.  I want ~80 buttons, each with a piezo connected to an ADC.  The idea is that you hit the piezo, then depending on how hard you hit it I trigger a louder or quieter sound.

I'm trying to figure out what to use for the ADC.  I could run ~14 arduinos, but that seems kind of silly?  Is there a better way to get ~80 ADCs?

I'm also trying to figure out about how to set up the circuits.  For each one I could just put a piezo and 1M resistor in parallel across the ADC:

ADC in0 ---+------+
           |      |
         1MOhm  piezo
           |      |
ADC in1 ---+------+

This is fine, but requires a relatively high sample rate from the ADC to accurately capture the peak of the input signal.  It seems like I should be able to put something in series with the piezo to cut off the negative side of the signal, and then something else to smooth out the signal, which would let me run a much lower sampling rate?

(This question is basically "what should the electronics for a an electronic drum kit's input look like", though that's not what I'm building.)


texts: Programming of STM32 with RFM95 LoRachip in Arduino IDE

texts:
I'd like to design a custom board around some STM32 chip, one of STMicro's mainstream  MCUs such as the STM32F103C8, which is used for the blue pill should do.
I am now wondering: Can I manage to get the STM32 working with the latest LMIC library:
LMIC Github Repo
There are tutorials that describe how to flash the Arduino bootloader onto the STM32:
Flashing Arduino bootloader to STM32
My questions are:

How do I flash the bootloader onto the 'bare' STM32
How do I upload the sketches in ArduinoIDE later, over the same pins used for flashing the bootloader?
Are the Arduino libraries compatible: probably difficult to tell or in general no because it depends on the hardware


texts:
I wanted to use a 12 LED bar graph with a LED bar graph driver but the the driver I know (LM3914) supports only 10 LEDs. Is there a similar driver IC with more out pins?

The purpose is to use the bar graph as a battery voltmeter. DIP package preferred.


texts: Photodiode selection for fluorescent probe

texts:
At the moment I am trying to build a DIY fluorescence detector using the Amplex Ultra Red probe with excitation and emmission maxima at 568 and 581nm respectively.

I just have problems choosing the right photodiode.
The photodiode will have to measure emmission through a .3 cm thick glass wall in a biological. It has to be very small and Through hole.
Somebody recommended me this photodiode but I can't find any details about it's specs to fit in with my local supplier.

Any help is very appreciated

Thanks in advance


texts: Circuit for recharging Li-ion Polymer Battery

texts:
I have a Li-ion Polymer Battery (Apple 616-0550), 3.7V 3.44Wh (~930mAh) salvaged from an iPod Touch 4th.
What do I need to know in order to build a recharging circuit for this type of battery?
Preferably, from a 5V or 9V power source.


texts: Protection against a circuit being closed too long or failing closed

texts:
I'm prototyping a device that allows me to electronically open my front door, which it accomplishes by using a relay to close an existing circuit in my house. All I know about this circuit is that it measures around 12V AC.

Now, I'm far from keeping this device permanently installed, if I ever will,  but thinking ahead, my biggest fear is that it would in any way fail with the relay closed while nobody is home, making noise all day (opening the door makes a loud buzzing sound) and letting all the unwanted people in.

I've thought of all kinds of methods to prevent this, like putting the timing of the relay under control of a really simple 555 or ATTiny circuit. I'll do that regardless of any other measures, since security is best applied in layers.

Ultimately, however, I would only leave the house comfortably if there's a super simple and reliable safety measure I can install in series with the relay in the 12V circuit, that would cut off the connection if it's closed for more than a few seconds. Something like a timed fuse. Something that, once triggered, can not be restored without physical intervention. It may even be sacrificial, since it will only be activated if all earlier measures fail.

What kind of protection would you advise me here?


texts: Object detection using sensors and then reporting the location

texts:
I am trying to prototype a sensor + location reporting chip that will do the following:

Sense if a object is present over the top of it (a vehicle to be specific)
Reporting the location of the chip (Not of vehicle)

The second option may be hardcoded into the chip and should be reprogrammable. These chips would needed to be installed in large numbers and there will be several such chips installed in close proximity. Each will report its own location to a centralized server (via wifi?)

That centralized server will then send the locations and busy/empty slots to a remote server which will then update some database.

I know the above description is very broad in terms of technical aspects but I need a starting point. Another thing to consider here is that I need to keep the cost of such chips lower considering that there will be 100's of such chips needed.


texts: Calculate the ampere hour rating of a battery using current over time and voltage over time

texts: I built a battery and measured the current and voltage of the battery over time. Is there a way I can use this information easily to calculate the ampere hour capacity of the battery?


texts:
I'm trying to interface the following chip with STM32F4
https://www.nxp.com/docs/en/supporting-information/AN12207.pdf

I'm currently trying to transmit a repeated start using hal sequential transmission with an interrupt but it doesn't work at all, I get NAK.

Would someone give me insights how to interface it and which HAL functions should I use?

unsigned int axI2CWriteRead(unsigned char bus_unused_param, unsigned char addr,
                            unsigned char *pTx, unsigned short txLen,
                            unsigned char *pRx, unsigned short *pRxLen)
{
    extern I2C_HandleTypeDef hi2c3;
    bool recv_length = false;
    HAL_StatusTypeDef status;

    *pRxLen = 0;
    memset(pRx, 0, 2);
    uint8_t rxData[255] = {0};

    status = HAL_I2C_Master_Sequential_Transmit_IT(&hi2c3, 0x90, pTx, txLen, I2C_FIRST_FRAME);

    if (status != HAL_OK)
        return I2C_FAILED;

    while (HAL_I2C_GetState(&hi2c3) != HAL_I2C_STATE_READY)
        ;

    readblock = true;
    readblock_length = 0;
    status = HAL_I2C_Master_Sequential_Receive_IT(&hi2c3, 0x90, rxData, 255, I2C_LAST_FRAME);

    if (status != HAL_OK)
        return I2C_FAILED;
    while (HAL_I2C_GetState(&hi2c3) != HAL_I2C_STATE_READY)
        ;
    readblock = false;
    readblock_length = 0;

    *pRxLen = rxData[0] + 1;

    memcpy(pRx, rxData, *pRxLen);

    return I2C_OK;
}


texts: Electric shock when touching insulated plug

texts:
Something weird happened.
My girlfriend tried to unplug our dryer from the wall outlet. We live in Germany.
She touched the plug on the insulation (like normal) and did not touch the pins, but still got a painful electric shock.
She says she leaned over the dryer to unplug, so maybe the issue is with the dryer having current on the outside of the dryer body, or the wall outlet has an issue.
But can it be an electrostatic shock? It seems weird because she got the shock when she touched the insulated part (she even didn't remove the plug, she just touched the plug right before.)
Just want to know if this is something we should watch out for health wise.


texts: Building a low-cost small-size CAN-to-I²C bridge

texts:
I have many (tens) sensors which talk I²C spread over larger area (10s of meters), and I am considering to connect them to CAN. I am looking for advise on how to do it, with lower cost ($20 or so would be ok per one sensor).

I don't think there is anything ready-made; except CAN/RS485 from Artesyn, https://www.artesyn.com/power/assets/trn_can_rs485_interface_adapte1321396157_techref.pdf, which is a I²C master connected over CAN - but maybe only works for their application (PSU), and maybe is expensive.

I looked at Arduino with CAN-BUS shield (too big in dimensions), Microduino, Teensy and a few other boards. I don't mind doing the programming (periodically, about 2 Hz, read from I²C sensor and send out over CAN), but I would like the hardware to be open (like Arduino), compact (let's say max 4x4 cm) and inexpensive.

Any recommendations, or even perhaps ideas how to make this differently, are appreciated.


texts: What Prevents load voltage from Flowing into Vsupply in this circuit?

texts:
Here, U1 is an optocoupler called TLP250. It is powered by Vsupply which is 12 V. V2 is the load voltage and it is at 24V. But it can be as much as 200V.

My question is, that since both Vsupply and V2 share the same ground, what prevents current from V2 from flowing into the Vsupply ground when Q1 is conducting?


texts: Why do stoves need not be connected under the earth leakage?

texts:
On some stoves I've seen stickers stating that the stove doesn't need to be connected under the earth leakage... Which is rather confusing since we need to earth it in case of earth faults.

I'm just struggling to understand why a stove shouldn't be under earth leakage.  Any information on this will be appreciated


texts: How to determine the power supply needed for a PCB

texts:
I am doing a project in PCB design and I am fairly new on this.

The board I am creating has various components among them an Ethernet, USB controller some DDR memory and an FPGA. I have found schematics of even the same components that I use, which have the power regulators and the connections needed. But I do not want to just copy them out.

So in order to determine the power supply needed, to properly power up my system, what are the key points that I should look in the components datasheets? What I need to consider when choosing regulators?


texts:
I burnt 3 chargers (Imax B6) simultaneously by connecting Lipo 4s battery in reverse . All showing connection break error. I changed the burnt MOSFET (U5) in all chargers, one charger is recovered and works perfect but the other two charge for exact 11 seconds and then both show FULL msg on LCD. Please let me know what else I have to change to recover them?
the Charger I am using is This


texts:
I am working with a CAN bus implementation of ATSAMC21 microcontroller now and have a question about CAN arbitration, but not for the ID field, everything is clear there, dominant bit gets the bus.

I have some problems with getting a lot of different IDs for my system and I have to work with CAN 2.0 format, so I have only 11 bits. The idea is to use some more info in the data field of the CAN packet. So the question is how the CAN arbitration within the data field works.

What happens if 2 or more CAN devices will try to transmit packets simultaneously with the same ID? Must the arbitration also process the data field correctly? I have done some tests and it seems to work, but not always, so sometimes MCU detects transmission errors, packet is corrupted (I am monitoring it with a logic analyzer) and TEC value of the error counter is incremented. Is it a right behavior or am I just lucky and it will not work?

I need this functionality for broadcasting commands and would like to know about this feature.


texts: String manipulation in synthesisable Verilog

texts:
I am interested in implementing an ASCII-based communication protocol in Verilog for an FPGA. The communication protocol is FIX, and would require various string manipulations.

What tools/libraries should I use for synthesisable string manipulation?


texts: I want to use a 4D Systems OLED display with an ATmega32u4 based PCB. I'm still working on designing the PCB and have hit a problem. In the data sheet it says that one of the power supply pins for the display requires 13.5-14.5 volts (which is VDDh). The problem is I will be powering the ATmega32u4 from a lipo battery with a 3.3V regulator. How do I convert 3.3V to 14V? Would I need to use a boost converter?


texts: How to filter a signal through a differential amplifier

texts:
An input signal must be scaled and biased for an ADC (MCU is TMS320F28027). I following an answer for a previous post.

 Figure 1: Original answer

If the signal needs to be filtered with a cutoff frequency of 5 kHz would adding the following capacitors be correct?
 (according to fcutoff= 1/(2πRC)

simulate this circuit – Schematic created using CircuitLab

How was the orignal capacitance of C1 chosen? is it better to maintain C1's value and change R3 and R4 to satisfy fc? Is C2 necessary to filter (its inclusion was based on another answer)?


texts: Timing circuit with op amps and capacitors

texts: I understand how a basic comparator op amp works and how a capacitor charges individually, but I can't seem to put it all together to make this circuit. I think I might be messing up with the voltage rails and grounds somehow. The point of the circuit is for the LEDs to light up at ~2 second intervals. The output of the comparator is supposed to transition from -13V to 12V where Vcc is +-15V. The op amps are TL081CP if that information helps. If anyone could give me some tips of what I might be missing or possibly add to this diagram with a little more detail that would really help a lot.


texts: Serial protocol delimiting/synchronization techniques

texts:
As asynchronous serial communication is widely spread among electronic devices even nowadays, I believe many of us have encountered such a question from time to time. Consider an electronic device D and a computer PC connected with serial line (RS-232 or similar) and required to exchange information continuously. I.e. PC is sending a command frame each X ms, and D is replying with status report/telemetry frame each Y ms (The report can be sent as response to requests or independently - doesn't really matter here). The communication frames can contain any arbitrary binary data. Assuming the communication frames are fixed-length packets.
The problem:
As the protocol is continuous, the receiving side might loose the synchronization or just "join" in the middle of an ongoing sent frame, so it just won't know where the start of frame (SOF) is. A the data has different meaning based on its position relatively to the SOF, the received data will become corrupted, potentially forever.
The required solution
Reliable delimiting/synchronization scheme to detect the SOF with short recovery time (i.e. it shouldn't take more than, say 1 frame to resynchronize).
The existing techniques I am aware (and using some) of:
1) Header / checksum - SOF as predefined byte value. Checksum in the end of frame.

Pros: Simple.
Cons: Not reliable. Unknown recovery time.

2) Byte stuffing:

Pros: Reliable, fast recovery, can be used with any hardware
Cons: Not that suitable for fixed-size frame-based communication

3) 9th bit marking - prepend each byte with additional bit, while SOF marked with 1 and the data bytes are marked with 0:

Pros: Reliable, fast recovery
Cons: Requires hardware support. Not directly supported by most of PC hardware and software.

4) 8th bit marking - kind of emulation of the above, while using the 8th bit instead of 9th, which is leaving only 7bits for each data word.

Pros: Reliable, fast recovery, can be used with any hardware.
Cons: Requires an encoding/decoding scheme from/to the conventional 8-bit representation to/from 7-bit representation. Somewhat wasteful.

5) Timeout based - assume the SOF as the first byte coming after some defined idle time.

Pros: No data overhead, simple.
Cons: Not that reliable. Won't work well with poor timing systems like, say, Windows PC. Potential throughput overhead.

Question:
What are the other possible techniques/solutions exist to address the problem? Can you point to the cons in the above list which can be easily worked around, thus removing them? How do you (or would you) design your systems protocol?


texts: LTC3780 Test load for adjusting current limit

texts:
I use the LTC3780 for my variable power supply, it can handle 1-30VDC and 7A output.

In order to be able to view my current limit adjustments, i thought to create a momentary test load by using a 4.7 Ohm 50W resistor.

Do you think this is safe?
If not what other options do i have?

Thanks


texts:
I need to use a stepper motor 6A with Delta PLC using a stepper motor driver.

My question is do  i need to use an overload protection relay or is there any alternative for stepper motor ?
stepper motor stepper
driverdriver


texts: How can one calibrate a multimeter, like a UT61E or any other multimeter in the 50 ~200 $ pricemark, when one does NOT have an expensive FLUKE nor a friend who has a FLUKE)


texts:
My multimeter shows:
Ib=218uA why?

But my calculation shows, it should be: 8.5uA

I used the formula:
Ib=(3.1-0.7)/(10k+271k) [I take Beta=270, BC548 transistor.]

What is the problem? Why is Ib = 218uA, instead of 8.5uA?