texts:
I'm trying to write a 24bin-32bcd BCD counter. Can anyone explain how to implement it ? Here is my code: http://tpcg.io/JOHf4IFj but it needs to be checked. I have some problems with "valid" in my simulation wave. On the picture
[1]: https://i.stack.imgur.com/WG6dJ.jpg you can see 1-expected output (9bin 12bcd: http://tpcg.io/cDAmZMUl) and 2 - actual wave.
Help me please, check my code and point out my mistakes.
Thanks !
module bin2bcd(
    input wire clk,
    input wire nrst,
    input wire start,
    input wire [23:0] bin,
    output reg [31:0] bcd,
    output reg valid
    );

    reg [23:0] bin_in;
    reg op;
    reg [3:0] cnt;

    always @(posedge clk or negedge nrst) begin
    if(nrst == 0)
            bin_in <= 0;
    else if(start)
        bin_in <= bin;
    end
 always @(posedge clk or negedge nrst) begin
        if(nrst == 0)
            op <= 0;
        else if(start)
            op <= 1;
        else if(cnt == 24 - 1)
            op <= 0;
    end

    always @(posedge clk or negedge nrst) begin
        if(nrst == 0)
            cnt <= 0;
        else if(op)
            cnt <= cnt + 1'b1;
        else
            cnt <= 0;
    end

    function [3:0] fout(input reg [3:0] fin);
        fout = (fin > 4) ? fin + 4'd3 : fin;
    endfunction

 always @(posedge clk or negedge nrst) begin
        if(nrst == 0)
            bcd <= 0;
        else if(op) begin
            bcd[0] <= bin_in[23-cnt];
            bcd[4:1] <= fout(bcd[3:0]);
            bcd[8:5] <= fout(bcd[7:4]);
            bcd[12:9] <= fout(bcd[11:8]);
            bcd[16:13] <= fout(bcd[15:12]);
            bcd[20:17] <= fout(bcd[19:16]);
            bcd[24:21] <= fout(bcd[23:20]);
            bcd[28:25] <= fout(bcd[27:24]);
            bcd[32:29] <= fout(bcd[31:28]);
          end
        else
            bcd <= 0;
    end

    always @(posedge clk or negedge nrst) begin
    if(nrst == 0)
        valid <= 0;
    else if(cnt == 23 - 1)
        valid <= 1;
 else
        valid <= 0;
    end
endmodule

`timescale 1ns/10ps

module bin2bcd_tb;

    // parameter
    localparam T = 20;

    // declaration
    reg clk, nrst;
    reg [23:0] bin;
    reg start;
    wire [31:0] bcd;
    wire valid;

    // instantiation
    bin2bcd uut(
        .clk    (clk),
        .nrst   (nrst),
        .start  (start),
        .bin    (bin),
        .bcd    (bcd),
        .valid  (valid)
    );
initial
 begin
        $dumpfile("wave1.vcd");
        $dumpvars(0, bin2bcd_tb);
    end

    // clock
    initial
    begin
        clk = 1;
        forever # (T/2) clk = ~clk;
    end

    // reset
    initial
    begin
        nrst = 1;
        @(negedge clk) nrst = 0;
        @(negedge clk) nrst = 1;
    end

    // test 4 instance
    initial
 begin
        // initiate
        bin = 0;
        start = 0;

        // wait for reset
        repeat(2) @(negedge clk);

        // test 0
        @(negedge clk)
            bin = 0;
            start = 1;
        @(negedge clk)
            bin = 0;
            start = 0;
        repeat(15) @(negedge clk);

        // test 0b1001
        @(negedge clk)
            bin = 24'b1001;
            start = 1;
        @(negedge clk)
            bin = 0;
            start = 0;
        repeat(15) @(negedge clk);

        // test 0b1111
        @(negedge clk)
            bin = 24'b1111;
            start = 1;
        @(negedge clk)
            bin = 0;
            start = 0;
        repeat(15) @(negedge clk);
 // test 0b1_0000
        @(negedge clk)
            bin = 24'b1_0000;
            start = 1;
        @(negedge clk)
            bin = 0;
            start = 0;
        repeat(15) @(negedge clk);

        // test 0b1_1111_1111
        @(negedge clk)
            bin = 24'b1_1111_1111;
            start = 1;
        @(negedge clk)
            bin = 0;
            start = 0;
        repeat(15) @(negedge clk);

        // stop
        $stop;
    end
endmodule```


texts: Trying to understand FPGA input pin impedance

texts:
From working with classical microcontrollers, I am used to the fact that pins in input mode appear to have high input impedance - when connecting them to a high voltage, only a small current flows, and the voltage is sampled in order to obtain a digital state reading.

I'm using a ice40-HX8K FPGA, and I have a pin set to input, and connected to some inner working of my core. When I briefly connect the voltage supply to the pin, it is indeed registered as a digital HIGH by my core (it's an interrupt line), but such a high current flows that the whole board browns out for a split second.

The external circuit looks as following:

The pin is declared as an input in my top level module:

module top(
    // ...
    input INT0
)

And connected to a pin of the FPGA in my pin constraint file:

set_io INT0 P16

Did I understand something wrong here? Are FPGA input pins low impedance?


texts: play-pause music by a foot switch in a website

texts: I want to make a web application that can allow a user to change, play and pause music with foot switch paddle. I can easily do this with a mouse or keyboard but I don't know how to take input from foot switch paddle in a website. Please help me.


texts: What is relevance of Norton's theorem over Thevenin's theorem

texts:
I am well aware of the importance (more appropriately, implication) of Thevenin's theorem in real-life circuits. Output impedance of amplifiers and the 'stiffness' of a power supply (such as the domestic mains power) has its theoretical roots in the Thevenin's theorem. See Norton's and Thevenin's theorems importance.

What I am not able to get is the need or importance of the Norton's theorem in a similar way, beyond undergraduate education. Are there any practical uses or importance of the Norton's theorem in any domain of electrical engineering (or even beyond!)?


texts: Purpose of components in op-amp radio circuit

texts:
I am trying to understand the purpose of a couple of components in a schematic I am looking in at:

My questions are:

1) What exactly is the 100k resistor attached to the diode doing?

2) Why is the output of the rightmost op-amp fed into a transistor? Could the audio signal not be pulled directly off the output of the op-amp?

Thank you for your responses.


texts: How to write data to this dataflash memory

texts: I'm trying to write data to a W25P80 dataflash memory using an mbed. The documentation says there is a read data instruction for reading data from a section of memory by sending the opcode 03h followed by the address to read. However, I see no corresponding write data instruction. So how is data written to the flash memory?


texts: Add ufl connector to internal patch antenna

texts:
Hey i am using Ublox neo 6m gps for some project and it has a U.fl connector and i dont have an antenna for it.I went to buy it and shopkeeper game me an ceramic internal antenna with a pin at its back

like this,how can i add u.fl connector to this antenna?


texts: How do I verify my solution is correct for a circuit diagram?

texts:
The original problem:

The trouble I'm having is that I'm not sure at all if my boolean expressions from the circuit diagram for (1) are correct; I also know that I definitely did (4) wrong since I didn't end up having to use a NAND gate. Moreover, I don't know where I went wrong.


texts:
Is there an easy way to identify exactly which LED I have? (So I can buy more that match in brightness).

I don't see any markings. Easiest thing I could think of is to measure the IV curve, but I'm not sure that will give me enough info to narrow it down. I don't have a way of measuring brightness, but maybe that would give me enough info to get something close enough...


texts: In practice, what is the difference between the "nominal plant model" and the "plant model"?

texts:
I am reading a book on nonlinear control and disturbance rejection, and in many examples, they distinguish between the "plant model" \$G_p(s)\$ and the "nominal plant model" \$G_p(s)\$. They also add that the discrepancy between these two models adds uncertainty that is lumped with disturbance. They specifically called this "unmodeled dynamics", or "modeling errors".

Nominal model was defined as the system's dynamics in the absence of modeling errors. On another hand, it was described as "the ideal model".

In another example, they provided expressions for \$G_p(s)\$ and \$G_n(s)\$.

I am very confused:

Is the nominal model the desired model? (i.e. do we want to reach it?)
Is the nominal model an imprecise idealization of the plant to simplify the mathematics?
Do we know both \$G_p(s)\$ and \$G_n(s)\$? In the book both were provided. If we know both, then what is the point of idealization and/or modeling errors?
How does it work in practice? Do implementations by researchers and engineers target \$G_p(s)\$ or \$G_n(s)\$?

I am really curious about both the theoretical and implementation side. Any insight is immensely appreciated.


texts: Transponder on Key Fob ineffective when below 40 degrees Fahrenheit

texts:
This webpage https://www.grupopremo.com/3dc11lp-3d-isotropic-smd-coil-for-transponder-125khz-238-720mh-13x116x315mm/485-3dc11lp-0238j.html says that my key fobs 3-Axes Transponder should work in  temperatures between -40 ºC to +85 ºC.

The last 5 times I left the key fob in my vehicle while it was in the garage I had to blow in my key fob for a good 3 - 5 minutes to get it to start the vehicle ( 2017 Dodge Journey ) at first I thought it might be the battery so i tried replacing it and also removing it completely and it did the same thing.

My personal transponder says Premo 5% X-D0240-066R3 42/16TB, Is there a button inside of the 3 sets of coils that locks in place, I cant figure out why it freezes up in 32 - 40 degree Fahrenheit temperatures?


texts:
What do I need to look out for when converting 9V example schematics to 12V?

Most of my ICs work until 18V, and it seems to me all the resistor divider stuff is based on ratios, so it should scale (correct?).

For LED resistors etc the 9V resistors should be more or less within the tolerances.

I usually need to do this for things like comparators in light sensor circuits and things like that: not incredibly complex, but i am constantly wanting adapting them to 12V for using relays, large batteries etc.

The thing I am not sure about for instance, is that for say a LDR based light sensor using a voltage divider and comparator it should effect the sensitivity right?
The reaction of LDR is the same but the voltage is higher so that swing represents a smaller change in the ratios.
This seems like it would be minimal..

Anything else to keep in mind, or is such a small voltage increase not usually a problem?

Example schematics:

I am at the stage in electronics where I can decipher and understand the idea what circuits are doing and understand datasheets, but I am pretty sloppy still with all the calculations stuff!


texts: Can I use a switch rated as 250VAC 25A to switch 50VDC 25A?

texts:
I am looking for a switch that can handle 25A continous current, the voltage will be maximum 50VDC, most often about 46VDC, and it will be used to switch on two dc-dc converters that have no load connected. The load will be switched on after the main switch is on.

Is this safe?

Switch:
http://www.ebay.com/itm/291078954518?_trksid=p2059210.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT


texts: Do double sided 2.54mm pin headers exist?

texts:
I like gluing together premade 1x female - female jumper wires and putting male pin headers on everything because its the least amount of manual labor I've found to be able to do to make wired connectors.

Sometimes I need a longer wire though. I've been breaking off little pieces of thick copper wire to put between the female jumper wires as a sort of extension patch but its nowhere near ideal, sometimes they slide and they are annoying to do.

