texts: What are the risks of variable-period PWM?

texts:
This is somewhat related to Exponential ramp for PWM but closer in spirit to someone else's question, Variable PWM for a PIC18F4550? .
I'm thinking about making a linear, "set-and-forget" PWM signal on the PIC16F1773 that is able to run during sleep and does not require intervention to update the duty cycle. I'm currently weighing two options.
The first uses two PWM modules whose period is set by a small beat frequency, fed to the Complementary Waveform Generator (COG) in "steered PWM mode". In this mode, I can fairly easily define rising and falling edge output events based on the source PWMs, to have a constant period and variable duty cycle.
The second requires one fewer module - only two PWMs are needed, where one is a parent, one is a child, and the parent's offset events reset the PWM counter of the child. The literature calls this "Continuous run [child] mode with sync start and timer reset". Unfortunately, if my interpretation is correct, this mode would not allow for an unsupervised variable duty cycle without also varying the period - effectively the high-time would be constant and the low-time would see linear reduction to zero.
Given that this is driving a LED at ~150Hz, nanosecond-level timing accuracy isn't all that crucial. This system is also not sensitive to very many power considerations, since it's fed by a beefy SMPS with no battery in the picture.
The only major trade-offs I see are:

The COG solution draws the additional power of one more module, but given that the frequency of the PWM-only solution ramps up, the increased frequency of CMOS transitions makes power comparison non-trivial
If I had a sensitive analogue section (which I don't), the variable-frequency approach could make spectral pollution more difficult to control
The variable-frequency approach does not support starting at zero duty cycle, because there must be some constant, non-zero high time

I think the last point is the only one applicable to my situation, which pushes me toward the COG solution. Have I missed any other considerations?


texts: I'm designing a system that needs two converters. The Vin input voltage is approximately 14.5V. I need to lower the Vin voltage to 12V and also to 5V. I chose two LM2576-5 (5V) and LM2596-12 (12V) converters, the two converters require a 100uF Cin capacitor. I put a 100uF Cin capacitor for each converter. Looking at the schematic below, as the Vin voltage goes to the two converters, the capacitors C6 and C8 in this scheme seem to be in parallel, resulting in a total capacitance of 200uF. I wonder, can this affect the functionality of the converters? The correct would be to put only one capacitor for the two converters? What can I be doing wrong by putting the capacitors in this way?


texts: Connect STM32F103 to MPU9250 over I2C with HAL (ERROR)

texts:
my experience in programming MCU is only Arduino (also STM32F103 over Arduino) I have now started to use the STM32CUBEIDE and an ST-Link V2 to program my STM32f103.

I have tried the functions:

HAL_I2C_IsDeviceReady
HAL_I2C_Master_Transmit
HAL_I2C_Master_Receive
HAL_I2C_Mem_Read

and the 'HAL_StatusTypeDef' return value is always '1' at the first call and '2' at the following calls (of any of the above listed functions).

1 means ERROR and 2 means BUSY. 3 would mean TIMEOUT and 0 would mean OK, as far as I know.

My questions is: even if I change the I2C address the return is still 1 (ERROR) on the first call, and never 3 (TIMEOUT). Why?

According to this: https://os.mbed.com/users/EricLew/code/STM32L4xx_HAL_Driver/docs/tip/stm32l4xx__hal__i2c_8c_source.html#l02221

HAL_I2C_IsDeviceReady shouldn't even return 1, only 0 and 3...

Can somebody tell me what I am doing wrong? I setup the pins correctly in STM32Cube (PB6 and PB7):

void MX_I2C1_Init(void)
{

  hi2c1.Instance = I2C1;
  hi2c1.Init.ClockSpeed = 100000;
  hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
  hi2c1.Init.OwnAddress1 = 0;
  hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
  hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
  hi2c1.Init.OwnAddress2 = 0;
  hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
  hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
  if (HAL_I2C_Init(&hi2c1) != HAL_OK)
  {
    Error_Handler();
  }

}

void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle)
{

  GPIO_InitTypeDef GPIO_InitStruct = {0};
  if(i2cHandle->Instance==I2C1)
  {
  /* USER CODE BEGIN I2C1_MspInit 0 */

  /* USER CODE END I2C1_MspInit 0 */

    __HAL_RCC_GPIOB_CLK_ENABLE();
    /**I2C1 GPIO Configuration
    PB6     ------> I2C1_SCL
    PB7     ------> I2C1_SDA
    */
    GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

    /* I2C1 clock enable */
    __HAL_RCC_I2C1_CLK_ENABLE();
  /* USER CODE BEGIN I2C1_MspInit 1 */

  /* USER CODE END I2C1_MspInit 1 */
  }
}

And called the initialize function (just like the IDE has prepared for me in the code setup):

/* USER CODE BEGIN 0 */
HAL_StatusTypeDef ret;
unsigned char buf[2];
uint16_t val;
int16_t valt;
float temp_c;
float RoomTemp_Offset = 0;
float Temp_Sensitivity = 321;
/* USER CODE END 0 */

int main(void)
{

  /* MCU Configuration--------------------------------------------------------*/

  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  HAL_Init();

  /* USER CODE BEGIN Init */
  DWT_Delay_Init();
  /* USER CODE END Init */

  /* Configure the system clock */
  SystemClock_Config();

  /* Initialize all configured peripherals */
  MX_GPIO_Init();
  MX_I2C1_Init();
  MX_SPI1_Init();
  /* USER CODE BEGIN 2 */

  ret = HAL_I2C_IsDeviceReady(&hi2c1, MPU9250_ADDR, 10, 100);
  printf("Is Ready: %d \n", ret);
  /* USER CODE END 2 */

  /* Infinite loop */

  while (1)
  {
       // Tell MPU9250 that we want to read from the temperature register
      val = read_register(0x41);
      valt = ((int16_t)val << 4) | (val >> 4);
      temp_c = ((valt - RoomTemp_Offset)/Temp_Sensitivity) + 21;
      printf("reading...\n");
      printf("%.6f \n", temp_c);
  }
}

and the read_register function is defined here:

uint16_t read_register(uint16_t register_pointer)
{
    HAL_StatusTypeDef status = HAL_OK;
    uint16_t return_value = 0;
    status = HAL_I2C_Mem_Read(&hi2c1, MPU9250_ADDR, (uint16_t)register_pointer, I2C_MEMADD_SIZE_8BIT, &return_value, 2, 100);
    printf("read HAL_RET: %d \n", status);
    /* Check the communication status */
    if(status != HAL_OK)
    {
        Error_Handler();
    }

    return return_value;
}

and the overall output of the script ower SWO:

Is Ready: 1
read HAL_RET: 2
reading...

read HAL_RET: 2
reading...

read HAL_RET: 2
reading...

read HAL_RET: 2


texts: How does the circuit of ITD(Time delay) and voltage sense works?

texts:
I have designed the schematic of ITD(Intelligent time delay) and voltage sense by tracing the circuit of AC Guard unit in which it senses the voltage and cut off the supply based on predefined upper and lower limit.
It features a start up delay of about 4 minutes to prevent frequent switching on and off during fluctuations. The A/C Guard has the advanced feature to save on down time. It means that when the mains returns to normal after any event, the A/C Guard checks the duration of the OFF time. If the unit has been off for more than 4 minutes then it will switch the air-conditioner on within 10 seconds rather than the standard 4 minutes. If however, the unit has been off for less than 4 minutes, the A/C Guard will ensure that it will remain off up to 4 minutes and then restarts automatically.
Following is the schematic of the same, ITD goes to the MCU(ADC).

Another schematic is of voltage sensing :

Now my query is how do both the circuit works, and how can I measure the OFF time of the unit using the ITD circuit using Microcontroller? I want to understand the work follow of this circuit.
Also what will be the value of D5 and D6 Diodes, will they be zener or simple 1N4007 diode?


texts:
Okay say I have to use a CLA adder to implement the addition of two 2-bit numbers, X = x1x0, Y = y1y0. And say I have to write down the logical expression for the final carry-out.

So C1 or the first carryout would be x0y0 + C0(X0+Y0). Now if we let x0y0 = g0 and x0 + y0 = p0,

we get: C1 = g0 + C0(p0).

Then C2 or the Final carry out = g1 + C1(p1) where C1 = g0 + C0(p0)

so C2 = g1 + p1g0 + p1C0p0.

Now my question is instead of letting the propagate term or p1 or p0 be xi + yi we let it be xi xor yi which is a valid implementation taught in many books.

My question is why? Why should one choose the Xor gate over the or gate. Are there any benefits it provides?


texts:
While studying radio electronics I stumbled across a small article about wave interference on the same frequency. The article was very simple explaining that if there a stronger emitter on the frequency or the emitter is closer than any other - it will take over the frequency.

That got me interested, but I couldn't find any information of how it works from the inside:

How does the wave gets overriden?
How can one emitter be stronger than another if there, for example are equal distance from the receiver and from each other?

I am especially interested in following topics:

How can I amplify a radio signal?
Is it harder to amplify signals on higher frequencies, e.g. WI-FI Internet?
What is the basic principle of devices that creates noise and blocks certain frequencies?


texts: Using multiple 4N25 optocouplers - Approach for compact PCB design?

texts:
I'm working on building an Ardunio Nano device that detects if automotive 12V circuits are on / off. I was able to successfully build & test a sample circuit provided Phil Frost.
The question I have is around saving space. I'm using this in a motorcycle so space is at a premium. The 4N25 uses 6-pins, even though I only use 4. I'm monitoring 6 separate 12V circuits and I'm wondering how to make it more compact.
Is there another chip (maybe a multi-optocoupler) or approach that will help me save PCB real estate?


texts: Ringing at mosfet source just before turning on

texts:
I am working on buck converter but stuck on at the basic results.

I simulated my circuit in OrCad.

Attaching my circuit diagram and waveforms.

The problem is with the voltage at source of mosfet.  Initially, the m source voltage goes down as gate goes down but just after a little time it is keep turning high(with ringing) while gate is still low.

Can some one please explain why this is happning.

I have fabricated this circuit also, same thing happaning . I am attaching those DSO waveforms too.

OrCad circuit diagram

DSO waveform of implemented circuit

OrCad circuit Simulated WaveForm


texts: What makes an electrical device draws a current

texts:
May be this is very silly question but i want to ask that if the system has 220v and we connect our mobile charger with this draws very little current and when we connect iron with this very same socket draws much higher amount of current.

My question is that what make current flow through device and what mentioned the quantity?


texts: FM Tansmitter - AC Equivalent Circuit - Capacitor Analysis

texts:
This is a follow on question from the following two questions:

Operation of LC circuit in Frequency Modulation with simulation and linking it to the basic principle of frequency modulation
How to build an FM transmitter and how does it work?

