texts: How can I bind a local variable to AVR's rXX register?

texts:
I need to have programmable pause with precision as high as possible. To accomplish this I have the following GCC code:

void delay(unsigned char d){
  volatile unsigned char i=d;
  while(i>0) i--;
}

Which is compiled to:

1cc:    89 81           ldd r24, Y+1    ; 0x01
1ce:    81 50           subi    r24, 0x01   ; 1
1d0:    89 83           std Y+1, r24    ; 0x01
1d2:    89 81           ldd r24, Y+1    ; 0x01
1d4:    81 11           cpse    r24, r1
1d6:    fa cf           rjmp    .-12        ; 0x1cc <__vector_1+0x2c>

(I'm showing just the loop core code). This leads to the fact that the precision is 7 cycles which is not very acceptable. However I see that the compiler made his job not as fast as possible: If the i variable would be r24 register I will save 3 operations and the code would be almost twice as fast.

So how can I tell to the compiler that I want this variable to be in a register?

PS. I'd consider to pause with programmable number on nop's. But I can not imagine how this can be achieved. AVR has no instructions to branch to calculated address. As far as I know stack is not directly accessible in AVR (if it would I could push needed value to the stack and execute ret instruction to jump to the needed program address - it is also a tricky job but it would be at least considerable).

UPDATE After I changed volatile to register keyword (as was described in one of the answers) I've got the following code:

 14e:   81 50           subi    r24, 0x01   ; 1
 150:   f1 f7           brne    .-4         ; 0x14e <__vector_6+0x1c>

So I reduced the cycle from 7 to 2 cycles. Which is far better than I could expect.


texts: Identifying and dealing with counterfeit parts

texts:
There seems to be a growing awareness of counterfeiting in the parts supply chain and the government seems to be pushing responsibility back onto suppliers and manufacturers (Clamping down on counterfeits)

I would like to know what steps and procedures people are using to identify and test if parts are genuine?


texts: What do these Battery Specifications mean?

texts:
I have a sealed lead acid battery with the spec as below:

6V 4.5Ah/20HR
Constant voltage charge
Cycle use : 7.25V-7.45V
Initial current : less than 1.8A
Standby use: 6.8V - 8.9V

What do these data mean?

Thanks for your help.


texts: How is the Tx/Rx Gain calculated in USRP?

texts:
I'm using Software Defined Radio NI USRP 2922 (Universal Software Radio Peripheral). I know that USRPs are uncalibrated devices. In many exampls you can set the so called Tx or Rx gain (as in the picture below).

Now, I know that this does not correspond to the real power of the transmitter, nor is it a "gain" of the antenna - the most appropriate term here would be "transmitter channel gain", right?
So I would like to know how this transmitter channel gain process is implemented, how it is calculated, and how it works in practice (since a particular gain value doesn't correspond to a particular power level).


texts: Control 12v lock switcher with Arduino Nano

texts: I have 12v poser supply for electronic lock. It has 3 valuable pins: +12V, GND and PUSH. So, when I want to unlock the lock, i need to push PUSH pin to GND. How can I push 12v line to ground with Arduino Nano?


texts: From what I've readed, a resistor is a component which limit the current in a circuit. Supposing that I've a load that is rated for 12v 500mA, if I put a resistor to limit the current to, for example, 100mA what will happen to the load that expect to draw more current? Will it drop more voltage?


texts:
I'm building an open source, commercially available eurorack module which is based on a stm32 chip.
The problem I'm facing is that when the module boots up sometimes it is working as it should but most of the times, it seems to be working at a lower rate and it has unpredictable output.
I checked all the voltages from the regulators and I checked the soldering of all the parts and everything was right. After checking the 8Mz crystal I found that the one end oscillates as it should but the other does not. When the module works as intended, it oscillates nicely but after a while it goes berserk along with the module outputs.
Now, I double checked the values of the capacitors (20 pF) and the value of the resistors going to the stm pins (100 ohms). I replaced both the stm and the crystal with new ones. I reflowed with hot air the crystal and the stm but the behaviour is the same.
What strikes me as quite peculiar is the fact that sometimes the module works but after some seconds, of even minutes (after a reflow for example) the crystal stops oscillating as it should. Can anyone tell me what can cause such a behaviour?
Thank you!
The schematics are here: pdf link

Edit: Schematic of crystal oscillator section


texts: Need a method for synchronization of galvanically separated microcontrollers

texts:
I would like to get some ideas for my problem. I have a HW which has a main processing unit (Beaglebone, host controller) which is connected to four galvanically seperated STM32 microcontrollers. All of the STM32 microcontrollers are doing analog measurement with the same sampling frequency (100ksps). The STM32 mcus are doing the acquisition and the Beaglebone collects the data over SPI and evaluates it. The acqusition is started on all of the microcontrollers almost the same time.  I would like to run the measurements over multiple hours. All STM32 has a 16MHz external crystal for clock source, with PLL the core is running at 100MHz. But because the crystals have tolerance the sample points will be shifted between the stm32 microcontrollers. After some minutes the differences are significant. It would be nice if the delay between the microcontrollers would be between +-10us - 100us.

The acquisition is continuous. I do not want to miss any samples.

Question 1: is there a method to do sampling correction/syncronization between the microcontrollers? Can you suggest a literature in this topic?

Question 2: if hardware redesign is possible, currently I am thinking in software solution, how can I put syncronization between the seperated microcontrollers?

Remark:
what if the main processing unit measures somehow the delay between the microcontrolers. Then it sends a number to each of the microcontroller about how much is the difference referenced to an ideal frequency (sampling frequency or the operation frequency of the host). And then each microcontroller would change the sampling frequency a bit (100.1ksps or 99.9ksps). Something like this is in my mind. Can this work? Did anyone do something before?

Every comment are welcomed!


texts: Is there a standard for this "outdoor light systems connector"?

texts:
I have a strand of LED Christmas lights I'd like to control with an ESP8266. It has a two-pin DC connector that attaches to a wall-wart adapter so ideally I would keep both and insert the ESP8266 controller in between. The connector looks exactly as shown in this picture from Wikipedia:

I'm trying to search for compatible solder-able parts (male and female), however, the article simply lists this as an "outdoor light systems connector" without any other info which makes it difficult to search for. Is there a standard or model number for this kind of connector?


texts:
I have been reading the following article about Class-A and Class-B amplifers.
http://www.antonine-education.co.uk/Pages/Electronics_2/Amplifiers/Power_amps/further_page_12.htm#Question 1.

I am not sure I understand the point of having an Op-AMP in the class-B amplifier !
Why do we use a set up pull-push in the Op-AMP's feeback loop?
Why don't we just use OP-AMP by itself? And, how does OP-AMP helps to improve cross-over
distrotion?

Also, in the same article, right above question 3, it states the following:

"The op-amp holds the base-emitter voltage of the npn transistor at 0.7 V.  When there is a negative signal, the op-amp changes over, dropping 1.4 V, so that it turns on the pnp transistor.  The voltage gain is 1, but the power gain is almost infinity."

Could someone please explain the above in relatively easier way?


texts: PWM Control vs Variable Voltage Control - Calculating Duty Cycle

texts: I have a strange problem. We have an actuator which was controlled using varying voltage. For example, to achieve setting 1 we measured that the resistance of the coil is 32 Ohms and 2.09 V is supplied. That should see a current of 65.33mA and power of 0.136 W. Now we have to change it to a PWM control with constant 4.5 v supply. But how to calculate the duty cycle. The resistance remains the same. We need the same power. Is there any formula which can be used to calculate the effective current which is needed to drive in this case 0.136W?


texts: For SMPS, I would like to know if inductors degrade with time and frequent high current usage. The idea of this, is to determine the elements that are most likely to fail over time in a SMPS (for example electrolytic capacitors), so I can make them easily replaceable in my PCB. Thank you


texts: I live in an area with frequent lightning strikes. Occasionally people get killed due to those - specially when strikes enter house through TV antenna cables. My house is quite tall and seems to be the tallest building in this area. I have one lightning protector installed already. I wish to install some TV and satellite antennas on the roof of the house but very worried about possibility of lightning strikes entering the house through these cables. I am currently thinking about passing each cable through a two pole isolator switch which would allow me to switch off the isolator when lightning occur. Does this sound like a good option? Or are there better options available?


texts: Do modern processors have redundancy in their logic units to compensate production faults?

texts:
Modern processors consist of billions of transistors and new production technologies often have problems with the yield, at least in the first months, but I guess that even after years there will be faulty chips every now and then.

I know that in large blocks (e.g. the cache) there is the possiblity to just disable parts of it and by that reducing the available amount of memory (so you can at least sell the chip at a lower price instead of throwing it away).
But is there something similar for the logic units? I am aware that there are multiple ALUs for dispetching, but is this a thing to just disable one of them if there is a production fault? Or are there even additional spare ALUs? Because for me it is hard to believe that fabs just dispose of every chip where there is a faulty transistor in the logic parts, while disabling a complete ALU would proberly reduce the achievable processing power significantly.


texts: How to power a nickel chromium wire to produce heat without burning the power adpapter

texts:
I want to build a toaster just for fun. I want to buy a nickel chromium wire to heat the toaster's plate. How to avoid burning my power adapter cuz the resistance is too low. I currently have a variable power adapter that goes from 9 volts to 24 volts. At 9/12/13.5\15 volts it outputs 1.5Amps. At 18/20 volts 1.2 Amps and at 24 volts 1Amp

Thank you


texts:
I am trying to re-implement the BCD to 7-SEGMENT converter by hand. So, I have came up with the following truth table:

I have the following minimization created with the Karnaugh map. Is there any way to minimize this more?


texts: What does a resistor pointing to the middle of another resistor symbolize?

texts: As the picture shows, is this a potentiometer, or is it supposed to be two resistors?


texts: How can I run a DC Motor using Arduino UNO?

texts:
Materials:

1 small DC Motor
1 Arduino UNO
1k Ohm Resistors(couldn't find any others, maybe I can put em in parallel to - reduce their resistance)
1 NPN 2N2222 Transistor
1 1N4007 Rectifier Diode

First off, I am able to run the DC Motor, but issue is the transistor overheats. Not sure if it's supposed to happen. I have an extra N-channel MOSFET Transistor - IRFZ44N lying around if that can be used. Doing a small project for a friend and I don't want to spoil the arduino.

Image above is how I connected the circuit.


texts:
I'm trying to understand the need for Zero packets in USB-CDC transmissions. From what I gather, this seems to touch upon some grey areas of the USB spec or in differences in implementation of host USB drivers. I'm interested in both the 'correct' behavior (as per the USB spec) and typical behavior as far as regular USB hosts are concerned (Linux, Windows, OSX). Any relevant insight would be appreciated.

A hypothetical example of a USB device would be one which is transmitting over a single USB-CDC endpoint, simply continuously generating and transmitting bytes infinitely. For this example, assume that the generation of data is considerably slower than USB-CDC transmission. The approach I would like to use is collect 64 bytes of data (device packet size), and when 64 bytes are ready, transmit a single packet. No zero packets will ever be sent, no short packets will ever sent. Any host-initiated polling will be NAKed when there is no complete packet ready.

Is this a valid way to transmit CDC data?
Are there any USB hosts that are known to have issues with this approach?
If the USB device is a composite USB device, and one of the provided endpoints is a CDC endpoint as described, is there any change to the answers of a. and b.?

In the device of 1., if, instead of sending NAKs when there is nothing to send, the device were to send back a 0 packet, is it likely to still work? How does the overall transmission change - in terms of how it is interpreted by a serial port emulator and/or the effective bandwidth?
If the device, instead, transmits a few bytes, waits for a response. The length of these 'few' bytes is not known apriori. The host must be able to receive, process, and respond to these few bytes - they can't just sit in a hardware / driver buffer waiting for the entire transmission to end. Assume for the moment that USB-CDC recieve-by-the-device is somehow working and stable. All I'm interested in in zero packet transmission from the device.

If the number of bytes to be sent out is not a multiple of 64 bytes (packet size), then simply ending with the 'short' packet would be enough to mark end of transmission, yes?
If the number of bytes to be sent is a multiple of 64 (packet size), then what happens if a zero packet is not sent after the last transmitted packet to mark end of transmission?


texts: How are some modules priced ridiculously low?

texts:
I am planning on carrying out a design using the CP2102 Interface IC. The cheapest price I can source (for bulk purchase of 1500 parts) is from Digikey at 2.34$/piece. A price of 2.34$ is approximately 151 Indian rupees.

However, CP2102 modules (with usb connectors etc.) are available on ebay India for prices as low as 162 Indian Rupees. How do they do get such ridculously low prices? I can't even imagine competing against such prices. So any ideas on how prices can be reduced? Any experiences?


texts: How do I write a requirement of an asynchronous input signal, when the sampling clock has a certain resolution?

texts:
Let's say I have an asynchronous input (let's call it enable_h). This signal is supposed to be active high for 100us.

My 2mhz clock is double-registering this async input. So once it is in my clock domain, it is in an certain integer value length of 0.5us.

My original req is: "Cit5's FPGA shall create an error if the enable_h signal is not within 100us +/- 0.5us".

How do I convey in the requirement that the signal should be tested with a resolution of 0.5us? Is that intuitive with the "+/- 0.5us"?

The issue with the requirement is that someone can come and generate an input signal of 100.6us of enable_h being active high. My internal logic would not detect the extra 0.1us and thus not flag it as an error. (And many other cases of this type you can think of.)

Could I say at the end of the req: "with a resolution of 2mhz"? Or with "with modulus 0.5us = 0ns"?

What would seem intuitive and bullet-proof in terms of writing a requirement for an asynchronous input that can be active high at any time phase but an expected time width clocked in at a known domain?


texts: Using IR thermometer for measuring component temperature

texts:
I'm trying to measure the temperature of various steel components being heated using power frequency induction heater. The IR meter being used can be set for emmissivity  value of 0.1 to 1.0.
For the same type of material EN353, I'm not able to get the satisfactory   reading of temperature of different components keeping the emmissivity and
measuring distance same.
What other factors need to be considered- is it the mass / profile / surface
finish of various components, etc..
I'm comparing the reading of IR meter with a hand held calibrated K-type temp. indicator


texts: How do I calculate the DC output of this specific low pass filter?

texts:
Hi!

I am having some trouble understanding how to calculate the DC output of this low pass filter.
Also are my calculations correcet that the transfer function of the filter is:
$$\frac{R_{\text{8}}*R_{\text{9}}}{sCR_{\text{9}}+1}$$

Thanks in advance!


texts: Circuit review: Switch/monitor 12V devices using a USB-connected microcontroller

texts:
I've designed a board to allow my desktop computer to switch external USB hard drives on and off.  I don't have a huge amount of experience with circuits like this one so I'd like to get some feedback on the design before I build it.

The circuit is controlled by a Teensy 3.1 microcontroller board connected to the host (and powered) via USB.  Each drive's USB connection is always attached to the host and its power supply is switched using this circuit.  Each drive has its own 12V 2A power supply.  Up to 5 drives can be controlled; each has its own essentially identical switch/monitor sub-circuit (described below).  The board itself will be a double-sided home-etched board with ~2oz copper (0.10mm) on each side; vias are "plated" with 0.5mm bus wire soldered on each side.  I am not using a ground plane.  I am going to be hand soldering everything.

Common ground
I've connected the grounds for the Teensy (and thus USB) and each drive.  The common ground trace (0.05") runs in a linear U shape on the bottom layer connecting to the Teensy's ground at one end with short (<1cm) spurs to each component.

12V power
The larger (0.05") traces on the top of the board carry the 12V power for each drive.  The power supplies are rated at 2A each and typical current is 0.8A peaking briefly at ~1.8A during drive spin-up.  12V_IN_1 is connected to the power supply's 12V rail and 12V_OUT_1 is connected to the hard drive's 12V input.  Ground is passed through from the power supply to the drive on GND_IN_1 and GND_OUT_1 and connects through a via to the board's ground rail.

Fusing
Each drive is protected by a 2A fast blow 5×20mm glass fuse (F1).  I'm using ones I have on hand.  They're designed for use in holders but I'll be surface mounting them.  I'll be monitoring the current through each circuit so I'll be able to cut power from software as well.

Power switching
Each drive's power is switched using a TPS22810 load switch (IC_SW1) with Ron of 79mΩ.  The datasheet recommends a max current of 2A at 65C and max voltage of 18V.  The switch is controlled by an active-high pin (ENABLE_1) where high is between 1.2V and 18V.  This pin is connected directly to one of the Teensy's GPIOs.  I may pull this high using 10kΩ pullup to the +12V trace (R7) so that the 12V output defaults to being on.  Normally the Teensy turns the 12V output on by driving ENABLE_1 high (3.3V) and off by driving it low (0V).

Current monitoring
The switched output flows through a 0.01Ω current sense resistor (CR1) with a Kelvin connection to a NCS199A2R shunt monitor (IC_CS1) with 100V/V output.  The power supply for this chip is the Teensy's 3.3V rail.  The chip's output is connected to a MCP3008 ADC via CSENSE_1.  The ADC is also powered by the Teensy's 3.3V rail and connected to it via a non-isolated SPI bus.

Status LED
Each drive has a status LED (D1, Vf=2.95V).  It is powered from the drive's 12V rail via R1 (either 100Ω or 220Ω) and is controlled by an N-channel MOSFET (Q1).  The MOSFET's gate is connected directly to a Teensy PWM-capable GPIO pin via LED_1 and driven to 3.3V for on and 0V for off.  The LED will reside off-board and connect to the two pads between R1 and Q1.

Does anything about this circuit seem dangerous or dubious?  I'm rather concerned about letting the magic smoke out.

Board layout for a single channel.
Portions of adjacent channels included to show clearance.
Grid spacing 0.1 inch


texts: How to create "wireless" networks in Eagle Cad

texts:
In this schematic they've somehow created "wireless" networks, meaning networks that connect two components but don't have an actual wire in the schematics.

What are these called, and how can I create them in Eagle Cad 6.5?


texts: LM317 VS AMS1117 as Constant Current Limiter for LED SMD Boards

texts:
i need to design some board like this:

each led is SMD 5730 type with current max 150mA  in three line and input voltage almost 3.2×7~23V, to create some SMD led board like this:

so i have seen this circuit:

bu at this post somebody introduced this circuit, SO there said some other method like this:

and at other post said this:

but i fond the AMS1117 with is more stable on stress by this datasheet part:

  Unlike  older  regulators,  the  AMS1117  family  does  not  need  any
  protection  diodes  between  the  adjustment  pin  and  the  output
  and from  the  output  to  the  input  to  prevent  over-stressing
  the  die. Internal  resistors  are  limiting  the  internal  current
  paths  on  the AMS1117  adjustment  pin,  therefore  even  with
  capacitors  on  the adjustment  pin  no  protection  diode  is  needed
  to  ensure  device safety under short-circuit conditions. Diodes
  between  the  input  and  output  are  not  usually  needed.
  Microsecond surge currents of 50A to 100A can be handled by the
  internal diode between the input and output pins of the device. In
  normal  operations  it  is  difficult  to  get  those  values  of
  surge currents  even  with  the  use  of  large  output  capacitances.
  If  high value  output  capacitors  are  used,  such  as  1000μF  to
  5000μF  and the  input  pin  is  instantaneously  shorted  to  ground,
  damage  can occur.  A  diode  from  output  to  input  is
  recommended,  when  a crowbar circuit at the input of the AMS1117 is
  used (Figure 1).

and could give me almost 1A by almost 1.3V drop and max Vin 15V,so by this connection type :

So i like to know is LM317 better than AMS1117 by some factors and  care about its price AMS1117 price is almost 1/3 amount of  LM317 price, and maximum voltage offers (which i dont think have any needs here because of open loop dont past any voltage on Adjustable voltage IC)?

Also i have also seen this question :

LM317 Constant Current vs Transistor Current Limiter

And think the LM317 or AMS1117 or better for this usage, am i right?

Thanks.


texts: At what frequencies does PCB design get tricky?

texts:
I have designed many mixed-signal PCB's where the highest-frequency component is the microcontroller's crystal oscillator itself.  I understand the standard best practices: short traces, ground planes, decoupling caps, guard rings, shielding traces, etc.

I've also put together a few RF circuits, at 2.4GHz and ~6.5GHz ultra-wide band.  I have a working understanding of characteristic impedance, ground stitching, balanced vs unbalanced RF feed lines, and impedance matching.  I've always contracted an RF engineer to analyze and fine-tune these designs.

What I don't understand is where one realm starts to cross over into the next.  My current project has a 20MHz SPI bus shared between four devices, which has let me to this question.  But, I'm really looking for general guidelines.

Are there guidelines as far as trace length vs frequency?  I assume that ~3 inch traces are fine with 20MHz (15 meters), but what is the general case?
As frequencies increase, how to prevent long traces from radiating?  Are striplines and coax the way to go?
What is the RF characteristic impedance of a typical microcontroller output stage, anyway?
etc.

Please feel free to tell me anything I'm missing :)


texts: STM32F discovery doesn't execute code after programming successfully

texts:
I have a stm32f051R8T6 Discovery board, and I compiled a simple blinking LED code to activate the LED's on the board itself. The code builds successfully and flashes the MCU but the MCU won't execute the code, I have reset it and tried programming it with a different code which worked in the past but still no luck, I am working in Coocox.

Once I have the hex file I flash the MCU with either the STM32 st-link unity or Coocox itself and both say it flashes successfully

I think the MCU is held under reset but I'm not sure and I don't know how to get it out.

THe link to the manual is here: http://www.st.com/content/ccc/resource/technical/document/user_manual/30/ae/6e/54/d3/b6/46/17/DM00050135.pdf/files/DM00050135.pdf/jcr:content/translations/en.DM00050135.pdf

Code is Below

#include "stm32f0xx.h"

void delay(const int d);

int main(void)
{
  // GPIOC Periph clock enable
  RCC->AHBENR |= RCC_AHBENR_GPIOCEN;

  // PC8 and PC9 in output mode
  GPIOC->MODER |= (GPIO_MODER_MODER8_0 | GPIO_MODER_MODER9_0);

  // Push pull mode selected
  GPIOC->OTYPER &= ~(GPIO_OTYPER_OT_8 | GPIO_OTYPER_OT_9);

  // Maximum speed setting
  GPIOC->OSPEEDR |= (GPIO_OSPEEDER_OSPEEDR8 | GPIO_OSPEEDER_OSPEEDR9);

  // Pull-up and pull-down resistors disabled
  GPIOC->PUPDR &= ~(GPIO_PUPDR_PUPDR8 | GPIO_PUPDR_PUPDR9);

  while(1)
  {
    // Set PC9
    GPIOC->BSRR = GPIO_BSRR_BS_9;
    // Reset PC8
    GPIOC->BSRR = GPIO_BSRR_BR_8;
    // Delay ~ 1 sec.
    delay(SystemCoreClock/8);

    // Reset PC9
    GPIOC->BSRR = GPIO_BSRR_BR_9;
    // Set PC8
    GPIOC->BSRR = GPIO_BSRR_BS_8;
    // Delay ~ 1 sec.
    delay(SystemCoreClock/8);
  }
}

void delay(const int d)
{
  volatile int i;

  for(i=d; i>0; i--){ ; }

  return;
}


texts: Raspberry Pi GPIO Input fires random high interrupts

texts:
I have a raspberry pi 3 model without anything attached.
If I configure a GPIO as input with the internal pull up resistor enabled, the GPIO reads high as expected.
However, the interrupt randomly detectes raising edges. I can even cause them by touching the USB casing (which the RPI connects to ground) with a single wire.

Why? How can I stop that?
I already tried

an external pull 4kOhm-pull-up resistor
a 0.1mF capacitor between 3.3v vcc and gnd
a 0.1mF capacitor between gpio and gnd

For clarification:
I want to detect my door bell ringing using an opto-coupler. I also want to have as much precision as possible so that I can decode ringing-codes (50ms precision should be enough though). Sadly I get random false positives :(


texts: What should be the phase difference in the two windings of a split-phase induction motor?

texts:
I'm having a little basic problem here.
I'm trying to reconnect the coils of a 4 pole motor (concentric winding) to make a 2 pole motor.
I've managed to make it work in 2 configurations so far (in two different voltages), but the one thing I never get is the fact the sum of the currents (main + aux) is always resulting in less than the greatest one.
In other words, the phase difference is always well above 90º.
If it was 90º, -90º, -270º or 270º the total current would always be bigger than the greatest current (and if both were identical it would be sqrt(2) that current).
But according to the phasor sum I made it's always like 130º, 140º, 150º out of phase etc.
I tested caps from 4 uf to 100 uf and tested several configurations but I never got a 90º difference.
Am I wrong to expect a 90º difference to begin with?


texts:
Firstly, I'm a hobbyist and have a lot to learn.

I'm trying to get a 0-5V signal created by a microcontroller to +/-2V audio level.

I don't want to spend a lot and would like to keep the part count down, so I started experimenting using resistor dividers and I can get it into either the 0-2V or 0-4V range.

But I don't know how to make the signal go negative.  What are some ways to do that?


texts: xilinx FPGA difference between bitgen and prom compression?

texts:
Page 39 of UG161 talks about compression/decompression and implies that either bitgen or prom compression can be used to shorten the config bit stream size. Most importantly I need to know whether, when using the bitgen compression option this means that I need to use the CLKOUT pin for FPGA configuration as described by UG161 pg 62.

Originally I was trying to load 2 revisions of my design onto one PROM device, however Impact reported that the bit file was too big. After using the bitgen compression option, my bit file was smaller and 2 designs were able to fit on the PROM. However, the Xilinx documentation is unclear as to whether using the bitgen option means that I must use the PROM CLKOUT or not, as pg 39 seems to imply there is a difference between this and PROM compression.

UG161 can be found here http://www.xilinx.com/support/documentation/user_guides/ug161.pdf

I am working with Spartan-6 series XC6SLX45T FPGA and XCF16P PROM if that helps. The tools I'm using are Xilinx ISE 13.4, both the command line and IMPACT.


texts: How to implement low pass filter in the differential part of PID in time domain

texts:
I programmed PID in MATLAB:

classdef PID < handle
    properties
        Kp = 0
        Ki = 0
        Kd = 0
        SetPoint = 1
        Dt = 0.01
    end

    properties (Access = private)
        IState = 0
        PreErr = 0
    end

    methods
        function obj = PID(Kp, Ki, Kd, SetPoint, Dt)
            if nargin == 0
                return;
            end
            obj.Kp = Kp;
            obj.Ki = Ki;
            obj.Kd = Kd;
            obj.SetPoint = SetPoint;
            obj.Dt = Dt;
        end

        function output = update(obj, measuredValue, t)
            err = obj.SetPoint - measuredValue;
            P = obj.getP(err);
            I = obj.getI(err);
            val = lowPass(obj,t);
            D = obj.getD(err*val);
            output = P + I + D;
        end

        function val = getP(obj, err)
            val = obj.Kp*err;
        end

        function val = getI(obj, err)
            obj.IState = obj.IState + err * obj.Dt;
            val = obj.Ki * obj.IState;
        end

        function val = getD(obj, err)
            val = obj.Kd * (err - obj.PreErr) / obj.Dt;
            obj.PreErr = err;
        end

        function val = lowPass(obj,t)
            N = 10;
            val = 1-exp(-N*t);
        end
    end
end

And tried implementing it using a random low pass filter as the plant:

function r = getResponse(t)
r = 1 - exp(-5*t);
end

The implementation:

sr = 1e2; % sampling rate 100Hz
st = 10; % sampling time 10s
ss = st*sr+1; % sample size
t = 0:1/sr:st; % time

input = ones(1,ss)*100;
output = zeros(1,ss);
measured = 0;

pid = PID(0,1,1,input(1),t(2)-t(1));
for i = 2:ss
    rPID(i) = pid.update(measured, t(i));
    output(i) = rPID(i)*getResponse(t(i));
    measured = output(i);
end
figure
plot(t,output)
hold on;
plot(t,input)
plot(t,rPID)
legend('Output','Input','PID')

Note that the parameters are set to kp=0;ki=1;kd=1;. I'm only testing the differential part here. The result is very wrong:

Notice the Y-axis is scaled by 10^307. It gets too big that after ~1.6s, the PID value exceeds the range of double precision and therefore, no more values for it. D values, in fact, start to oscillate too much from the beginning:

I have made sure that both P and I parts work well enough (see Values got from programmed PID are different from ones simulated in Simulink), so the mistake is only from the differential path. I'm almost certain I must have made a mistake in implementing the low pass filter, but I also noticed that even if I remove the low pass filter, the differential values are still very unstable.

I also made a simulation of the PID in Simulink, using the exact same parameters, and here is the result:

I know these gains for PID are not optimised but they work in the simulation not in my programmatic PID.

Therefore the big question is am I doing something wrong here? Why is there a difference between the simulated result and it obtained with the programmatic PID?


texts: Mounting SIP Power Module with 1.7mm Pin Pitch @ 8 Amps

texts:
I'm attempting to mount a GE NQR010A0X4Z power module (datasheet here) on a prototype board or custom PCB and am not sure what I can do besides directly soldering wires to the pins (which seems very hacky).

At first, I was looking to create a simple breakout board but the narrow pin pitch restricts me from creating traces wide enough to handle the current and creating heavier traces also get's too expensive.

What are my options?


texts: Determine to Assume Outer Diameter of Cable for Choosing Cable Gland

texts:
Is there any method to determine the cable outer diameter just only known from the pin connector which is M23 Connector 17 Pins?
I need the method for choosing cable gland size.

Thank You


texts: Electrical quick disconnect identification

texts: Trying to correctly identify a female spade quick disconnect terminal. It is 2 mm wide (.0787") and 1 centimeter long, which includes the stem. But cannot find a source to buy from because the smallest available size seems to be .110" wide. So either I am measuring wrong or the pieces I have are custom made. How can I correctly look for a 2 mm wide female spade quick connect?


texts: Why should BJTs be saturated in switching circuits?

texts:
Assume that I'm going to drive an LED with a bipolar transistor as a switch. According to books, when the LED is on, the transistor should be saturated, i.e. V_CE should be close to zero. But why do authors emphasize on saturation? I mean, in plots of collector current (I_C) as a function of V_CE, we can see that for a wide range of V_CE values, I_C is almost constant.
I can think of two possible motivations for using saturation:

When a BJT is saturated, the calculations are simpler: no need to calculate V_CE and insert it in Kirchhoff's voltage law.
When a BJT is saturated, all voltage provided by power supply can be given to the load (with no V_CE voltage drop)


texts:
We have been working on motion sensor unit FIS1100.

We decided to use it as traditional motion sensor (FIS1100 can be operated in two modes Attitude engine mode and traditional sensor mode). We are using I2C for communication with motion sensor. Read and write to the motion sensor works properly. After making the configurations, I am not seeing any output in the output data registers.

Can anyone tell me where i had gone wrong in my configuration as this is my first experience with motion sensors.

Below is my configuration:

CTRL1 - 0x00
CTRL2 - 0x00 [full scale = 2g and ODR = 1000 ]
CTRL3 - 0x00 [full scale = 32 gps and ODR = 1000]
CTRL4 - 0x00 [There is no external magnetometer connected to FIS1100]
CTRL5 - 0x00 [Disabled low pass and high pass filters]
CTRL6 - 0x00
CTRL7 - 0x83 [Enabling sample synchronization,accelerometer and gyroscope]

How i read data from output data registers [Ax,Ay,Az and Gx,Gy,Gz]

Read STATUS0 register [Stop the updation of output data].
Read Output data registers [A[X,Y,Z][H,L], G[X,Y,Z][H,L]].

Note : We have also carried out accelerometer self test but there is no
output data in the output data registers.

Output:

MS conf completed
/*************CTRL registers after configuration ********************************/
ctrl1 = 0x0
ctrl2 = 0x0
ctrl3 = 0x0
ctrl4 = 0x0
ctrl5 = 0x0
ctrl6 = 0x0
ctrl7 = 0x83
/********************************************************/
STATUS0 = 0
ax = 0 : ay = 0 : az = 0 ;
gx = 0 : gy = 0 : gz = 0 ;

Datasheet can be downloaded from the following link
https://www.fairchildsemi.com/datasheets/FI/FIS1100.pdf

Edited to add answers to questions and schematic:

Read and write to the motion sensor works properly - I confirmed it by probing the I2C lines with DSO; moreover when I read 0x00 register I got 0xFC.

How have you proved that your hardware design (including I2C interface) is correct? - We used the application diagram (section 1.4 in datasheet) given in the datasheet FIS1100 (except that we haven't used magnetometer).

How do you know that your software program is correct? - When I read the datasheet this is what I understood,  We can control FIS1100 motion sensor with seven control registers. I have listed out how I have configured them in the OUTPUT section above. This is where I need to know if anything needs to be done in addition to what I have done above, or if I am configuring it wrongly ????

Thanks


texts:
I need to calculate the \$V_{DS2}\$ in the following circuit, but am unable to solve it. I know that \$I_{D1}=\frac{1}{2}k_n(V_{IN}-V_t)=0.4\$ mA and that with this value I can calculate \$V_{DS1}=V_{DD}-R_1 I_{D1}=1.5\$ V. But then I'm stuck, I think \$V_x = V_{DS1}\$ but \$V_{DD}\$ also connects there so it needs to drop voltage somewhere? Also I'm not sure what to do with the current source, since it's pointing downwards it is just an infinite resistance, but then the circuit isn't grounded?

Also note that \$\lambda=0\$.


texts: Electrical circuit with capacitors and transistor

texts:
I don't know how this circuit works. So I would like someone to explain me. I know that the qustion is too general, but I am new in electricity and I don't know someone who can answer me how this works.

The result is that when The circuit is connected to 9V battery one of the diodes start lighting and after some time (for example 5 seconds) the other diode start lighting while the light of the first diode start to decrease (start to dim) and a after second for example it stops lighting. So only the second diode now lighting and after for example 5 second it starts dimming and the first diode start lighting and after one second the second diod stop lighting at all an so on and so on.

I do the following measurements when D2 lights. C2 start to discharge when D2 start to ligthing.I measure that VCE (voltage drop between C and E) is positive. I measure that VDE is the sum of 9V + current voltage of C2.

So let assume that D2 starts lighting. I have the following questions:

The capacitor is charged at 6.8 Volts, but why?
Why when the D2 starts lighting the D1 dim for one for one second. Where the current goes through that lights the diode?
Why the voltage drop of R2 is the sum of 9V + voltage of C2. And when we have voltage drop through it this means that some current pass through it, but what is its path (maybe through C2?)
Why D2 stops lighting when the voltage drop across C2 is 0V. Why it don't stops when it is 0.7 for example?

Thanks in advance for your attention!


texts: Are there regional constraints with the SIMCom modules? (Eg. SIM7605CE/SIM7600CE)

texts:
I recently received a SIMCom Module (Model no. SIM7605CE), shown below.

The item can be  (purchased online as well). The device, much like the ones used with Arduinos (like the SIM800L), is supposed to respond to AT commands. However, it does not recognize the SIM card that I use (here in Malaysia). I wanted to know if anyone else had a similar experience. And is it possible that this particular model does not operate in South Asia? The AT responses are given below.
ATI
Manufacturer: SIMCOM INCORPORATED
Model: SIMCOM_SIM7605CE-CNSE
Revision: SIM7605M11_A_V3.0
IMEI: 869404040055042
+GCAP: +CGSM

OK

AT+CSQ
+CSQ: 99,99

OK

AT+CCID
+CCID: 89601618113007656907

OK

AT+CREG?
+CREG: 0,0

OK

AT+COPS?
+COPS: 0

OK

AT+CBC
+CBC: 3.730V

OK


texts: NodeMCU power via battery + battery charger + booster

texts:
I need to power a NodeMCU (as far as I know it can work with 3v3 but I use some I2C modules that need 5V so let's power everything with 5V.)

I have a Li-ion battery (3.7V.)
I have a TP5046 based module (here) to manage the loading / discharging of the battery

This will lead to a rechargeable 3.7V power supply.
Then I have a one of those cheap power boosters from China (here) that brings the voltage up to 5V.
I'm a hobbyist electronic and I like to think about my modules as Lego pieces that I plug here and there.  Any recomendations on how to piece the things together?
This is my proposal:


texts:
I recently acquired a 2000 Watt Inverter with a 4000 Watt Peak from a friend who did not like they way it worked in his RV. How would I safely wire it into my car? If it helps I drive a 2005 Nissan Sentra SE-R Spec V. I have a single battery under the hood.

So far my plan was to mount the inverter in the trunk and run 4 gauge cables from the battery to it. For convince I was planning on wiring a switch in the dashboard with a 200 amp relay (https://www.amazon.com/dp/B01I9CI3VS). Would this be a safe option to shut it off when I am not using it? I do plan on putting a 200 amp fuse close to the battery.

In the front of the car I was looking at running an extension cable and cutting the ends and splitting the power to a few of these (https://www.amazon.com/dp/B0031C11DY). Is this the best way to do this or is there something better I can do?

Also my car is around 14 feet in length so I am imagining I will be using around that much in wire. Will 4 gauge be safe enough or will I need to use 2 gauge? I am somewhat new to this and do not want to set my car on fire.


texts: Problem with nRF24L01 2.4GHz radio/wireless transceivers

texts:
I want to control my car with nRF24L01 2.4GHz Radio/Wireless Transceivers. I am using an Arduino Mega, Arduino UNO, joystick, LED and two nRF24L01 2.4GHz radio/wireless transceivers. Here the Arduino Mega is the transmitter circuit and the Arduino UNO is the receiver circuit.

In the transmitter the circuit connections are:

GND
VCC 3.3V
CE to Arduino pin 9
CSN to Arduino pin 10
SCK to Arduino pin 13
MOSI to Arduino pin 11
MISO to Arduino pin 12
Joystick X axis to Arduino pin A0
Joystick Y axis to Arduini pin A1
Joystick Vcc and GND

Here I want to send the joystick's x and y axis with the module. Here are the receiver circuit connections:

GND
VCC 3.3V
CE to Arduino pin 9
CSN to Arduino pin 10
SCK to Arduino pin 13
MOSI to Arduino pin 11
MISO to Arduino pin 12
LED to Arduino pin 3.

This LED helps to control. Actually I want to control my car with joystick like a remote controlled car. Here is the transmitter's code:

#include "SPI.h"
#include "nRF24L01.h"
#include "RF24.h"
#define VRx A0
#define VRy A1

int VRxPos = 90;
int VRyPos = 90;
int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;

void setup()
{
    radio.begin();
    radio.openWritingPipe(pipe);
}

void loop()
{
    VRxPos = analogRead(VRx);
    VRxPos = map(VRxPos, 0, 1023, 0, 180);
    VRyPos = analogRead(VRy);
    VRyPos = map(VRyPos, 0, 1023, 0, 180);
    if((VRxPos==88) && (VRyPos==85))
    {
        msg[0] = 111;
        radio.write(msg, 1);
    } else {
        msg[0] = 112;
        radio.write(msg, 1);
    }
}

Here is the receivers's code:

#include "SPI.h"
#include "nRF24L01.h"
#include "RF24.h"

int msg[1];
RF24 radio(9,10);
const uint64_t pipe = 0xE8E8F0F0E1LL;
int LEDpin = 3;

void setup()
{
    radio.begin();
    radio.openReadingPipe(1,pipe);
    radio.startListening();
    pinMode(LEDpin, OUTPUT);
}

void loop()
{
    if (radio.available())
    {
        bool done = false;
        while (!done)
        {
            done = radio.read(msg, 1);
            if (msg[0] == 111)
            {
                delay(10);
                digitalWrite(LEDpin, HIGH);
            } else {
                digitalWrite(LEDpin, LOW);
            }
            delay(10);
        }
    }
}

It's not working. The LED is not lighting. What can I do to solve this problem?
Is const uint64_t pipe = 0xE8E8F0F0E1LL; wrong? I saw some different numbers for this equation. What is this logic?


texts: Routing a HV pulse across a number of channels

texts:
I have a number N of loads ranging between 3 and 16 (In the schematic I only draw 3 to avoid bloat) that requires well-timed high voltage pulses. The pulses have a width of 20~50 us and a period of 150 us

Instead of having separate pulse generators for each load, I would like to share the same generator circuit with all the loads, and send every pulse on sequence across the loads (so that every N pulses, the pulse is sent back to the first load)

What would be a reasonable way to route the pulses across the sequence of loads?


texts: I found on a site that it is important to know the temperature of the infrared sensor while calibrating the infra red sensor, but I could not find the real reason behind this. Anyone knows it?


texts: Unknown smd device from ST replacement possible?

texts:
first time here

I would like to ask what is the blown up device on the picture. I think its somekind of diode. I searched the ST site, but I didnt find anything with these markings. The board is from an APC BacUPS 600.

Picture of the device

EDIT
Thanks for the identification. Do you know of any parts that i can use to replace this one? Sucks that this one is obsolete.


texts: Can I use an external GPRS antenna for my bluetooth device to extend range area of bluetooth? I have a Bleugiga WT11 bluetooth device.


texts: Best way to pass floating-point numbers to DDR - Zedboard

texts:
I have a Zedboard and I made a PL block in Vivado HLS that is going to return milions of floats to the DDR via an AXI DMA block, and those results are then going to be read by the PS from the memory.

Problem is that I can't find a way to read/write floating point numbers to the DDR since in Xilinx SDK the only functions are based or integers (i.e. Xil_Out32(..),Xil_In16(..),etc)

How do I do this?


texts: If I buy a spectrum analyser, how do I do an EMI test?

texts: Maybe when I have the cash to buy one, I will. But my question is more related to how to use one once I've got it. I assume I'll need some kind of antenna to receive the EMI. Are there general rules for self-testing? (Before sending it off for proper FCC/CE/etc. validation.)


texts: Inconsistency in Values of Laplace Transformed Current when Changing Units

texts:
I was trying to convert the units of the following current in Time Domain and Complex Frequency domain (s-domain):
$$
i(t)=20\cdot e^{-t}H(t)\,\,\,\,\,\text{[mA,ms]}
$$
Where \$\text{[mA, ms]}\$ indicates that in this formula time must be entered in
\$\text{ms}\$ and the calculated current will be in \$\text{mA}\$.

Time Domain:
$$
\bbox[8px,border:1px solid black] {
   i_1(t)=20\cdot e^{-t}H(t)\,\,\,\text{[mA,ms]}\,\,
   \require{AMScd}
      \begin{CD}
         @>>>
      \end{CD}
   \,\, i_2(t)=0.02 \cdot e^{-1000t}H(1000t)\,\,\,\text{[A,s]}
}
$$

If, for example, \$t=1\,\text{ms}=0.001\,\text{s}\$, we have:
$$
\begin{alignat}{1}
i_1(1)&=20\cdot e^{-1}H(1)=\frac{20}{e}\,\text{mA} &= \frac{0.02}{e}\,\text{A}
\\[6pt]
i_2(0.001)&=0.02\cdot e^{-1000\,\cdot\, 0.001}H(1)\,\,\,\,\,\,\,\,\,\, &=\frac{0.02}{e}\,\text{A}\,\,\,\,\,\,✔
\end{alignat}
$$
Here no big deal, trivial conversion. The problem is in s-domain.

S-Domain:
$$
\bbox[4px,border:1px solid black] {
\begin{alignat}{1}
I_1(s)=\mathscr{L}[\,i_1(t)\,]=\frac{20}{s+1} \,\,\,\left[\text{mA,}\frac{1}{\text{ms}}\right]
\\[6pt]
I_2(s)=\mathscr{L}[\,i_2(t)\,]=\frac{0.02}{s+1000}\,\,\,\left[\text{A,}\frac{1}{\text{s}}\right]
\end{alignat}
}
$$

If, for example, \$s=(e-1)\,\frac{1}{\text{ms}}=1000 \cdot (e-1) \,\frac{1}{\text{s}}\$, we have:
$$
\begin{alignat}{1}
I_1(e-1)&=\frac{20}{e-1+1}=\frac{20}{e}\,\text{mA} &= \frac{0.02}{e}\,\text{A}
\\[4pt]
I_2\left(1000 \cdot (e-1)\right) &=\frac{0.02}{1000e-1000+1000}\,\,\,\,\,\,\,\,\,\, &=\frac{0.02}{1000e}\,\text{A}\,\,\,\,❌
\end{alignat}
$$

Here the conversion didn't work. Results differ by a factor of \$10^{-3}\$ and I can't figure out why. The transforms and operations are right, I did them in Mathematica to make sure they weren't wrong:

A note about the units of the complex frequency \$ s \$ - the product \$s \cdot t\$ must be dimensionless, so:

Since the time in \$i_1(t)\$ is measured in \$\text{milliseconds}\$, the complex frequency \$s\$ in \$I_1(s)\$ must be in \$\frac{1}{\text{milliseconds}}\$;
Similarly, \$s\$ in \$I_2(s)\$ is in \$\frac{1}{\text{seconds}}\$ because \$t\$ in \$i_2(t)\$ is measured in \$\text{seconds}\$.


texts:
I recently used a small audio device that could be powered by an AC or DC power supply 12-24V. How is this possible? And why isn't it more common?
Are there reasons that more manufacturers don't follow this route?


texts:
I am trying to understand how an arbitrary noise spectrum is sampled by an ADC. Let the broadband noise floor be, for example, \$e_n\$ = 5nV/√Hz @ 1kHz and the 1/f noise be \$E_{1/f}\$ = 2 μV peak-peak integrated over 0.1 to 10 Hz (specified in the manner of most amplifier datasheets). If I make a single measurement of this noise (say with a ΣΔ ADC) the noise with an integration time T, what is the amplitude of uncertainty in my sample (neglecting quantization noise)?

Another way of posing this question; most ΣΔ ADCs appear to specify a peak-to-peak input-referred noise for a single measurement under various conditions (e.g filter mode, data rate, PGA gain, Vref, etc.). Given a known input noise spectrum as described above, how do I compute a noise amplitude to compare with the ADC input referred noise to know whether I can resolve my input noise in a given configuration?

If, for example, the sample interval is T=10μsec, would the sampled RMS amplitude just be \$e_n \sqrt{1/T}\$ = 1.6μV (assuming the 1/f noise is negligible at this BW)? Then if I average many just measurements the measurement improves by \$\sqrt{N}\$ which is equivalent to using a longer integration time \$NT\$?

EDIT: Also, what if I am making a precision DC measurment with a long integration time such that 1/f noise dominates? My 1/f noise spec only goes down to 0.1Hz so how do I estimate noise for integration times longer than 10 seconds? Do I need to extrapolate the 0.1 to 10 Hz noise amplitude to lower frequencies?

[Note that this question pertains to the mathematics of sampled noise not about the challenges in measuring this low noise level, the subtleties of particular ADC technologies, or low noise circuit layout.]


texts: How to correctly supply power to multiple 12 V devices wired in parallel?

texts:
I am an artist, building a functional miniature which contains multiple devices (3 12 V computer fans, 1 cooling pump, two LED strips totauling 14 segments of three or 42 individual lights, and 1 Peltier tile). They are currently wired in parallel. I have been using an adjustable power supply, and it works however it only works when I turn the supply up to 19 V, which I know is bad for all of the devices. This supply claims a max of 3.4 A output. I also have a power supply which provides 12 V and 6 A, which when plugged in is insufficient to power the device. I have tried calculating what the current draw of the device should be, however I am not sure what the current draw of the Peltier tile is or how to determine it, and my best estimate is the the device should use possibly 4-7 Aat 12 V. Why does it work when I give it additional voltage, and yet when using a higher amperage power supply (possibly sufficient) it doesn’t work? What would be a better hypothetical way to supply power to this device? How can I calculate the current the Peltier tile is drawing?
I am learning as much as I can about electrical engineering to safely build this object, and I know enough to hack together art objects, however I am not a professional, and I feel like I have come up against the limits of my ability to figure this out!
I do have a multimeter, which I’ve used to test the claimed voltage of my adjustable PSU, and it is accurate to what it is putting out.


texts: How does an antenna tune in a particular frequency on the receiver side?

texts:
When an electromagnetic wave strike an antenna, a current starts to flow in it.

There are many EM waves (at different frequencies) around us. Does this mean that there is always current flowing in the antenna at each frequency?

If we want a particular frequency, do we just use a resonant circuit and take our signal?


texts:
I have a small project and I would like to have an LED display, just for the sheer fun and look of it. However it would be too expensive for me to make (I would like to use RGB leds) and I would need small LEDs very densely packed to display the information I want. However, the project I'm making I don't want to just stick an LCD panel in it.

So I was wondering, is there any way of hiding the fact an LCD is being used.

My initial thoughts where to use some kind of black / dark acrylic which would be strong enough to block out backlight bleed and the "greys" of an LCD but the colours and information on the LCD will be bright and strong enough to shine through the acrylic. Coupled with say an LED font or LED / dot matrix style graphics it will look like an LED display.

Is this a feasible idea? Are there any other alternatives or other techniques I could use? I thought about making my own LED backlight and using software it would only light specific parts of the screen that have text or information, making the black areas truly black with no light behind.


texts: Can't reproduce resisted power circuit on breadboard

texts:
simulate this circuit – Schematic created using CircuitLab
When i build this circuit on a breadboard, it works find. When I solder a few pieces together to produce it, it kills my Arduino board. I need 9 identical ones, and I made that board, but it failed. Thinking maybe things were too close together for my soldering skills, I made it again but bigger. When that didn't work, I made a single instance of what I need. Still no joy.
I need someone to tell me what the difference is between the breadboard and my board.
This works. Those are 10k ohm resistors, by the way:

This doesn't work. For some reason, the Arduino programming app won't communicate with my Arduino board. It apparently doesn't like my resisted power leads being plugged into the same types pins on as where the breadboard resisted power went. Even unplugging the power lead from Arduino's 3.3v doesn't help. It doesn't like the blue and white leads. If I untwist them and reset the board, all goes back to normal. I just don't see how they are different from what is on the breadboard.

Just to show, here is the back side of my board.

I don't do a lot of this, but what I don't understand is that measuring on the breadboard from power to R1 or R2, I get a full needle swing (I don't have digital). Measuring across either resistor doesn't move the needle. Then, going to my board, I can measure anywhere from power to R1, across R1, from red lead to either white lead or blue lead, and I get a full needle swing. It's like the resistor isn't there.
This is way too simple to be this difficult.


texts: Help with grounding a generator on a running vehicle

texts:
Ok, this may be basic, but I can't seem to find a solid answer. If I have an AC generator in use on-board a running vehicle (that is being driven), is a GFCI enough or must some sort of grounding be used? I'm not sure what that would be though. On a side note, in different forums I've found people talking about grounding and bonding - what's the difference?
Thanks a bunch.


texts: Measuring accelerometer frequency with an oscilloscope

texts:
I've got a VTI CMA3000-D01 digital accelerometer and I'm controlling it via SPI from a Texas Instruments CC2540 chip using the embedded 8051 MCU.

In the datasheet for the CMA3000, it mentions that in 2g mode, the output sample rate is 400 Hz or 100 Hz (depending on how the accelerometer is configured). There's also a "Motion Detection Mode" which works at 10 Hz sample rate.

What I'd like to do is change the configuration of the accelerometer to either 400 Hz mode or 100 Hz mode and measure the frequency on an oscilloscope to verify that I've actually made such a change.  This is mostly for me to better understand how to make useful measurements with an oscilloscope, and to get a better grasp on SPI.

I've recently purchased a Rigol DS1052E oscilloscope, so I'd like to know how to hook this up to my accelerometer to measure the output frequency, and what settings I need to use on the oscilloscope to make such a reading, and if it's even possible.

I've tried connecting the probe (at 10x attenuation) on the scope to the SCK lead on the accelerometer and the ground lead from the probe to the ground on the circuitboard, then hitting the "Auto" button on the oscilloscope, but it gives me a waveform with a frequency and voltage that jumps around:

I was expecting to see a square wave with a frequency of 100 Hz (this is what the accelerometer is currently set to in my software), but I got a sine-looking wave.  Now the above images may actually be correct, but I don't know enough to determine if they are, which is why I was hoping someone more knowledgeable in regards to SPI and oscilloscopes might be able to give me some direction, or tell me what I need to read to better understand this stuff.

It would also be great to know how to read output from the MISO port on the accelerometer to see what data is being sent back to the MCU. I'm not sure if this is possible to do with only a scope, or if I'd need a logic analyzer to see this data.  Thanks in advance.


texts: I have an audio circuit that I need to find the internal impedance of the circuit. How do I do this by only changing the output impedance of the circuit and taking measurements? I know I did this back in school but forgot how to solve. Basically, I need to find internal resistance of a black box without knowing the total voltage being supplied. Thanks!


texts:
For the longest time, I've stayed away from FETs and MOSFETs (when it comes to using discrete transistors in my circuits, that is).  I'm taking a current hobby project as an excuse to try and finally get comfortable with using them. However, I can't seem to make heads or tails from these beasts.

Before trying any real circuits, I'm running basic (almost "sanity check") LTspice simulations.  Extremely simple circuits, and they still don't seem to work.  For example, see this LTspice screen capture below — the voltage probe is at the output of the power supply; the current is measured through the resistor connected to the Drain pin.  It is supposed to be 1mA when the MOSFET conducts (V2 is 12Volts), and I expect it to go back to 0mA for 1μs when the input voltage is 0V:

BTW, if I make V1 a DC source, then it works: I set it to 0V and the current through R1 is 0mA (well, in the order of pA), and if I set it to 5V, current is 1mA.

What am I missing? I also tried with a 100Ω resistor from V1 to the gate; it just makes a little round-ish bump in the current when switching, but it still does not come back to 0mA. I also added a 10k resistor from gate to GND. See image below, showing the output of the simulation (and again: what am I missing?):

I do have some more concrete questions on the topic, but I figure I better get comfortable with the simplest "toy" circuits before I try to do any "real" applications (even in the context of hobby projects).


texts:
I'm using voltage dividers to drop down from high voltages like 327V peak to 2.5V peak and read it with an ADC. (Also reading lower voltages like 5V from various sources, so the above was just an example)

In that particular case I'm using 1.3Mohms with 10Kohms resistors, giving a current of 0.25mA, with 80mW power.

Should I use 130Kohms and 1Kohms? Power will get a bit high. Also, if I'm drawing 2.5mA with my measuring it might affect the circuit I'm reading.

The question is: At what current values does noise become a thing to look out for?


texts: Conceptual paradox with resistance in loop/node analysis

texts:
There are loop/mesh analysis and node analysis corresponding to Kirchhoff’s voltage law (KVL) and Kirchhoff’s current law (KCL), respectively.

Let's consider three elements, R,L,C, connected serially in the simplest way to some external voltage source.
With KVL and a charge variable \$q\$, we have \$(-\omega^2L+\frac{1}{C}+j\omega R)q(\omega)=v_\mathrm{ext}\$.
Let's consider three elements, R,L,C, connected parallelly in the simplest way to some external current source. With KCL and a flux variable \$\phi\$, we have \$(-\omega^2C+\frac{1}{L}+\frac{j\omega}{R})\phi(\omega)=i_\mathrm{ext}\$.

We see that such a resistor in the KVL of an AC simple RLC circuit can lead to a term proportional to \$j\omega R\$, which becomes a term proportional to \$\frac{j\omega}{R}\$ in KCL. And all other terms are real.
(Surely, if you divide or multiply these equations by \$j\omega\$, you get the impedances like \$j\omega L,\frac{1}{j\omega C},R\$.)

We know resistance entails dissipation, which is naturally related to imaginary terms. So I don't think these equation forms are meaningless. I hope to understand.
However, the imaginary \$\frac{j\omega}{R}\$ term in node analysis KCL seems to be smaller and smaller as the resistance increases. It appears somewhat counterintuitive. How to understand this?


texts:
I was wondering if it is possible to transform a TFT LCD into an AMOLED as both are active matrixes.
The composition seems to be similar.
AMOLED

TFT (LCD)

And if it wouldn't be possible, could I at least keep just the part that is very hard to manufacture (the TFT itself)? Maybe do the rest myself?


texts:
i am referring to this datasheet

http://www.cui.com/product/resource/cma-4544pf-w.pdf

As you can see, there is extra circuity needed apart from the microphone.
One thing i don't understand is the output impedance...the specs lists
output impedance of the mic to be 2.2 Kohm and in  the circuit a 2.2 Kohm resistor
is connected to terminal 1. I know the definition of impedance but my question is how is output impedance useful?

Thanks for the help!


texts: How to I wire this particular variant of 2.5mm female jack?

texts:
The second image has the pins not the top one.
Now the pinouts are a bit confusing here. Now, I've wired a jack before but none like this. Can someone please help me out?


texts: How to drive a speaker/microphone from a digital circuit?

texts:
I’m having a hard time understanding how to use speakers or microphones. My end game here is a sequencer

I’m going to lay out what I think so that you guys can correct me and help me understand why I’m wrong.

Suppose I built a square wave generator from a Schmitt Trigger using 5 V. From what I understand, the output will fluctuate between 0 V and 5 V.

But from my extremely limited understanding of speakers, as analog components they should “rest” at 0 V and fluctuate below and above 0. But isn’t voltage relative? Couldn’t we just “say” that 2.5 V is ground, and the oscillator actually fluctuates between -2.5 V and 2.5 V? How would I “set” that?

I’ve also heard that you have to use a coupling capacitor to block the DC component. In this example - a square wave from 0 to 5 V, what’s the DC component?  And how would we pick that? If I’m using an 8 ohm speaker, with a range of about 200 Hz - 20 kHz, this calculator would suggest that I should use a 200 uF cap if I want the -3 dB frequency to be at 100. Does that sound right? I’ve also seen diagrams where there’s a resistor between the negative end of the cap and ground... why?

Is 5 V even enough to drive one of those tiny 8 ohm speakers? Do I need a higher voltage? How would I go about amplifying the output if I did need a higher voltage?

If I were to turn off the oscillator, it would rest at 0v. But, as I assumed earlier, wouldn’t the speaker have to rest at the reference voltage of 2.5 V? How would I go about doing that? Or if I wanted to turn down the amplitude?

If I wanted two tones playing - two frequencies - how would I add their wave forms?

I basically have no idea how to do anything and I can’t seem to find a guide that both shows the circuit AND explains it.
I also have basically no idea how to use a mic.

Any explanations or links would be appreciated.


texts: Powering device through external power supply, programming via PC USB

texts:
Would really appreciate some help with this:
I have a set up for a project which has worked fine for a while. I have a 5V bench power supply that is powering an FPGA development board and the rest of the electronics (a rotary encoder opto-coupler circuit). The FPGA board became damaged as I mistakenly plugged the negative connection from the power supply into the 24V channel that feeds another part of the electronics for the project. This a dual channel power supply with the 5V and 24V channel negatives tied together. The negatives are not tied to ground.
To program the FPGA, it's USB port is plugged into my PC USB port. Before the FPGA was damaged, I was able to power the FPGA with the 5V power supply, and have the USB cable plugged into the PC.
Now that I have replaced the FPGA, when I plug in the USB cable into the FPGA, the FPGA power supply shuts down. Why is this doing this and why did it not do it before?
Also, should you always ground the negative of the power supply?
The FPGA is a Nexys A7-100T.
The power supply is an RS3305P.


texts: How to filter out certain wavelengths of light

texts:
I am trying to filter out certain wavelengths of light and I was wondering if there is a way that you can filter them out. I am using Silicon Photomultipliers (Linked below) and I only want to detect 830nm, not 400nm-825nm and 835nm-900nm but I can't find similar sensors who only work at this wavelength. Is there something that I can do to filter these out?

Thanks.

https://www.digikey.com/products/en?WT.z_cid=sp_516_buynow&keywords=AFBR-S4N44P163


texts: Difference on component size (Resistor, Capacitor, inductor)?

texts:
I am wondering if there is any difference (apart the size) between two SMD components who have same characteristics but different size, example:

RESISTOR, THICK FILM, 100k, -5%/+5%, 0.063W, 50V, -55DEGC/+155DEGC, 0402, SMD

RESISTOR, THICK FILM, 100k, -5%/+5%, 0.063W, 50V, -55DEGC/+155DEGC, 0603, SMD

If no differences, then why bill of materials and design don't use a single size instead of varying 0402, 0603, 0805 ?


texts: How to calculate how much wight a motor can lift?

texts:
I know it might be a naive question but am not really an electrical or a mechanical engineer, but am in a situation here and I need some help.
I work in motorized rolling doors and I need to know how to chose the right motor for the door I have. Basically I want to calculate how much a motor can lift,
maybe a general rule of thumb on how does it work.

So the information I have is Torque (Nm), hollow Shaft diameter (mm), voltage (V)
output speed (RPM), and motor output (kW).

And as an example of this is that i have an industral motor with

Torque = 450 Nm,
Hollow Shaft = 40 mm,
Voltage = 230/400 V,
Output Speed = 14 RMP
Motor output = 1,5 kW


texts:
I have a very basic question about the input current in a basic DC chopper. Following is a picture taken from the book "Power Electronics for Technology", by Ashfaq Ahmed.

Considering that the switch is ideal, then the power loss during the switching operation is zero and \$V_{\text{o}}I_{\text{o}} = V_{\text{i}}I_{\text{i}}\$. I understand that the input RMS current is the same as the output rms current, however, when I calculate the output RMS voltage and use \$V_{\text{o}}I_{\text{o}} = V_{\text{i}}I_{\text{i}}\$ to determine the output current, the values found are different.
Example: $$V_{\text{RMS}} = V_{\text{i}} \times \sqrt{d}$$ $$ I_{\text{RMS}} = \frac{V_{\text{RMS}}}{R}$$
Input voltage = 100 V, Load = \$10 \Omega\$, duty cycle = 0.4. The output voltage and RMS current are 63.25 V and 6.33 A, respectively. However, the input RMS current calculated by \$V_{\text{o}}I_{\text{o}} = V_{\text{i}}I_{\text{i}}\$ gives 4A.
What am I missing?


texts:
I recently bought a Digi XBee S2C Development Kit. This is my first time with XBee radios and I'm working with DigiMesh as I will be using sleeping coordinators to make the entire network sleep.

I managed to communicate two modules in API 1 mode by giving them the same ID and Channel and the network is created automatically as far as I know. I also used the network discovery in XCTU so I can see all the nodes in the network.

I want to know if there's any way to scan for nodes with a different network ID than mine and request joining to that network or send some kind of package to the coordinator of the network. I will explain my scenario so maybe this makes some sense.

I have 'central units' that will have GSM connection and this unit will collect data from multiple 'sensor units'. The 'sensor units' will send data to the 'central unit' using DigiMesh. The problem is, If I have all the units with the same network ID there's a possibility that two 'central units' that are nearby (this is totally possible) have their XBee join to the other 'central unit' network because they all have the same ID, and this is not desired. So, I wanted to make some kind of associating mechanism like WPS on WiFi, you press a button on the 'sensor unit' and on the 'central unit' so the 'sensor unit' joins the 'central unit' network. Is there any way to achieve this? How is this problem approached generally?

My last resource is to have all the units with different IDs hard-coded but that's not desired because if I put a different 'central unit' I will have to reprogram all the 'sensor unit' IDs to join the new 'central unit'.


texts:
The circuit is based on AD725 encoder, and the proto board is functioning relatively well. Here're the pics:

NTSC mode:

PAL mode:

Circuit detects PAL or NTSC mode using MCU, and performs automatic switching to the respective mode of operation and input clock.

As you can see PAL output is left-aligned to the screen border. While there's software way to adjust horizontal position of the image, it would be great if, when changing the mode (50 Hz <-> 60 Hz) image would adjust automatically.

I searched for available information, and did not find anything specific other than theory on how video works. My initial idea is to delay some signal, but that would be delaying all color video signals relative to HSYNC in PAL mode which potentially leads to significant circuit complexity increase.

And also not sure if it is so simple - colors are timed together with SYNC, and encoder may extract wrong information from the color channels due to timing discrepancies (like I had with my original big problem).

Are there any simple ways to achieve the outcome in-circuit - have NTSC image as it is and PAL image shifted right several pixels?


texts: Half Adder and Two Function, A Contest Questions?

texts:
I ran into a 2013 contest question on computer-science filed.

What is the following True about F and G function. (The output of Decoder is zero when disabled).

  I) Is equal.

  II) Complement to each other.

  III) the 1's in F is more than 1's in G.

  IV) the 0's in F is more than 0's in G.

Answer Sheet Select (1), But I think (2) is Correct. Who can verify me and hint how we can correctly solve such a circuit?


texts:
I have an educational assignment to make an floor-planning tool.

Can I use machine learning in some part of the algorithm? For example, I was reading the book Algorithms for VLSI Physical Design Automation by Naveed Sherwani, and here's a quote from there:

  Initial estimate on the set of feasible
  alternatives for a block can be made by statistical means, i.e., by estimating
  the expected area requirement of the block.

Can I use ML for that? Or there's no sense in doing so?
If no, is there some part where I can use ML?

Thanks in advance.


texts:
Forgive me if I misunderstand some basic EE principles -- I'm a CS guy. After some googling, nobody really explains how the chip runs faster. I understand voltage must increase per this related article.

Do we actually increase the frequency at which the chip operates?

A CPU runs at a certain frequency, which is programmed into it's registers. This frequency can be modified at any time to account for drifting, which is used to account for distance between the crystal and the CPU. (This is going from memory from years ago -- chances are every assumption here is inaccurate.)

So, the original frequency is defined by the crystal which, by the nature of a crystal, oscillates at a static frequency band. This in turn we program into the CPU, which will go on to do X number of calculations per millisecond.

At this point, overclockers manipulate the drift that is programmed into the CPU? My gut tells me that the drift registers can't increase the frequency enough to be relevant. So where does the increase in frequency come from?

Something that has just occurred to me is that just by applying more voltage, the 'bits' actually move around a faster..but then that wouldn't mean an increase in frequency, right?


texts: How should I start an electronics project?

texts:
Background

I have limited exposure to practical and real-life electronics (particularly in the analog world). I haven't made something all by myself from the ground. So to remedy this, I want to make something.

This is what I want to build, albeit a simplified version with 4 or 6 light things to hit.

I am envisioning it that you have to hit the lit up things n # of times and once you hit it the nth time a time will display to show how long it took.

Problem

Because of my lack of experience, I am not entirely sure how to start. Should I try searching for existing designs (cursory searches didn't find anything substantial)? Should I start by designing a circuit that would behave in that way, and if so, how do I know what components to use?

Brainstorming

Currently these are the things I think I might need:
LEDs, Resistors, Capacitors(?), some sort of programmable circuit board (Arduino?), certainly wires, power source (batteries), 555 timer?. (i like FPGAs but they seem to expensive for something like this)

Apologies if the question is too broad. Let me know if more information is required.


texts: STM32F103C8T6 - I2C communication with TI FuelGauge BQ78350

texts:
I am trying to establish communication between TI BQ78350 FuelGauge and STM32F103C8T6 using I2C/SMBus. The following is the I2C configuration used for the standard HAL I2C library.

static 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(__FILE__, __LINE__);
  }

}

When I try to transmit something to FuelGauge, using the following code there is no proper acknowledgement and response. Only the address byte is getting transmitted.

 HAL_I2C_Master_Transmit(&hi2c1,11<<1,0x09, 1, 100);

This is how the waveform looks in an oscilloscope.

On the hardware side, I am using BSS138 Mosfet to level shift between 5V fuel gauge and 3.3V STM32F103. Pull-up resistor value is 3.3k.

Any pointers to the cause of this issue would be helpful. Thank you.


texts: 230V 50Hz to 15V Switching Transformation

texts:
I have an audio circuit which is supplied by a voltage of 9V dc and 12V dc. These voltages are produced by means of a conventional transformer which transforms the mains 230V ac 50Hz to 15V ac 50Hz. After the transformer there is a rectifier (diode bridge and capacitor) followed by two regulators, one for the 9V dc and one for the 12V dc.

My problem is that the transformer produces a heavy magnetic field, which couples with my circuit producing a low hum. I am thinking about substituting the linear power supply with a switching one, thus avoiding the 50Hz magnetic field.

Now:

Is there around on the market a switching power supply with the requested characteristics?
Is it better to use a power supply giving directly the 9V dc and 12V dc, or is it possible to Step down the 230V ac to 15V ac (without using a Conventional transformer) and keep in place the rectifier and regulators?


texts:
To be honest, this is a homework question. Screenshot of it's given below.

And the  five choices are given below,

What I already know

I know that Eddy current is a  circular electric which is  induced within conductors by a changing magnetic field in the conductor.
Here the magnetic field is subjected to change, because  the rod is
made to move towards right

Simply, I am stuck on this question. I can not see a clear pathway to proceed.

So what is your way to approach and solving process for  this question?


texts:
The  Wavetek 144 HF frequency generator has an unusual power receptacle that I cannot identify. The link references the manual, which does not name the part. I'm not sure it isn't proprietary. Here is an image of the socket.

Is it an IEC 6320-C5 connector?

Failing finding a replacement, any advice on the best/safest way to adapt a regular power tail for this device?

Update

My friends and I discussed the options presented here, and finally decided that we would be able to modify the inlet using an IEC inlet and connector cable, trimming the IEC components rather than the nice case of the Wavetek. Thanks to Brian Drummond for the advice.


texts:
I'm pretty new to 'breadboard-ing' and I'm beginning to work with and need help understanding some basic concepts that I can't grasp.

Basically I've made a basic circuit with a push button for an LED light. There circuit is a basic circuit, powered by two double A batteries and there is a 220\$\Omega\$ resistor on the cathode side of the LED (from what I understand it doesn't matter which side it's on but that's the way I have it set):

The LED lights up when I press the push button. Victory.

The next set up is with a 3VDC Motor (350mA) and when I plug that into the batteries directly it spins. When I plug it into the circuit where the LED is (with the resistor) and press the push button, it doesn't spin:

BUT, when I remove the resistor and put a straight wire into the circuit it works great when I press the push button:

So obviously the resistor causes enough resistance to not spin the motor in the circuit BUT 220\$\Omega\$ seems like a very small resistor and would seem as though that should resist the circuit so much that the motor doesn't work at all.

I don't have a resistor smaller than 220\$\Omega\$ to try out but obviously anything more than that won't work if this doesn't work. I'm just trying to understand the concept of why this wouldn't work because I'm trying to chain some LEDs and motors together and the resistance obviously causes an issue.

I tried a capacitor after the resistor too but that didn't work (but maybe my concept is off so far; as I said I'm pretty new to this and am having trouble even knowing what to search for to get answers).

Thanks for your help!


texts: Controlling the current through a Diode Bridge VCF

texts: I'm investigating different analog low pass filter circuits and came across this Yamaha patent which ingeniously utilizes a diode bridge as a variable resistor. It takes some reading but in short: several transistors (Tr2-Tr5) act as a current source to provide a constant high impedance current to the diodes (from 'a' to 'b'). The relationship between the current through the diodes and the voltage across them results effectively in a resistance value. A signal is passed through the midpoints of the diode bridge ('c' and 'd') and and the effective resistance works with the capacitors impedance to filter out high frequencies in the signal. But having figured out how it works I'm not sure the current mirror/current source assemblage is really necessary. Could you not simply connect, say, Vcc to point 'a' and connect 'b' to ground? Couldn't you even leave in Tr4 between 'b' and ground and program it by sending a voltage to it's base?


texts: Is a protection diode needed on a TRIAC optocoupler and what for?

texts:
Please refer to page nine of the Sharp S108T01 / S108T02 datasheet:

Is this diode needed - why/why not?

How do I choose the correct diode, if yes?

UPDATE:  Thank you all for your educational inputs.  We've decided to go with the diode since it will not add significantly to the cost of our product (a vaporizer) and this will keep it on the safe side, right?


texts: I came across this component, it looks like a resistor but has no color bands:


texts:
I've been investigating non-thermal plasmas, specifically dielectric barrier discharges, where two electrodes, at a potential difference of several kilovolts, are separated by a dielectric and a gas gap. We've tried two configurations (shown below), one with coplanar electrodes and a sheet of glass as a dielectric, and one where the dielectric is a bed of alumina (AlO2) pellets.

A common method of characterizing the power consumed by the electrical discharge is by integration of a voltage -charge Lissajous (XY-phase) plot. In other words, the voltage across the electrodes is plotted versus the voltage on a serial capacitor (circuit schematic below). Ideally, the voltage on the capacitor should represent charge on the reactor.
In the conventional coplanar cofiguration, the pattern is as expected, in the shape of a parallelogram. However, with the coaxial, alumina packed-bed reactor the corners of the figure begin to round.

As a newbie to electrical engineering, I'm having trouble understanding the mechanism differentiating these two behaviors. The sharp corners of the first Lissajous should represent distinct discharges, where voltage exceeds breakdown and charge transfers in the form of plasma. How then could the packed bed lack these corners? Is it still an adequate measure of discharge power?


texts:
For my project I am creating a RISC processing architecture on an FPGA that can perform various basic instructions like adding, multiplying, subtracting, storing and fetching from memory etc. To prove my architecture I am using these instructions to control the speed of a motor using a PID control loop.
So the system has a potentiometer to set a speed setpoint, a direction and start/stop inputs, a motor driver to drive the motor with PWM, and an encoder to read the speed back. Its pretty simple.
I at the stage where everything has been tested individually and can now start controlling the motor speed with the PID loop. I am new to PID loops but have been reading up on them.
I read the speed setpoint from potentiometer and rotational speed from the encoder every 1ms. However in my program that I write with instructions that is ran at 100MHz, I keep calculating the speeds as they are refreshed every 1ms. So I calculate the same answer a lot of times before it is refreshed. This is no problem currently as it is only for display on 7 segments.
From my PID loop understanding, you need a fixed scan time as the integral and derivative accumulations will be skewed. Currently I have no means to do this as my processor will be calculating at 100MHz but the variables are only refreshing at 1ms.
I have two questions:

Should I add an interrupt capability to my processor to only run the PID code every 1ms as the speeds are refreshed?

Also in your opinions, is every 1ms too fast or too slow to refresh the values? This is a motor and encoder on a bench with no load so it probably doesn't even matter, I am just unsure.

If there is anything unclear, please ask :)
EDIT
Some additional process information:
Motor speed: Approx 1000 to 4000 rpm max
Motor no load, full speed current: 200mA
Motor load: Virtually nothing, just an encoder
Motor driver: L298n (PWM is created in FPGA logic)
Encoder type: Rotary incremental encoder, 2 12V channels 90 degree phase shifted, 1000ppr (doubled to 2000ppr)


texts: How to hook Raspberry Pi with Electret Microphone to detect sound levels in dB?

texts:
I have to detect sounds levels in an enclosed area, so I thought this could be the right choice.

/*EDIT
I wish to collect sounds levels of about 30-60dB, normally human conversations or just environmental noise. What I really want to achieve with this is to collect sounds that may be noticeable to humans.
*/

I purchased an Electret Microphone with Auto Gain from Adafruit https://www.adafruit.com/product/1713

I am trying to interface it with a raspberry pi 3 to detect sound levels, however, I have not been able to find a solution for it as most of the tutorials are for Arduino or other breakout boards, does anyone have a solution for this?

Understood that the output from the microphone is analog typed and I have an adc converter ADS1115 and MCP3008 that would be useful, but I have not been able to search for the solution that would guide me on using the microphone and the converter.

//EDIT I have been able to hook the sensor to the ADC and MCP, however, the values stay constant and do not seem to change at all, even playing songs into the microphone do not change the values. I get a constant value ranging from 200 to 300 on MCP and around 1056 on ADC.

Followed tutorials on https://learn.adafruit.com/adafruit-microphone-amplifier-breakout/measuring-sound-levels
but I need to output them in decibels on RPI, I need to send the data to a server.

I have been using Adafruit's libraries on MCP3008 and ADC1115, am I doing this wrongly?

I need to collect the sound levels in decibels and put them up into a server.

Cheers


texts: Buck Converter vs plain PWM Power modulation

texts:
I have a dc load that I'll be controlling with a fixed voltage DC source. The output of the load is proportional to the average power delivered (it's a heating element). Since the element is a fixed resistance (approximately) the power dissipated by the element is proportional to the voltage put across it. I have a 36 volt source, of which I wont need all 36 volts for most of its use--based on the likely amount of heat I'll need for my application. Is there any benefit to regulating the voltage down with a buck converter (i.e. with an inductor) vs just chopping the 36V with pwm to get the desired average power?

Would the case be different for a different type of a load such as a motor?


texts: How to insert background EM noise into pathloss equation?

texts:
I am trying to understand how to add the background noise into the equation. I am trying to work out the pathloss of a radio signal over a certain distance.

We have the Friis Formula for that for example. Now the Friis Formula has 2 parameters for the gains of the receiver and transmitter antenna. I don't necessarily know whether the antenna gain variable contains or is influenced by the atmoshperic noise. I think it's just the internal noise inside the antenna, like how a not perfect conductor will generate heat and that loss can interfere with the signal.

But even then to just be safe I like to use the maximum gain formula, as in the fundamental limit on the antenna gain for a theoretically perfect antenna, which I have talked about and asked some questions about here.

Ok so I read this paper:

"Atmospheric Magnetic Noise Measurements in Urban Areas" (2014) - Christian Schlegel, Matt Mallay, and Chris Touesnard

Where they break down the background noise, in this case the magnetic noise into 2 parts:

Thermal ( the heat energy in the air)
Atmospheric (micropulsation of the Earth's magnetic field)

They both disrupt the signal of the antenna, and basically at lower frequencies you have more atmospheric noise ,and in higher frequencies you get more thermal or even man made noise, at very high frequencies you get cosmic noise.

David Gibson also wrote an interesting paper on this: "Channel Characterisation and System Design for Sub-Surface Communications" (2003)

To keep it short, the formula is basically this:

$$F_a(f) \approx  294.15 - 36 \log_{10}f $$

I have checked it, it matches the data of both Gibson's research and that of the 2014 paper, which has experimental evidence, although there is a 20 db difference between indoor and outdoor noise. Gibson's research relies on the 1968 CCIR study, which might be obsolete now as the electromagnetic spectrum with all the new technologies affecting it have changed.

Question

The question is this: Could I consider this atmospheric noise as a fundamental minimum in dB that a signal has to have in order to be able to be detected by an antenna.

For example this formula says that a 1 Hz signal will have ~ 294.15 dB level noise interference, so would this mean that the receiver antenna has to receive higher than 294.15 dBW signal, probably way higher, in order to establish a communication channel. I mean the level of the noise would totally overwhelm any signal that would have a power level lower than this and it would be impossible to send information through.

So going with the Nearfield formula that I've talked about in my previous question:

A 1 Hz magnetic signal, going between 2 magnetic antennas placed 50 centimeter from eachother with a boundary sphere of 20 cm has a path loss of roughly 16 dB
Now inserting the atmospheric noise component, which is 294.15 dB (probably +20 dB higher in a building)
Would this mean that the total attenuation of the signal in this case is 310.15 dB? And note that this is the minimum attenuation, since we used the maximum possible gain for the antennas, and in reality the gain will be much lower, so the attenuation would be much higher. Also this would be the attenuation of the signal, the antenna would still receive the energy, it's just that you could not decode it due to the overwhelming noise interference.


texts:
I opened up an old soldering iron and when I took out the tip, I found this substance underneath that even comes on my hand if I touch it. What is this?
Is this still suitable for use?

Note- I really couldn't find a way to search this thing so forgive me if it's a duplicate of some sort.

Addition : I removed the tip and saw this -
Is this still good enough to use or should I replace the tip?
The tip heats up but solder won't stick and tip is just black.
I could clean it upto this level -

Why does it have a bluish tinge @ some places?


texts: K-map: how to decide which implicant to be prime

texts:
I am a bit confused about deciding which implicants to turn into prime. If I group implicants 1 and 2 into a bigger implicant, can I group implicants 2 and 3 as well?

For example, if I have the K-map below, I can find implicants as follows:

There are three options:

Group the red and orange into a bigger implicant.
Group the red and green into a bigger implicant.
Do both (1) and (2), resulting in two overlapping implicants.

Do I choose only one option or do all of them?


texts: what is the use of a resistor in the PNP transistor?

texts:
The R3 is connected to the output of the PIC, I could understand the NPN transistor but PNP was a bit confusing. When the transistor starts to conduct, some current will flow towards the base. My question:

What is the use of R3 in PNP transistor?
There is current coming from the PIC as well as base, now the two currents will be in opposite direction. So what happens?


texts:
I am designing an opamp based linear regulator for educational purpose.Please find the attached image.

I know that due to negative feedback voltage at the both terminals of the opamp will be same and is equal to Vref .Here it is 1.25V and Vout=Vref(1+R2/R1) and I obtained the proper 2.5V at output.
Now I removed the refernce and Vin(5V) is directly connected to Opamps non inverting terminal.

At this time the output obtained is 5V only as per the equation it shoud be 10V.May I know why
I am not getting 10V at output.Please tell me where I went wrong in understanding the circuit.


texts: Is this Bad Capacitor repairable on this power supply?

texts:
A capacitor blew on my B-Tron 16-8-1 power supply.

When I removed the cover and unseated and reseated the fuse. The power supply began to function again. BUT the power it was giving to each channel 13.4 to 13.44 volts DC.

I finally noticed a huge amount of tan colored build up between 5 Capxon 1000uf capacitors. And there is clearly a hole on the top of  of these capacitors.

Hi-Res images

Is it possible to repair this board? If so.. Is this board worth repairing? Why is it functioning if this capacitor blew? Is this unit functioning properly if each channel is giving me 13.4+ volts?

Please check out the hi-res images link above. Thanks.


texts: PNP array TD62783 output is not closing correctly when input signal goes down

texts:
I have TD62783 powered from 12V rail, inputs are driven from 5V rail by HC540. Each output has bunch of leds on the other side along with constant current sink (multiplexed 7 segment display).

IC18/BCR420 is not installed. Q6,Q5 = AO3400, R33 = 330Ohm

When HC540 provides hi level signal, TD62783 output turn on as it should. But if then signal goes low, output does not turn off as quickly as it should. It shuts down very, very slowly, so in effect i have large "crosstalk" between LED displays. Oscilloscope shows this:

Yellow signal is TD62783 input signal, blue is output signal.

Could someone tell me what may be causing this?


texts: Troubleshooting Hum in a Tube Guitar Amp

texts:
I have a Fender Deluxe Reverb Reissue guitar amplifier that hums whenever I turn on the reverb. It sounds like loud 60 cycle hum. The reverb effect is still applied, but is accompanied by the hum.

Here's what I've observed about the hum:

-It only happens when the reverb is on (switchable via the footswitch)

-The reverb knob affects the volume of the hum so the hum must be before the reverb level pot in the circuit

-The hum persists even if the reverb tank is disconnected

-If I turn on the vibrato, the effect is applied to the hum as well (in other words the volume of the hum is modulated according to my vibrato speed/depth settings)

Here is a full schematic:

And here is the reverb circuit:

Because it still hums when the tank is disconnected, and goes away when the footswitch is pressed, I have isolated the possible source of the hum to this portion of the circuit (after the return from the reverb tank and before the point that the footswitch grounds i.e. pin 3 of the reverb pot):

So I went thru with my multimeter/component tester (after discharging the capacitors) and tested all the passives here. Nothing looked abnormal although I didn't measure ESR or anything, just capacitance and resistance.

I tried replacing all of the tubes as well. I haven't tried powering this thing up and taking any measurements yet, I want to try to do as much as I can with the thing discharged first.

I suspect the last tech who was in here made a mistake when recapping and doing repairs. There are some questionable solder joints in here, the connection to the plate of one of my power tubes was hanging on by a thread!

I've tried to clean up some of the solder joints and clip some leads that were left unclipped etc just to rule out the physical stuff.

Does anyone have any advice on how to further troubleshoot this issue? Maybe someone has an idea of where this hum might be coming from?

UPDATE: Per Lars's suggestion, I shorted the reverb return to ground and the hum still continued. So now it's looking like the problem is in that gain stage in the above screenshot.

UPDATE 2: C17 seems to have higher than usual ESR, will replace it and test again.

UPDATE 3: With a brand new C17, the hum continues.

UPDATE 4: Probed around that gain stage for DC voltages and compared to what's written in the schematic. TP22 (the voltage at the cathode of V4A) read 1.4V just as expected.

UPDATE 5: The hum is much louder when the footswitch is plugged in. I'm starting to suspect the footswitch or something in that area. I noticed the footswitch's cable has no shield, just a few insulated wires.

UPDATE 6: Rewiring the footswitch with shielded mic cable significantly improved the hum! Now it is pretty faint unless you turn the reverb up all the way (with or without the footswitch, makes no difference now).

Ordering new capacitors for the power supply to try to troubleshoot the rest of the remaining, more subtle, 60 and 120 Hz hum.

Resolved! In fender reissues put in a NOS mullard 12at7/ecc81 into V3....clean tubes pins first though.


texts: How to calibrate opamp to eliminate input offset/bias current and offset voltage?

texts:
I am doing on a project using opamp OP07 to amplify a current.
Here is my schematic:

The problem is, the output I obtained is not highly precise as I expected. For example in the figure above the \$ V_{output} \$ should be \$ -2.2V \$ which means \$ \tilde ~-4.84V \$ but I am obtaining \$ -5.14V \$. I know this is due to many parameters: input offset current, bias current, offset voltage ...

I just wonder is there anyway to make output more accurate? Any calibration method available?


texts:
simulate this circuit – Schematic created using CircuitLab

I'm trying to solve the following circuit using mesh analysis. Here is my equation. The goal is to find the value for Vx. **Vx is the also the parameter over R3

Loop1

i1=1mA  ----------------------Eq1

Loop2

2k(i2-1mA)+3+1k(i2)=0
i2=-1/3000A   ----------------Eq2

Loop3

1k(i3-1mA)+2vx-3=0
1ki3=Vx-3    -----------------Eq3

Loop2 again

1ki2-Vx+3=0 ------------------Eq4

Sub(Eq2)into(Eq4)

Vx=7/3V


texts: What are the effective power limitations of the flyback converter topology, and why?

texts:
Looking at several different isolated converter topologies, flyback looks like it's the simplest at first glance. There's only one switch, so there's only one driver, which (all other things being equal) should reduce the cost. However, at high power levels (5kW+) flyback seems to generally not be considered practical. I asked why early in my career, and the answers I got were vague.

I met one person who was commonly winding his own flyback transformers; he said he got 500W out of one once, but just barely, and with lots of rewinding to optimize the transformer. The commercial manufacturers I talked to went silent, or asked what insane thing I was doing to want a flyback transformer that big.

An old book I came across said that flyback transformers need to be operated at high frequencies, and the available switches couldn't survive the stresses of a flyback converter at those power levels. However, it wasn't clear on why those stresses were worse than other single-switch topologies, like boost converters. Nor was it clear on why the frequencies needed to be so high. I suspect it's because exceptionally tight coupling is needed across the transformer/coupled inductor, which limits the choice of core materials and sizes, dictating frequency choice, further dictating switch selection. But that's just a guess.

So what's the real deal? What's the effective power limit of the flyback topology, and why?