Now I could get myself some male-female jumper wires to extend the female-female ones with but I'd like to keep the different types of parts I have to a minimum to ease organization. Also I have a crapload of female-female wires already.

If only the other side of the breakable male headers was long enough to make contact with a female connector, I could just put those between them instead. Has anybody seen those for sale anywhere? Do they have a special name?


texts: Is a CAN enabled microcontroller sufficient to drive a CAN bus?

texts:
There are a number of CAN modules built into microcontrollers these days. The PIC18F2480 is an example of that. Is that microcontroller (with built-in CAN) capable of driving a CAN bus on its own or is an external CAN transceiver/controller required?

I believe CAN has both a software and hardware layer and by the looks of it these CAN-enabled microcontrollers appear to have just the software, but it does not state that it can or cannot drive the CAN bus as is.

I'm looking to connect more than six microcontrollers through a CAN bus and would like to know if I need a transceiver across all of them or whether the built-in stuff can handle the communication from a software and hardware perspective.

Assume that I'll have necessary termination resistors and other small discrete components (caps, resistors, etc.)


texts: What is the maximum amount of ripple input voltage a linear regulator can handle?

texts:
Greetings fellow EE's:

Referring to the classic LM78xx series, I notice there is no specification on the maximum amount of ripple voltage these devices can handle at their input terminal.

So for instance a 7812 with 16VDC fed to the input. Let's say you have 15-20% of voltage ripple. It's probably okay, and yes it will be attenuated through the regulator, but is there a rule of thumb or maximum amount for best performance?

Your help very much appreciated.

A...


texts: I have a PCIe reference clock generator chip, ASVMPHC-100.000MHZ-LR (datasheet), but it generates a sinusoidal waveform at 100 MHz with an amplitude of ~750 mV.  Should I be running this through a NOT gate or something to generate a square wave before sending it to the PCIe slot?  If so, what logic level should I use?


texts: Power amplifier shows 0 input and output resistance

texts:
I have a non-functioning transmitter for a radar I've built. When I was checking for shorts using a multimeter, I noticed that the resistance measurements between RFin and GND and RFout and GND of my power amplifier (SE5004L) were practically 0 (about 0.8ohm). The datasheet specifies that these ports are matched to 50ohm. I thought I might have damaged the device during soldering so I performed the same measurement on a brand new SE5004L and got the same result. Moreover there is no short between the voltage supply pin and GND (confirmed when hooked up to 5V as well). Am I faced with two bad chips, or is the measurement I'm performing flawed, or does this result somehow make sense?

If the chips are bad, how do I prevent this sort of thing (especially considering one of the chips is fresh out of the packaging)?


texts:
I am very curious to see how a USB signal looks like but couldn't find any related article and graph still. Is it possible to see the shapes of USB and TTL data signals by using an oscilloscope. Will they be square waves and look like very similar?

My question may sound a bit weird but I always read that USB is very complicated to understand so at least I was hoping to visualize the change in USB signal when it is converted to RS232. The graphical representations in time domain. Time vs Amplitude.

I have many questions in my mind such as: "Is USB serial data less noisy than RS232? ect."(under the same circumstances with RS232) I really want to see how both USB and TTL data looks like.

I found a nice article with waveforms of RS232 and TTL. Here seems TTL is more noisy waveform than RS232 which is converted by MAX232.

But still couldn't find about USB.


texts: Solder stripped USB-C cable to Keyboard PCB

texts: The cable that came stock with the board had 4 wires in it. They were red black white and green. Where should I connect them? Also some pads on the right might be lifted so I don't know if it is fixable in the first place.


texts: Why the voltage across MOSFET (VDS) is increasing even when the voltage at the gate (VGS) is constant?

texts:
Following is the screenshot schematic for Buck-derived half-bridge isolated DC-DC converter in LTSpice.

In the following plot it can be seen that when the lower switch is turned off the voltage across it (purple) rises to a maximum value and it makes sense because the voltage across a switch is maximum in the off state. When the upper switch is turned on then voltage across it starts rising (yellow), but the voltage across a switch is zero (minimum) when it is in on state. At first I think that this rise in VDS is due to decrease in the Vg as the boot strap capacitor is discharging. But when I plotted the VGS (green) it is essentially constant well above the threshold value. My question is how the VDS can change if VGS is constant?
Also why the voltage across the upper switch (with VGS=0V) changes to zero when the lower switch is turned off as highlighted on the plot?

Inductances are calculated using the relation \$\ sqrt(L_p/L_s)=1/n)\$ where n is the turn ratio I assumed Ls to be 1uH and then Lp is found

Here are the associated simulation files


texts: Pulling different voltages directly from AA alkaline cells wired in series

texts:
I need to power a miniature LED light show that will draw a few hundred mA, or possibly more, and requires less than 5 Vin, and a microcontroller board that wants 7-21 Vin.
I was thinking the easiest solution would be to use 3 AA alkaline cells in series, to provide 4.5 V, which is fine for the light show, and then 3 cells in series with that to provide 9 Volts, which is good for the microcontroller board, which will only draw 20-30 mA. Then I wouldn't need to worry about a voltage regulator, and wouldn't have to do worry about heat dissipation inside the electronics enclosure, I've heard that those Voltage regulators dissipate heat under heavier loads.
So, the two systems will have a common ground connector, and two different V+ connectors.
But many places I've heard that it's bad to combine more depleted batteries with less depleted batteries, and since the first three cells will have more current draw than the next three, that will eventually happen. But I don't understand it completely, because surely not all batteries will be exactly equal in terms of capacity, so sooner or later one battery might get discharged while the others still have charge, even for conventional setups?
So will the above setup work, and is it OK practice? Or am I being paranoid regarding the voltage regulator solution? The thing is that I'm not completely sure about the power draw of the light show, because it will also depend on the contents of the show itself. I only know it's within acceptable limits for alkaline AA cells.
I see a similar question has been asked, but it focused on rechargeable batteries, and the answers focused on problems related to charging, while my question is specific to alkaline cells that are not going to be recharged.


texts: voltage regulator prevent back flow of current?

texts:
I have solar cell with peak volt=9V and I=300mA. I want to charge 6V acid lead battery 4.5Ah.
I'm thinking to put L7809 voltage regulator to prevent spike in voltage of solar cell and at night time there will low voltage at solar panel.

1.Does voltage regulator prevent voltage back flow from battery to solar panel?

2.Do i use voltage regulator or not?(this will reduce the life of battery if not use? right)


texts:
I am usually in need of powering my microcontroller projects with 5V. Typically this is not a problem, as I use any power supply (converted PC power supply, wall adapter, USB, etc.).

However, when I need my projects to be portable and lightweight, I am not quite sure what the cheapest/easiest way to accomplish this would be. The additional requirement is that I would like to use 3.7V LiPo batteries. This is simply because they are much smaller than any other solution, and can pack a lot of power. Also because I have many lying around.

If I was using something higher than 5V, then I would just use the L7805 to drop it down, or some other solution. So how would I step up the voltage from a 3.7V battery to 5V in the cheapest and smallest way possible? Is there a widely used IC which accomplishes this task?


texts:
I have a 5V ultrassonic sensor HC-SR04 and I want to read the value and (if > x) turns ON output 1 and turns OFF output 2  and (if < x) turns ON output 2 and turns off output 1.

Outputs are 24V so I would use a transistor or a relay to turn on the outputs with the arduino.

The only way I know is to use an Arduino. But dont you think it's overkill? Is there a simple way to do this?


texts: How to observe the signals of a radio remote control using CubicSDR?

texts:
I have to admit I'm a complete newbie with regards to radio frequencies and such ... :-(

Thanks to this site I've been able to find out what transceiver is being used in the remote control I'm investigating [1].  The datasheet is here [2].

I have a USB-based SDR (R820T from NooElec) and CubicSDR. Now I'd like to find out what happens when I push a button on the remote control. But I have no idea what band to use (FM? What is FMS? NEFM? you see my problem ... ;-) ).

From the datasheet, I've understood that the remote control could transmit signals on several frequencies, such as 433 MHz, 868 MHz or 915 MHz. So I tried to set the observed frequency centre in CubicSDR (see the screenshot with 915 MHz, I think!). But when I press a button on the remote control I don't see any change in any of the different windows.

I'd very much appreciate your help with this. Any pointers to educate myself are appreciated as well!

PS: Obviously, I've looked at the CubicSDR documentation (http://cubicsdr.readthedocs.io/en/latest/) but I can't make head or tails of it.


texts: How to derive the gain (ratio of output voltage to input voltage)

texts:
$$
\frac{V_c}{V_s} = \frac{\frac{j}{\omega\cdot C}}{R+\frac{j}{\omega \cdot C}}
$$

Given this starting formula, how to rationalize the denominator and find the gain?


texts: Two different ceramic decoupling capacitors in parallel

texts:
I am trying to repair a motherboard that had a shorted ceramic capacitor (1206 package) in position B. The voltage across the pads is ~19V. I put in a 10 μF 25V-rated ceramic cap, and the motherboard could be powered on, but the cap quickly became very hot (75°C after a couple of minutes), even when the board was just plugged in, and not powered up. The smaller ceramic cap in position A is in parallel with the cap in position B, and they seem to be decoupling the power supply for the IC in position C.

Fundamentally, my question is how to puzzle out the capacitance of the shorted cap (or, alternatively, an explanation of why the 10μF cap might be inadequate). But a secondary question is why the need for two ceramics (of different capacitance) in parallel.

One idea is to just get the datasheet for the IC, and see what decoupling cap values are specified. Unfortunately, googling the markings on the IC ("EN=FG 82W") don't lead to any obvious result. Perhaps someone here is knowledgeable enough to identify the chip by its appearance.

Needless to say, I don't have access to the schematic, and the manufacturer wasn't forthcoming with the needed info.


texts: PIC18F452 interfacing with HD44780 LCD in assembly

texts:
I have been trying to get a Hitachi HD44780 LCD to work with my PIC18F452 for a few days now, with no luck. I have tried moving the data lines to different ports on the microchip, I've tried interfacing it with a few arduino's I have lying around, and also swapping the LCD out for another - but all that comes up on the display is a single line of block characters.

I am writing the PIC code in assembly and have it wired up on a breadboard - I have triple checked the connections to make sure that they are to the correct pins on the microchip. PIC has a 10Mhz crystal attached to it, using PORTE for LCD control pins, PORTB for LCD data and PORTD for LED outputs.

My init subroutine for the LCD is

LCD_init:
    delay_t 15, msec, delay_timer
;;  AN5/E0 = RW, AN6/E1 = R/S, AN7/E2 = E
    movlw b'00000010'       ;; PORTA shared w/ PORTE, set pins to DIGITAL
    movwf ADCON1

    clrf TRISE          ;; Clear TRISE - PORTE as outputs
    clrf TRISB          ;; Set PORTD to outputs