From link 1, an AC equivalent circuit is derived as shown below:

My question: If C1 is shorting all AC signals directly to ground - how do they propagate through the circuit? Usually the AC signal is applied across the transistor. Why is that not the case here?

EDIT: I had a further look at common base BJT configurations and re-arranged the circuits to match the fundamental example (see below).

For the signal generator lets assume we are going to use a microphone. Would it be correct to assume that it would be wired as shown in the AC equivalent circuit?

After re-arranging the circuits, I realised on the AC circuit everything from the collector side has now been shifted onto the emitter side. Is this correct? If so..why?


texts: Computing a mathematical expression using half and full adders

texts:
I am new to logical desing and I am not sure how to start the exercise.

The problem:

  Assume that we have 2 assinged numbers of 2 bits (A = a1 a0 and B = b1
  b0). Desing a combinational logical circuit that computes the S = 4A +
  3B and uses half and full adders, only.

What I am thinking is to use 2 full adders to compute the "4 * A", another 2 to compute the "3 * B" and another one to compute the S = 4A + 3B. This mean that I will need 5 full adders in total.

Is this the best and most efficient solution? I guess no but I can't think something better.

Is this diagram right?


texts: Can I combine two separate 120V isolation transformers, tie the secondaries in series, but not tie the primaries?

texts:
I want to connect two separate 120V (7.5KVA) isolation transformers, tie the secondaries, but not the primaries. The input is 120V for each primary, with the goal to have 240/120V on the output. I guess you can call the primaries of the two transformers as floating and/or isolated primaries. I tried searching all of the world wide web for this type of application, but it seems very uncommon. Typically, the primaries are connected right at the transformers. The logic I had was that the transformers are technically connected at the neutrals upstream at a terminal block, but that distance is about 50 feet. To clarify my intention, I drew what the circuit would like below. I want to know if this is possible, what should I do to make this works, and what issues should I look out for. Also, how would the output look if the 2nd transformer below had Line 2 and the Neutral switched on the primary?
I did see issues online about non-matching polarity, insufficent insulation in the transformers, ease of mis-wiring, and others.


texts:
The 74hc590 http://www.ti.com/lit/ds/symlink/sn74hc590a.pdf is a binary counter followed by a register with a tri-state output.

I thought about using it an a (homebrew cpu) design, as it's wider than the 74hc161, but the output buffer means that it takes an extra clock before a counter clear CCLR# is reflected at the output.

Have I misunderstood this part?

What was the 590's original purpose?  i.e. Why were people putting registers after counters, resulting in this part being made?


texts: Dual power supply: two secondaries or series regulators?

texts:
I am going to create a simple dual voltage power supply for powering logic (5V) and some stepper motors (12V).

What would be a better solution: Would it be to use a transformer with two secondaries (or a center tap) and regulate them separately? Or a single one with two regulators in series, first one regulating down to 12V and second to 5V?


texts: Purpose of linker files in placing code in internal flash

texts: How linker file has to be programmed to place a code in internal flash?how linker filer files are different for different compilers?


texts: Which alcohol is bad to use when cleaning computers?

texts:
I heard there are some alcohols that are prohibited to be used when cleaning a computer or an electric device.
Apart from beverages, which ones are these?


texts: How does a bipolar transistor work on logical level?

texts:
When does a BJT conduct electricity and from where to where does it flow?

I thought a BJT is off when the base is low and otherwise the electricity flows from emitter to collector (pnp) or from collector to emitter (npn), right?

I have this exercise with solution for example. How can I figure out if a BJT is on or off?

For T3 it seem's to be simple: It's on when A is high because then T3's base is high.

But why is T7 always on although it's connected to ground?

How can T9 be on although it's base is connected with T4's collector?

Solution:

Seem's like I didn't understand how BJTs work overall...


texts:
Basic theory of clamp meter to measure rms of current wave.

What I have in mind is that wire creates the changing flux that induces voltage in the meter.This voltage is calibrated ?
Also how does the working of clamp meter compare to that a current transformer
Any knowledge would be helpful

Thanks!


texts:
I'm tasked with a design/proof of concept for electrical side of fitness equipment.
The main problem for me how to transfer the statistics from the fitness equipment to various consumer devices- iPhones/iPads/Android phones/PC's etc.
The controller will probably be Arduino, at least for the initial prototype.

What I have come up with:

Use BlueGiga's BLE112 (as outlined here http://www.glynstore.com/bluegiga-ble112-bluetooth-low-energy-module/) for interfacing iPhone 4S+, iPad3, latest Macs and some of the latest Android devices.
Use some regular Arduino BT shield for communication with pretty much all other phones, except < iPhone4s (which don't have Bluetooth LE stack). Our company does not want to participate in Made For iPhone program in order to be able to communicate with < iPhone4S.
Use either Arduino Ethernet together with WiFi router packaged in fitness equipment OR use Arduino WiFi shield in adhoc mode, to communicate with < iPhone4s.

All of this seems an overkill- I could just use Arduino WiFi shield in adhoc mode, and that would probably cover all the other use cases (except for devices without wifi), however, I really don't like that device won't have access to the internet when connected to our equipment via wifi.

I have also explored using phones cellular data connection, but that would require internet access on the fitness equipment, which some might find weird.

I'm wondering if there are some other wireless ways of communication which I have overlooked. We would like to maintain a wide range of supported devices.

EDIT:

@RussellMcMahon hardware "dongle" would require participation in Made For iPhone program, wouldn't it? I'm also skeptic about communication via headphone jack- it just seems plain wrong for me.

@m.Alin Currently I'm looking for 1:1 communication between consumer device and our equipment, but keeping an option to connect the equipment to the internet would be nice.


texts: How to do switching noise analysis of dcdc on LTSpice

texts:
Background : In one of my board i have used LT8471 as DCDC , as my cards being analog cards, i tried maximum to seperate the power network and analog chain from noise, my initial problems with dc-dc noise are answered here at Apporach1  and Approach2 after which i have curbed the noise to <100mV by incorporating CLC pi filters at dcdc output

Problem :
still i see some spurious switching noise pulses appearing in my analog channel , in order to completely eliminate switching noise , i wish to do noise analysis like we do with case of opamps, similary i want to measure the switching noise on LTSpice and then apply correct combination of pi filters to eliminate them

below is the the schematic of IC i am using, i have just added a CLC pi filter at the output where L is a 10uH and C being combination of 1nF,100nF,47uF


texts:
For my undergrad EE capstone project I'm designing and building a 2m band analog amateur radio repeater. Our design goal is to build a solar-powered low power repeater (something like 5-20 watts) which can be carried in a backpack and easily deployed. The frequencies should ideally be software programmable.

One big problem we're going to need to overcome is the duplexer on the antenna. Traditional VHF repeaters use huge resonant cavity filters to get something like 70 dB of isolation, but for us this just isn't practical, both due to size and the manual tuning requirement.

What alternatives do we have? I know we could use a circulator and get about 20dB of isolation, but I don't know if that would be sufficient to protect the receiver. We're designing the receiver ourselves. Any suggestions are welcome.


texts:
Consider this double balanced mixer:

Its output contains only the frequencies generated by the product of those of LO and RF signals, where LO is supposed to be a large signal (which switches ON and OFF the diodes) and RF a small signal.

I read that the fact that it is double balanced is due to its symmetry. Precisely, LO frequency is not present at the output (IF) terminals since the the corresponding BALUN splits its voltage on a central node put to GND and so points A and B are virtually at ground at the LO frequency (since half of VLO drops on a diode and the other half on the other).

But I do not understand why at the output there is not the frequency of RF (I read it is also due to symmetry but it is not clear to me.

Reference: http://mwl.diet.uniroma1.it/people/pisa/RFELSYS/L07_MixerModDemod.pdf, page 6.


texts:
I am building an RS485/modbus controlled device for sensing AC current and switching on/off AC loads. The schematic is given below.
5V DC power for the device and RS485 bus connection are provided through a unique cable, which connects on header SL8.
Given that 5V DC supply is coming from an external source over a long cable (I expect the power/RS485 cable to possibly extend up to around 20meters or so), is it advisable to include additional voltage regulation within the circuit?
Thank you in advance
EDIT: Some more details:
The lowest voltage at which the circuit can operate is 4.3V DC.
The circuit draws a current of up to 180mA.
The supply source produces regulated 5V DC. As an alternative, I could install a separate power adapter and use a higher voltage source.
I am considering to use either Cat6 cable, or a cable such as this: https://www.indiamart.com/proddetail/rs485-2-pair-x-20awg-0-5-sqmm-modbus-armoured-cable-22715928773.html?pos=11&kwd=4+core+twisted+pair+cables&tags=B%7C%7C%7C%7C8211.605%7CPrice%7Cproduct


texts: Where is the Stack RAM and data RAM located in the block diagram of 8085 microprocessor ? I am unable to find it in block diagram .


texts:
I am working on a project to control AC load using TRIAC

In normal operation it working complete fine

But when a fan regulator specifically step type capacitor regulator is used in vicinty the TRIAC gets triggered and load connected to it which is CFL flikers

After testing I found following observation

  The problem only occurs with capacitor type regualtor and not with TRIAC type fan regulator

so my question is how could I reduce the noise (that as per my knowledge is electrically fast transient correct me if i am worng) from Fan regulator.

Please suggest a way to reduce this noise.

Thank you in advance.


texts:
simulate this circuit – Schematic created using CircuitLab

Hello all,

I am trying to make simple circuit that will basically pass a signal from a signal generator to another circuit that can be controlled depending on what the generator output is.  I am going to use this as a device keyer and want to confirm the relay behavior before I build it.  However I cannot get the LED to activate to confirm when the Relay is closed, or open for that matter.  I can hear the relay click so I know it's getting power at least but I am not experienced with relays so I am unsure what's am missing.  The relay I am using is a MT2, and I am using one position only.  The grounds are all the same on my breadbord, and V2 in the circuit is 12 volts, not 1 volt.  The control signal coming in is anywhere from 9 down to 3 volts.


texts: Current Transformer giving a reading when not clamped around a wire

texts:
A split core current transformers is currently clamped around a live wire. One end of the transformer's output wires are connected to the analog pin of an Arduino and the other end has a 2.5V bias created by tapping between two 470k ohm resistors connected across GND and +5V of the Arduino.

If the current transformer is removed and A0 is connected to the 2.5V point, Arduino gives a steady reading of 512 which is expected..

However when the current transformer is connected as described and A0 is connected to the other end of the current transformer (as described), Arduino readings of pin A0 will fluctuate around between 503 and 519 even when the clamped wire is unplugged or even when removed.

What is causing the current transformer to still give a reading?

Additionally, if we have 2-3 split core current transformers about 1-3 inches apart from each other, will the readings of each current transformers be affected?


texts: Using a usb-c laptop charger to charge a phone

texts:
I don't really know anything about electronics and I'm not sure if it's the right place to ask, but still.

Is it OK to charge my phone with my laptop's charger?

Here's info on the laptop charger:

And here's info on the phone charger:


texts: Handling stability of very small currents

texts:
I saw this circuit somewhere and am wondering how to find an equation for the current of Ic2 in terms of circuit parameters such as Vcc.

For this circuit lets say that Q1=Q2=Q3, and that IS5=10*IS6 just to make I1=10I2=10I3. Here is what I can say in terms of equations:

$$I_2=\frac{1}{R_2}V_T\ln(\frac{I_1}{I_2})$$
But since
$$\frac{I_1}{I_2}=\frac{I_5}{I_6}=10$$
I get
$$I_2=\frac{1}{1k \Omega}25mV.\ln(10)=57uA $$

However, things get complicated if I'd have considered Q5=Q6, because that would have implied that I1=I2 and the first equation would give out zero amps, but that is not the case since I1 is a few hundredths of a microamp different from I2. Anyway, now that Q5=Q6 I'm not sure how to find an equation for I2. I guess that would be proportional to log(Vcc) but how?

The other thing is that at relatively low currents, of the order of a few microamos, which is the case when Q5=Q6 and R1=R2=1kohms, the Early effect comes up and a few Volts change in Vcc would result in significant change in I2. That now I2 highly depends on Vcc through Early effect is not desirable and I would like to know if I could take care of Early effect so that it doesn't affect the circuit's operation point. My idea is that since Vec3 is slightly more positive than Vec2 the change in I2 or I3 due to Early effect would be compensated If I would have made Vec2=Vec3. But don't know how to implement the idea.


texts: Does Arduino use step down voltage regulators?

texts:
I am designing my first "permanent" Arduino application, and I would like to know if the voltage regulator is linear or step down.
The reason I would like to know is because I am currently powering the prototype with an 11.1volt 1300mAh LiPo battery.  If it uses a linear regulator the efficiency would be, best case, 30% and 46% for the 3.3v and 5v regulators respectively.
I would much rather add my own step down converter to drop the voltage to 5v and power via USB port if that would be much more efficient.
I'm not sure if the different Arduino models have different parts or not, but for this application I am using an Arduino Leonardo.
Here is the schematic of the Leonardo


texts: Detecting touch using electrical noise on microcontroller pin

texts:
I have recently been experimenting with detecting touch on a microcontroller digital input pin using the following method:

Put pin in output mode
Drive the pin high
Put the pin in input mode
Time how long it takes for the pin to switch state from electrical noise.
Filter the value and look for large increases or decreases in time (presumably this is when the user touches the pin).

In brief testing, this time taken for the pin's state to change is several thousand times shorter when a person is touching the pin. With a small demo application toggling an LED, in a relatively low-noise, residential environment it works reliably.

So now I am attempting to understand what the system is, and how it works. I believe the system is:

When the human touches the pin, they act as an antenna, increasing the electrical noise going into the pin, and decreasing the time it takes for the parasitic capacitor to change state.

I also believe the voltage on the pin will follow brownian motion, and meander from one state to the other (this is because the capacitor is integrating the white electrical noise). However, without an oscilloscope I have been unable to actually see what the pin voltage is doing.

My Questions Are:

Is my understanding of the system correct?
What are the disadvantages and limitations of the system?

Some Limitations I can see:

Susceptible to spikes in environmental noise (eg turning a microwave on).
Static electricity from touching the pin may cause damage to microcontroller (Possibly ground the hand relative to the circuit via enclosure?)


texts: Arduino - Cannot get ECG readings from heart, but I do when I poke at the leads

texts:
I have a minor issue with my ECG.  When I poke at the leads, I get a reading.  But when I hold the leads or place it near my heart, I don't get anything.  I'm pretty sure this is hardware related, but I don't want to completely rule out a potential software problem.  I used this YouTube video as a guide: https://www.youtube.com/watch?v=NDjRg-KgIXY, with their circuit show below.

My breadboard almost looks exactly the same as that, but with a couple of changes.  Instead of connecting the ECG to the computer via a audio cable, I used Bluetooth to transfer it to my phone.  Here is my schematic diagram.

Here is my breadboard diagram.

In my breadboard, I used three LM358 op-amps.  Here is my Arduino code (if you need it):

const int  signal = 7;    // Pin connected to the filtered signal from the circuit
unsigned long currentBeatTime;
unsigned long previousBeatTime;

unsigned long frequency;

// Internal variables
unsigned long period = 0;
int input = 0;
int lastinput = 0;

void setup() {
pinMode(signal, INPUT);
Serial.begin(9600);

previousBeatTime = millis();
}

void loop() {
delay(100);
input = digitalRead(signal);

if ((input != lastinput) && (input == HIGH)) {
    // If the pin state has just changed from low to high (edge detector)
    currentBeatTime = millis();

    period = currentBeatTime - previousBeatTime; // Compute the time between the previous beat and the one that has just been detected
    previousBeatTime = currentBeatTime; // Define the new time reference for the next period computing
}

lastinput = input; // Save the current pin state for comparison at the next loop iteration

// Detect if there is no beat after more than 2 seconds
if ( (millis() - previousBeatTime) > 2000 )
{
    //Serial.println("dead");
}
else
{
    if (period <= 0)
    {
        frequency = 0;
    }
    else
    {
        frequency = 60000/period; // Compute the heart rate in beats per minute (bpm) with the period in milliseconds
    }

    Serial.println(frequency);
}
}

Any help regarding this issue is highly appreciated.  Thank you!


texts: Optocoupler circuit accept input between 3-50 volt

texts:
How can an optocoupler be used in order to accept a voltage range for example between 3-50 volt to a digital input pin of 3 volt like on the Raspberry?

What would a typical circuit look like in order to drive the optocoupler? Would a simple voltage divider be good enough or is there other more robust ways?


texts: Controlled Temperature Coefficient of chip resistor

texts:
I am designing and experimenting with current source circuit using Op amp and transistor.

As output current increases, the temperature rises which then makes the output current value to change for about 0.5~1%

I am wondering if I can use resistor voltage divider with two different temperature coefficient to offset the temperature drift.

The temperature coefficient in datasheets are given as +/- 25 ppm, 50ppm, 100ppm, etc..

I think above means the given ppm value is maximum temperature drift, rather than the exact temperature drift which I can use to design my circuit?

Is there resistor maker or type which I can rely on their temperature characteristics to offset the temperature issue?

The circuit is for controlling the output current from 4mA to 20mA.

When driving 20mA, as the circuit heats up, the output current decreases.

Chaning R5 with 10ppm resistor helps, but i need more improvement.

I am trying to Use different temperature coefficient for R1 and R2 to counteract this phenomenon.

If there is another way, that would be great too.


texts: Some question regarding pwm of PIC microcontroller

texts:
Hello guys i have some question regarding PWM.

What does it mean by pwm master-slave?? Why it is called master-slave??


texts:
I am trying to optimize the power usage of a custom application (C#) running on an embedded computer (Intel i7, Windows 7). To do so, I am measuring the current that the system requires while running the application.

This current fluctuates; every second I get a different reading using a regular multimeter (Fluke 175). This makes me wonder about the accuracy of the reading.

1) If I would calculate the average of these readings, would this be a good indication of the power usage? Or would I miss high frequency peaks / dips in the current?

2) Could this be solved by taking multiple measurements per second using some sort of current sensor with a microcontroller and averaging the values?

3) If so, what would be a good rate to take measurements at; 10Hz? 1000Hz?

4) Could adding an RC-filter between the current sensor and the ADC of the microcontroller help in some way?

This is my first question on StackExchange, please let me know if I'm making any mistakes.

Edit:
The goal is to get a realistic power consumption estimation so we can improve and predict battery life.


texts: Why the euclid distance between the plates of the capacitor has been doubled to find out the capacitance?

texts:
I may have been asking of an easy problem.
The problem requires to find out the capacitance.
The ideal capacitor with area of \$S\$  exists and the euclid distance between the plates is \$d\$.
The dielectric with permittivity of \$\epsilon\$ has been filled in the half right side of the space between the plates and the remaining half left side has been filled by vacuum(of course the permittivity of it is \$\epsilon_0\$).
The textbook solution says that the capacitor of the problem is equivalent to the connected 2 capacitors in parallel.
One of the plates of the parallel capacitors has been filled with the dielectric and the other has been filled with vacuum.
\$C_0:=\frac{\epsilon_0 S}{2d}\$(capacitance of the capacitor with vacuum of parallel)
\$C_1:=\frac{\epsilon S}{2d}\$(capacitance of the capacitor of the dielectric of parallel)
And my doubt has came from here.
Why the each denominator has \$2\$?
I thought that the each denominator must be \$d\$.
And the capacitance of the answer \$C\$ is given by \$C=C_0+C_1\$.
Can anyone tell me the hints so that I can resolve the doubt on my own.
\$\$


texts:
Understanding the overall function and various sections in this simple timing circuit are clear to me, however it's apparent I have holes in my foundation of branch behavior with some components. I'm someone who visualizes what's happening to get a clear idea. I'd like to see the current flow and voltage drops before applying hard calculations. Since RC circuits change over time I'm trying to see what the voltage and current are over R1, R2 and C1 at start up, around half of cap charge and final steady state. The R2 and cap interaction is where I'm unclear.

When the switch is closed I assume R1 has the full 12v immediately with cap at 0v to ground. R2 has minimal to no voltage so Q is off. When cap is charging- this is what I need to understand- Does R2 have a voltage drop directly tied to cap voltage over time -Vbe? Does R2 and the cap form a type of equivalent voltage divider with R1 that can make the picture more clear? And finally in steady state, cap is at 12v with R2 and R1 in series powering Q. Kindly help give me clearer picture over time so I can plug in equations properly.

Edit: Cap steady state is a product of voltage divider.

Cheers.


texts:
I'm trying to simulate two scenarios in LTspice. One is when things are ok. The second is when a short happens.
As you can imagine I'm a beginner with LTspice. At first I was just putting a resistor at the output of my circuit to simulate my load. And when I wanted to simulate the short, I put the resitor at 1 mohm.
But I'd like to "automate" this. A short that happens after the sim has been running for some time.
I tried this. But I don't have a perfect zero when shorted.

But I've seen another solution:

When I do this I get the error : Can't find the definition model "SW".
EDIT: Thanks to Winny and his link I was able to correctly set up my short. You can also find more about switches in a post here


texts: how to calculate maximum allowable current density for a PCB trace?

texts: How to calculate maximum current density(J) for a copper pcb trace.


texts: How to erase a bitstream from an FFPGA using a microcontroller?