;;  Function Set - 8-bit, 1 Line, 5x8 map
    movlw b'00110000'       ;; 00l DataLength NumbLine Font x x
    movwf PORTB
    movwf PORTD
    call LCD_send_command
    delay_t 5, msec, delay_timer
    call LCD_send_command
    delay_t 100, usec, delay_timer
    call LCD_send_command

;;  Display On/Off
    movlw b'00001110'       ;; 00001 DisplayOn Cursor Blink
    movwf PORTB
    movwf PORTD
    call LCD_send_command

;;  Entry Mode set
    movlw b'00000110'       ;; 000001 Inc/Dec Shift
    movwf PORTB
    movwf PORTD
    call LCD_send_command

;;  Clear Screen
    movlw b'00000001'
    movwf PORTB
    movwf PORTD
    call LCD_send_command

;;  Data write test
    movlw b'01001001'
    movwf PORTB
    movwf PORTD
    call LCD_send_char

    return

My LCD_send_command subroutine:

LCD_send_command:
    call LCD_busy       ;; Wait for LCD to finish command
    clrf TRISB          ;; Set PORTD to outputs
    bcf LCD_rw          ;; Clear R/W
    bcf LCD_rs          ;; Clear R/S
    bsf LCD_enable      ;; Pulse E High...
    delay_t 1, msec, delay_timer
    bcf LCD_enable      ;; ... then low
    return

My LCD_send_char subroutine:

LCD_send_char:
    call LCD_busy
    clrf TRISB          ;; Set PORTB to outputs
    bcf LCD_rw          ;; Clear R/W
    bsf LCD_rs          ;; Set R/S
    bsf LCD_enable      ;; Pulse E High...
    delay_t 1, msec, delay_timer
    bcf LCD_enable      ;; ... then low
    return

My LCD_busy subroutine:

LCD_busy:
    setf TRISB          ;; Set PORTD to inputs
    bcf LCD_rs          ;; R/S = 0
    bsf LCD_rw          ;; R/W = 1
    btfss LCD_BUSY      ;; BUSY_FLAG, skip if set
    return
    bra LCD_busy

Please let me know if there is anything else you need from me, any help would me much appreciated. Thank you.


texts: What does "injection current" mean in the context of a microcontroller datasheet? Specifically, I have the following on a dsPIC:


texts:
I am trying to implement the circuit as shown below.

I essentially want to be able to control the gate voltage of the NMOS to change the resonant frequency from 5GHz to 2.5GHz. For a transistor size of 20um/1um, I swept the gate voltage for about 20 points from 0 to 1V and the resonant frequency did not change (maybe by a few kHz).

The issue seems to be that the source voltage is not fixed. I checked the DC voltage at the source node and it varies depending on the gate voltage. There is also no path to ground. Do I need to add a large resistor to provide a path to ground for the DC current?

Could anyone provide how this issue is solved or refer to useful documents? All documents I see just model the MOSFET as a switch and don't actually show how it is implemented.

The voltage swing at the output is around 100mVpp. Thank you.


texts: In wifi modules what does the shield have to protect?

texts: All wifi modules have a shield over the chip but what I’m wondering is if the track to the antenna need to be shielded or is it just the chip that needs shielding ? Thanks Ben


texts: Why is the unit for capacitance so large?

texts: Most capacitors are in the µF, nF and pF range. I know there are some special ones that go that high, but at the time faraday was around, and the unit was named after him, they didn't have such a thing. Why is the unit so large if we rarely use caps with that high of a value?


texts:
How would you suggest charging 2S lion pack from any USB port?
One thing is to Enumerate the USB port and decide how much current we can draw. There are ICs for this, but I would prefer complete module with the circuitary already implemented.
The next thing is proper charging profile for the Li-On (CC/CV), balancing those 2 cells and if they cannot be charged independently then we would need step-up from 5V to 8.4V.
What would be simplest approach to this?


texts:
I am a unskilled in this domain, so I hope you can bear with me a little.
I am doing a project for my teacher and I chose to do this

I tried to search for the best suitable values for the components and I put them on Pspice.

V5.Vamp=0.8v,fre=1k,Voff=0v.

After stimulating using

I get this graph

I am not sure if this is how it supposed to be. Is there anything wrong that I did?

Thanks in advance.


texts:
What is the difference between monolithic and non-monolithic dc-dc converters?
For example this is monolithic dc step down controller: LTC3609


texts: ESD protection of battery operated device in metal case

texts:
I have a board design inside a metal case (video processing MCU), and it has one external USB port with ESD protection on all pins. It's battery powered and handheld. The exterior metal case is not tied to the ground of the internal circuit board. In fact the board essentially floats inside the metal housing on plastic standoffs, with the processor pushed up against the metal through a gap pad for a heat sink.  I don't have the option to go to a plastic case.

The problem is that occasionally when someone touches the unit, or hands it to another user it goes bonkers. I suspect ESD, but I'm not sure of the right path to fix it. If it were a plugged in device I'd do ESD protection to ground. But in a portable case I don't see where I can redirect the energy to. I'm left thinking about using an ESD protection coating that greatly increases the resistance of the outer case.

But is there another option I'm not thinking of?


texts: Decoding multiple quadrature rotary encoders

texts:
Scenario

I have 4 ACZ16 quadrature rotary encoders connected to GPIO Port D on an ATMega168P. I am only trying to extract rotation direction from them. Position is irrelevant, and it is guaranteed only one encoder will rotate at any given time. Debouncing is handled in hardware using the recommended debounce filter in the datasheet and there is no switch bounce visible on the scope.

Problem

Differentiating between the encoders is not a problem. Where I run into hurdles is extracting the direction. My first thought after some Googling was a pin change interrupt.

Resulting ISR:

ISR(PCINT2_vect)
{
unsigned static char int_count = 0;
unsigned char pins = PIND;
unsigned char send;

if(int_count == 0)
{
    switch(pins)
    {
        case 0x7F: send = MIRROR_X_L; break;
        case 0xBF: send = MIRROR_X_R; break;
        case 0xDF: send = MIRROR_Y_D; break;
        case 0xEF: send = MIRROR_Y_U; break;
        case 0xF7: send = LASER_X_L; break;
        case 0xFB: send = LASER_X_R; break;
        case 0xFD: send = LASER_Y_D; break;
        case 0xFE: send = LASER_Y_U; break;
        default: send = NOTHING; break;
    }

    if(send != NOTHING)
    {
        sendSPI(send);
    }
    int_count++;
}
else
{
    if(int_count == 3)
    {
        int_count = 0;
    }
    else
    {
        int_count++;
    }
}
}

This detected rotation in the correct rotary encoder, but only one direction. A clockwise rotation is decoded correctly, a counterclockwise rotation is still decoded as a clockwise rotation.

After further Googling, I tried a polling approach, using similar code.

Resulting main loop:

while(1)
{
    switch(PIND)
    {
        case 0x7F: send = MIRROR_X_L; break;
        case 0xBF: send = MIRROR_X_R; break;
        case 0xDF: send = MIRROR_Y_D; break;
        case 0xEF: send = MIRROR_Y_U; break;
        case 0xF7: send = LASER_X_L; break;
        case 0xFB: send = LASER_X_R; break;
        case 0xFD: send = LASER_Y_D; break;
        case 0xFE: send = LASER_Y_U; break;
        default: send = NOTHING; break;
    }

    if(send != NOTHING)
    {
        sendSPI(send);
        _delay_ms(40);
    }
}

I played with multiple delay values following my SPI transmission, thinking that would fix the issue (actual cycle time is about 20ms), but this approach exhibits identical behavior to the pin change interrupt example. A clockwise rotation is decoded correctly, a counterclockwise rotation is still decoded as a clockwise rotation.

Most methods I've found, such as look up tables do not scale well past one, maybe two rotary encoders. What is a better way to do with with multiple rotary encoders?


texts:
I am experimenting using gps devices. I managed to utilize a NEO-6M gps module, but it only works when there is a direct 'optical' connection to a satellite (aka it does not work inside a home, under a roof or inside a bag. It needs to be outside)
So i wonder what sort of ICs do mobile phones use, since they can work inside buildings etc (even without a sim)? Is there a specific family of GPS ICs which is good and cheap that almost all phones use?


texts: FET DC operation in the ohmic region if the SOA curve doesn't have a DC line?

texts:
From my understanding, the SOA lists the drain current for a given VDS in the ohmic and saturation regions where the FET can function without damage.
I read a thread that says FET SOA graphs with short pulses and no line for DC operation are not rated for DC in the linear mode/saturation region.
Thread in question: What's the difference between field-effect transistors (FETs) marketed as switches vs. amplifiers?
Can these FETS  operate with DC in the ohmic region without an SOA line for DC operation?
I don't have a specific FET in mind but I plan on using a FET driving a relay that will remain closed for an extended period of time while DC flows.
Here is my schematic(I forgot the gate resistor):

Related thread: Undestanding the SOA of MOSFET from the datasheet?


texts: How do residential analog and smart meters measure power?

texts:
I'm building my own digital meter in order to upload the data to a SQL database; up until now I know that there are several parameters being measured into a digital watt-meter:

volts, current, apparent power, instantaneous power, actual power, power factor

However, I still have to understand which one of these is the real value used to increase the counter on both devices. To be more precise with my question, old analog meters couldn't do all these calculations, and still they worked out as intended. However with, no linear loads being more and more common, I'm guessing the power factor in a common house would be hanging around .7 or .8 so how does this change in the type of load would affect the measurement in a digital vs analog watt-meter?

My first guess would be that analog meters measure REAL POWER, but I can't be so sure about digital smart meters.

How do they work?


texts: Battery powered device hardware design tips

texts:
I'm working on a prototype product(Wifi motion sensor) that will be powered from a battery source, it has a mega328(arduino bootloader, with sleep mode on and wake on interrupt,and WDT in case it hangs up), a PIR motion sensor , and a CC3000 break out board.

Power saving is done in software, but what type of battery should I use? I initially used 2AA with LT1302-5 boost converter, but I think it was not able supply enough current for the CC3000 module, it could not start the SSID scan also the LED on the break out board dimmed out a bit.

Now I'm thinking of using 4AA and using a 5v LDO regulator.

How do I go about it?, what other options I have, I need 5V to operate the circuit. I've never designed a battery powered project before. Should I use different type of battery,LiPo perhaps?

Peak current of 150mA is drawn when communication is going on, draws and 10mA when its asleep.
Let me know if you need more details.
Circuit Diagram

The LT1302 IC is soldered exactly as in its data-sheet.
Source code
https://github.com/hemalchevli/Sketchbook/blob/master/PIR_LP/PIR_LP.ino

This is how to looks


texts: How do I limit the current drawn by a DC fan to increase battery life?

texts: I have a simple 5 volt DC circuit powered by a LiON battery.  Running a fan that is rated at 5 volts 100mA-300mA.  The battery has a 1000mA output max so the fan draws its full 300mA.  I am looking for a way to lower the current available to the fan to 100mA so I can, in theory, triple my battery life.  How do I accomplish this?


texts: Why the difference between maximum junction temp (150°C) and storage temp (165°C)?