texts:
How can I erase the bitstream that is stored in flash memory from an FFPGA (Flash FPGA, e.g. MAX10) using a microcontroller or any other logic?

I analyzed MAX10 documentation and still didn't find any easy (and fully documented) solution.

It seems like I could use the Altera On-Chip Flash IP Core, but it requires to power up the FPGA, load the bitstream, and then eventually erase the proper CFM memory. Maybe I could use JTAG In-System Programming and somehow invoke ISC_ERASE command? Is there any other way that requires less power?


texts: PIC 16F877A toggle half of the leds when button is pressed

texts:
In this simple circuit, there is a button connected to the A0 pin.

I'd like to toggle half of the LED's when button is pressed.
#include <pic.h>

#ifndef _XTAL_FREQ
// Clock frequency is 16 Mhz
#define _XTAL_FREQ 16000000
#endif

__CONFIG (FOSC_HS & WDTE_OFF & LVP_OFF & CPD_OFF & CP_OFF);

int main()
{
    static char flashingLeds = 0xFF;

    ADCON1 = 0x06;        // RA0 digital input
    TRISAbits.TRISA0 = 1; // RA0 input

    TRISB = 0;    // PORTB is output
    PORTB = 0;    // Make all pins on PORTB low

    while(1)
    {
        // If button is pressed reverse LED's
        if (PORTAbits.RA0 == 1)
        {
            __delay_ms(250);
            flashingLeds = ~flashingLeds;
        }
        PORTB = flashingLeds;
    }
}

When button is pressed the program toggles all of the LED's on and off.
On the other hand I want to toggle only half of the lights. When I change flashingLeds variable to 0x0F it doesn't work as it should.
static char flashingLeds = 0x0F;

When I change the variable to 0x0F and when the button is pressed, I expect half of the LED's should be on. In binary notation as follows :

b 0000 1111

After some time I pressed the button again LED's should switch to this state.

b 1111 0000

Any ideas? Thanks.
Update: After making the recommend changes the code became like this. Just for testing purposes, I gave different values to flashingLEDS variable. Like 0xF0, 0xAA, 0x0F etc.
#include <pic.h>

#ifndef _XTAL_FREQ
// Clock frequency is 16 Mhz
#define _XTAL_FREQ 16000000
#endif

__CONFIG (FOSC_HS & WDTE_OFF & LVP_OFF & CPD_OFF & CP_OFF);

int main()
{
    static char flashingLeds = 0xAA;

    ADCON1 = 0x06;        // RA0 digital input
    TRISAbits.TRISA0 = 1; // RA0 input

    TRISB = 0;    // PORTB is output
    PORTB = 0;    // Make all pins on PORTB low

    while(1)
    {
        // If button is pressed reverse LED's
        if (PORTAbits.RA0 == 1)
        {
            __delay_ms(250);
            flashingLeds = ~flashingLeds;
        }
        PORTB ^= flashingLeds;
    }
}


texts: When should an audio pre-amp use a differential input

texts:
As a guitarist, very familiar with the various types of noise that can wreak havoc with electric guitars, I've been mystified at how infrequently guitar amplifier inputs have employed differential stages. Of course low impedance microphone inputs have done so for a long time, specifically to reject as much common mode noise as possible, especially given the typical use of long cables. Now I understand that most magnetic pickups used in guitars have comparatively higher outputs then microphones. But these guitar pickups generally perform best when connected to high impedance inputs, which always works against noise immunity, and their amplifiers need to cover a very wide dynamic range. Of course many guitars employ dual coil "humbucking" pickups, which help null out both electric and magnetic field induced noise. But all such approaches change the sound, and many players favor the tonal quality of simple single coil pickups.

So my question here is simply whether the failure to transition to balanced differential inputs for guitars is due to some disadvantage I'm not taking into account, or if its simply a matter of how difficult it is to change the "status quo" with anything related to audio and psycho-acoustics. I've made many home brewed amplifiers over time, and have re-wired enough guitars to consider all kinds of experimental changes. And of course a differnial input can still function with an old fashioned single conductor coax cable. But I'd still like to hear from others on this. If differential inputs have drawbacks I'm not considering, it wouldn't be the first time I thought I had a better way to do things, and was later proven dead wrong.


texts: Emulate impedance response using RLC components

texts:
I need to emulate measured impedance response of some blackbox using only RLC components. Measurements:
[Hz]    [Ohms]
--------------
20      14.5
40      15
70      15.5
100     15.75
200     16
300     16
400     16.75
500     17
700     18.5
1000    20
2000    26
3000    31
4000    35
5000    39
6000    42.5
8000    50
10000   57
20000   85

The closest I found is circuitry like this:

But it has major error around 2kHz (5 ohms of mismatch):

Blue plot is impedance response I want to model.
Red plot is impedance response of cuircuitry I found.
Previously I thought it is quite easy task, but unfortunately it found to be quite challenging for me as I do not have much experience with modeling impedance responses. Do you have any idea how to make the circuitry more accurate to measurements I have?
BTW. Impedance I want to emulate is impedance response of simplified closed speaker cabinet. It is simplified, becasue currently I ignored bass resonant peak (I already perfectly modelled it). The only problem I have is shape of this treble cuircut.
EDIT: I tweaked as suggested with resonance above 20kHz, but adding additional capacitor on L1. Still cannot cover the knee:

I tweaked with various cobination of values of resonance components values, but still it does not fit in any configuration.


texts:
I'd like to build a set of miniature two-way (half-duplex) radios that operate on the FRS band. It seems that transceivers for this band would be widely available. However I've not been able to find any. Ideally they would be controlled digitally (I'm thinking to use a PIC controller) and have analog inputs and outputs for earbuds and a microphone. Where can I find a transceiver?

I was planning to use this transceiver from Sparkfun but it doesn't look like there will be an easy way to get an analog output and input.

I'd actually not mind building a basic transceiver from scratch but I can't find a good tutorial or set of schematics.


texts: Working of a Doubly-Fed Induction generator (DFIG) in wind turbines

texts: I am unable to understand how a Doubly-Fed Induction generator works (in Wind Energy conversion system)? I do not understand how the reactive power fed into the stator interacts with the rotor so as to produce active power in the stator. It would be helpful if somebody is able to explain the phenomenon with the help of a phasor diagram showing the voltage, current and the field directions.


texts: What is the difference between an injected and regular STM32 ADC channel?

texts: The STM32F1's reference manual describes "regular" and "injected" ADC channels but is not clear on the difference. What is the difference between the two types and when might you use one or the other?


texts: Help understanding high \$V_F\$ ratings of Schottky diodes

texts:
My reason for wanting to pick a Schottky diode is being lead to believe they have lower \$V_F\$ than conventional silicon or germanium ones. So I was a little taken back to look at offerings at Mouser and digi-key. Even for fairly low forward current ratings (100mA would more than suffice), the \$V_F\$ values are really no better than silicon. In fact much worse. Am I just "looking for love in all the wrong places" here?

I'm thinking now I'm missing some key parameters in my search. I may pull my post until I've been a little more thorough. Thanks though!

Here's a typical part whose forward voltage drop of 1V seems ridiculous: BAT41 datasheet


texts: P-Channel MOSFET has a really high voltage drop

texts:
I just got a new P-Channel MOSFET FQP47P06.  In the datasheet it says it has an RDSon of 26 milliohms, Vgs(th) of -4V, and a max current of 47A, but when I hooked it up in a simple test circuit like this:

It generated a voltage drop of 0.6V and was getting quite warm, I can't understand why it's generating such a high voltage drop when it apparently has an RDSon of 26 milliohms.  Is there something I am missing?
I also tried recreating the circuit with an IRLZ44N on the low side and removing Q1, the IRLZ44N had a voltage drop of around 0.07V. In the original circuit with the P-Channel MOSFET, I also increased the current flowing through Q1, and at 2A it generated a voltage drop of about 1.9V using a 60W car lamp.
Edit: I managed to measure the resistance with my multimeter and I was able to measure about 0.8 ohms constant, I was also increasing the gate voltage to above -10 volts and the resistance stayed the same.
Could it be a fake?
Could it be a fake MOSFET or is it simply that I am doing something wrong?


texts: Capacitors have me crazy. I can't comprehend them even after lots of research. I know that capacitors deal with resistance, voltage, current and capacitance (ohms, volts, amps and farad) but I cant connect them. I am making a plane and want to use a capacitor as battery. The motor uses 3.7V at 100mAh. I have a 6.3V 1F capacitor. And 39ohms resistor and I can't make the motor run for more than 0.5 seconds. If anyone could explain me and help me I would be so grateful. Thanks


texts: How to account for the low voltage when designing a Step Down Switching Regulator

texts:
Datasheet: http://www.ti.com/lit/ds/slvs569f/slvs569f.pdf

Design procedure:

**Essentially my question is say I have an input voltage that can range from 7-15V. When designing this converter (must use this converter), so I only do calculations based upon the maximum input voltage. Say the output voltage was 2 V

If it is 7 V input wouldn't a new inductor value have to be chosen as it would have a different value? Or do we just have to use the value chosen for the maximum input voltage? I.e. the lower the input voltage wouldn't the higher the inductor value L1 have to be from the equation in the second table?**

Thus how do you account for this voltage range? Do I just use the max input voltage only for calculations?

Is this just a tradeoff that has to happen or do I calculate for both ranges and see what the current ripple is? Also for the capacitor, different input voltages will cause the capacitance value to change as seen in the Cout equation.
Hence to I do a design for both and see what the ripples are for each component value and say possibly the 7V input voltage value found for L1 is better than than the 15 V?


texts: How to shift-up logic signal from 3V3 to 5V for NeoPixel

texts:
I'm working with NeoPixel led strip and a microcrontroller which run at 3.3V.
As you can read in the NeoPixel documentation using a micro with 3.3V out on pin require the DATA signal to be shifted up from 3.3V to 5V to avoid unexpected behaviour. On the Adafruit page they suggest to use a 74AHCT125 converter IC.

Is it possible to achieve same result avoiding IC? (eg. with mosfet or similar).

NeoPixel data protocol is very strict about timing (800 KHz signal), so I think solution needs fast ON/OFF switching time.


texts: This automated light system is slowing down randomly

texts:
A PIR sensor sends input to the AVR (ATmega 32A), when input is received and the ADC (LDR) is below a critical value, PB0 is to go high to switch on a relay. A timer counts seconds so that the relay can be turned off after 3 minutes of no PIR signal.

It works, but sometimes it takes a long time to respond, and at random times it is instantaneous. What should I do?

EDIT: I have left the AVCC and AREF pins not connected. Is that a problem?

Code:

# include <avr/io.h>
# define START 1
# define STOP 0
# define RESET 3
# define TRUE 1
# define FALSE 0
uint8_t seconds=0;

void stopwatch(void)
{
    seconds=0;
    TCNT1=0;
    TCCR1B |= 1<<CS10|1<<CS11;//timer counter control register started with prescale 64

}
void InitADC()
{
ADMUX=(1<<REFS0);                         // For Aref=AVcc;
ADCSRA=(1<<ADEN)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0); //Rrescalar div factor =128
}

uint16_t ReadADC(uint8_t ch)
{
   //Select ADC Channel ch must be 0-7
   ch=ch&0b00000111;
   ADMUX|=ch;

   //Start Single conversion
   ADCSRA|=(1<<ADSC);

   //Wait for conversion to complete
   while(!(ADCSRA & (1<<ADIF)));

   //Clear ADIF by writing one to it
   //Note you may be wondering why we have write one to clear it
   //This is standard way of clearing bits in io as said in datasheets.
   //The code writes '1' but it result in setting bit to '0' !!!

   ADCSRA|=(1<<ADIF);

   return(ADC);
}

int main(void)
{   uint16_t adc_result;
    InitADC();
    DDRB=0b00000101;
    PORTB=0b00000000;
    char lightoff=TRUE;
    //stopwatch();
    while (1)
    {
    //adc_result=ReadADC(1);

        //*****clock work***********
            if(TCNT1>15625)
            {
                TCNT1=0;
                seconds++;
            }

        //********************

        if(bit_is_set(PINB,1) && lightoff && ReadADC(1)<700)
        {
            PORTB|=_BV(0);
            lightoff=FALSE;
            stopwatch();
        }

        if(bit_is_set(PINB,1)&& !lightoff)
        {
            stopwatch();
        }

        if(seconds>180 && !lightoff){
            PORTB&=~_BV(0);
            lightoff=TRUE;
            TCCR1B = 0; // stop clock
            seconds=0;
        }

    }

}

EDIT:

The slowing down is not as random as I initially thought. It only responds late if it has been running for a long time without pin B1 getting high from PIR. It is fast if it has been triggered in the last 30 mins at least.


texts:
I'm trying to build an UPS for a device that needs 5V and 3A.
But I'm not sure if this block diagram (using 3 3.7v 18650 cells) is safe and would work. Can anyone give me some feedback?
I hope my writing is clear enough.


texts:
I am working on our company’s custom stm32f429 board which is fairly complicated with multiple peripherals. Till today morning the board worked fine with no issues. Once i shifted the board from the test bench to inside the robot (connected to a battery). It stopped responding well to openocd and gdb commands. I have debugged all possible electronic issues and no new parts have been added to the board recently (just to rule out the possibility of interference). Other boards working off the same power rail do not exhibit such issues. I replaced the chip twice to no avail. ST-link utility works fine as well.
Following is the output of openocd telnet session:

command: reset halt
    “target state: halted
    target halted due to debug-request, current mode: Thread
    xPSR: 0x01000000 pc: 0x1fff5162 msp: 0x20002d40
    ”

As you can see the program counter does not reset to its intended location i.e. “0x08000200” and the msp points to the wrong address as well: 0x20002d40 instead of 0x20003000.

Following is the output of “flash write_image erase ”

flash write_image erase /home/talha/Seven_LLS_experimental/build/F429/src/stm32_uavcan/stm32_uavcan.hex
auto erase enabled
Padding image section 0 with 12 bytes
Padding image section 1 with 4 bytes
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20002d40
wrote 262144 bytes from file /home/talha/Seven_LLS_experimental/build/F429/src/stm32_uavcan/stm32_uavcan.hex in 7.289705s (35.118 KiB/s)

The program counter and msp point to the wrong address again. I have checked if there is any issue with the linker script or my code but the code runs flawlessly on the eval board.

I want to know if someone here has experienced a similar issue before? I strongly believe that this is a HW issue and i’ll have to perhaps solder a new board cry, but before i put in the effort i just want to ensure that there isnt anything else that i could try


texts: High current/high voltage/high frequency measurement

texts:
I have a circuit that I'm having trouble understanding.  It measures the current flowing through a conductor.  The measured load is 20-100 Amps, 9kHz-34kHz, and approx. 340 volts.  The main conductor passes through a toroid that has a 10 turn winding (winding #1).  The two ends of the winding extend away from the toroid.  One end of the winding loops through another toroid that has a 100 turn winding (winding #2).  The two ends of winding #1 are then spliced together.
Winding #2 has both ends terminated across a 100 ohm resistor.  The voltage across the resistor varies from 0 to 6.6v p-p, dependent on the current of the the measured load.
The question I have is that it seems like the voltage would be MUCH higher. Winding #1 should produce 3400 volts, then winding #2 should produce 340000 volts?  I know I'm missing something very fundamental.  Could someone help me to understand this?


texts: Output current sourced/sunk by comparator

texts:
I am using the LM139 comparator chip. Now, I understand that the output of the comparators,or for that matter op amps are open drain/collector. SO they can only sink current and not source it per se.

I had a glimps of the data sheet which says Iout = 20mAmps. Is it the max current that it can sink ?

The datasheet screen shot is -.

Also, in the LT1716, the output pin is stated as - "The output stage of the LT1716 can drive loads connected
to a supply more positive than the device, the same as
comparators with open collector output stages.".

Does this mean it (output load) has to be connected to a different voltage rail. Suppose I connect the comp to 44V (Vcc), then effectively the Load should be connected to a voltage rail > 44V.

Are my assumptions right ?


texts: Why doesn't this schmitt PWM circuit work as expected?

texts:
I've designed and built an adjustable PWM generator using schmitt trigger inverters. However, it doesn't seem to be working.

Here is the circuit:

The capacitors at the bottom are intended to be switched in and out, to vary the frequency of the oscillation. The potentiometer is for adjusting the duty cycle.

Initially, I designed the circuit without the resistive divider on the input of the first inverter, but discovered that the frequency of the oscillator varied as I adjusted the potentiometer. Looking at the datasheet for the inverter chip (HD74LS14) I discovered it was asymmetrical, with thresholds of 0.7v and 1.6v. Adding the resistive divider lowered the input level to more evenly distribute the input across the threshold region.

It works perfectly in this simulator here. In reality, however, it's not working.

I get no illumination from the LED at one extreme of the potentiometer, and full-on at the other extreme. That would of course be normal, except that there is no gradual fading as you adjust the pot. It stays full-on for some of the turn, then gives a flashing output (when the 100uF capacitor is used) for a couple of degrees of turn, then goes off for the remainder of the turn.

Can someone explain what is happening please? I'm completely stumped.


texts: Is it possible to suppress oscillation at reactive load (non inverting amp)

texts:
I am using a non inverting amp with B class voltage follower to drive a piezoelectric transducer (used as sonar for fish scanning in boats). I am using trains of 20 sinewave pulses (85KHz), like the ones you can see in the blue image (input).

However, at the output I am getting the green signal, which have undesired residual oscillations with the same frequency. The problem with this, is that the receiver circuit amplify the full incoming wave with a large gain - and there is no way to difference the 20 pulses from the "blank" space. This jamming effect is screwing up the data transmission.

The circuit I build in PCB is this:

I have discovered in simulation that if I decrease the value of the decoupling capacitor, in theory the oscillation tale dissapears. I will try this in the real circuit, but I would like to know which is the correct way to deal with this.

BTW, these parasitic oscillation just happens when the transducer is plugged in the circuit. I am pretty sure isnt related to the operational amplifier.


texts:
I am currently investing the topic: Wireless Sensor Network. Specifically, I need to show the calculation of how much power received against distance between the transmitter and receiver in WSN. However, I don't have any background to it. I am only asking help to get me started on this topic.

So, what is the basic formula of power transfer between transceivers?


texts: What type of thermal paste for cooling a stepper motor?

texts:
My little Nema 11 stepper becomes hot when I use it to hold a position. This is quite normal since it use 1.3 A of current.
My plan is to use the big aluminium supporting bracket as an heat-sink too. In this way I will avoid a bulky envelope box (this stuff has to be mounted on a motorcycle).
I'm thinking to apply a layer of thermal past between the motor and the surface of the bracket before fixing it by using some screws.
After googling, I discovered that there is no agreement about which pastes are electrical conductive and which are not. I got confused...
What is paste composition more suitable for my application? Somebody has some practical experience about that?


texts: Where to find an 0805 SMD LED in Altium?

texts:
I'm trying to learn to use Altium and am having a really difficult time finding components. I discovered capacitors and resistors in Vault Explorer->Unified Components->Components - Generic, but how do I find other basic elements such as LEDs?

I tried searching the vault for LED, but there are thousands of search results and I can't figure out a way to specify a package type (I'm wanting 0805).

EDIT:

I assume it's a good idea to try to avoid making new components in Altium (i.e. re-inventing the wheel) because it takes a long time.

To my knowledge, making a new component in Altium requires these steps (at a minimum):

Creating a new schematic and PCB library or adding existing ones to the project
Finding the IPC footprint standards document
Create the footprint (add the pads, draw the outlines, etc.)
Create the 3D model
Attach 3D model to footprint
Create the schematic symbol
Add footprint to schematic symbol
Add 3D model to schematic symbol
Edit pins to match between schematic symbol and PCB footprint
Fill in all of the other information for the component

For me, at least, all of this takes a really long time!


texts:
I'd like to use my ATX PSU to power a DC motor Turnigy L2205_1350 motor
Voltage: 7.2v~11.1v (2s~3s)
Max Power: 100w
Max Current: 13.5A
No load Current: 0.3A

Can I connect to 12V+ on the PSU?  I noticed Max AMPS of the 12V is below 13.5 motor's max current.

Would if be better to connect the motor to the PSU's 3.3V and 5V connectors?

Motor: http://www.hobbyking.com/hobbyking/store/__14739__Turnigy_L2205_1350_Brushless_Motor_100w_.html


texts: What is the usage of 3rd lead in mobile batteries

texts:
Possible Duplicate:
  Why we have 3 pins on some batteries?

I'm trying to build (DIY) open charger for mobile battery. I would like to know what is the usage the middle one?

Is there anyway I could check the status of battery (i.e., charged to max)?


texts: What does this microcontroller notation mean?

texts: Referring to this schematic, what do the little white circles with red lines mean in the pin out diagram?


texts:
EDITED to update diode spec and schematic...

I have two failed outside security lights each with PIR circuit with relay to switch 240V AC mains voltage to another circuit which looks to be a simple AC/DC converter which then feeds a matrix of 60 LEDs wired in series.

Looking at the (very) simple circuit board, the AC/DC converter looks like the image below...

Apologies, the image isn't great. List of components...

L1 4.0 is all it says on the side. Just a radial inductor.
R1 510K (1/4W by the look of it)
C1 0.68uF metallized film

U1 4x 1N4007 diodes arranged as a bridge rectifier