texts: Many integrated circuits I have seen have the specification of maximum junction temperature (150°C) but storage temperature is invariably higher (165°C) and often lower, e.g. -55°C. Why the discrepancy? Surely the junction will be damaged whether or not it has current flowing through it...?


texts:
I have these ESD protection devices on my SPI lines. Now, my SPI clock is at approx 4MHz. I go as high as 20MHz.

The datasheet states the following -

It shows 0.1pF at 1MHz. Will this capacitance increase at higher frequencies ? WIll it affect my system (SPI) ?


texts: Can anyone help to id the component from la-d933p motherboard?

texts:
The component is placed on dell laptop la-d933p motherboard
And is connected to AON6992 mosfet


texts: Effects of "loading down" Voltage-Divider Circuits

texts:
Hello I am currently a beginner in the world of electrical engineering and would like some help on voltage-divider circuits.

My question mainly concerns the "loading down effect". Can someone please explain what this effect is and what effect it has on a simple voltage divider circuit?

Please try to keep it as simple as possible without going into too much detail, I want to know the main idea behind it.


texts: Short range wireless pulse transmission in wind anemometer

texts:
I have an old windmil-type anemometer, something like this:

(Illustrative image, the real unit is 40+ year old soviet-made device with presumably no operational active components inside)

My project is to hook it up with sensors, so I can read and record wind measurements. I need to record orientation of the windmill and rotation rate of the rotor blades. The problem is, that the system has two rotating axes and I cannot run any wiring across any of them. Also, I probably cannot take the thing apart, so any sensors would have to be surface-mounted.

So far, my plan is to use a lot of magnetic switches. For the orientation - I can mount a magnet on a freely rotating part of the windmill and just attach a barrage of switches to the fixed bottom rod. I can run any amount of wiring and power up there.

For the rotation of the blades, magnetic switch seems to be also sufficient, just like in the bike tachometer. The problem is, that I still need to cross one rotation axis with the resulting pulse signal. Few centimeters of wireless transfer only.

I would like to have everything passive, so I don't have to worry  about replacing batteries. As I said, I can run any kind of power to the base of the windmill, since it's attached to the building.

My google searches along the lines of "wireless passive switch" failed so far, but I am sure some induction-based element should be able to do the trick. But it seems I don't have the right keywords.

I am not really good in circuit construction, so I prefer a solution out of fewest readily available components possible. Also, it will be surface mounted outdoor system, so it will have to endure a lot of extreme external conditions (typical European temperature/humidity cycles).

I am also open to any other suggestions on what type of sensor to use. I can foresee that the rotation of the blades could be inducting something directly, with the induction detectable at the base wirelessly.


texts: Trying to find and bridge USART pins from the manual of an STM32 board

texts:
I am trying to solve an issue regarding a firmware with this 64-bit Nucleo Board.
I have the hex file and can see the ready source code but when I upload the firmware I am not able to communicate through virtual port via PC USB port.
I was suspicious of the USART settings and I noticed the firmware I am trying to use is using USART3. And in the Nucleo's manual here the following is mentioned:

If I am not mistaken I need to do the above wiring to be able to communicate with the PC. Because in my case the firmware is configured for USART3.
And in my case USART3 is set as following:

So in my case the USART3 pins are:
PB10: USART3_Tx
PB11: USART3_Rx
And below is the board's connectors and pins:

My questions are:
1-) If what I am trying to do is correct, in my case(with this board) I need to connect:
PB10 to CN9 pin RX
PB11 to CN9 pin TX
If correct, which are PB10 and PB11 pins on the board connectors?
2-) I have the board in my hand and I cannot see any pin numbers on CN7 neither in real nor in the manual. How is it found which pin is where?
Edit:
Seems like I found the pin out here:

So my question is reduced to: Is the following correct way?:
D6(PB10) to CN9 pin RX(D0)
D10(PB11) to CN9 pin TX(D1)


texts: Optimal method for multiple MOSFETs for LED driving with a shared power rail

texts:
I have three LEDs (RGB), with the following forward voltages and current:

red 2.25 V @ 0.35 A
green  3.3 V @ 0.35 A
blue 3.1V @ 0.35 A

I plan on using three (3) RFP30N06LE MOSFETs in parallel @ 0.35 A each using independent TTL-based PWM dimming from the PWM pins of an Arduino, each MOSFET connected in parallel to a shared 9V - 12V @ 1 A power rail fed with a wall wart supply.

What would the optimal method be to wire these MOSFETs in parallel and use the same shared power rail?


texts: What is this connection of resistors? Parallel or serial?

texts: How i can simplify this electric circuit?


texts: Nodal analysis with ideal operational amplifier

texts:
I want to do a nodal analysis on this circuit

Before I do the nodal analysis I want to construct an equivalent circuit, such that the analysis is easier. My question is if the my constructed circuit is equivalent to the original one and if it is possible to make a even easier looking construction?


texts: Motor works on 9V battery but not 9V power supply

texts:
I had a motor that was working on a 9 V battery

I now want to connect it to a charger that has 9 V output.
When I connect the motor to the 9 V charger sparkles poop out.

The charger is rated at 1.5A, is this too much for this motor?
I cant find the current rating of the 9 V battery. The battery is a 'Krona' brand battery.

What can I do to get the motor to work from the 9 V charger?


texts: 5.8GHz omnidirectional antenna inside wood

texts:
If one would enclose 5.8GHz transmitting omnidirectional antenna inside dry wooden block (wood would be cut to semi-precisely fit the antenna), how much it would attenuate the signal? (roughly)

And would coating the wood with lacquer worsen the situation considerably?


texts: Portable electronic musical instrument: energy from pressing keys, no batteries: feasible?

texts:
on one hand electronic musical instruments are very nice (lot of features: change tonality, change timbre, small number of mechanically breakable parts ), on the other hand they need external power source (electric wire, batteries) so they are not really "long term" portable and one needs to take care about batteries.

Would it be feasible, from engineering point of view, to construct musical instrument which gets energy from key pressing (imagine a keyboard) using EM induction or piezoelectricity? By feasible I mean especially energy, i.e. can key pressing provide enough energy for feeding all needed electronic and speaker to produce sound loud enough? Pure energy balance should be OK (piano does not have batteries and is loud) but (as a stranger to electronis) I do not know what are (energy) efficiencies of different electronic components (circuits, speaker...).

Thanks.


texts:
heyy, I study software so i'm absolutely new when it comes to drawing electrical circuits and I need to add a new instruction to This MIPS machine here

The new instruction i have to add jt - jump table - is an instruction which makes it possible to go to the address indicated by a value in memory at the address indicated by two registers:

jt rs, rt # PC := mem[ R[rs] + R[rt] * 8 ]

Its encoding is as follows:
• Instruction [31-26]: Operation code for jt
• Instruction [25-21]: rs registry number
• Instruction [20-16]: rt registry number
• Instruction [15-11]: 0
• Instruction [10-6]: 0
• Instruction [5-0]: 0x20
Can someone explain to a complete beginner (me) the process to add an instruction like this one on the diagram? Thanks for your time.


texts: anyone knows miniature wireless system with data rate >= 2000 Hz?

texts:
I am currently using TS7250 board from "embeddedarm" for my sensor and having it set up at 30 KHz for data rate. However, the board is too big for my current application. Can anyone recommend another off the shelf product (size <3 inch^2) with date rate >= 2000 Hz?

Thanks a lot.

Kerith


texts: How to use input/output termination resistors in filters?

texts:
NOTICE: I have added another question here that a solution for each one may help for solving the other one.

Please look at  Fig-1  below. It is a common usage of termination resistors. R1 , R2  work for impedance matching and R2 also reduces the return signals ( specially we have them when Q>> 1/√2).

Firstly, input resistors (R1) are based on line driving. What about the PCB ? in PCB we have not coaxial lines . Should we need them ?

Second question is my specific problem: my filter receives the signal from a source with 75Ω impedance and sends it to a FPGA with a very large input impedance (Fig-1 ,2 ). When I connect R1 as Fig-1, filtering performance is fair ( Q=0.6) with slow slope but if I connect it as Fig-2, it shows satisfactory performance ( No Return Signals ) and if I remove it, many return signals will appear.

I am confused about the theory: If the device impedance is very high ( say in MΩ region), why putting a relatively small resistor (20KΩ /1MΩ  )in series with that should stop return signals ?

And Finally, how I can relate these resistors to other steps impedances (for best Quality factor across the whole Cauer design)?

Additional Information:   The main purpose is designing a very high quality LPF for a DDS (that I have designed with FPGA ) for removing aliases that follow Nyquist diagram. The device at the output are the Differential pins of FPGA Xilinx XC3S400. Any help that lead to best design is highly appreciated.

Pictures:
I just put these designs as example , I am using a 3 pole Cauer LC filter but the same result with the circuits in these pictures

Fig-1  Original Design:

Fig-2 My test circuit:


texts: Why cascode transistors contribute little to overall noise in an OTA?

texts:
I have read this sentence below in a paper which describes a low noise amplifier. I can't understand the reason why cascode transistors contribute little to overall noise in an OTA?. Can someone explain me the reason?

Also, I search in the group and I have found a similar question which has posted one year before but the answers don't help me.


texts: Measuring 0-240v 50-60hz Mains AC with Arduino/MCU

texts:
What is the proper way to measure 0-240v 50-60hz Mains AC with an arduino / 3.3v mcu?

(Edited to include a diagram of a proof on concept, which is transformerless)

Can anyone confirm that this is the right choice, or provide reasons why this wouldn't work as I intend, given the requirements mentioned below? Keep in mind, I plan to use this in a commercial product

I've been researching the webs through so many ways to accomplish this, from octocouplers, mid400, LM2902N, tl081, voltage dividers, transformers, etc.. for a production product I have in mind, but I haven't ended up an any clear solutions. I'm hoping to get a clear sense of direction.

I'll leave this at the basics and provide more info needed.

I found these seemingly simple devices on amazon, same concept, being plugged into a general US home outlet, but I want to accomplish it using an Arduino. (I.E. I want to read the output via serial.)

https://www.amazon.com/dp/B00PBW5A4I/
https://www.amazon.com/Yeeco-Display-Digital-Voltmeter-Voltage/dp/B00PZBEJ7Y/

Requirements:

Read value of 0-240v (or higher) from AC Mains 0-240v 50-60hz to analog input of 0-3.3v for a microcontroller. (+/- 1% tolerance is probably acceptable aside from 0)
Safety from reverse polarity/shorts
Safety from voltage spikes
Smallest form factor possible. Unit is handheld & battery powered, so prob not enough room for transformers.
Low heat dissipation (all parts are enclosed in small handheld unit)

Not worried about:

Isolation to user (device is presumed to be live)
Powering the device from mains (mcu is powered by battery)


texts:
I'have to build a buck converter with the following requirements:

$$\text{1) Input voltage (Uin): 12 Volt}$$
$$\text{2) Output voltage (Uout): 5 Volt}$$
$$\text{3) Voltage ripple (on the output) 0,1 Volt}$$
$$\text{4) Output current of 0,5 Ampere (when you short the output resistor)}$$