C2 4.7uF 400V axial electrolytic
R2 15R (also possibly 1/4W)

R3 UNKNOWN

OK, so R3 is unknown as it has been fried and the outer resin coating along with colour coded bands has turned to dust (the PCB also has a nice blackened look to it). Interestingly though, the resistor is still mostly intact and my meter reads it as 54K but I don't know if that was its original value or if it has degraded due to partial burn-out.

So, what's my question? I've wired the input directly to the mains and left the LED matrix in place. I measure 239V AC input (close enough) but I'm seeing 292V DC on the output. How is that possible?

The LEDs don't light up but I've since worked out that's because one of the LEDs has blown (all others test OK).

I'm assuming that R3 is under-rated and should be at least 1W if not 2W but even at that rating, what should its value be based on the general design (54K?, something else).

I've dealt with this sort of circuit before but normally with input fed from the secondary of a 12V transformer (for example) and output going to a voltage regulator to create a regulated PSU. I've never dealt with a straight 240V AC-DC converter before.


texts: What does the CLF number of CoAx Cable mean?

texts:
Specifically, I want to connect a 900MHz antenna using (~.5m) a cable - does the CLF number of the CoAx that I use matter?

What should it be? (Or how would I calculate it?)

What does CLF even stand for?


texts: Out of curiosity, the MAX2769 EV Kit uses a 16.368 MHz Rakon TCXO. What would happen if a 16.369 MHz oscillator were used? I realize it would shift the IF, but it would still be functional, wouldn't it?


texts: Why does a pole at high frequencies attenuates noise?

texts:
I am trying to understand the concept of realizability for an improper transfer function, and I am struggling to understand some concepts. I know that if I have an improper transfer function, for example:

\$P(s)=s+1\$

I can make an approximation to make it realizable by adding a pole at high frequnecies using a low pass fiter of the type:

\$\frac{1}{1+\tau s}\$

and so the transfer function:

\$P(s)=\frac{s+1}{1+\tau s}\$

is realizable. What I don't undesrstand, is that I have seen that if I do this, at high frequencies I obtain noise attenuation, for example look at this video :
video.

But, if I plot the Bode plot of this transfer function I see that it behaves as a lead compensator, which could have the problem of amplifying noise at high frequencies. Here is my Bode plot:

s = tf('s');
P = s+1;
filter = 1/(1+0.001*s);
P_approx = P*filter;
bode(P_approx),grid;

which is exacly the plot of a lead compensator.

So, suppose I am considering a control scheme with a feedforward term

Can somebody please explain me why does a pole at high frequencies attenuates noise?


texts:
I am implementing external code execution for STM32F765VG with NOR flash (8/16 bit). The idea is to execute code from external flash memory. are there any ways to protect my code present in external memory from unauthorized access?

I have understood about following two methods presently. But, i am not sure whether i am thinking in right direction. Also, please guide me in right direction.

Method 1:
Encrypt whole code Hex file blockwise, before flashing to external memory. Load the blocks with normal read to the internal RAM, decrypt in the internal RAM and execute it from RAM. By this method, there will be no possibility for external parties to understand the code content of external flash memory.

Method2:
Recompile the software for every MCU and flash combination based on the unique hardware ID of flash memory and MCU ID. This way, even if the code is copied by third party, it will not execute as the IDs of new MCU will not match with the ID assumed in the code.

Please suggest if there are standard practices. Thank you  in advance!


texts: What is the purpose of the emitter resistor in this OR gate?

texts:
I am building the following OR gate:

What is the purpose of the 4.7k ohm resistor at the bottom?  Will the circuit work without it?


texts: Reducing voltage/current of AC circuit with makeshift bi-polar capacitor

texts:
WARNING! To others reading this question: This circuit uses high voltage. DO NOT mess with 220V/110V unless you know what you're doing and know the risks (electrocution and death, mainly)

Now that that's out of way...

Hello everyone, I'll try to be as brief as possible: I have a heating element taken from a 220V hot plate and connected like so:

Components:
Vs: 220V (RMS) 50Hz sine AC (from wall outlet)
U1: Bog standard DIAC-TRIC dimmer
R1: The heating element, 100 Ohms in room temperature (assumed more when hot)
R2: A very small incandescent light bulb, also taken from the hot plate, I assume its current is negligible

I need to slightly reduce the current of the heating element. I thought about a non polarized 100V 100uF capacitor but I don't have one. I do have 50V 1000uF polarized capacitors, so, my first question: If identical capacitors in series have their max allowable voltages added up but their capacity divided by the number of capacitors, AND, if 2 identical polarized capacitors connected in series with reverse polarity make a non polarized capacitor with half the capacity (reference), then, will connecting eight 50V 1000uF polarized capacitors back to back create the equivalent of a single 200V 125uF bi-polar capacitor?

The new schematic:

New components:
C1 - C8: Radial aluminum electrolytic polarized 50V 1000uF capacitors

So if my calculations are correct, when the dimmer is at full and the element is at room temperature, the capacitors will measure 63V at peak amplitude and will reduce the RMS current by 447mA (2.2A without the capacitors, 1.753A with them).

Second question: Is everything I wrote correct? Or did I accidentally build the equivalent of a hydrogen bomb that will destroy my house, neighborhood, and everyone I've ever known and loved??


texts:
I was pondering the analytic effect of Q on the voltage gain for quarter wavelength helical resonators (Tesla Coil Secondary). One of the reasons a great looking secondary can perform poorly is due to a low Q, typically caused by winding on a material that is lossy at RF frequencies. From an analytical point, does an identical set up containing a resonator with a Q, vs 2Q have a specific expected voltage gain difference?
Question:
If I have a resonant system, How does Q affect peak resonant voltage, i.e. does a doubling of Q result in double the power being stored in the system? Or my interest is specifically voltage, so
Is this correct? \$ 2Q \space\approx \space \sqrt{2}*V_{pk} \space\$
My Logic:
I have seen Q generically described below:
\$Q\colon= 2{\pi}f_r \times \frac{E_{stored}}{P_{Loss}}\$
Given the above info, assuming \$P_{Loss}\$ is constant in a given system due to consistent \$R_{DC}\$.
Then \$E_{stored}\$ Must double, given a steady state system, this effectively doubles the Power consumed, so \$ 2 \times Power => \sqrt{2} \space V\$ ?


texts:
I used one of these scales and after a few months the reading started drifting up: after hitting tare to get to zero, the reading would show 2 grams, then slowly go up to 10 g in one minute.

I thought the problem was in the electronic circuit so I took it apart, hooked the load cell to an amplifier and a microcontroller, and got the same results: after an initial calibration to a known weight of 200g, the reading increases from 200g to 269.7g in 30 minutes, removing the 200g weight brings the reading down to 89.7g, and adding the 200g weight again brings the reading to 348.8g.

A drift in the measurement has to come from a drift in the resistance of the load cell. This page mentions offset drift:

  I've been working with load cells for a long time now, and one of the problems that I have not yet been able to solve to my satisfaction is offset drift. Offset drift is the drift in output voltage over time even when the cell is under no load.

But I have had many commercial scales that show no similarly strong drift.

What could explain such a strong drift?

Update: I left running for 5 hours, where the only difference was that a soldered connection from the HX711 to the load cell broke and I replaced with an alligator cable. Instead of a strong drift, I now have a negative drift and then a positive one:


texts:
I'm about a to choose a chip to store a mp3 file (few mo) in it. But I don't really know how to well choose such a memory. Should I go for a flash memory? Eeprom? Nand? Nor?

What kind of parameters should I consider in my choice?

While consulting some distributor online shop, I figure out that SPI communication is widely use instead of I2C or UART. Is there a reason for that?

The memory will store only one file of few mo. The idea of the design is to load a part of the file in the MSP430 (the µC I'll use), process the data and then send it to a DAC. Since MP3 file have a sampling rate of 44100 Hz, I think the transfer speed has to be 4 or 5 time greater. I never use a memory or even audio conversion (from Digital or Analog) so I don't exactly know the require speed.


texts: Are the reflected and absorbed components of an antenna actually orthogonal?

texts:
I'm having a discrepancy between mathematics and my gut sense of reality.  (Application: trying to figure out how much reflection I'm going to see in my package.  I can tweak the CMOS, but I'm stuck with a package)  RF is not my strongest area.

An electromagnetic wave (RF), in a planar sense, has absorbed component and a reflected component.  These two components are orthogonal over the interval \$\left[0,2\pi\right]\$ and is represented by

\begin{align}
0 = \int_{0}^{2\pi}  cos(x)sin(x) dx,
\label{eqn:sincos}
\end{align}
where, the reflected component is real, represented by (cos(x)) and is the "inphase" component, I. The absorbed component is imaginary, represented by (sin(x)) and is the "quadrature" component, Q.  Mathematically, the absorption of the RF wave can be modulated by changing the imaginary component.

What this means is that mathematically, everything seems the I and Q components will be orthogonal, but I "feel" that this is not necessarily true.

The question:  Is the actual behavior as pretty as the mathematics?


texts:
Simple project: Swap the on-off switch on a coffee-maker with a relay.

The relay is rated to be safe for wall power. The coffee-pot can take it, obviously. But the old crimp-on connectors that the coffee-pot used to connect to its on-off switch are far to big for the relay.

Ideally, I'd want to attach these wires to the relay directly, without introducing any new components, or adding any gaps between the already-nicely-insulated wires and the relay. Wouldn't want to create any opportunity for mains power to short!

How would you adapt these connectors to fit tight together?


texts: LTSpice divergence between AC analysis and transient analysis for low frequency gain

texts:
A simulation is done in LTSpice (version 4.23k)

There is an inverter:

Fig.1: schematic

1mV small-signal input.

AC analysis is run. Low frequency gain (Vout/Vin) is 20.69 dB (10.82 times).

Transient analysis (for the same schematic) is run. The amplitude of the small-signal component of Vout is 47.89 mV. It means low frequency gain is 47.89.

Fig.2 Results of simulations

It means, for the DC gain, AC analysis produced 11x, while transient analysis produced 48x. Nearly five time difference!!!

1) Can you explain the divergence?

2) After this, can we rely on LTSpice AC analysis?

The link to the LTSpice files is in comments below.


texts: Relay model for controlling the Air Conditioner power supply

texts:
I am trying to control my Air conditioner via MQTT protocol. I just want to make the power on and off. How can I calculate the relay current rating for 1126 Watts of power?
Link to AC model: https://www.amazon.in/Voltas-1-2-Split-155-CY/dp/B00LWRDJEE

Also which is better for this application ( SSR/electromechanical relay).

Experts please, Help.


texts:
I need technology in which the IC will work at temperatures above 300 °C. For example, Fraunhofer makes chips at this temperature using Tungsten interconnect.
Do foundries like TSMC or Globalfoundries have similar technology for fabricating high-temperature chips?

I'm looking for a chip like this. Can it be made with conventional foundries such as TSMC or GF ...?
High temperature SOI CMOS technology and circuit realization for applications up to 300°C

I need technology like this:
High Temperature Electronics


texts:
In my case I need a relay to switch continous 0.5A at 24V DC, but in time of closing the contacts there will occour an inrush current from the further circuit of 6A, but only for max. 100ms because there is a contactor (DC) in line of the switch.

I dont know the exact amount of damage of the contacts in that case, because its only for milliseconds. Do I need a Relay with max. switching current rating of 5A or 8A rating?
Could there be a significant amount of damage in general?

I already checked the datasheets according to that, but the graphs are ending at the rated current.

I personally think I schould just take the overrated big one, but in my case a smaller component size would be better and it will be fully underrated wit 0.5A for the continous time

At a 5A type I would take the omron G6B-2214P-US or the Panasonic DSP2a-DC5V.
They are DPST relays, the second pole will be used for a signal.

Thanks for your help!


texts: Interfacing a phone's microphone to a MCU

texts:
I am doing some speech recognition, and my phone is my microphone. I have used it to collect data for PC and would like to do the same on my Tiva C launchpad. I planned on using an app,such as this one, to send data from a phone's microphone to an audio jack, in real time.

I am wondering how to connect the phone and the MCU. With a 3.5mm jack and an aux cable? Stripping the wires and plugging them in ADC input pins? (L or R ?)
Is it possible to get the same data on PC and MCU with the same speech signal?

EDIT: I should mention that the sound produced using this app is as good as the recorded one.

SOLVED. Look in the comments.


texts: Diode forward current with µV..mV forward bias

texts:
When running LTSpice simulations on forward biased diodes I get plots like the following:

This example is for a BAS116 and a 1N4001 - the current in the sub mV region is about 5 orders of magnitude different.

I am wondering if there is a reason for this huge difference in current given that the Silicon diodes should obey more or less the same principles in the "sub-threshold" region ?! Or is this only an inaccuracy in the models ?

I have read about the Shockley Diode equation which predicts an exponential dependence. In Spice the V-I dependence is linear below about a few 10s of mV. Is this accurate ?

I am interested in this regime of operation as I want to use antiparallel diodes to clamp a fault voltage of a node to within +/- 1 V of another node, but present as little leakage as possible (pA) between the two nodes in normal operation, where both nodes are within about 1 mV of each other.
EDIT
I realized now, that the Shockley equation does indeed predict the linear region for \$|V_D|\ll V_T\$. Thanks to Enrico's answer I became aware of the large differences in Diode Reverse Saturation Current that determines the leakage in this bias regime.
For my application, I need a low leakage, but also large current capability for a few µs in the fault case. After comparing several diodes, it looks like unidirectional ESD diodes are best for this job. They will clamp in forward direction to about 1 V, so antiparallelling two of them does a good job. Their actual Zener Voltage does not matter in this application, so one could use whatever is on hand. Their leakage is also much better than rectifier diodes with a similar current rating. The latter seem to favor low forward drop.
There was also the comment of just measuring it. I will try to add results, if I still remember when I get around to visit the lab and find the time.


texts: Choosing Configuration Jumpers - Solder bridges, 0-ohm resistors, DIP switches, pin jumpers

texts:
I'm working on a development board, and need to let users set some configurations.
It will be used by students and engineers who are trying to build circuits on a breadboard; I'm not dealing with consumers.  Usually, the settings will stay the same, but it's possible that every new project could use a different configuration.
I will be dedicating some pins to interfaces like USB and Ethernet, but I'd like to give users the option of using those pins for a different purpose.  Some kind of configuration will be required.  The options I've considered so far are:
Solder bridges:

Either 0603 resistor packages to allow 0-ohm resistors to be used, or nearby pads for a solder blob.
Pros:

Cheapest option possible
Smallest PCB area required
No accidental changes
Customizable by soldering directly to pad

Cons:

Requires soldering iron to make changes
Possible to damage board with repeated soldering/desoldering
0-ohm resistors require having those parts on hand.

DIP switches:

Tiny mechanical switches in an IC package.
Pros:

Easiest to change
Fairly durable

Cons:

Most expensive option by far
Might be changed by accident
Large area on PCB
Lowest current of the options
Hard to make changes to PCB

Pin Jumpers

Removable Jumpers for .1" headers like those found on PC motherboards and drives.
Pros:

Less expensive than DIP switches
Easy to make changes to PCB
Good balance between easy-to-change and semi-permanent
Easy to see configuration

Cons:

Large PCB area required
Tallest profile; usually .5" or so required vertically
Jumpers might be lost

Electronic Bus Switching

Use FETs or a bus switching IC like the TI 74CBT series, and control with an EEPROM/microcontroller.  Suggested by Brian Carlton.
Pros:

Small PCB area
Configurable in software
Can put both to High-Z or connected

Cons:

Requires another couple ICs; medium cost.
Less current than other options
Has real resistance
Can now confuse hardware bugs with software bugs and vice versa

The solder bridge option makes me worry about weakening the pad with repeated resoldering and delaminating it from the PCB. How many times can a good soldering tech change a part on 1-ounce copper with an ENIG finish?  Would covering the edges of the pad with soldermask and adding thermal reliefs (for adhesion, not heatsinking) on several sides of the pad increase the durability?
Am I missing anything?  What configuration methods do you like to use on a dev board?


texts: Low power, cost effective way to measure CO2 (or equivalent CO2)?

texts:
I'm trying to develop a system that will monitor long term CO2 levels indoors and will run on a battery.

A lot of the conventional CO2 sensors are really power hungry and expensive. However, I came across this (http://www.ccmoss.com/gas-sensors) which claims it can measure 'equivalent CO2' in the environment where the main source of VOCs is from humans.

This seems great with a power consumption of <1mW, but it's £5.96 per sensor which is quite pricey!

Has anyone heard of anything similar, or have an idea of how 'equivalent CO2' is calculated so I could maybe use a cheaper VOC sensor and do the calculation myself?


texts: ESD strap/mat when working on battery powered devices/PCBs

texts: When the devices you're working on are plugged in an outlet or when you're working on loose components, it makes perfectly sense to ground yourself to the outlet or any other solid ground through a 1MOhm resistor. But if you're working on battery powered electronics, then you're actually putting yourself on a different ground than the electronics you're working on. Or do you pull the battery's negative terminal also to the same ground? I don't think that's a good idea...


texts: How can one measure extremely low-uf capacitors?

texts:
I'd like to measure (to a few percent precision) the capacitance of a 0.8-0.06pf variable capacitor (eventually to be read by a 120mhz 32-bit microcontroller, if that's any help). I realize that one cannot just measure an arbirarily small capacitor to any accuracy, so I'm not sure if this is practically feasible. I've looked into making a regular RC time circuit and polling to measure the discharge time, but even with the highest value resistor I can easily source (100M) the capacitor is discharged within 1 microseconds, which (I believe) is a stretch for me to sense with the microcontroller.

If this is practically possible, how could I do this?

EDIT:

The capacitor I'm giving values for is just two 1cm^2 parallel plates with a 1-13cm gap between them. I'm ultimately trying to get the distance between the plates from this capacitance. This is probably just a shot in the dark, but I thought I'd entertain the possibility and see what one could hypothetically do; any information on why this wouldn't work would be appreciated. Once known from calibration, any added parasitic capacitance (from traces, etc) can probably just be removed from the final value, correct?


texts: Differential remote sense circuit for 0.85V DC/DC supply

texts:
I have this sort of odd requirement and I'm wondering if someone with experience might have some advice on a circuit to use.   I have a chip that draws 40 Amps of current at 0.85V with +/3% tolerance.  Now normally I would use a DC/DC supply with a differential remote sense feature to counteract the IR drop from the switcher output to the core power balls at the middle of the chip.

However this time I'm forced to use a specific switching controller that does not have differential sense pins, just a single vsense pin.   I was hoping I could maybe use an opamp setup as a differential amplifier.   Then run the inputs as a diff pair under the chip and have the output drive the vsense of the regulator.  Or maybe drive it through a resistor and keep the vsense hooked up locally.

Oh and one more thing I can't use any supervisor or power manager chips like the LTC2974.   So it has to be a circuit I put down on the board.  Crazy design constraints, I won't go into the reasons behind it.

Anyway does anyone have advice on what kind of opamp circuit I could use to accomplish this?  Am I missing something critical?


texts: What are the advantages and disadvantages of thinner PCB thickness (<1.6 mm or 0.063'')?

texts:
What are the advantages and disadvantages of thinner PCB thickness (<1.6 mm)?

My approach:

Better capacitance interplane and better power decoupling.
Better track-plane coupling.
Problems with assembly process with heavy components
Problems with PCB twist
Extra cost. No standard thickness.

When do you use it?

Which are the technical limits for assembly thin PCBs (i.e. 0.5mm)? I know that It depends on the size of PCB. Could somebody tell about these limits?


texts: How to copy a polygon in eagle from one layer to multiple others in library (package) editor?

texts:
I have to layout kind of several boiler plates for layouts. I thought of designing it as a package in the library editor.

Some drawing elements have to be present on any layer and some other have to be present on several different layers.

I could copy them to one layer after another, but this is tedious, error prone and tedious to check.

I tried to use copy wire-to-any-layer.ulp but it doesn't work in the library editor. Any hints? I'm using the latest version (7.7.0 Ultimate)


texts: Do high voltage low amperage motors exist?

texts:
I have an idea, which is essentially using the power running down an electrified electric fence to move a stretch of wire between two fences.
I have been trying to find if it is even possible to have a motor that could run off of the high voltage extremely low amperage output of a typical electric fence.

This would be used to move the wire at a constant rate to automatically move cows for continuous grazing. So it will be necessary to control its travel and have it travel a certain distance for a certain period of time during certain times of the day. So a stepper motor set up might work well?

I am in the very begging process of trying to design this so any help is greatly appreciated. Also, this whole unit will need to be extremely light weight as it will be suspended on a wire, although that might change as well.


texts:
I've worked on the Arduino family (specifically the Sanguino), built a few simple devices and a simple phototrope. I am thus pretty comfortable with microcontrollers - specifically Atmel's. I'm curious to know how do FPGA's differ from standard microcontrollers. I am from a technical background (C/C++ programming) and thus would love technical answers. Just keep in mind that I am a newbie (relative to my s/w experience) in the electronics domain. :)

I did go through this query and it was good but I'm looking for further deeper details.

Thanks!
Sushrut.


texts: Are there any wifi chipsets out there that don't have an internal uC or require Linux?