The Dutch word functiegenerator is a functiongenerator, that produces the input puls.

The MOSFET is a P-Channel MOSFET IRF9540n. And the voltage drop on the diode is 0.6 volts

The question I've are the following:

The formula for getting the right duty cycle (that you've to set on your fuctiongenerator) is that given by:

$$D=1-\frac{V_o}{V_{in}}$$

And how can I calculate the minimum value of my capicator and inductor?

Thanks in advance


texts:
I took 18 samples of a sine signal(Va) of frequency 50Hz and sampling frequency of 900Hz  using Matlab.
I want to phase shift the signal with 120 deg. where my result=Va*(e^j120).
As we know that multiplication of e^j120 will only phase shift the signal with 120' since its magnitude is 1.
I want that phase shifted sample here.
Please help me out how to do it using VHDL.


texts: Can a solid capacitor be damaged by a heat gun?

texts:
I used a heat gun to solder a 32 pin SOIC IC (DIR9001) and after I was done I saw that a cap nearby (solid cap) got EXTREMELY hot and started to discolor (yellowish hue).

Is it possible that the cap died? It hasn't exploded or something.


texts: Low voltage (<3V) signalling on USB DP/DN - will it work?

texts:
I'm using a microcontroller (specifically, the STM32L1) that integrates a USB device full-speed interface. I want to supply it with just 2V VDD, which is within spec for that micro. But that means USB pins DP and DN, in particular, will be driven high to 2V, while the USB standard calls for a high level voltage of 3V.
I suspect that, since USB signalling is differential, driving DP and DN to 2V only would still allow proper operation (event though that would not pass USB certification).  Is this a correct assumption ?
Thanks -


texts: Can a thyristor be built from two transistors?

texts:
Supposedly, an SCR/thyristor is just a simple, four layer PNPN semiconductor.

If that's the case..

When a circuit calls for a SCR/thyristor, and there isn't one available, can it be substituted by (i.e. crafted from) two BJTs (or other discrete components, for that matter)?

Here are a couple of examples I had in mind; anode = blue, gate = green, cathode = orange:


texts: Huge spikes and sudden offset in accelerometer data (FRDM-K64F & ADXL357)

texts:
I'm working with vibration analysis on electric motors (AC). I have a mBed FRDM-K64F with a EVAL-ADXL357 connected to it - mounted onto a motor.

The device samples from the FIFO 4000 times per second, and afterwards converts the samples to m/s^2 and transmits them to our server. It does this one time per hour.

The first 4000 samples (after the microcontroller has been reset) look like this (converted to m/s^2) - The data here looks fine, except for the huge spikes:

The following 4000 samples look like this:

And the third, and following, package(s) of 4000 samples look like this:

When I reset the microcontroller the same "process" happens again.

The piece of code I use to sample from the accelerometer is the following:

SPI accl(PTD2, PTD3, PTD1); //mosi, miso, sclk
DigitalOut cs(PTD0); //Chip Select
int idRawData = 0;
uint32_t axisMeasures[37000];
Ticker tickRawData;
float sampleRateRawData = 0.00025;

void tickFuncRawData() {

    cs = false;
        accl.write((0x11<<1) | 0x01);
        for(int i = 0; i < 9; i++) {
            axisMeasures[i+idRawData*9] = accl.write(0xAA);
        }
    cs = true;

    idRawData++;

    if (idRawData == 4000) {
        tickRawData.detach();
    }
}

tickRawData.attach(&tickFuncRawData, sampleRateRawData);

In order to find out what causes the problem, I have implemented some "printf" logging to output data at various stages in the sampling and converting process, and these are the first 9 entries in the axisMeasures array, from the third package of 4000 samples (the third chart):

No. 0. Value = 86  //x
No. 1. Value = 102 //x
No. 2. Value = 65  //x
No. 3. Value = 85  //y
No. 4. Value = 86  //y
No. 5. Value = 32  //y
No. 6. Value = 88  //z
No. 7. Value = 27  //z
No. 8. Value = 192 //z

The corresponding x, y and z values converted to m/s^2 are:

270.96, 267.62, 276.32

So basically the problem is that huge spikes and later a huge offset are/is gradually "added" to the samples. These extremely high values are not generated naturally by the vibration coming from the motor.

I hope you can help me solve this issue.
Please let me know if your need more information AND please bear with me - I'm not so experienced when it comes to electrical engineering :-)

Thanks!

Link to datasheet for ADXL357: ADXL357 Datasheet


texts:
simulate this circuit – Schematic created using CircuitLab

I have found this questions and the circuit seems worong to me because  the output terminal hasn't end point.

  If we add  a more diode into the circuit will it be explainable? is the circuit has been drawn in a right way??


texts:
I am performing eye safety calculations on a device and I have hit a roadblock.
To perform the calculations I have been following the IEC 62471 "Photobiological safety of lamps and lamp systems" Standard.
I am using three IR LED arrays. One has 34 IR LEDs and the other two have 3 IR LEDs. The arrays utilizes the SFH 4243-Z IR LED from OSRAM.
OSRAM Provides an eye safety document in order to calculate if your set up is potentially hazardous to the eye however, their examples when calculating the burn hazard has me confused.
I will post an example they provide that is the most similar to my device. However I will ask my question first because the snippet may be confusing at first.
EXAMPLE SUMMARY:

They have 20 X IR LEDS , which operate for > 1000 seconds
Each LED has a Radiant intensity of 160 mW/sr
In total the array produces a radiant intensity of 3.2 W/sr
When they perform the retinal burn hazard calculation they only use 160 mW/sr and not 3.2 W/sr. (I have highlighted this in red in the snippet below)
Because they only use 160mW/sr, the value of L_IR is calculated to 58.7 mW/mm²/sr, which falls within the exposure limit of 545.5 mW/mm²/sr.
Therefore, this would pass and be NO RISK
However, if this value is multiplied by 20 for the entire LED array (3.2 W/sr) you get 1174 mW/mm²/sr which would FAIL the limit
This calculation is used in this way for all of their examples.

Therefore, my question is: Why is the radiant intensity of only one LED used for the burn hazard calculation and not the entire LED Array? Is there a scientific reason for this?
Here is the example:

Thank you
(For additional information Equation 10 has been appended below)

For a description of my IR LED arrays, in relation to the eye, here is a simplified picture I have drawn for my setup. Each LED has a typical radiant intensity of 11 mW/sr


texts: From which circuit, I will be able to measure high frequency signal (in MHz) by using micro controller with 200 Ksps ADC?

texts:
I want to measure 20 MHz signal by using microcontroller with 12 bit ADC And 200 Ksps sampling rate.
Which circuit should I design in order to measure it accurately?


texts:
I wanted to build a device which can stay and move underwater (let's say, for instance, 15m underwater).

Since RF frequencies are very attenuated by water and VLF antennas would be too high, I was thinking of using a cable which connects the device to an antenna which is on the surface. I have seen that a good idea is that of using an optical fiber, but I am totally unskilled with it (I think it will more suitable for me to choice something at RF frequencies or lower) and moreover I wanted to know if there were the possibility of finding something more flexible.

So, my questions are:

which kind of cable do you think will be more suitable? For instance I think that a 15m coaxial cable at RF frequencies may attenuate a lot the signal.
which voltage supply value do you advice?
which frequencies will you choose for that application? In case of a coaxial cable, I'd say that it is good to use low frequencies, since the attenuation constant increase with frequency, but I do not know which is the best range. Moreover, I'd say that the signal, once arrived at the underwater device, should be amplified with a low noise amplifier, and since this kind of operations is difficult at high frequencies, I'd prefer not so high frequencies if it not necessary (but if it is necessary, no problem)

Obviusly it is a hobby, so my idea is that of choosing a compromise between price, flexibility and performances...


texts:
Let's say I take my multimeter and measure the voltage across the poles on my battery, I get some reading X volts. I then put a resistor between one terminal and the adjacent probe, this resistor has resistance Y ohms.

First:

simulate this circuit – Schematic created using CircuitLab

Then:

simulate this circuit

What will the new voltage reading be?


texts: Extend life of hygrometer? (Prevent breakdown over time)

texts:
Context: I'm working on a gardening project using a microcontroller to power grow lights and other related components after I've built on top of it.

Case: I was interested in adding some hygrometers to detect their moisture levels rather than guess-timating when it'd be appropriate to water them.

Issue: One design issue I've seen repeatedly when researching the subject: if hygrometers are used to detect moisture levels in soil over prolonged periods of time, the metal will begin to corrode causing accuracy/sensitivity issues.

Q: Is there a way to prolong their life to prevent corrosion+retain accuracy, or some tips for instrumentation people may not be following? Would a hygrometer be the sustainable solution here considering the Case and Context?


texts:
This is the circuit i'm creating.

BTW: The light pink area is a D flip flop.

(From left to right)

The green area is a microphone with a preamp.
The signal passes through a low pass filter, with a cutoff frq. of 300Hz (Yellow)
It then passes through a peak detector, which holds on to the peak value until the capacitor discharges [discharge speed controlled by a 150Ohm var. resistor] (Orange)
An op amp is acting as a comparator. If the signal that comes off the low pass filter is higher than the (smooth) peak detector signal, it should output 5v, other wise, 0v. (Light blue)
This signal then gets smoothed by another peak detector, which discharges 0.25 seconds. (Purple)
A D FLip Flop, toggles between the Q and Q' terminals, which should turn on either transistor (Pink)
The change in resistance across the 555 timer circuit, replaces a 100k Ohm potentiometer, being turned backwards and forwards. I hope that this will toggle a servo between to definite positions.

In essence, all I want is for the servo to toggle between to definite possitions, to the beat of music.

Is there an easier way to achieve my essential goal?
Does my circuit work like I think it should?
Do you have any ideas on how i could improve/fix this circuit?

The original PWM Controller:


texts: Wiring up ESP8266 relay (Shelly 2.5) to power receptable

texts:
I have several of the Shelly 2.5 relays:
https://shelly.cloud/knowledge-base/devices/shelly-25/
I'm trying to wire it up to a power board. The power board has four outlets, so I'll assume I need two relays per board, with each one linked to two of the outlets.
Here is the front of my powerboard:

Here is the rear, showing the L/N/E poles:

What is the correct way to wire this all up?
And in terms of physical connections - is the best way to drill in from the black plastic at the rear? How do I secure the jumper leads to the gold terminals? (Solder?)
Or is there an easier way to do this?
This is also available in a two terminal version - although I only have a single power cable coming in - so I assume I'll need to jumper the two - not sure if that makes things easier though?


texts: What's the difference between 3 and 4 quadrant triacs?

texts:
I'm looking at triac datasheets, in particular this datasheet for BTA16 series triac. The "electrical characteristics" section is split into two parts: snubberless/logic level (3 quadrants) and standard (4 quadrants).

I have no idea what this is referring to. Are they different devices, as suggested by the column titles? Are they different operating modes? What is the difference?


texts: What are the capacitors between 5V and Gnd for?

texts:
In this article:
http://playground.arduino.cc/Main/MAX72XXHardware#Wiring

In particular the circuit of interest is:
http://playground.arduino.cc/uploads/Main/MAX72XX_Schematic.jpg

Functionally, capacitors resist changes to voltages. What is the advantage of this in this circuit?


texts:
I have another curiosity question:
Why is there a 10-pin AVR ISP connector and a 6-pin version?
It seems that the only difference is that the 10-pin version uses the extra pins for a heap more ground pins.
I personally prefer the 10-pin version because it is much easier to get 10-pin IDC connectors at most electronics stores. I have only seen 6-pin connectors at really specialized online stores like Digikey and Element14.
But why is there the need for so many ground connectors?


texts: How to detect whether a bathroom stall is closed?

texts:
I've got a bathroom stall with a sliding bolt and would like to detect when the door is closed and locked. I'll receive the state of the door with an Arduino Uno

Not sure what's the best way to go about this, would I use a hall effect sensor?


texts: What is the best way to design GUI on ARM cortex-M microcontrollers?

texts: STM currently supplemented emWin for free, but it got a Win98-ish style which is not very user friendly. Is it possible to use qt to design UI? What are the recommended approaches?


texts: Any downsides to greasing electrical connections?

texts:
I learned long ago, living in Buffalo NY, that any and every electrical connector I service in my cars needs grease stuffed in it or it rusts out FAST
So why don't we put any grease or other coating on card-edge connectors???
Reason I ask, I was recently put in charge of the test lab here at work (or all things electrical at least).   These test machines are predominately LabView based systems i.e. they are standard Dell PC's.   However, they only get fired up maybe once every other year or less.
I tried to run one a couple weeks ago, wouldn't boot.   Being an EE, and having serviced computers for the last 30+ years, I gravitated immediately towards pulling the cards and reinserting.   Did that a few times, and the machine booted no problem.
Which makes me think -- Should I grease the card-edge connectors in these bad boys???   Or is there something about grease and PCB's of which I'm unaware and it would cause more problems than it would prevent???


texts: What is maximum frequency of ADG506 Multiplexer?

texts:
I want to use AD506 as a multiplexer in a high frequency design (50MHz).

It receives 1.2 Vpp sine wave signal from AD9850 and sends the signal for amplification.

According to page 2 of its datasheet, its transition time is 200ns. When I convert it to frequency I assume it should support up to 5MHz.

But it works just fine up to 50MHz ! I want to know if I have a mistake in my calculation or the device really supports higher frequencies or its working in such high frequency may lead to damage or something?


texts: How to build a digital potentiometer with standard value resitors and MOSFETs?

texts:
I like to create a digital potentiometer with standard value resistors and MOSFETs.

The principle is easy: I put a lot of resistors in series and parallel to each resistor I have a MOSFET which shortcuts the resistor. Then I control the MOSFETs with digital signals from an Arduino.

I tried this with 3 resistors and 3 MOSFETs and in principle it works fine.

For my project I want results from 300 Ohm to 100k Ohm with 1% tolerance for each value. With 100k Ohm this means only 1k tolerance, no problem. But for 300 Ohm this means maximum 3 Ohm tolerance!

I guess the theoretical easiest approach is to use resistors like 1, 2, 4, 8, 16, 32, ...  Unfortunately most of those values are not or very difficult available.

So my idea is to use standard 1% resistors like 10, 15, 22, 33, etc. They are easily available. But if I use every E6 series value between 3Ohm and 68k Ohm I end up with 26 resistors and 26 MOSFETs and 26 digital outputs. That's a lot!

So now my question is: Did anybody have a similar problem and figured out how many of those resistors are actually necessary to archive the goal to have the outputs mentioned above. I am sure I don't need all the values. But which once can I skip. I would be able to get reasonable results by letting my PC do the work and just try all combinations. But that's not very scientific and maybe there is a better way.

My question: Which commonly available resistor values do I need to archive accurate in series results between 300 Ohm and 100k Ohm with max 1% tolerance?

Here is some more info because I guess some questions will come up in the comments.

This question is similar to the following but it's not the same.

Logarithmically-spaced resistances using switches

Electronically switched decade resistance box design

I looked at available digital potentiometer. I didn't find what I want for two reasons. Many of those digital potentiometer ICs have 20% tolerance! Best case I found 4% tolerance. Most of what I found are linear, not logarithmic. And many, maybe all, allow only very little current. I found 1mA max current. That is not enough for what I need. I need at least 5mA current (long time).

I use MOSFETs because I read they are the perfect switches. My current test was with MOSFETs which I had already which have 22 mOhm resistance when closed. Now I ordered (still cheap) MOSFETs with 3.5 mOhm resistance (STP105N3LL). Maybe there are better options to switch just a few mA. Suggestions are welcome.

If I need lots of I/O lines I will use 16 bit I/O expander like these: MCP23S17-E/SP or MCP23017-E/SP

In my case I need this for max 5V DC and the switching speed is not critical.

Any suggestions are welcome. Thanks!

Edit: My application is that that I want to emulate a NTC. In my current case it's an existing NTC which is on one end on GND and on the other end connected to an electronic device which I can't change (black box). That device uses likely a 2.2kOhm Resistor on a voltage divider and then an ADC.

But in the future I want to be able to use this to emulate other NTC independently how they are connected. I want to be able to have a device which looks on the outside like a 353 Ohm resistor or a 43k1 resistor, independent on how the outside electronic actually works. These are just example values


texts:
i working on 3W DC to DC boos converter using LM2733YMF IC
Specs are-
Vin- 12V
Vout- 36V, 100mA
FSW- 600KHz
Schematic and components selected as per WEBENCH design tool.
find attached file

board work fine without load all parameters ok like SW, FB, SHDN, VIN.
but when i test with load suddenly after suppy turning ON IC get damage due to spike at SW pin.
Any suggetion..?


texts: Beginner resources device design/assembly

texts:
During the summer I would love to get into electrical engineering. As background, I'm a computer scientist and as such, I have a fairly decent grasp of basic circuit design and electricity, which means I don't have to start entirely from scratch. I have however no experience with developing micro circuits or anything of the kind.

As an end-goal I would like to design/assemble ARM powered devices, using existing components. I am however aware that this is not a task for a beginner.

My problem is, that I'm not entirely sure where to start, or to what extend I need to educate myself in electrical engineering to accomplish my end-goal. I could buy a BeagleBoard or an Arduino to practice with, but I'm not sure if that would be of use to me or not.

What should I start learning first with my end-goal in mind and what tools should I obtain to assist me?


texts: Looking for circuit, reversing polarity of DC motor

texts:
Consider I have 2 inputs, A and B.
I need help with a circuit that does the following
if only A is active (A,B : 1,0), then the motor should run clockwise
if only B is active (A,B : 0,1), then the motor should run anti-clockwise.
for other situations, let the motor be in off state..
I'm using a raspberry pi's GPIO pins to send inputs ( i.e. A and B)

Also, since I'm using a power bank, i would like to know is there any way or a device that converts usb port to get Vcc and GND terminals.

The DC motor I have is the ones usually found in toys, maybe called miniature low torque flat motor, and the power bank I have has 3 USB ports,5V 2A, 5V 1A, 5V 1A.


texts: Capacitor in opamp non-inverting audio amplifier

texts:
In an opamp circuit for audio purposes like the following, I'd like to know  about the capacitor C1:

Which type is the best in this application (polyester, Al electrolytic, tantalum, bi-polar electrolytic?)
If polarized, what is the correct polarity in the circuit and why?

simulate this circuit – Schematic created using CircuitLab
The choice of electrolytic capacitor is justified because it needs a large value if you want to keep a good lower cutoff frequency (in the example, about 70Hz) and low resistor values to reduce noise; but I'd like to know if there are troubles with the polarization (and maybe the distortion due to non-ideality.)
Moreover, is it correct that C1 reduces op-amp offset effects at the output?


texts: Can an FPGA/ASIC have an Operating System?

texts:
I know FPGA/ASIC are for a specific task and they are not microprocessors and an OS is needed mainly if multiple processes(tasks) need to be run concurrently.
Just wondering if an FPGA/ASIC can have an Operating System? Is there any real time need which may require this?


texts: How can I activate lights with 6-pin DIN?

texts:
Good evening!
I am quite new to electrical engineering but I am trying to help out a local fire department with a project. Here's the goal: whenever the sirens go off, turn on the lights in their bunk room. In the room, they have a device with a 6-pin DIN output that is energized only when an alert is received.
I found some socket adapters on Amazon for the 6-pin DIN, but would love a little bit more understanding of how I can use that to possibly activate a relay (or something) to turn on a full-sized light.
I know I am new so I really do appreciate the help! Please dumb things down if possible... I am still learning.
Project specifications: the room is pretty small, so they are hoping for one (maybe two) red light bulbs to activate whenever an alert comes in. They do not need the main lights in the room, as this would be a little to intense to wake them up. I really just need help figuring out how to connect the 6-pin DIN to a relay to activate these lights. I watched a YouTube tutorial on relays with Arduinos, and am wondering if this would be similar. The desired result would be a small box, with a light bulb or two on top that plugs into the DIN port on their pager system and lights up whenever the port is activated. My biggest question is: would there be an easy way for a Raspberry Pi to detect the change in state from the 6-pin DIN? I can figure it out from there.


texts: Low cost connector for 500 connection points, of which only a few are used at any time

texts:
So, I've been asked to make a GAL-like PCB that can be 'manually programmed' without need of soldering for an educational setting.
Meaning, I have signals coming in ('horizontally') that can be linked up to a wired AND ('vertically') by means of some connection, those ANDs then being linked up by an OR to go into the input of a Flipflop.
Thing is, the requirements are that I'd need to have at LEAST 5 inputs (inverted and non-inverted), 5 Flipflops, and all the flipflop outputs returned normal and inverted, with 5-10 AND-paths. Even if we assume the minimum of 5 on each, that would require
5(ff) * 5(and-paths per ff) * ( 10(input) + 10(ff-output) ) = 500 connection points per board
If I use any connector whatsoever - even just pinheaders, that makes it hard to produce and expensive, which both is not ideal.
Ideally, the connectors would be 'implemented' only on the PCB, with the connection bit (the 'jumper' if you so will) being the only thing that actually costs money per unit.
I've been thinking about solutions like having small screws (like M2 or something?) with nuts to connect the 'grid', on a PCB that is not throughplated, but that would be a pain for the users to assemble and disassemble, and would be fairly expensive at around 10-20 cents a connection, checking supplier prices for M2 screws.
Another thing I've been thinking about were those little earring needles with the retention clip - they can be bought cheaply from that one marketplace with an "express" attached to it, and would be easily affixable to the board. Problem would be the connection, as it is not spring loaded, however you could affix some conductive rubber, as is used in for example, controller buttons to it, to provide a 'natural spring' to it, holding it together.
I've also thought about just putting the pads next to each other, like in a controller button, then electrically connecting them with one of those conductive pen inks or electrically conductive stickers - that might work, but the cleanup would be a problem.
This would be a series of maybe 100-200pcs, maybe repeated every 2 years, so not extremely high volume.
Any other bright ideas how to implement an ultra-low cost connector that is implemented fully by just the connector that closes the connection, that's not one-way?


texts:
I'm planning on building some dimmable lighting controller for Christmas lights, but with LEDs being all the rage nowadays, I was thinking that instead of using triacs and dimming at 60/120 Hz, rectify the AC to DC and use MOSFETs to reduce the strobing that is more evident in LEDs.  This might allow the controller to be smaller and/or cheaper.

This would depend on how the LED strings are actually wired up.  I don't currently have any to look at, and I could imagine a few different ways they might be connected, such as diodes that only conduct for half the cycle, which would axe the DC idea if true.


texts: Osciloscope output timing header meaning and interpretation

texts:
I have obtained a set of readings from a set of oscilloscope data, RTA 4004 from R&S. the readings headings kind of puzzle me. It has an index.csv and multiple readouts.csv. The index.csv looks something like this

And the C1_0.csv looks like this

The rest of the csv (C1_1, C1_2,....C1_n) looks similar. From what I observed, the sampling seems to be done at 0.4ns. The total length of one record (C1_x) is around 1.224 us.
My task is to form a continous signal waveform from this capture. Hence my question is more focused on the index.csv

Is the meaning of thousandths in ms really meant 0.8596383072 ms (for C1_1)
Is the Time field to be combined with thousandths in msec to give an actual real recording time eg 16:07:02.0008506383072 (for C1_1.csv)
Does this time refer to the start of recording or end?
If 2 and 3 is correct, this will mean that the signal overlap one another (ie part of C1_1 overlaps with C1_2? and in certain part of signal there is no signal at all (consider inbetween zone at C1_4 and C1_3)
Is the time the output time(write on disk time or the actual acquisition time)? at loss at which direction should my sequence start from?

THanks for your help


texts:
I'm studying the four kinds of amplifiers implemented through feedback in op amp circuits.  When trying to relate all my previous knowledge with this, I'm getting a bit confused.

Can any BJT, MosFET, or JFET transistor be an amplifier of any kind? Are there advantages of BJT being a specific kind of amplifier?

Now, considering a basic op amp (voltage difference amplifier), can it be used as any of the four amplifiers (current, voltage, transcondutance, transresistance), how?

Can be a op amp circuit (inversor, non-inversor, summer, etc.) any of the four amplifiers (current, voltage transcondutance, transresistance)?

If that's possible, how would they be implemented?

What i want to know the most is like a yes/no question.Here it is : Can the four amplifiers configurations be made interchangeably from any (one unit ) electronic device ( bjt,jfet,mosfet) or integrated-circuit ( basic op amp and op amp circuits )?


texts: Anticipating processing delay in embedded systems

texts:
Background:

I have been working with the STM32F3 discovery board and I am trying to implement some signal processing algorithms from the ground up. My problem is shown below in the graph. The more taps I add to an FIR filter, the longer the delay between the input signal and the DAC output signal. For the audio signals I am using, a delay over 40 us will cause distortion that can be heard, limiting my filtering capabilities. It also makes it difficult to design the filter because the sampling rate is limited by the computation time (the next input cannot be processed until the previous is sent to the output).

Questions:

Are there hardware or software structures that I should be making use of that improve performance?

If I cannot improve performance, should I design my filter with a sampling rate that takes into account the number of operations I need to perform between samples and the operation time from the datasheet?

I haven't tried the CMSIS libraries since I wanted to get a better feel for the actual algorithms but would these libraries improve performance?

Code Snippets:
(Generalized for IIR Filters)

while (1)
{
    dreadADC();
    FilteredValue=filter(ADC1ConvertedValue);
    DAC_SetChannel2Data(DAC_Align_12b_R, FilteredValue);
}
uint16_t filter(__IO uint16_t nValue)
{

    for(i=(Taps-1);i>0;i--)
    {
        x[i]=x[i-1];
        y[i]=y[i-1];
    }
    x[0]=nValue;
    y[0]=0;
    for(j=1;j<Taps;j++)
    {
         y[0]= y[0]+(b[j]*x[j])-(a[j]*y[j]);
    }
    y[0]=y[0]+(b[0]*x[0]);
    return y[0]+1024;
}

ADC Timing Setup

ADC_RegularChannelConfig(ADC1, ADC_Channel_7, 1, ADC_SampleTime_1Cycles5);

DAC Timing Setup

TIM_TimeBaseStructure.TIM_Period = 2-1 ;
TIM_TimeBaseStructure.TIM_Prescaler = 1-1;
TIM_TimeBaseStructure.TIM_ClockDivision = 1-1;

Thanks for your time and I would appreciate any guidance!


texts: diode 1n4007 in fan speed control project

texts:
I was making a Fan Speed Control by temperature with the arduino, and I am dealing with this circuits:

I didnt figure out what is the purpose of this diode 1n4007.
What are the purpose of it specifically in this circuit?

thx!


texts: Why doesn't my USB switch toggle between inputs when the LEDs are added?

texts:
I'm new to electronics so any helpful advice or resources would be greatly appreciated. I built a USB switch to connect my keyboard to two PCs using a 4PDT switch and it works great. Now I'm trying to add LEDs to indicate which PC is connected. I added LEDs in the manner this diagram illustrates only using the switch above instead of a rotary as shown.

My problem is both LEDs are powered in both switch positions (A/B). Why would this be the case when the LEDs are connected to power from separate USB connections and only share the ground? What can I do to correct this behavior and illuminate only one LED based on which switch position is selected?

Here are some images of the circuit. Helpful comments welcome, but I know it's an ugly prototype. You will note the resistor through hole N07 is purposefully disconnected until I can wrap my head around the issue.


texts: What is meant by the MOSFET is pinched-off? It is same as in the JFET case where the depletion region becomes too large until the electron cannot flow through the transistor?


texts: Why does the distance between the plates of a capacitor affect its capacitance?

texts: Why does the capacitance of a capacitor increase when its plates are closer in distance to each other?


texts: Read LDR with A/D converter with adjustable senstivity

texts:
I'm working on a small project, where I read up-to 12 brightness values from light dependent resistors (my schematic below only shows three). The basic layout is a voltage divider per sensor, which is feed into one of the ADC channels of a teensy microcontroller.

simulate this circuit – Schematic created using CircuitLab

From the ADC I get a pretty good reading from 20-1000. I actually tried different resistor values for the voltage divider (R5) and I ended up with 47kOhms.

In some environments, I have lower light and I would like to make the voltage divider adjustable. With low light, my readings only go to 200-300.

I've tried to add a potentiometer, but this does not work. I'm not 100% sure why to be honest. Is there another way to do this? I want to have ONE adjustable potentiometer to change the voltage dividers on all channels.


texts:
Hi :) I was wondering if I could have some help with figuring out what circuit would yield this waveform. I'm trying to make sure that 1 and 3 can only be high if 2 is high when they are triggered. I'm unsure of how to:

a) hold 2 high and have it drop when the signal from 1 or 3 ends (it will be a blip from a button)

and

b) have 1 and 3 be ignored when 2 is not high