texts:
For the past few days I've been browsing wifi chipsets and their development tools. I noticed that all of them either require Linux for running (at least that's what the forums say) or have an internal microcontroller (usually a STM32F4 or something similar, only TI and Espressif use a different architecture).

I'd like to know if there are chipsets out there that can be driven from an external microcontroller (not via AT commands, I mean handle the lwip stack and send/receive packets to/from the chipset). Here's my situation, I need many hardware resources and I want wi-fi on my board (I'd like to be able to handle it), that's why I don't use an ESP8266, or a CYW43362 or a CC3200.

Is what I want possible or am I just dreaming? By the way I'm using a stm32 microcontroller.

PS: Maybe there is a modem out there that connects to an MII/RMII and then I can treat it as if it where regular ethernet? I found the nano wireach .. but it's just too expensive


texts: Is an USB-to-UART converter different from an USB-to-RS232 converter?

texts: I have a USB-to-RS232 converter. The GND, TX and Rx pins of the RS232 I connect to GND, Rx and Tx on a development board I have. I've set the right baud rate, flow control and other settings in my HyperTerminal. However, all I receive is garbage data. I looked it up on the Internet and people who used a USB-to-UART converter, like the one here http://cpc.farnell.com/ftdi/ttl-232r-rpi/cable-debug-ttl-232-usb-rpi/dp/SC12825, have had no problems with it. I obviously I am missing something, any help in this direction would be really appreciated :)


texts: Getting trigger signal for 555 timer from elevator button

texts:
I want to turn a load like light on for a certain time when one of elevator buttons pressed say button 1 and while the button pressed the load should be on.

In the figure below circuit 1 describe how the controller of the elevator read button .

I tried two circuits to get  low signal to trigger 555 timer .

I tried circuit 2  with 10k for R1 and R2 and i faced a problem .
*the led of pc817 always on an this tell the controller the button always pressed.

So i tried to change R1 and R2 to 1M the problem disappeared. But another problem happened  when the motor of elevator start  this trigger the 555 timer :(
I am using decoupling caps 0.1u and 10u.

So i tried to add C1 to trigger pin with different values 0.1u ,1u,10u,47u and 100u the problem still exist.

So i went to try the circuit 3.
The problem when the elevator motor start run still exist .
So i tried to add 1 uf cap to trigger pin the problem disappeared.

Does the last circuit i used practical circuit and will work properly?
 is there another approach better than what i tried do what i need?

Regards


texts:
[No TL;DR provided]

I am an undergraduate electronics engineering student and I am working on designing a linear bench top power supply with foldback current limiting. Inspired by designs all over the internet (30V-3A types mostly) I've already came up with a complete design and with the help of LTspice I have resolved most of the oscillation issues (to the extent I am concerned, of course).

For voltage and current adjustment, I have used a zener regulator with an opamp to obtain various reference voltages and I observed that the input power supply ripples and transients are affecting my reference voltages which causes oscillation.

My solution was to change the zener configuration, as I've seen the issue with a trivial design. Since my whole design is irrelevant, I'm posting the zener voltage regulator part:

Trivial design was #3. Suffering from supply ripple, changed to #4 but than realized that better(?) alternatives are #1 and #2. They turned out to be great.

I know why #1 and #2 are superior to #3 and #4, basically power supply rejection . Simulations also verified this. Small signal analysis on ripple source with only gain plots (ngspice) are as shown below:

It is obvious that #1 and #2 are doing great, but my first question is, which is better? Is there any aspect of why one should be preferred over the other?

And my second question: Is it possible to make design #4 perform better by playing with capacitor-resistor values while still having a reasonable settling time?

Thanks in advance.


texts:
I have stripped one wire, the black/hot/positive one, for a 120v appliance.  I had to cut away the outer plastic that surrouneds all three wires, and now I'm afraid I may have nicked a small hole into one or more of the wires, and am deathly afraid of getting shocked.

Is there a way to test for very small holes in wires?  The ole put-water-on-something-inflatable-and-listen/feel-for-bubbles comes to mind, but this is electronics.  I suppose I could closely inspect the wires, but am hoping there's a better way.


texts: Magnetometer (LIS3MDL) temperature reading changes with orientation

texts:
I have a LIS3MDL outputting what seem to be reasonable magnetic field strength values (see second image).  However, I am confused why the temperature reading seems to be dependent on the orientation of the magnetometer when I performed the "figure 8" motions.  As far as I understand, the temperature value I am reading is used as an input to a compensation algorithm in the magnetometer, so it should be independent of the field itself.

Concerning acquisition of the value, I am reading out the 16-bit, 2's complement value and then dividing by 2^8 and offsetting to 25 degC.  I believe this is justified by the application note AN4602 (http://www.st.com/resource/en/application_note/dm00136626.pdf):

Serial.print((((int16_t)((buf[8] << 8) | buf[7])) / 256.0) + 25.0); // temp


texts:
A square wave contains only odd-integer harmonic frequencies. In figure 1 you can see a square wave with a frequency of 100 MHz, the square wave is composed of sine waves with a frequency of 100 MHz, 300 MHz, 500 MHz etc. (theoretically till infinity).
In figure 2 you can see a single pulse, does this single pulse contain the same frequency components as the periodic square wave in figure 1?


texts: How can a DC-DC converter kill SLA battery voltage on light load?

texts:
I'm running a small 12V-500V DC-DC converter (shown) on a purely resistive 50mA load.  I was getting weird behavior off my bench 12V DC supply so I plugged in the SLA battery shown.  I connected a multimeter directly to the battery's terminals and read 13V.  It holds that voltage for single-digit mA loads on the high side of the converter, but when I step up to the higher load my high-side ammeter reads 50mA but the battery's voltage collapses.  The multimeter (digital, so only updates a few times per second) shows it mostly hovering about 3.6V, but occasionally cycling to other values from 0 to almost 12V for one update.

I actually tested two different batteries and got the same behavior.  Then, to make sure it wasn't a surge condition, I put a 3A fuse in-line.  Then, to make sure the batteries weren't just drained, I connected a 4Ω power resistor directly to each one and confirmed no voltage drop and a sustained 3A through the resistor.

These are SLA batteries designed for 120V AC UPS (which can draw 250W for 5-10 minutes), and my high-voltage load that's killing the battery and converter should not be more than 25W.  How is that terminal voltage drop even possible given that feeding the converter isn't blowing a 3A fuse and can sustain a direct 3A test?  Evidently there's some dynamic here of which I am ignorant, so what could be going on?

Amendment: As another test, to determine if this DC converter has "spikey" demand, I added a 5µF polypropylene capacitor in parallel with the 12V power supply, and put a multimeter on the capacitor's leads.  This eliminated all voltage cycling on the supply side, but it did drop the 12A voltage instantly to just under 6V when load was connected.  Then I put the volt meter on the high side of the DC converter and saw the voltage cycling from 0 to 500V while the high-side ammeter showed it barely holding 50mA.  I could understand high-side problems if the converter were just underrated for the load, but I am still so confused as to how it can affect low-side supply side voltage like that.  Especially with nothing heating up or blowing.


texts:
I'm controlling a 4-pin PWM PC fan from a PIC16F684 with the fan speed driven from an ADC reading of a proximity sensor. This all works ok.

I wasn't originally planning to use the tachometer output from the fan, but as it's available I been monitoring it with my 'scope just to see that my mapping between proximity and fan speed is working.

Now, what I've noticed is that when the PWM is running the fan at 100%, the tach signal (which is an open drain pulled up via a 10K resistor) is nice and clean:

However, when I run at less than 100%, it's noisy:

Zooming in on that noise:

I'm guessing it's being affected by the PWM signal but I would like to understand why and how so that I could clean it up if necessary in future. Really I'm interested in what you should do when you see noise like this, how you find the cause and how you "fix" it. The scope manages to trigger ok so I'm wondering if I just feed it to the external interrupt pin on the PIC (RA2), which is a Schmitt Trigger input with CMOS levels, then I won't "see" the noise and I could e.g. echo a clean signal out of another pin to fade an LED or something.

So can someone explain in general terms how to go about recognising and correcting noisy signals? Or if that's too broad maybe just this particular problem? Also if there's anything wrong with my circuit it would be nice to know too. In the schematic below, the signal I'm displaying is the TACH input at the left of the circuit:

UPDATE
After helpful suggestions from both @MichaelKaras and @techydude, I've ruled out Q2 as the source of any problem by removing it from the circuit completely and grounding the fan directly. No significant effect on the noise.

So I then coded the external interrupt on RA2 to echo a "cleaned" signal out of a spare pin (RA1 in this case), which helped a lot but was still flickering due to false interrupts. (So I'd set the interrupt to trap rising edge then switched to falling edge when triggered and vice versa, setting/resetting RA1 accordingly).

But, after also adding a 100nF capacitor across R3 (as part of @techydude's suggestion), I now get a much more stable output. The screenshot below is the TACH signal after cleaning via the Schmitt Triggered RA2 input and re-output on RA1:


texts:
I have a circular buffer in my code (TI 28027) saving around 500 data points. Is there a way to easily save this data to a text file in Code Composer 4? Right now I am just using watch window, stopping the code and using copy/paste but I need to manually scroll through the whole buffer first so it loads all the values.

Is there a way to do it through GEL scripts?

Does upgrading to CCS v5 help?


texts: Trying to power on/off esp8266 power with a 2n2222a NPN transistor

texts:
I am trying to save some power, using an Arduino and an ESP8266 (ESP12 ESP-14F version).

The 3.3v is provided thanks to an LD1117V33. I've placed a 2n2222a transistor between the LD1111V33 and the ground. When ESP is powered on through the transistor, AT commands don't work anymore (I am mesuring 3.2V between Collector and the ESP VCC).
When I short Collector to Emitter, everything is fine.

Here is a log of AT exchange with the ESP. As you can see, the 2 first "AT" requests return something I can't read, then, all the other "AT" commands don't receive anything:

***** SEND *****
AT+CIOBAUD=9600[CRLF]
======= WIFI INIT START =======
***** SEND *****
AT[CRLF]
***** RECEIVE *****
sllœ�sŒ!ãoŒ€lìpŒ|�ƒŸìp“Ÿ�“œæŒpŒpóoŸlooœccpŒ�!lãú
***** SEND *****
AT[CRLF]
***** RECEIVE *****
kÿ
***** SEND *****
AT[CRLF]
***** RECEIVE *****

***** SEND *****
AT[CRLF]
***** RECEIVE *****

I read on the post below, that it is not possible to use the 2n2222a NPN transistor to do so. Could anyone give me some explanations?
(I know, there is a deep sleep mode I could use, but I'm trying to learn from my mistakes).

For an Arduino and ESP8266, can I power up the ESP8266 from a set of 2n2222 transistors?

Here is how I wired it up (I removed the resistors to ESP RX, and CH_PD to simplify the picture).