I was thinking about potentially using a clocked t-flip-flop but I have minimal experience in pretty much all things EE.

Thanks for your help :)


texts: Can I use a separate power supply to charge the phone while working with a IOIO board?

texts:
The current I get from the IOIO to charge the phone (500mA) is too low for my application (I need it to run for a long time, and the battery drains).

I was thinking of taking apart the cable (the red one that comes with the IOIO) and connecting the power to the phone directly to a 2A phone power supply (the IOIO is powered by a separate 12V power supply).

I wanted to know if this is safe to do (for example, is it a problem that the phone and the IOIO don't share a common ground?)


texts:
I'm trying to understand, from a functional standpoint, how the 555 timer plays a role in this circuit?

What I understand:

Astable at f = 7.142kHz
It's supply is the 150VDC.
It's floating on R6.

The highside is turned on, the low side is PWM at f = 2kHz. Duty is changed as per the control loop.

To me, it looks like it is trying to push current to U10. But I'm a bit confused looking this one... Any info will help. Thanks.


texts: Importance of electrolytic capacitor size

texts: A large aluminum filter capacitor about 1" X 3" can, from a 1972 power supply, needs to be replaced. it is 4000uf/50V/85 degrees.  Any reason why it can’t be replaced with a much smaller 4700uf/50V/85 degrees Electrolytic cap from Amazon?  I don’t understand the difference, except for physical size and price.


texts: Useless input - logic circuits drawing convention

texts:
I am a logic circuits beginner.
We are asked to draw a circuit which takes a four-bit word as input, and outputs true if the word is greater than or equal to 10.
Symbolizing the word as (b1b2b3b4), this translates to (b1 | b2 | b3).

Now b4 is completely useless in the circuit. What is the drawing convention for a completely useless input? Do I leave it utterly disconnected, which feels weird, or do I have to go through the hassle of inverting it, ORing itself with its inversion, and ANDing that to the rest of the circuit? Or something else I haven't thought of?

Thanks!


texts: Why two independent if-loops are always put in different always/process blocks?

texts:
architecture rtl of goodFFstyle is
signal q1 : std_logic;
begin
    process (clk)
    begin
       if (clk'event and clk = '1') then
          if (rst_n = '0') then
             q1 <= '0';
          else
             q1 <= d;
          end if;
      end if;
end process;

process (clk)
begin
   if (clk'event and clk = '1') then
      q2 <= q1;
   end if;
end process;
end rtl;

In the above example the second process could have avoided if q2 assigned is included in the first process.

architecture rtl of goodFFstyle is
    signal q1 : std_logic;
    begin
        process (clk)
        begin
           if (clk'event and clk = '1') then
              if (rst_n = '0') then
                 q1 <= '0';
              else
                 q1 <= d;
              end if;
              q2 <= q1;
          end if;
    end process;

Second example uses less lines of code, but most of them prefer first way of coding. So my doubt, is there is any advantage if we code in first method?


texts: Micro-controller to develop application for Android

texts:
I'm quite new to micro-controller development. However, I wanted to start from someplace. Currently, I wanted to start a project to interface analog signals, do some DSP with it and be able to display these signals in a GUI on a smartphone like Android.

Could you'll recommend a few micro-controllers I should be looking at that allows easy portability to an Android phone? My criteria for the micro are as follows:

Low Power
Great documentation/ sample    code
At-least 6 analog input pins
Has Bluetooth/wifi capability
Has an   ADC

I have looked up a few micros like the

Arduino
Fez Domino
Beagle Board
Microchips, PIC18, PIC24 etc. series

But, I'm not sure which provides the most easy to port to an Android phone?


texts: Can resistive traces be created on a PCB?

texts: I'm assuming that copper traces on a PCB have negligible resistance.  Is it possible to put a trace on a PCB that has some greater amount of resistance?  The amount of resistance would not need to be precise per distance, but consistent along the length.


texts: Unexpected ADC behaviour - can anyone help diagnose?

texts:
I'm attempting to read an air temp. sensor made by Amphenol (Datasheet).
The sensor outputs is pulse density modulated (PDM) and is filtered to DC using a simple LPF as suggested by the manufactorer. Testing the output after the filter using a scope looks great with neglectible ripple for my need.
My ADC input circuit is loading the output, probably because the impedance is too low, so the voltages I see are skewed. I've managed to correct them using a 2nd order equation and now I am usually withinin 1 degree of the theoretical (expected) temp. reading.
Here is the strange part - in a certain range in the middle of the sensor's range I get a "hump" where readings will stop responding linearily and act like a parabole with max. point. After the edges of this area, the behaviour goes back to linear again.
I am puzzled what is skewing the readings exactly in that range. I can undertand that due to capacitors and loading the ADC input circuit is affecting the whole range, but what affects just a part of it?
Here is a circuit of the sensor + fitler + ADC input. R1 + C1 make up the LPF. R2 + R3 + C2 make up a voltage divider at the ADC's input. The ADC's input resistance is now shows but according to the MCU datasheet it is max 50kOhm.
The sensor's output after the filter is expected to be perfectly linear. Just thught to make that clear.
Worth mentioning that I have repeated this experiment 3 times using different sensors, different filters and different input channels of the MCU's ADC (although they are multiplexed, but still to rule out a damaged MUX). I have seen the exact same thing each time with minimal diff. between the sensors.
There might be additional information missing here, so please let me know and I will add as requested.
Update #1
X axis are ADC raw readings (basically mV at R2 & R3 junction), Y axis is the expected mV reading from the sensor at the temp. that was meassured using an external thermomether. According to the equation from Amphenol / Telaire this should be linear.
Here is the equation from Amphenol:
PDM_T [mV] = ((T[degC] / 165) + 0.2424) * VDD [mV]

simulate this circuit – Schematic created using CircuitLab


texts: Is that IGBT will failure if apply Vce with out gate pulse, and driver supply

texts: I gave 100v dc in the Igbt with out gate supply, The IGBT gate section went failure. Please tell me whether the method  I tested will create problem.


texts: I've got a board I'm working on that I think may have two USB ports and both of them could conceivably be connected to a computer at the same time. Both USB connectors need not be connected to the PC, but I'd like the board to be powered by USB from the PC when one or both of them is plugged in. Can I simply connect the 5V pins on both USB connectors together on my board to achieve this outcome? It's all the same 5V net on the PC internally anyway, right? If you don't think it's sound to connect 5V to 5V on different USB connectors, then please propose an alternative solution.


texts: Connecting a 48 V battery to a grid tie inverter

texts:
I am working on a grid tied wind system project. I am planning to use a battery in the system which will be the source to the grid-tie inverter. Also the battery will be used only as a source to the grid-tie inverter and will not be used for back-up. So, the connection is as follows:

Wind generator (2 kW AC) ----> Rectifier/charge controller ----> 48 V, 5 kWh Battery ----> Grid-tie inverter ----> Grid

Will a grid tie inverter be able to take input from a 48 V battery?
Is this type of connection feasible?

Any guidance is much appreciated. Thanks


texts:
I have been struggling to see how C1 and R1 in this picture form a high-pass filter.

The voltage isn't taken across R1 like in a potential divider:

Could someone shed some light on how this works please?
How does this configuration form a band-pass filter:


texts: Unsure if this asynchronous D-Flip-Flop Verilog code makes sense

texts:
This is my code for an async-reset-set D-flip-flop. I'm using quartus, and the module compiles, but there is no way to check if my logic is valid. I could use some outside opinions.

The reset is asynchronous (1=reset) and set is represented by enable.

Here is my code:

module DFF_async(in, enable, clock, reset, out);
    input in, enable, clock, reset;
    output out;
    reg out;

    always @ (posedge clock or posedge reset)
        if(reset) begin
            out <= 1'b0;
        end else if (enable) begin
            out <= in;
        end
endmodule


texts: I am going to get a PCB produced, but was wondering how the FR4 thickness measurements work, i.e. how thick are 1.6 and 0.8 FR4, in millimeters, to a few decimal places?


texts: Why isn't iPhone minicom reading serial data from Arduino?

texts:
Alright, this is my first time posting on electronics.stackexchange.com but I have frequented stackoverflow.com for some time now.  Basically I am trying to output serial data from the Arduino to an iPhone.  I installed OpenSSH on the iPhone, and starting minicom from the ssh session.  I have a simple Arduino sketch outputting Hello World.  So I thought I would see Hello World in minicom window but I don't.

My minicom window looks like the following   Yes, the baud rate of the Arduino sketch and minicom are both set to 9600.  If you look in the lower right you will see that minicom states that it is "offline" so I am wondering if this is my problem.

My arduino sketch code looks like the following:

void setup()
{
Serial.begin(9600);
Serial.println("Hello World");
}

void loop()
{
}

The solder joints on my iPhone dock connector look good, and I think I breadboarded everything correctly, so I don't understand why I am not seeing Hello World in minicom.

Here is a picture of the dock connector

Here is a picture of the breadboard

Update on June 07.  Well I tried a couple of things and still no luck. I created a google doc that I will try and keep updated with my progress, it can be found here.


texts: OpenOCD SAMD21 programming from RPI Error Flash write discontinued / NVM programming error

texts:
I am trying to use OpenOCD + RPi to program an ATSAMD21J18A via SWD.  I have a connection, can see flash info but programming fails with a Flash write discontinued / NVM programming error.
I have a feeling it has something to do with Erase or reset. I see posts with people who say they have got this running, but I'm not finding the issue.
This is the error point:
** Programming Started **
Flash write discontinued at 0x00012f84, next section at 0x00013f00
SAMD: NVM programming error
Failed to erase row containing 00000200
SAMD: failed to erase sector 2 at 0x00000200
failed erasing sectors 0 to 303
embedded:startup.tcl:530: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 595
at file "embedded:startup.tcl", line 530

My set-up:
 sudo openocd -f interface/raspberrypi2-native.cfg \
                 -c "transport select swd" \
                 -c "set WORKAREASIZE 0" \
                 -c "set CHIPNAME at91samd21j18" \
                 -c "adapter speed 400" \
                 -c "adapter srst delay 200" \
                 -f target/at91samdXX.cfg \
                 -c "at91samd bootloader 0" \
                 -c "program openocd_hex/123456.hex verify"\
                 -c "at91samd bootloader 8192"

My raspberrypi2-native.cfg file is pretty generic:
adapter driver bcm2835gpio

bcm2835gpio_peripheral_base 0x3F000000

# Transition delay calculation: SPEED_COEFF/khz - SPEED_OFFSET
# These depend on system clock, calibrated for stock 700MHz
# bcm2835gpio_speed SPEED_COEFF SPEED_OFFSET
bcm2835gpio_speed_coeffs 146203 36

# Each of the JTAG lines need a gpio number set: tck tms tdi tdo
# Header pin numbers: 23 22 19 21
bcm2835gpio_jtag_nums 11 25 10 9

# Each of the SWD lines need a gpio number set: swclk swdio
# Header pin numbers: SWCLK:23  SWDIO:22
bcm2835gpio_swd_nums 11 25

# If you define trst or srst, use appropriate reset_config
# Header pin numbers: TRST - 26, SRST - 18

# bcm2835gpio_trst_num 7
# reset_config trst_only

bcm2835gpio_srst_num 24
# reset_config srst_only srst_push_pull

# or if you have both connected,
# reset_config trst_and_srst srst_push_pull

I've used telnet localhost 4444 to feed line by line, but I get the same error when I try to program.
Tried changing adapter speed/delay, tried flash write_image, flash info 0 shows no protection.


texts: Find critical path and maximum clock frequency in digital circuit

texts:
I have this problem:

  Consider this circuit:

  Find and describe the critical path. What is the maximum clock frequency?

MY ATTEMPT

Okay, this is how I see the critical path:

DFF -> G1 -> G3 -> DFF -> G4 -> DFF

The critical time can then be found with the given delay values:

\$t_{critical}=3(t_{cQ,prop})+3(t_{prop})+t_{SU} = 2(30 ps)+3(40ps)+10ps=190ps\$

The max clock frequency is then: \$f_{clk,max}=1/t_{critical}=\frac{1}{190ps}=5.26 \text{GHz}\$

Am I understanding this right? I spoke with one of my peers and he said that critical time is only between to registers and not through them.


texts: Suppose we have an ideal diode cascaded with an RC filter , what is exactly the analytical expression of the voltage across the resistance R in terms of our initial (ac) voltage , that is : how to do a circuit analysis in the presence of the ideal diode ?


texts: Followup to "12V Constant voltage regulator for Car?"

texts: I have a problem similar to Suresh @ 12V Constant voltage regulator for Car? (I want to power an electric dog fence from my car battery), and like Trevor_G suggests, I probably don't have the smarts to do a DIY solution. I get that you can't get 12v output if you only have 10v input. Trevor_G suggests instead an "off-the-shelf automotive 12v power supply." I'm not sure what type of device Trevor_G is recommending - one of those 12v rechargeable lithium battery "portable power supplies" that are supposed to power your 110v shaver while charging 6 cell phones simultaneously? The 110v AC-12v DC power supply that came with the dog fence provides 12v DC at 750mA. Assuming the unit draws 750mA, how big of a battery (watt/hours?) do I need to power it for 12 hours on one charge? (I get confused witht he math) Is this even practical? How long would I have to run my car to recharge the unit? Manufacturers don't give any data on this. Thanks. Forgive me for being an electronics pre-schooler.


texts: Negative voltage regulation in transformers

texts: If a capacitive load is connected at the secondary coil of a transformer, a leading current flows and in turn, the secondary voltage is higher than the referred primary voltage. I learned that partial resonance is the reason behind this. However, I can't seem to understand why.


texts: Why don't interfering radio stations both play at the same time?

texts:
Since radio-waves are additive, I would expect that overlapping stations (eg. two different signals broadcasting on 95.7 within range) to both play over my radio at the same time.

But that's not what happens.  Instead, I hear only one station at a time, with the radio switching back and forth between the two stations as I drive, and some static inbetween.  Why does this happen?  Why don't I ever hear both stations at once?


texts: What is the proper name for small uninsulated ground posts

texts:
I am looking for some of the small uninsulated posts used for grounding on bench test equipment such as oscilloscopes. They are usually used for establishing a common ground when measuring small signals.  They usually have a knurled nut, and are cross drilled, so suitable for rings, forks, and bare wire.  A bit like a 5-way binding post but much smaller and not insulated from the panel they are mounted in.  Here are a couple of examples (click for larger):

But when I search the usual distributors for "binding post" "ground post" "ground terminal" etc, I'm not finding these.  Nor am I finding the parts direct from manufacturers on google. Presumably I am using the wrong search term. What would you call these?


texts: Cost of assembling components in different packages

texts:
I was wondering different packages are usually handled. Specifically, the SMD packages.

Are there any benefits to having all components in a single package?

For example, I have all of my resistors and capacitors in 0402 package but one of the capacitors is nearly 10x in cost for this package size vs say 0805.
Does it make sense to use the cheaper one or would such a choice in turn make assembly more expensive?