texts: Can I use an Ethernet switch IC without connecting to the mcu?

texts:
I'd like to add an unmanaged Ethernet switch IC to a board I am designing, but I have no free RGMII/SGMII/PCIe connection available on my MCU. The goal of this IC is just to save space/hassle (in the application I am targeting, I cannot afford to have an external switch, so I have to integrate everything on this board). No need for me to configure it or whatever, it simply has to link the devices connected to it (and, since one of its port will be directly connected to an MCU's Ethernet port, also to the MCU).

Is it still mandatory to connect it (via RGMII/SGMII/PCIe/...) to the MCU or can I skip the connection entirely? It is not that clear to me after reading several datasheets... Any reference to the literature is more than welcome.


texts: Looking for a cheap cellular modem chipset + GPS

texts:
I'm looking for advice about available cellular modem chipsets, my main concerns being power consumption followed reliability & then by weight/size.  It can be the worst-performing chipset in the world for all I care as long as I can transfer large amounts of data (up to 100MB or more every couple of weeks) reliably over a period of 6-15 hours (so a very low throughput is perfectly acceptable as long as it won't overheat and die while being active for that long).

I'm looking for suggestions as to brands (the only one I can really find is the 3G chipsets by broadcomm), pricing (I need up to 1,000 or more of these), carrier information (such as suggestions on how to go about talking to a carrier about adding 1,000 intermittent devices to their network?) and any nuances or general suggestions that people have.

Also, integrated GPS is a definite plus, as long as I can kill power to the GPS when necessary.  Otherwise I'm also looking at stand-alone GPS modules.

Thanks!


texts: 74LS vs. 74HC series ICs for Ben Eater's 8-bit Computer

texts:
What are the primary differences between 74LS series and 74HC series ICs? I know that LS series are TTL and HC are CMOS, but beyond that what are the key differences?

For example, Ben Eater uses LS series chips in his 8-bit computer. Why would he do this as opposed to using HC series chips? What is most ideal to implement his design and why?

Ben's 8-bit computer: https://eater.net/8bit/


texts: Where to find Sparkfun's 1.0mm pitch connectors?

texts: I'm trying to buy these recently stocked connectors from Sparkfun from either Farnell or Digikey, but have no idea what they are called or how to find them. Also, what about the female connector that mates to this? And would I be easily (without an expensive tool) be able to crimp connectors for this series of connectors?


texts: Safety concerns over generic switching power supply units

texts:
I'm looking for a more stable power supply for my 3d printer. I've recently come across the following kinds of switching power supplies.

They seem to come in all sorts of different sizes and wattage ratings and look perfect for powering my power hungry 3D printer. The printer draws large amounts (20+ Amps) of current at 12V and these supply exactly that - nothing more, nothing less!

I just have a few concerns about the safety of using one of these devices. To be perfectly honest, my knowledge of electronics and electricity is very basic but I know enough to treat mains voltage with respect. In general, I stay away from it and stick to low voltages.

My main concern is that I noticed there is nowhere to simply plug a mains cable as an input to the power supply. I take it that you gotta screw the cable in yourself. However, isn't there a fair likelihood that someone may just pick it up by putting their fingers and short the live and neutral together? The exposed screw contacts look awfully prone to accidental contact with not just fingers, but nearby metallic objects. A built-in fuse won't exactly help here would it?

The other concern I have is whether it will be extremely dangerous if I accidentally reverse the live and neutral wires? Given that it's probably headed into a bridge rectifier at some point anyway, my basic knowledge of AC power tells me it's not too much of a big deal in this case but then again, I know enough about electricity to know that I know very little.

I'm wondering if I am being a little over-cautious here or whether someone at my level of electrical knowledge should be playing around with something like this at all?

A little background

At the moment, I am using a typical 320W PSU for a desktop computer to handle the power workload. However, they seem to need a ~1.5A dummy load on the 5V line to improve the voltage regulation on the 12V line for some reason I haven't been able to figure out yet.

Through testing, I have found that it does indeed seem to be true - no dummy load: ~11.8V, with dummy load: ~12.1V (these are measured without a load on the 12V line).

The PSU is rated at ~18A for 12V and it seems the printer draws more than to close to that since the voltage dips down to 11.7 - 11.8V during peak power draw.

Obviously, we can see that a desktop PSU is probably not designed to handle strangely large values on the 12V line so I'm a bit hesitant on just getting a bigger desktop PSU.


texts: What is the minimum charging current for NCR18650 li ion battery?

texts:
I need a rechargeable battery pack for my project, I need to know what is the minimum charging current for NCR18650 li-ion battery?

In the datasheet, it says max charge current is 2A.
what is the minimum charge current?

I use tp4056 module for charging, I can change the charging current

is 300mA to 600mA ok for charge current? will it damage the battery or affect badly for a battery lifetime?

Delaying in charging time is not a problem for my application .


texts: Vehicle wiring diagram - interpreting symbols compared to actual physical devices

texts:
I am going thru my bike's schematic/wiring diagram and going wire by wire I think I'm starting to understand how it works from turning the key onward. But some things are still confusing so perhaps some of you may help me out. In the picture I have three qualms, three things I'm confused about.

Diagram vs. actual switch on the bike - the "Passing" button seems to be wired in straight to the "Hi" wire, so you can activate it temporarily (push the Passing button, turn on high beam, release the button - turn off). Would this imply that there's no separate wire for this function, just internal "bridge" short connection between Passing contact and high beam wire?

Diagram vs. actual slide switch - there are three positions I can choose here, white dot is "all lights off", middle symbol is "position light" and left symbol is headlights on. However, the way I see it on the diagram, with two switches connected by the vertical line, it seems that the off position is missing? Looking at the diagram, where would the middle position be? Also I can't find what HL and TL means, perhaps Head Light and Tail Light, although that doesn't make much sense to me.

Fuel cut and engine stop relay - from the diagram it looks like 4 pole relay, and in each symbol, I would say top two wires are switches, and bottom two wires are coil that pulls the switch on or off. However, if you look at the wires coming into the relay, it seems that two wires in the middle go both to switch pole and coil pole?

Any help welcome and appreciated :D


texts: Excessive latency in inter-FPGA communication

texts:
I have 4 Spartan 6 FPGAs connected through 64-bit lanes, forming a line. (That is, FPGA1 is connected to FPGA2, FPGA2 is connected to FPGA3, and FPGA3 is connected to FPGA4.)

I have split each 64-bit lane into two 32-bit lanes, one for each "direction". I then connect the 32-bit lanes to form a big loopback from FPGA1 to FPGA4 and back.

When testing this loopback (where FPGA1 drives the test) with a "walking 1" travelling every 100 clock cycles, I notice that the loopback is flaky (bit 7 doesn't go high quickly enough, it seems). When I reduce the walking 1 speed to move every 1000 clock cycles, the test passes.

FPGA1 is clocked at 20 MHz, so 100 cycles is 5 micro seconds. Does a signal really need more than 5 micro seconds to travel from FPGA1 to FPGA4 and back? What could be causing this excessive latency? (The FPGAs are on the same board, closely routed to one another.)


texts: What formula(s) should be used to determine the lifetime value of a wireless sensor node, charged up by a supercapacitor(its capacitance value its known), with a given power/energy consumption? It is also known that the capacitor has a known inital voltage. The WSN can operate at a certain minimum voltage.


texts: Could an ARM (ARM7TDMI) Branch instruction take 6 cycles?

texts:
I have found an ARM Branch instruction appears to take 6 cycles to run on an ARM7TDMI processor. It seems it shouldn't be happening because in all references I've found, an ARM7TDMI branch instruction should take only 3 cycles. But:

The C function:

start_time = TC;
for (int i=0; i<120; i++) {
  __asm("NOP");
}
end_time = TC;

The disassembly shows the loop as: (Update: instruction addresses added):

0x120             MOV R1, 0
0x124             B LOC0
            start:
0x128             NOP
0x12C             ADD R1, R1, 1
            LOC0:
0x130             CMP R1, 120
0x134             BLT start

Now the result shows the loop takes 1080 cycles (converted from a timer counter put in TC), i.e., 9 cycles per loop kernel. Since NOP, ADD, CMP are all single cycle instructions, BLT has to be 6 cycles.

I once suspect if my timing method has flaws. But if I add 1 NOP in the loop kernel, the time increase would amount to exactly 1 cycle.

What's wrong here?

(Update: fix: the original disassembly code miswrote ADD R1, R1, 1 as ADD R1, R1)

 Update: Answer Accepted: Flash access stall causes the 3 extra cycles

Thanks all for the helpful answers and comments, especially @supercat, @Dzarda, @DaveTweed, @IgorSkochinsky, @WoutervanOoijen. I am running code from flash. The CPU is a LPC23xx. According to the User Manual, it does include a Memory Acceleration Module (MAM) for bufferred flash access. And the suggested flash fetch cycles under my CPU speed is exactly 3 cycles.

The start in the above penalized loop kernel is aligning to a 8-byte boundary. If I change the alignment of start to 16-byte boundary, then the 3 extra cycles penalty disappeares. This can be explained by the 128 bits (16 bytes) flash prefetch buffer size of my CPU.

(@WoutervanOoijen) Note the 3-cycle MAM flash fetch time is not done by ARM CPU, but by the MAM module which prefetches the flash data in parallel with CPU. So in my code with start aligning at 8-byte boundary, CMP is the first instruction in the 128-bit (4-instruction) MAM prefetch buffer. When the ARM CPU executes BLT, it takes the 1st cycle to "understand" the instruction. Then it tries to fetch NOP instruction which is not in the MAM prefetch buffer. That should be the moment when the extra 3 cycles happens when the MAM accesses the flash. When the NOP instruction is in the buffer (along with 3 other instructions in the 32-byte flash line), the ARM CPU can actually re-fill the pipeling by fetching NOP (5th cycle) and decoding NOP (6th cycle). That's where the total 6 cycles come from.

So the answer to my question is Yes, a 6-cycle branch instruction is possible if there's a flash access stall.

 Final Unresolved Question

As @WoutervanOoijen points out, the above reasoning has a flaw. LPC23xx's Memory Acceleration Module has an additional Branch Trail buffer that is supposed to avoid this kind of repeated re-fetch loop branches. The LPC23XX User Manual states:

  The Branch Trail buffer captures the line to which such a non-sequential break occurs. If the same branch is taken again, the next instruction is taken from the Branch Trail buffer

This statement doesn't seem to be very clear about what's exactly being put into the Branch Trail buffer. It could be the last prefetched flash line, or the last branch destination flash line. In either case, the flash access penalty shouldn't have happened because the flash line (0x120 ~ 0x12F) including the branch destination instruction (NOP) should already be in the Branch Trail buffer when BLT is being executed (at least from the second time on).

(BTW, I verified the MAM is put in Fully Enabled mode, i.e. MAM_mode_control is 2.)

I will update this question after I find more information about this. And I'll appreciate it if you have any comments on what might be happening here, or what test can be done to look for clues.


texts: How does an embedded application and RTOS communicate with each other?

texts:
I am working on a project which uses ARM 7 processor and a micrium - os II RTOS.
Kindly help me out in understanding the fundamental questions that have come to me regarding this project.

Below are the questions:

How does the application interact with the RTOS?
Inturn how does the RTOS interact with the controller? (same as windows ineracts with the intel processor?)
We specify the location of RAM, ROM, stack etc., but how are the ports identified via the C program i.e., we specify some hex value in our program but how are this linked back to the controller
How does the RTOS know where to start the execution of the program?
Once the application is loaded into the ROM and on switching ON the embedded device, how does it know where to start exectuing the application?


texts: How to design a high impedance buffer circuit?

texts:
How can I design a buffer circuit that takes an input of +/- 10V and scales it down to a 0V to 5V.

The idea is to design a circuit that is microcontroller compatible (can be read by an analog-in pin by a typical 5V microcontroller) with input signals from Eurorack modular synthesizers outputting +/- 10V.

simulate this circuit – Schematic created using CircuitLab

I think I need a high impedance input but don't know what kind of transistors to use or what configuration to use them in.


texts: Why is there a single high frequeny noise component in the output of an op-amp filter?

texts:
I have designed a lowpass filter of corner frequency = 50 kHz. According to TI's "Filter Design in Thirty Seconds", I build the schematic in LTspice as follows:

The Op Amp LT1126 has following parameters:
Gain-Bandwidth-Product: 65 MHz
Slew Rate: 11V/µs

I choose LT1126 bacause it is available in my lab and I want to use it in a bandpass filter circuit. I thought the two parameters are far more than enough for this LPF. However, there is a very high frequency component of about 20.9 MHz in the output signal. As shown in the following two pictures:

What is the reason of this phenomenon?

Actually, I have built a bandpass filter (fc = 42 kHz, B = 5 kHz) with LT1126 using the "Narrow Band Pass Filter" design in "Filter Design in Thirty Seconds". But there is also a similar high frequency component in the filter's output. So I tried to simulate the simpler LPF in LTspice and observe the similar result.

As far as I have read, GBP and slew rate are the critical parameters for designing a filter. But with above mentioned results I am pretty sure that there must be something I miss here. Can someone give me a hint?

Or more specific: an Op-Amp of which parameters should I choose to implement a bandpass filter with: fc = 42 kHz, B = 5 kHz and Gain > 1?


texts:
I have this simple program:

#include <p16f1503.inc>
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _BOREN_OFF & _CLKOUTEN_ON
__CONFIG _CONFIG2, _WRT_OFF & _STVREN_OFF & _LVP_OFF

    org      0x00
    goto     setup

setup
    banksel  OSCCON
    movlw    b'01101010'  ; Int. osc. 4 MHz
    movwf    OSCCON

    banksel  OPTION_REG
    BCF      OPTION_REG, TMR0CS

    banksel  ANSELA
    clrf     ANSELA
    banksel  TRISA
    clrf     TRISA

    goto     main_loop

main_loop
    nop
    goto     main_loop

    end

What I would like to do is to enable CLKOUT pin, but it doesn't work... Am I missing something?

I am using:

IDE: MPLAB X IDE v1.20
Compiler: MPASM v5.45

and integrated software simulator...

[EDIT]

CLKOUT works just fine.. But sadly not in simulator.... Can someone explain reason for this behaviour.


texts: How do I save a waveform from ModelSim for later opening/viewing

texts:
If I save the waveform, it is saved as a .do file in ModelSim/QuestaSim. This does not help as later I will have to run the simulation to get the wave back anyway!

What I am looking for is means by which all the wave (their data at points in time) is saved in a single file like an EVCD file. Later I can just open this file even when I have absolutely nothing from the design itself and be able to pan and zoom in/out on the wave. I find nothing in ModelSim that can be used to do this. Saving the waveform as an image takes away a lot of important features, this is what I do at present but want to know how to save the wave itself for later use in the wave editor???


texts:
I am trying to create a bifurcation figure of the Chua circuit as shown in the figure. The 'x' in the figure is the voltage across the capacitor C and the F is the amplitude of the input signal. Here the input has been increased from 0 to 1. The other parameters are for Chua's diode.
When I try the same circuit in Ltspice I am not getting a similar bifurcation figure. I get something like this.
Any help is appreciated.
Here is the link to the paper - Link to the paper
Thank you in advance.


texts: How to make a non-conductive filled via in EAGLE PCB

texts: How do I make a via that is filled with a non-conductive material in EAGLE PCB?


texts: What microphone (sound sensor) that can work with Arduino to detect gunshot?

texts:
I am working on a project to detect a very loud sound/Pop(like gunshot).I am using a microcontroller like Arduino. Currently I am using this simple  sound sensor. But the issue is, it is very sensitive, I connected it with 3.3V and the highest it gets is around 560's from analog read, whether it is a simple clap or loud bang, it maxes-out at 568. I have tried to adjust the potentialmeter but no difference.

Can this sensor measure gunshot intensity? If not what sensor can I use?


texts: what happens when you increase the power of bluetooth? Is it possible to increase the range of a bluetooth signal?


texts: DC-DC converter cause PC GPU computer to shut down

texts:
I am currently trying to power up a edge GPU computer that runs on 12-19 V and is rated for 60 W.
Whenever I start to overclock my computer to run some machine learning stuff, the computer will just shut down. I notice on my bench supply that it draws between 1 A to 2 A as it rapidly swings inbetween this range. I tried a few DC-DC converters as well, from famous brands that are rated 200-300 W, but the computer will just shutdown.
My take is that the transient current change is so rapid that the short circuit protection of the DC supplies kick in.
A thing I noticed was that when I directly use the computer AC adapter plugged into the mains, it's able to work perfectly
May I know:

if my assessment is accurate.

Would like to understand if it's not accurate.

How can I allow my computer to still work without reducing its performance i.e. what can I do in a electrical standpoint to compensate?

My first time posting! Sorry if it sounds amateurish.


texts: Is it possible to switch high speed USB data lines with a MOSFET?

texts:
I'd like to programatically disconnect DATA lines on a USB device (while leaving the power lines active), and I know that USB data lines are a differential pair, which I have no previous experience with.

So the question is: is it enough to use a reasonable quality signal MOSFET (p-channel) to do so? This should work with high speed (480 Mbit/s) USB, and I've found a blog post which recommends using an analog switch ("like 74HC4066") for this purpose instead.


texts:
I have a rechargeable vacuum cleaner with NiMH batteries, 1800mAh and 14.4 volts, 12 cells. The charger is 18v 200mA. The batteries have now died.

Can I replace the batteries with 4 cell Li-ion in series?

That will be 14.4 volts, if considered 3.7v each. Of course, I know it will be roughly 4 volts when fully charged.

Li-ion batteries in my mind: 18650, 2500mAh.

Also, can I charge them with the same charger?


texts: "Normally closed" switch: does it use more power than a "Normally open" for a low-power battery-powered ATtiny project?

texts:
I have a "normally closed" magnetic door sensor, that I'd like to use with an ATtiny microcontroller.

Does a "normally closed" switch use more power than a "normally open" switch?

i.e. since the switch will be closed 99.9% of the time, will some current flow through the switch, thus wasting battery?

Or is there a way to make a "normally closed" switch not use more than a "normally open" one?

Note: This is a low-power project (goal: 1 year with a set of batteries):

ATtiny powered with 2 or 3 AA batteries, I'm thinking about using ATtiny85 "V" for powering with as low as 1.8V
I'll use "deep sleep" features to use very few power (see https://jeelabs.org)


texts:
What happens to Voh and Ioh when the number of loads connected to the output of this logic gate increases?

My interpretation is: the increase in number of loads decreases the equivalent impedance, which causes the current Ioh to increase. Is this view correct? But I can't visualize what happens to Voh.

simulate this circuit – Schematic created using CircuitLab


texts:
I'm thinking of using few of the CREE LEDs but wondering what all would i need to build
a bulb from scratch.

Here's what I've got:

LEDs (of course)
LED high current drivers
some sort of rectifier circuit for AC to DC
heatsink

Any other details or resource you guys can point me to? I'll make my designs, schematic, PCB and BOM open source.


texts:
am using two A4988 drivers to control two NEMA 17 stepper motors with 1.8 degree full step resolution on Rpi 2b. I am using them as wheels. The motors are initially given ramp signal using PGPIO wave_chain function and then a steady PWM signal using the SET_PWM function in PGPIO library.

The ramp and pwm are defined each wheel and are called together but the problem is the wheels turn one after the other and not synchronously.

pWhich wheel turns first depends on which wheels function is executed first. Please help me to resolve the issue


texts: Is there a device to measure distance to a live wire through bone-like material?

texts:
Is there any electronic device that can measure the distance from a point in space to a wire with very low voltage running through it?  The measurement of concern would be approx. 3 to 5mm .   Its application would require the measurement to be made through a material such as bone.

Any ideas?


texts:
In motorcycles broken stock voltage regulator is a very common issue.
Stock solution is SCR based and commonly burns due to overheat/ SCR failure.

DIY regulators usually have the following design (mostly it's a copy-paste of original solution):

As moto alternator has no field winding, all the schematics are simply shorts windigs. From my point of view, it's quite ineffective.
First, I thought about using IGBT/MOSFETs as rectifiers and PWM it's gates in order to regulate voltage as simple shunt regulator.
But there are ideal rectifier controllers, like LT4320. Maybe there are ready to use IC controllers for ideal diodes that can do it?

Or is a SCR schematic is really enough? But change the design - use SCR as rectifier part. But it's not clear for me, what C terminal should be connected to. I think to Vout, but it's not shown

The main target is to get more current and increast ruggedness of current alternator.
The question: is there a well known design of regulated rectifier with MOSFETs? Why it's not in use? It looks so simple. Shunt regulator inside rectifier itself.


texts: What is the true reason for the rolling shutter effect on modern CMOS camera?

texts:
I was wondering what is the true reason for the rolling shutter effect that can be observed on many CMOS camera.

I've done some research on the internet and found an excellent article about it: link.

In this article (page 1, paragraph 3), it mentions that modern CMOS sensor uses ADC for each column of pixels and these ADCs work in parallel for higher frame rate.

However, the entire sensor array can only be converted one row at a time. This introduces a slight delay between each row's readout, and leads to a delay btw each row's next exposure, making them no longer simultaneous.

I have some questions about this explanation:

Why the entire sensor array needs to be converted one row at a time? what is the limiting factor?
What kind of conversion does it need?
As the rolling shutter results from the quest for higher frame rate, when taking a still photo, it seems no requirement on frame rate. Why does the roll shutter effect still happen?


texts: Is it normal to brick the STM32F0 with certain software pin configurations?

texts:
I've flashed the following code to my shiny new STM32F0DISCOVERY board. The comments explain what I thought it would do.

RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA, ENABLE);
    // Place PIN 4 (DAC out) into analog mode
GPIOA->MODER=0b11<<8;

RCC_AHBPeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);
// Default DAC settings are fine.
DAC->CR = 0;
DAC->CR = 1;

Unfortunately after flashing this code openocd can no longer talk to the board or recognize that it is an stm32f0 (but it can still connect to the onboard ST/LINK if the reset button is held down). I thought I might be able to hold BOOT0 high and boot from the internal serial bootloader, but that doesn't seem to allow SWD flashing either. The rest of the short program just uses GPIO B and C and the timer.

Should I expect that code to brick the chip or did I just get unlucky?


texts:
Is a cloverleaf antenna (that is used for FPV applications) good for home wifi?

If not, why?


texts: How do I convert a Karnaugh map into a Logic gate circuit?

texts:
Ok, so I currently have some questions that I need to work out in uni, I've basically been given 2 lengthy boolean expressions and I need to simplify them.
Question a I feel like ive done right but question b im stuck on as its so long and im fairly new to Logic Gates still. Ill attach a picture of the question and what ive come up with so far for the karnaugh map,
I feel like I understand how the terms work and how to get them with say ABC = 2 terms, AB = 3 A =4 etc. I know that the + symbols are OR gates.

Added another image below, I knew about being able to overlap when circling the inputs but didnt know and still have no idea what they mean or how to replicate those circled inputs into a logic gate circuit, ill have to do some research on karnaugh maps. Also apologies for the mistype earlier, I put AND instead of OR.

Id assume the 4 shown below would replicate the 4x1 4x1 4x1 and 2x1 inputs but id assume i have to change quite a few things
My attempt at creating the circuit:


texts:
I've very less knowledge in electronics, I've read that a latch is a simple circuit that stores 1 bit of data (or state).

A Latch is a circuit that has two stable states and can be used to store state information.

That means it is a noun or a simple thing.

But while reading microprocessors (8085), in Timing and Control, there's a signal called ALE (Adress Latch Enable).
And I read this line -

  The ALE is a pulse signal, used to latch the address from AD0-AD7.

Now in the line above, the term latch is used as a verb. I don't know what exactly mean by that line above. What is mean by latching something?

So here my question is what is a latch? And what is the meaning of the line above? And what is ALE?


texts: Connection of two open drain outputs to control common LEDs by PIC32MZ

texts:
I want to use this Single Cell Li-Ion Battery Charger (MCP73833).
The pins STAT1 STAT2 and /PG are an open collector outputs and it will be connected to low power LEDs as shown in the schematic.
If I would also like to connect these pins to 5V tolerant open drain GPIO pins of the PIC32MZ microcontroller to also be able to control the LEDs by the microcontroller.
Will this direct connection work?


texts: How to choose what voltage power supply to use?

texts:
I'd like to build a keyboard emulator, and I've found three links that detail the process: 1, 2, 3. Here's the rough circuit:

The thing is, across the various articles I've read, people are using different voltage power supplies. All use DC. Most use 12v, but some reference 5v supplies. Others use 9v or 10v.

My question is: how do I select a voltage to use? I'd like to create the above circuit approximately 5 times, on the same supply.

Batteries would probably be easier - would it be possible to use a single 1.5v AA battery? If not, how many would I need? When would I use AAA's? How long could I expect the batteries to last?

I can of course change the capacitors and relays out, to match the voltage of the power supply.

Some general guidance would also be appreciated! Some background is in my other questions.


texts:
I am new to Orcad. I made some changes in capture and when I am trying to generate netlist using old board as input, netlist file is generated successfully but I am not seeing changes in board on PCB editor.

I get warning

  W-(Spmhdb-213): DRC set to "out of date". The current product
  selection supports a different DRC capability than what is saved on
  the design.


texts: I am looking at a portable inverter that claims to be able to output two modes through its Type B socket: 120V AC or 150V "HVDC". The documentation says the 150VDC mode can be used for resistive loads or for switched mode power supplies, avoiding conversion loss from the inverter. How can I tell what black box device normally rated for 120VAC can take 150VDC? Some SMPS have filters before rectification and I'm concerned the filter will short / not work on DC.


texts: Impedance matching through via and signal trace of 2 layer board

texts:
Due to tight space constraints I need to pass my LTE signal (800-1800 MHz) through a via. The proximity between the antenna connector and the modem is very short (literally on the other side of the pad).
Using impedance calculators, I have found that via diameters/ pads need to be somewhat small (Hole = 12, Pad = 18, Ref plane opening = 32 mils). However impedance controlled signal traces on a 2 layer 63 mil thick PCB are generally pretty wide: 33 mil width with 4mil conductor gap.
My question is how am I to connect the trace to the via when the trace width is substantially larger than the via pad diameter. If I connect it, I would effectively be increasing the via pad diameter to the trace width (33mil), and mess up my impedance.
Thoughts?
Also, here is an image of my PCB with the modem on the top layer, and a u.FL on the bottom layer. Please let me know if you have better ideas on how to connect this or if you see something wrong.
Thanks.


texts: Voltage to PWM Circuit, need to understand frequency

texts:
This is an off shelf component that might fit my need. Unfortunately the documentation is terrible. It should convert a 0-5v or 0-10v analog to PWM (0-5v/0-10v is a jumper). The analog voltage signal controls the duty cycle. The potentiometer controls "Precision" per the description. I think they mean it can offset the duty cycle from the control signal. I don't care about that, I can program the control signal. This should be perfect for me if the PWM frequency is 21-28KHz.

I can't find/get any info about the frequency.  It was cheap enough that I picked one up and started mapping out the traces. I've been trying to learn for a few hours now and I can't quite figure it all out. I think the 555 is controlling the frequency, but this doesn't look like any examples I have found. I want to know specifically which resistors/capacitor are controlling frequency and what it calculates to. I have the ability to rework the board and change them if needed. I don't have an oscilloscope right now, but I'm working on borrowing one. I'm hoping to figure this out and get any possibly needed components before I borrow the scope.

The picture should show connections, sorry if it is ugly. I will gladly clarify anything if confusing.  FYI, I just used purple when it would cross over another red line.


texts: Is there any chip that can measure temperature from the bottom of the chip with radiation?

texts:
I'm trying to find a chip that can measure temperature from B side(PCB board side). All chip that I could find is measuring temperature from A side of the chip. Is there any chip like what I described? The chip should be small, low powered.

I'm gonna use the chip for human body temperature check by putting it on to the PDMS(flexible, transparent PCB)


texts: Is there a standard reference designator to use for labelling indicator lamps in schematics?

texts: In a schematic, LEDs typically are labelled using the letter 'D' since they are diodes.  From what I can tell, it seems that there is no standard for labelling indicator lamps (e.g. small incandescent bulbs) in a schematic.  My question is: is there a letter that is typically used for labelling indicator lamps in schematics?  Or is there any published standard which defines the "proper" labels to use in schematics for indicator lamps?


texts: AT89c51RE2 replaced with AT89LP51RD2, ISP programming

texts:
have a question I can't seem to figure out the answer to. We have existing boards running off the AT89c51RE2 processor. Works great because it supports In-System-Programming. This means we can use BatchISP to program them very easily while they're already socketed on the board.

The issue is, we are now trying to switch to the AT89LP51RD2 and it would seem it supports the same ISP programming, but I can't seem to find anything as far as devices to add to Flip or BatchISP in any way. If I try to just change the device parameter it obviously says that it's not a recognized device because it doesn't know what it is. If I just run the existing batch programmer it connects, opens ports, erases, reads buffer, but then when it tries to program the HEX file to the chip it fails.

Any information in this area would be a huge help. I thank you for any advice!


texts:
I am trying to use the ethernet PHY on my Nexys4-DDR.  The manual for the phy gives the following timing constraints for the RMII ports.

I am getting confused as to what exactly the constraints for this should be in my XDC file.  For the above diagram I think I can conclude...

Input setup time  = 20 - 14 = 6ns
Input hold time   =  3ns
Output setup time = 4ns
output hold time  = 1.5ns

From this I generated the following constraints relative to clk_mac which is the 50MHz clock driving clkin.

set_input_delay -clock clk_mac -max 6.000 [get_ports {eth_crsdv eth_rxd eth_rxerr}]
set_input_delay -clock clk_mac -min 3.000 [get_ports {eth_crsdv eth_rxd eth_rxerr}]
set_output_delay -clock clk_mac -max 4.000 [get_ports {eth_txd eth_txen}]
set_output_delay -clock clk_mac -min 1.500 [get_ports {eth_txd eth_txen}]

I am unsure if I am mapping min/max to hold/setup correctly.  When I ran this design with chipscope it does not look like I am getting a valid packet on the rx side.  I previously had it working using no input constraints but with a 45 degree phase shifted clock.  So I guess that is like an effective delay of 5ns everywhere.  I also tried just setting all delays to 5ns and it started to work.   How should I correctly constrain this design?


texts: Using a replacement AC-AC adapter that has a lower current specification

texts:
There are many similar questions for AC-DC adapters but couldn't find an answer for the AC-AC adapters, I apologize if it has been already replied but I have missed it.

I have bought an old headphone amp that requires a 16VAC adapter. Another specification is that it should supply 1000mA current. I have searched all the online retailers in the country that I live and the best I have found was an adapter that is rated for 600mA. The headphone amp has five outputs, so I thought if I don't use all the outputs with full power 600mA will be sufficient, is this correct? I also thought that since this is an AC adapter it possibly only uses a transformer and the current limitation is only relevant when there is a risk of overheating, so if I choose to not to use all the outputs with full power it should be okay. What do you think?

Best regards.


texts: Mitigating touch current in two-pronged AC without dedicated ground

texts:
I'm trying to work on a simple circuit where (simplified) I plug in a 240V 50Hz AC through a resistive coil to convert to heat. The coil is insulated and placed under a metal plate. I'm noticing that if I touch the plate, I would feel a slight buzzing/tingling sensation, AKA touch current. I have some questions about that:

Is this effect due to induction, or is it a capacitance phenomenon, (or something else??)
How should I design to ground the plate to eliminate/reduce the touch current? It's easy with 3-pronged plugs with a dedicated earth pin, but old EU plugs are round two-prong and indiscriminately reversible making grounding tricky. The solution would have to work when I plug it in either direction.


texts: Sensing the capacitance value of a material - for an ID system

texts:
This is a follow up question to 'How does a Capacitive ID / Signatures / Sensing system work? e.g. Google Bloks'

In the 'Google Bloks' project. A tangible programming experience is created by allowing children to place physical instruction blocks (Pucks) next to each other.
The computer is able to read the sequence of instructions and turn it into a program to e.g. control a robot.
It uses a capacitive sensing / capacitive ID system to detect whether an instruction card is a "GO FORWARD" or a "TURN LEFT" card (for example).

From the technical whitepaper :

Pucks are easy to create, for example by cutting paper, or 3D printing
the form and then drawing the capacitive signature with conductive
ink. This enables an infinite number of commands to be easily made on
the fly by anyone.
The Base Boards have their function specified by the puck placed on
them. The Base Board has a capacitive sensor and magnetometer. The
capacitive sensor reads the command expressed by the puck, and the
magnetometer detects the state of the mechanical control by reading
the magnet position.

The Base boards are able to read the capacitive signature of a puck to identify it:

I am interested in how Google Bloks uses capacitive sensing to read the conductive paint pattern, and decode it as a Puck identifier.
Looking at the images more closely, we can see the materials used for the pucks - one layer (A) with a conductive pad and the other (B) an insulator.
My guess is that if one were to paint the insulating layer (B) with some conductive ink, then together with layer A, the puck will form a capacitor. The value of its capacitance will vary depending on the pattern drawn. Thus the idea of a capacitive signature that can identify a puck.

My questions are:

Would this work in practice?  Could the capacitance value be reliably read, to uniquely identify a puck?

How to detect the capacitance, contactless ? The pucks have no electrical contact with the 'reader' base board.


texts: External offset voltage adjustment on NE5534?

texts:
I am working on an audio amplifier for fun. The OP-AMP I chose is NE5534.
I think I figured out most of the circuit, but the pin 5 and 8 confuses me.

Pin 5 is "External offset voltage adjustment" pin (output)
Pin 8 is "External offset voltage adjustment" pin (input)

I haven't had the chance to understand this from the datasheet

It seems optional, so I am tempted to leave unconnected. However, perhaps I should break out the pin to a throughhole or a pad.

Since I am unsure what kind of capacitor/resistor is required, I don't know if I can use a generic 0804 type place holder for it.

Can someone please enlighten me?

[update] Ok, I found the description for the two pins:

  The input offset voltage of operational amplifiers (op amps) arises from unavoidable mismatches in the
  differential input stage of the op-amp circuit caused by mismatched transistor pairs, collector currents, currentgain
  betas (β), collector or emitter resistors, and so on. The input offset pins allow the designer to adjust for
  these mismatches by external circuitry. These input mismatches can be adjusted by putting resistors or a
  potentiometer between the inputs as shown in Figure 10. A potentiometer can be used to fine tune the circuit
  during testing or for applications which require precision offset control. More information about designing using
  the input-offset pins, see Offset Voltage of Operational Amplifiers (SLOA045).

After reading the description, I must admit I am lost. Can you please explain what "mismatches in the differential input stage" is?


texts: LCD/display for a digital thermometer-like device

texts: I need a small LCD display for a digital thermometer-like device I am making. I need to be able to display 6 digits or letters only.The main constraint is the small size and rectangular shape.I cant have width more than a little over a centimeter and length appropriate for 6 characters. I am unable to figure out how and where I can get this type of LCD. I am also ok with other displays, e.g. LED-based.


texts: Problem capturing specific signal from CAN bus

texts:
I am having a problem capturing a specific signal from a CAN bus. Since this task is quite out of my ordinary area of work it might be a pretty simple question.

On the device reading from the CAN I have to specify 7 values:

CAN-ID (0x....)
Start Bit
Bit Length
Use Little Endian (yes/no)
Sign bit available (yes/no)
Use Two's Complement (yes/no)
Sign Bit

Information I have about the desired signal:

CAN-ID (self explanatory)
Byte-order: Motorola

Google tells me this leads to 'use little endian: false'

Sign bit is available (self explanatory)
length: 16 bits
DLC = 8
Last information I have is a (shortened) layout table of the entire message with my signal marked:

Long story short my issue is obviously lying in not being familiar with byte ordering and similar things. I still have to specify start-bit, sign-bit and wether or not to use two's complement. Can somebody please help me with what values to enter, as all combinations that made sense to me didn't work so far. Thanks a lot, much appreciated!


texts: Simple PWM vs Buck Topology for Motor Speed Control

texts:
A simple triangle wave generator with a comparator can be used to create PWM that can be fed to a switch for controlling the speed of the motor.
    Alternatively, by using any buck controller integrated circuit such as TI LM3485 we can step down the voltage to a defined value, all the PWM and controlling feedback topologies integrated inside the chip.
    My question is, given the fact PMDC motors which are not so sensitive to momentary spikes (at least in my case), isn't the first method also reliable for speed control?
Except for the efficiency is their any other reason as to why one should go with the second option where we use inductor in the circuit?


texts: Board or product to drive 15 PWM/analog outputs from USB/serial connection

texts:
Ok, Let me explain: I would like to drive 15 analogs (0-12V) signal from my computer (based on user interactions/other not-so-cool stuff).

This hardware has to be controlled over USB or Serial port or USB-to-serial adapter, keep in mind that this application will be installed on various OSs (I have to control this board from an application I already have, written in c# (for windows) and in java for linux (both with c++ parts))

I've considered using Arduino, there's one version with 15 PWM outputs and it should be possible to do exactly that.

I can "convert" PWM signals to voltage using a mosfet (and that's pretty easy).
Each output will require about 200mA.

Does anyone know a similar solution?


texts: How to choose nodes for Thevenin equivalent circuit

texts:
I would like to know how do we choose the nodes for a Thevenin Equivalent Circuit.
For example, in the voltage divider, we compute the Thevenin equivalent circuit between the nodes where we would connect our load:

simulate this circuit – Schematic created using CircuitLab
(do not mind the value of the voltages and components, they are irrelevant for my question in addition to be wrong because I haven't done the calculations).
However, in an amplifier circuit (for example, a simple common-emitter), I do not understand how do we choose the nodes for the equivalent circuit:

simulate this circuit
We use for example a thevenin equivalent circuit to easily compute the biasing base current of the transistor. What nodes do we choose for that? As the resulting equivalent circuit is connected between the base and the ground, I assume it was computed between these nodes (nodes B and D), is it correct?
This case is similar to the voltage divider, however what do we consider being our load? As we computed the equivalent circuit between B and D, does it mean that our load is the base-emitter junction along with the emitter resistor?
Why have we not chosen to compute the equivalent circuit between nodes A and B for example? Would it be possible and would we get the same results?
Thank you.
EDIT: after having thought about this and redone the calculations, it seems that the two solutions are equivalent:
Taking the Thevenin equivalent between nodes A and B gives:

simulate this circuit
Here we have \$ V_{TH} = \frac{R1}{R1 + R2} V_{CC} \$ and \$ R_{TH} = R1 // R2 \$.
KVL gives us: \$ V_{CC} = R_{TH}.i_b  + V_{TH} + V_{BE} + R_E.i_E\$
which can be rewritten as:
$$ \frac{R2}{R1 + R2}.V_{CC} = (R1 // R2).i_b + V_{BE} + R_E.i_E $$
Taking the Thevenin equivalent between nodes B and C gives:

simulate this circuit
Here we have \$ V_{TH} = \frac{R2}{R1 + R2} V_{CC} \$ and \$ R_{TH} = R1 // R2 \$.
KVL gives us: \$ V_{TH} = R_{TH}.i_b + V_{BE} + R_E.i_E\$
which can be rewritten as:
$$ \frac{R2}{R1 + R2}.V_{CC} = (R1 // R2).i_b + V_{BE} + R_E.i_E $$
This is exactly the same equation as the previous circuit, hence they are both equivalent.
I hope it will help some people, because it really confused me at first.


texts: PIC16F883 over 12V input with resistors?

texts:
I am using a ADM00308 with a MTS2916A driver development board from MicroChip. There is a serial port RX & TX which can be programmed into an input. I'll use those inputs to drive the motor a specific direction. The signals I will be using is 4.5V for the motor going clockwise. By going counterclockwise the signal will be 18V. This is because the clockwise speed is setted to be slower than the reverse speed. I am planning to tap these signals and put it on my input. Since the operating voltage of the PIC16F833 processor is
2V to 5.5V , am I able to put 18V with a 10k resistor on the input of the processor? The current is about 0.150A.

Since for example 3.3V leds can be driven by a supply of 12V with a specific resistor on it, I am not sure if the same applies for input of microprocessors. Sorry for my potential silly question.

Processor:
https://www.microchip.com/wwwproducts/en/PIC16F883

Driver: https://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=adm00308


texts: Two or more Diac Triac dimmers in parallel

texts:
I wanted to know whether connecting two or more simple diac-triac ac lamp dimmers in parallel with the same load cause any problems?
I do not want to connect them in series, just parallel will be enough.

The dimmer circuit is the common diac-triac dimmers found in stores and wired in paralled like this .

The load will be a dimmable led light bulb at 240v ac 12w.

Edit: Updated circuit diagram


texts:
I want to build my own 120A Electronic Speed Controller and decided to try it with the DRV8305 IC. I am by no means a hardware expert, so go easy on me.
On page 45 of the DRV8305 datasheet: https://www.ti.com/lit/ds/symlink/drv8305.pdf?ts=1603013837741&ref_url=https%253A%252F%252Fwww.ti.com%252Fproduct%252FDRV8305
You will see SN1, SP1, SN2, SP2, SN3, SP3 as the connection points for 3 sense resistors. In many other datasheets, I see that all low side sources are connected together in a single shunt resistor. Page 47 describes just using 1 shunt, but I am not sure what the trade-offs are. What information do I get by using 3 instead of 1 and can I just use 1 to drive a sensor-less BLDC motor?
Another question I have is how to choose a shunt resistance value. In many datasheets examples of the rated current are like 10A, but I want a rating of something like 120A (common ESC rating). In the examples, the shunt resistance is something like 5 mOhm, but for 120A, I would need something like 500 uOhm. At that resistance, isn't the resistance so low that the PCB trace resistance dwarfs the sense resistor? If my sense PCB traces are even 1mm different from each other, that could be ~3 mOhm, about 6x the shunt. What is the solution here?
Thank you :P


texts: Dual supply source, how to do the switching?

texts:
I'm designing a circuit that I'd like to normally power from a 12-36VDC source, but want to have the option of also powering it via the USB connection during configuration.

I've chosen the LMR16030 for the regulator via the TI "PowerBench" designer. This regulator works with a 4.3-60V input and is set up to regulate a constant 3.3V output to power the microcontroller (a PIC32MZ2048EFM144).

Originally I had thought of just using a diode, but because VIN can be 12-36V I didn't want to reverse-bias and conduct back into the USB port, and additionally the forward voltage drop was too much (can't be more than 700mV before the regulator goes into low-voltage shutdown).

So I decided to come up with the same reverse-voltage that I use on the VIN line for the VUSB line. What I'm not sure of is if this will work when both supplies are connected, especially if the VIN is removed if the regulator will drop out or not?

(Don't mind the symbol for the SI4447ADY-T1-GE3, I'll change it to a standard P-Channel Mosfet soon. Q1 is also a P-Channel Mosfet).

There should be enough bulk-capacitance on the input side to make any transition bump-less, but I haven't designed a dual-input supply before and would like to know if I'm hitting my mark or not?

The goal here is to be able to plug/unplug one supply source or the other without the 3.3V output turning off. I understand I'll have to do some power negotiation with the USB host to get full power but having the full 3A power output from the regulator from USB input is not a design criteria.

Edit: Here are the design specifications:

12-36VDC Normal Input Voltage
5VDC Input Voltage via USB during Configuration
3.3V @ 3A Output Voltage
Industrial Temperature Range up to maximum operating temp of 120°C
Output of 3.3V @ 1A when connected to USB
VUSB power may be removed while VIN is connected without resetting device
VIN power may be removed while VUSB is connected without resetting device

I won't put the microcontroller side requirements because I don't think they are relevant here, but if there is something specific I'm missing I'll add it in. I'll be shutting peripherals down when VUSB is connected to avoid drawing more than 1A from the power supply. I'm not concerned too much about efficiency because this is not battery powered, but it should be in the 85%+ range when connected to normal power.


texts: Understanding Data Sheet for Current Gain of BJT

texts: I am confused about reading and understanding current gain of BJT from their datasheet. The following images are from data sheet of BC337. The first graph shows a Hfe of 100 (approx) when Ic is 100 mA (approx), the second graph said For Vbe saturation the Hfe is 10, and the table says something differently. How to read them properly?


texts: Magnetometer perpendicular to ground plane

texts:
A team and I are building some wearable tech that needs a magnetometer to know your heading. Unfortunately, we have to mount it "vertically" - imagine that the board is flat against your stomach/waist.

As all magnetometers that I know of require you to be parallel to the ground, I'm wondering if anybody knows of any sensor boards in which the internal circuitry is rotated 90° such that it allows you to be perpendicular to the ground plane or any other methods which we can use that allows us to determine our heading with a board that's vertical/perpendicular to the ground.

Note: the sensor will be interfacing with an Arduino.

Thanks!


texts: How to play music on PAM8610 with ESP32?

texts:
I'm trying to use Xtronical's DAC audio library on an ESP32 to run 10W speakers. The board that Xtronical used is a PAM8403 which has a signal voltage range of -0.3V to +0.3V but as it can only run 3W speakers thus I cannot use it.
Hence, I am using a PAM8610 which can drive 10W speakers. The problem is that I don't know what its signal voltage range is. Can anyone help me in this regard?

If the range is different than that of PAM8403, then how can I map my ESP32 output to this range?

References:

https://www.xtronical.com/driving-a-speaker/
https://www.xtronical.com/adding-amplified-sound-simple-version/
https://www.xtronical.com/the-dacaudio-library-download-and-installation/


texts:
I have an STM32 dev board with some external SRAM. I would like to execute my code from that external SRAM, but my processor only supports booting from the Flash, internal SRAM or System memory (a part of the internal SRAM).

What is the easiest way to run code from an external SRAM?

Notes: I load code with OpenOCD through JTAG, and I use GDB.


texts: How to create a copper pad for heat dissipation in eagle?

texts:
The data sheet for this component, the RPX-1.0, says "SW Switch node. Connect 6, 7, and 8 to large copper pad for optimal heat dissipation".
Is a "large copper pad" an extra component that you solder onto the pcb and then solder the pins to that pad?
Or when creating your layout do create a pad somehow that those pins connect to?


texts: Is the ESP8266 able to collect 8 bytes data at 1 KHz for 1 second through I2C?

texts:
My project requires collecting data samples from an MPU6050 (i2c communication) at 1 KHz for 1 second, when the value exceeds a certain threshold. The data required are 3 axes acceleration data and the time in ms, totaling 8 bytes. So a sample would be ~8KB.
I am using ESP8266 NodeMCU with 4MB flash and 26MHz crystal.
Is the ESP8266 able to collect the data at 1 KHz through I2C to the memory?
If yes, which platform would be optimal (Arduino, Esplorer-lua, etc.)?
To be specific, which of these platforms would give more optimized machine code?


texts: Do NRF24L01 modules have to use the same SCK-Frequency to work together?

texts:
I have two Atmega 328p Microcontrollers connected to NRF24l01 modules. The first one uses a SCK-Frequency of 2Mhz and the second one a SCK-Frequency of 4Mhz.
Sadly the Connection doesn't seem to be working.

Do both modules have to use the same SCK-Frequency to work together? Why or why not?


texts: What are these metal plates on this car battery charger/starter output and what is their purpose?

texts:
I was trying to figure out why a car battery starter/charger (input 220V, output 12V wasn't working and when I opened I try following the wires to see what the circuit is, but then I run into these plates and I've got nothing, The negative output is connected to one of the plates, but the positive is connected to both of them which is what confuses me the most.
I don't have a schematic, I'd be checking that if I did, I think the reason it doesn't work is because the cable from the positive which appears as it should be connected to both plates has cut the connection to one of the plates, but that's beyond the question. I'd like to know what these plates are and what purpose they serve.


texts: Calculate measurement accuracy of kelvin 4 wire measurement circuit?

texts:
Forenote: I'm not an EE, I'm a Controls Engineer.

So if need to measure a resistance value of 240Ω ±2%. I need to figure out what voltage and current range I would need to measure to within 4.8Ω (= 240Ω * 2% I assume I did that right).

So for example (not actual numbers just examples), if my voltage on the line being measure is 9V and voltage input measures 0-10V ±1% of full scale and my current input measures 4 to 20mA ±1% of full scale. How would I calculate my resistance measurement accuracy?

ETA: Side Note I need to ultimately use a PLC to measure this.

ETA2: I added a diagram of the

simulate this circuit – Schematic created using CircuitLab


texts: If an IC has an external resistor for timing, can that be replaced with an analog voltage out from another IC?

texts:
Specifically, I want to control the sample rate of an ISP1820 with an analog out from an Arduino. I know I could drop-in a digital pot but I don't have one and that seems like needless complexity if I could remove the resistor and have the Arduino look at one of the pins on the other chip and math up what the other pin should see.
Or could I put two pins of a transistor to the daughter chip and have the Arduino control the sample rate by flipping the transistor at a certain frequency? I also have a small pile of random opamps, CMOS logic chips and 555s. I have no problem with the 1820 glitching a bit so a kludgey solution would be acceptable.


texts:
I have a question related to 802.11n wi-fi antenna. What actually do we mean by 1T1R mode for Wi-Fi?

As per wiki, the same channel is used for Tx & Rx:
http://en.wikipedia.org/wiki/MIMO
http://voyager8.blogspot.in/2011/09/wireless-antenna-technology-siso-simo.html

In 1T1R  mode, do we need a separate antenna for both transmission and reception?


texts: I find analog switch usually label the two terminal of the switch channel as "S"(Source) and "D"(Drain). Such as this. I think they are equal in function, either can be used as input or output. So why still use the terminology from MOSFETs?


texts: What kind of power supply is this?(using an NPN as regulator and Buck converter)

texts:
I have one of this FM Modulator and use it in my car as MP3 player.

Currently it doesn't work and I opened it to know what's going on inside it and saw this ridiculous supply:

As you see there is just a MJE13003 transistor. interesting. I expected to see something like 7805 not a BJT. How does this power supply work?

Source of images: link

Add:

Another images:


texts: Garbled characters from micro-controller


texts: Controlling DC motor with an Arduino motor shield using PID

texts:
I'm currently trying to control a DC motor using an Arduino motor shield using PID control. I found this code that can control the motor and also give encoder values and I adapted it for my motor shield. The code is shown below.
Unfortunately the motor isn't moving despite the adaptation but the encoder spits out values when you turn it. I have a schematic of the system. The shield I am using is Ardumoto shield.
I was just wondering if anyone can tell me what the issue is as the hardware has been wired correctly and the code makes sense.

    #include <PIDController.h>
volatile long int encoder_pos = 0;
PIDController pos_pid;
int motor_value = 255;
unsigned int integerValue=0;  // Max value is 65535
char incomingByte;

int dira=12;
int speed_a=3;

void setup() {

  Serial.begin(9600);
  pinMode(2, INPUT);
  pinMode(8, INPUT);

  pinMode(dira, OUTPUT);
  pinMode(speed_a, OUTPUT);

  attachInterrupt(digitalPinToInterrupt(2), encoder, RISING);

  pos_pid.begin();
  pos_pid.tune(15, 0, 2000);
  pos_pid.limit(-255, 255);
}

void loop() {

if (Serial.available() > 0) {
    integerValue = 0;
    while(1) {
      incomingByte = Serial.read();
      if (incomingByte == '\n') break;
      if (incomingByte == -1) continue;
      integerValue *= 10;
      integerValue = ((incomingByte - 48) + integerValue);
      pos_pid.setpoint(integerValue);
    }
}

   motor_value = pos_pid.compute(encoder_pos);
if(motor_value > 0){
  MotorCounterClockwise(motor_value);
}else{
  MotorClockwise(abs(motor_value));
}
  Serial.println(encoder_pos);
  delay(1000);
}

void encoder(){

  if(digitalRead(8) == HIGH){
    encoder_pos++;
  }else{
    encoder_pos--;
  }
}

void MotorClockwise(int power){
  if(power > 100){
  digitalWrite(dira, HIGH);
  analogWrite(speed_a, power);
  }else{
    digitalWrite(dira, LOW);
  }
}

void MotorCounterClockwise(int power){
  if(power > 100){
  digitalWrite(dira, LOW);
  analogWrite(speed_a, power);
  }else{
    digitalWrite(dira, LOW);

  }
}


texts: Why does the current in a transformer's primary coil change when a load is attached to the secondary coil?

texts:
I don't really know if the question is suitable to be submitted here or in the Physics StackExchange. The problem is I don't quite understand this sentence from "Practical Electronics for Inventors" Book, p.377

When a load is attached to the secondary, the secondary current sets up a magnetic
field that opposes the field set up by the primary current. For the induced voltage
in the primary to equal the applied voltage, the original field must be maintained.
The primary must draw enough additional current to set up a field exactly equal
and opposite to the field set up by the secondary current.

The explanation says that when a load is attached to the secondary, the current in the primary must change to keep the applied voltage field the same. I have no idea what that means and why does this phenomenon have to occur in the primary, when there is a load in the secondary.
Furthermore it's assumed that the magnetizing current will be very small in comparison to the current after the circuit being loaded, which I also don't understand.
I need some more in-depth explanation. I have quite good background in physics of electricity from first year of engineering college, so feel free to give a deep explanation about what is happening.


texts:
I am designing a bluetooth low energy device. It basically reads a sensor over I2C and collect data. You can check data in your phone whenever you want. I have two questions, one related with antennas and another one related with battery.

first of all, this is my layout so far

It is based in this schematic

IC2 is B1 from schematic, IC3 is X1. The left part is my specific sensor.

My questions are: First, the one related with antennas. Since this is a homemade project I do not have a vector network analyzer so I can't tune the antenna. However, I found this antenna from Texas Instruments:

http://www.ti.com/lit/an/swru120b/swru120b.pdf

They claim its impedance is 50 ohm, so could I just attach its 50 ohm feed point to my 50 ohm output from the balun? with a extremly short wire so I don't add extra resistance or inductance (or as low as possible)

Second question is I need it to be battery powered and small. I went for a CR2032 battery. However I checked its current specifications and it says 4mA maximum discharge current. I need around 20mA in some moments when the radio is working. I thought I could add a large capacitor (C14) so it can provide higher current for a short time and then it will be charged again when the system is sleeping. It is possible?

Thank you.

[EDIT]

I added a pi-network just in case. My layout is this now

and this is the schematic

I'll use a 0 ohm resistor as R3. R4 and R5 are not mounted initially. This would allow to eventually tune the antenna, but it won't be easy since I don't have lab equipment. I am wondering if this would work without tuning?


texts: Why does this optocoupler circuit work without getting destroyed?

texts:
This circuit is being used for mains detection. Input is being fed directly from 220V 50Hz mains and output goes to Arduino which is running on 3.3V.
Theoretically the optocoupler LED should burn out during reverse polarity of 220VAC in the circuit given below:

Here is the voltage graph which appears across the LED of opto-coupler:

It shows a peak reverse voltage of 50V only instead of expected 220V (at least that's what I expected). However 50V alone should be able to destroy the LED.

I have used this circuit in a project and it has been working perfectly for about 6-7 months. Why does this circuit work?

Here are the Absolute max ratings from the datasheet:

And these are characteristics for the device:


texts: How do devices like the Game Boy Advance achieve their frame rate?

texts:
I've been designing my own handheld gaming device based around an AVR microcontroller and a small OLED display.

I started off with a monochrome display 128x64 pixels and can comfortably draw to it at over 60 frames per second.

I recently reworked it to use an RGB OLED, 128x128 pixels without really thinking too much only to find I could only achieve about 4 FPS. After some thought and careful refactoring I can get that up to ~12fps if I don't care too much about doing anything else!

My question is - how did a device like the GBA (Game Boy Advance) achieve a frame rate of nearly 60fps? I thought about having a separate 'graphics processor' but realised I would still be bottlenecked transferring the display data to that.

I also wondered about using the vestigial 8-bit parallel interface most of these screens tend to have, which might net me an 8x speed up, except that modern MCUs don't tend to have hardware parallel interfaces like they do for serial and bit-banging will likely eat up a lot of the speed gain.

What other options exist?

I'm currently using an ATmega1284P connected to an SSD1306 OLED controller via USART-SPI.  That's the monochrome version.

The colour screen was an SSD1351, not originally connected to hardware SPI. I wasn't convinced it would make enough difference, it's just too slow overall

I know I can get faster MCUs, but I want to know what other options I could explore - the GBA processor is much slower than my 1284!


texts: LM386 motorboating that goes away with a resistor in parallel with the bypass capacitor on pin 7

texts:
I'm building a simple amplifier around a LM386. The circuit I'm using is this:

The input is on pin 1 of the connector and is a square wave coming from a digital pin on a NodeMCU devboard.

When I turn the circuit on, I can hear a low frequency oscilation on the speakers (not a constant tone, but as if the speaker was turned on and off a few times a second).

I tried adding a capacitor between the signal and ground as it seemed to work in this related question but I needed a fairly big capacitor (220uF) to get any result at all, and it only decreased the volume of the noise (not to mention it is filtering my input, if I understand it correctly).

What did get rid of the noise completely was adding a 1K resistor between pin 7 and ground (in parallel with the existing capacitor):

I have no idea why this works, but it gets rid of the noise completely.

So my main question is: what is this resistor in parallel with the capacitor doing and why does this remove the noise?

I'm happy to keep this solution if it makes sense, but first I need to understand why it works.


texts: STM32 - Sampling ADC value at known regular time intervals

texts:
I am working on a simple microcontroller based proportional controller to regulate the temperature of a heater cartridge using a feedback thermistor. I'm using the 'black pill' STM32F103C8T6 and have the controller working however I would like to send out time stamp and temperature readings over UART so that I can plot a graph of the temperature output vs time and use the Ziegler-Nichols method to obtain integral and derivative values (by obtaining the ultimate period of oscillation and ultimate gain).
I played around with DMA mode and ADC but had a lot of troubles so ended up using the simple polling method mentioned in the answer here:
The controller works in the main loop:
 /* USER CODE BEGIN 2 */
  usart_send_string("READY");
  HAL_ADC_Start(&hadc1);
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {

     if (HAL_ADC_PollForConversion(&hadc1, 1000000) == HAL_OK){
         waxThermistor = HAL_ADC_GetValue(&hadc1);
         temperatureInDegrees = read_temp(waxThermistor); //Calculates the value in degrees using a look up table
     }

     if(heater==1){
         HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1); //PWM for heater element
         heater = 0;
     }

     int currentTemperature = temperatureInDegrees;
     int pi = PI(30,currentTemperature,50,0); //returns the controller value P + I
     int actuate = limitActuation(pi,0,500); //Limits the actuation range between 0% and 50% duty cycle
     htim3.Instance->CCR1 = actuate; //Sets the duty cycle
     sendTemperature(currentTemperature); //transmits the temperature over UART
    /* USER CODE END WHILE */

I would like to be able to send out a time value along with the temperature. I tried removing the polling and placing waxThermistor = HAL_ADC_GetValue(&hadc1);in the interrupt routine for a 20ms timer (using OC mode) however I no longer get any PWM output as the ADC value is just returning 0 all the time. Could anyone recommend a better method for ADC sampling at a regular known interval rather than polling like this?
One possible solution I thought of would be to setup the ADC to trigger conversion on a timer and then read the sample in the conversion complete callback function. The time elapsed would then be the time between triggers + time taken for conversion to complete which can be calculated through the formulas given here. Would this be a viable solution?
For example if sampling every 20ms, the data sent out over UART would look like:
0ms;25c\n
20ms;27c\n
40ms;35c\n


texts: Is there a way to measure or infer the color of a material from a distance (~2m), without using visible light?

texts:
I've recently started working on a graphics/SLAM project. We've encountered a problem that requires us to measure or infer the color / spectral reflectance (and ideally albedo) of points on objects in a cone-shaped field of view from ~1-10m away.

Currently, we're using an IR sensor to determine distance and angle, and we're also measuring reflectivity (over the wavelength of IR light that the sensor uses). We now need to determine color, but we're not able to use visible light emissions on the robot, which complicates things. As the only person the team with any physics knowledge, I've been assigned this particular problem, but I don't know enough to even hypothesize about solutions.

The key requirement is that we're hoping to be able to assign a color to every point; however, the color doesn't need to be very accurate.

I was thinking that maybe with the IR sensor we could estimate the dielectric function of the material and then subsequently infer the spectral reflectance from those measurements? But it's been several years since I studied optics/E&M and even then it was only at an undergrad level. If anyone could shed some light on the problem I'd be very grateful!

Thanks!


texts: Power supply design with charging circuit

texts:
I am designing a GSM modem power supply circuit.

The circuit requires a 2A power supply.
The module SIM800C itself can be powered directly by Li-Ion or Li-Poly battery power.

I am looking at a ready-made charging and output voltage protection PCB like this.

These are commonly found at many places and hence the motivation to use these boards off-the-shelf.

The circuit that I am designing should work reliably (for at least the next 5 years).

I have the following questions:

Can I give 5V supply at the input at this circuit and connect battery at the battery terminals. Can I draw supply from the output terminals of the circuit infinitely?
The power adapter at the input will be connected forever and this is in turn connected to UPS. The battery is only for the unforeseen event when UPS also goes down. Will the circuit above work OK for an extended period application?


texts: When we should use only an "Analog" multimeter?

texts: I know electronics testing with digital multimeters is easier than analog, but I'm wondering whether there is any electronic testing which can done with only "Analog" multimeters? For example measuring AC voltage with a square waveform: some people say it can't done with a digital multimeter because they are made for measuring sine waves from the grid. If that's right, are there any other tests that require analog multimeters?


texts: System Identification (Linear Passive Circuit)

texts:
I'm need to find what's inside the following black box but I'm not sure how to exactly do this.

simulate this circuit – Schematic created using CircuitLab

I'm thinking that I might use the circuit's bode plot as well as the step and impulse response to find it's transfer function. Does this sound right?


texts:
I am trying to build a +12V Power supply from an old PC PSU:
http://www.instructables.com/id/Convert-an-ATX-Power-Supply-Into-a-Regular-DC-Powe/

I am planning on using it to power my old cordless drill (battery dead)

it is working great, however I get an annoying high pitch noise, I assume it is so called "coil whine".

is there a good way of determining which coil is it coming from?

since this PS will not power anything sensitive to minor voltage irregularities, is it ok to bypass a coil? i would try one by one to find the one causing the noise


texts:
When using nodal analysis, my book says you will always end up with \$n-1\$ linearly independent equations, where \$n\$ is the number of nodes.

Can someone intuitively explain why this is true? If it's too hard too give intuition, I'll settle for a formal proof.


texts: How do you find high-quantity prices for ICs?

texts: I know of findchips.com, oemstrade.com, octopart.com, and the like. But even the lowest prices on these sites are still higher than the prices on BOMs I get from China.  How do you realistically estimate the cost of an IC purchased at high quantities for manufacturing purposes?


texts: Variable resistors - resistance value meaning

texts:
I'm normally using in my circuit board a 10K variable resistor. Those specific 10k variable resistors are no longer in my supplier stock for now and I was wondering if I can place a 200k variable resistor instead of the 10k one and tune it accordingly?
I also want to understand the meaning behind the resistance value of each variable resistor: does it mean that this resistance value is the resistance threshold? Or is like the minimum resistance that you can get from it?
Still confusing for me.


texts:
This may be a question strongly depending on application and opinion, but I'll give it a try.

I am designing some controls for an industrial application, including cap touch buttons and LED 7-segment displays. As I have many of those LED-segments (about 280) I won't be able to control them directly all the time, instead I will multiplex them.

The brightness of the led-segments will be indirectly proportional to the multiplex factor, I am wondering how bright a LED display "normally" should be, and if I can get away with my heavy multiplex design.

I am planning to use this, which has a typical brightness of 9.0 mcd. How deep can I multiplex this? could I get away with a 1:7 multiplexing (the brightness per segment will be 1/7th)?

If the above is not answerable: Is there anyone regularly working with displays? how is the brightness with those in general? The device I am building is only used inside. Sun-radiation directly onto the display is unlikely.


texts:
I am looking for a cheap and easy way of creating a small electronic device that is capable of detecting whether or not it is inside a Farraday Cage.

Hopefully, without an external sensor/emittor.


texts: What class of audio amplifier is this unusual configuration?

texts:
Regarding Figure 1 on page:
http://www.rason.org/Projects/transaud/transaud.htm

I'm trying to get my head around what type of amplifier "class" Figure 1 is. The last part of it looks like a Class AB or B amplifier, except that it uses two NPN transistors (plus the 2N3904 that controls them) rather than one NPN and a PNP.

The original page only states:

"This circuit is really a current repeater formed by Q2 and Q3 and driven by Q1. This circuit is similar in performance to many IC amplifiers but requires an initial bias adjustment. R2 controls the bias and should be adjusted so that exactly ½ of the supply voltage is measured at the collector of Q3 with no signal. Once adjusted, heat sinks are not needed for Q2 and Q3 and a very high input impedance of approximately 47,000 ohms is seen at the input. Diodes D1 through D4 provide a constant voltage of 2.8 volts and form a constant current source through the base of Q1. This circuit is almost as good as some audio amplifier IC's and is preferred when a minimum power drain is needed."

1) What type is it and why do I never see this type of amplifier when I read about audio amplifiers elsewhere? What is the benefit or reason for it instead of AB?

2) It claims to be good for power-conscious applications. Is it more power efficient than an AB amplifier? How could I calculate the efficiency?

3) What impedance and power of speaker is the amplifier intended/able to power?

4) I actually only need to power a 0.5 Watt 8 Ohm speaker by battery. In this case could I use general purpose 2N3904 transistors, and could I increase the resistor sizes to reduce power losses, and decrease the 220uF capacitors to save money and bulk?

5) What capacitor size would be recommended for 0.5 W 8 Ohm? Is there a trick to calculating that?

6) Would the circuit still work at 5 V?

7) How can I calculate the gain, or at least avoid blowing a 0.5W speaker?

8) And how good is the sound quality likely to be from this?

Many thanks!

Figure 1


texts:
I'm would like to control the AC current that is will be consumed by a homemade arc welder. Website I used as a reference: http://www.mike-worth.com/2013/07/31/adding-a-current-limiter-to-my-mot-welder/

He converted a transformer to a rheostat (blue handle). I can't really make it out but can someone explain the following:

Looks like there is only a primary, no secondary winding
Is current is modified by laterally sliding the E and I sections of MOT apart? Or is tilting a single side of the E off the I of the MOT enough to modify current?
Can the rheostat transformer endure 30-50 amps of current going through its primary winding without being damaged or melting the primary coil? I would like to know what kind of duty cycle to expect.

I prefer a mechanical means to control the current. I'm open to more efficient/simple suggestions, simplicity is what I'm after.


texts: Do BJT (Darlington) transistors have a minimum collector current?

texts:
I am using a TIP122 Darlington transistor. From the graph provided in the datasheet, I can see that the saturation voltage decreases as the collector current decreases.

Since the load I am driving upstream only draws 400mA, can I assume that the aforementioned trend continues? That is, at Ic of 400mA, the saturation Vce voltage will decrease to below 1V?

Or do transistors have a minimum Ic threshold that disrupts this trend? I can't seem to find such a rating on the datasheet.

Datasheet: https://www.onsemi.com/pub/Collateral/TIP120-D.PDF


texts: Cyclone II FPGA Starter Kit Configuration Seems to be Giving Bogus Results

texts:
I've been trying to get my Cyclone II FPGA (from the Starter Kit, EP2C20) to work. I've gotten the Quartus II software to work on my Ubuntu setup and it' ALMOST working - I can write some Verilog, compile it, and put it on my device via the programmer. However, I can't get my code to control the FPGA outputs in any meaningful way. Here is, essentially, the code I'm trying:

module fpga(output LEDG[7:0);

assign LEDG = 1;

endmodule

I want all the green LEDs on the FPGA to light up. What am I doing wrong?

Terribly sorry if this is something I could've Googled, I just spent the past hour trying to but didn't get too far (there doesn't seem to be much example Verilog code made for FPGAs out on the internet, at least any code which deals with minutiae like activating LEDs).

I can't wait to get started playing with this thing for real, so would appreciate any help getting this minor step working!

Update: The Quartus II Pin Planner is showing that the Fitter Location for the pins I care about is different from the pins specified in the datasheet. How can I fix this without manually re-assigning all the pins to the right places?


texts: DC-DC Buck, Selective Voltage Binning (SVB) technique

texts: I have been trying to understand SVB technique and unable to understand how it is implemented in a DC-DC buck converter as shown in the schematic below. Can someone please explain the SVB circuit part of the below schematics? How does SVB work in the below specific case?


texts: How to measure 0.02V to 0.18V audio signal with arduino?

texts:
I have a Sony STR-DE845 home theater amplifier with 8 Ohm speakers. I want to measure the voltage sent to the speakers to infer their volume using an Arduino. The AC voltage measured across a speaker ranges from 20mV to 180mV using a true RMS voltmeter when playing music or various test tones over the audible volume range (are those readings too low?).

To do this I want to:
-amplify the AC signal with a gain of ~100 (output is 2VRMS to 18VRMS)
-put the amplifier signal through a full bridge rectifier made of 1N4148's (output is ~0V to 16VDC)
-Use a voltage divider and zener diode to give ~0 to 5V DC for the arduino's analog pin

If the above makes sense, what kind of circuit should I use to amplify the AC signal by 100? I have some AD623 instrumentation amplifiers, 2N2222 transistors, 1N4148 diodes, etc.


texts: Is the melting point of pure indium too low to safely use to solder together a custom copper heatsink to be used ontop of motherboard mosfets?

texts:
Is the melting point of pure indium too low to safely use Indium to solder together a custom copper heatsink that will then be used ontop a motherboard mosfet?
In other words, can the mosfets get hot enough (without actually failing) during normal operation to melt the indium and thus cause the solder joint between the two pieces of copper fins to fail?
The Indium was chosen due to its thermal conductivity.


texts: Demo of designing a modern CPU in Verilog/VHDL

texts:
Please help me understand how such huge and complex devices like modern CPUs' are designed - would it be possible to see an example of some final circuit with billions of transistors made with Verilog/VHDL? All examples on the Internet show only small ICs. I would like to see how today's engineers manage "ultra-large-scale integration" designs for chips like CPU/GPU/ASIC on regular workstations. I would like to know how such humongous device can be managed effectively and by so many people.
I am aware of FGPAs, but I think that their workflow is much more predefined and doesn't lend itself to the same complexity. I am aware of the Verilog/VHDL pipeline and I haven't seen anywhere a demonstration with BILLIONS of transistors chips.
I would really like to know how teams manage such amount of complexity and how much is it being broken down into IP blocks. For example, how many lines or Verilog/VHDL is being written for one of Intel's i7 CPUs?
RISC-V looks interesting and if nothing was available on the mainstream ICs it would be also helpful to see some good CAD/GDS output from RISC-V.
The reason why I would like to see it, is I worked a lot with CAD software (AutoCAD, McNeel's Rhino) and it's always been very slow. Hope that getting some insight from EDA/ECAD could hint a path to use them more effectively.


texts: How/can I plug a 3 wire 4-20mA current sink probe into a 2 wire 4-20mA loop powered controller?

texts:
I have a 3 wire 4-20mA output probe simulated here, where during normal operation the 20v and 250 ohm resistor are variable chosen by the user.

One of my users has a 2 wire 4-20mA meter, and I am unsure what the normal approach to 2 wire 4-20 is.

Can i plug my probe into the user's controller? If so what wires go where?


texts: Motor speed control using arduino and quadrature encoders

texts:
I am trying to get precise control over the speed of rover 5 based robot. It has four PWM controlled motors and 4 Optical Quadrature Encoders. I am using 4-channel motor controller with rover 5 chassis. I am using arduino Nano for control. I am able to read encoder INT output and change PWM based on pulse width to control speed. But, as a result, I am getting heavy oscillations in the control output. That makes, the robot to move in steps, as PWM is changing constantly. I need an algorithm which can minimize this ringing and have a smooth moving robot. Here is my arduino code snippet.

void setup() {
    Serial.begin(9600);
    init_motors();
    init_encoders();
    req_speed[0] = 20;
    req_speed[1] = 20;
    req_speed[2] = 20;
    req_speed[3] = 20;
}

void loop() {
  update_encoders();
  update_motors();
}

void update_motors() {
  int i, err;
  unsigned long req_width;
  if(micros() - mtime > 2999) {
    mtime = micros();

    for(i=0; i<4; i++) {
      digitalWrite(pins_dir[i], req_speed[i]>0);
      if(mtime - change_time[i] > 50000ul && req_speed[i] != 0) {
        cur_pwm[i] += 5;
      }
      if(req_speed[i] > 0)
        cur_err[i] = req_speed[i]*10  - cur_speed[i];
      else
        cur_err[i] = (-req_speed[i]*10)  - cur_speed[i];
      if(cur_err[i] > 0 && cur_pwm[i] < 255) {
        cur_pwm[i]++;
      } else if(cur_err[i] < 0 && cur_pwm[i] > 0) {
        cur_pwm[i]--;
      }
      analogWrite(pins_pwm[i], cur_pwm[i]);
    }
  }
}

void update_encoders() {
  int i;
  unsigned long w;
  enc_new = PINC & B00001111;
  unsigned long etime = micros();
  for (i=0; i<4; i++) {
    if((enc_old & (1 << i)) < (enc_new & (1 << i)))
    {
      w = (unsigned long)(((etime - change_time[i])));
      pulse_width[i] = (w + pulse_width_h1[i] + pulse_width_h2[i])/3;
      pulse_width_h2[i] = pulse_width_h1[i];
      pulse_width_h1[i] = pulse_width[i];
      change_time[i]=etime;
      pulse_count[i]++;
      cur_speed[i] = (3200000ul / pulse_width[i]);
    }
  }
  enc_old=enc_new;
}

Here req_speed is between -100 to 100, where sign indicates direction. Please consider all undefined variables as globals. I experimentally measured that, when motor is running at full speed, the pulse width is around 3200us.

Encoders' INT outputs (XOR of A and B) are connected to A0 thru A3. Motor PWM is connected to D3, D5, D6, D9.

Is the arduino not fast enough to catch up with 4 encoders?
Is PinChangeInts better than polling?

Please let me suggest any improvements to this code and advice me about what am I missing here.


texts: ESP32 Arduino Bluetooth Serial does not reconnect after disconnecting

texts:
The basic ESP32 Arduino Bluetooth Serial example pairs and connects as expected, BUT once I disconnect the Bluetooth terminal it stops responding to new events at all. Once I reset the ESP32, it starts working again with the same problem. (It doesn't matter if it keeps being paired or not.)
I have tested it with the Windows Bluetooth terminal and with the Bluetooth Any terminal (from the windows store.)
I have downloaded the latest ESP32-Arduino library from GitHub and I still get the same problem.
I have tested it with several ESP32 modules, and they all respond with the same problem.
It looks like a bug in the library code.
See the simple Arduino example code below:

#include "BluetoothSerial.h"

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

BluetoothSerial SerialBT;

void setup() {
  Serial.begin(115200);
  SerialBT.begin("ESP32test"); //Bluetooth device name
  Serial.println("The device started, now you can pair it with bluetooth!");
}

void loop() {
  if (Serial.available()) {
    SerialBT.write(Serial.read());
  }
  if (SerialBT.available()) {
    Serial.write(SerialBT.read());
  }
  delay(20);
}

Does anyone know of another Bluetooth serial library that does work?


texts:
I’m just curious what kind of protection you would typically expect to see on a battery powered circuit. Circuit in question is a simple 24v dc relay controlled motor. Main power source would be 2x car batteries in series or temporarily a back up lipo/li-ion pack. Motor rated current is 2A but I may also do another with a (24v dc) 5A motor.

I know an AC mains circuit would have breakers, fuses in addition to whatever protection is offered by the psu or motor driver itself but I know very little about portable or battery powered electronics.

The motor was expensive and I want to keep it, the batteries and myself safe. Would a simple linear voltage regulator provide ample voltage, over current and reverse polarity protection on the circuit side of things?


texts: Powering the esp12 with an UA78M33CDCY voltage regulator

texts:
I have designed a board with an UA78M33CDCY voltage regulato which is connected as recommended in the datasheet.

When I hook it up to my 3.3v bench supply it boots fine. But powering it from the regulator does't give any response.

When a apply 12v power from a stable 3.3A psu the output of the regulator is reasonably stable at ~3.45v. Have I chosen the wrong voltage regulator or should I look for the problem somewhere else?


texts: Determine the value of a constant for which the system is marginally stable

texts:
So I have the following transfer function

$$G(s)=\frac{s^2+0.1s}{10s^3 + 1.1s^2 + 0.01s + 2K}$$

Now I'm trying to determine the value of K so that I have a marginally stable system. I'm not supposed to use the Routh-Hurwitz method. I'm thinking hard but I seem to get to nowhere. I know that for the system to be marginally stable I will need a real pole in the left complex plane and two complex conjugate pure imaginary poles. But how can I determine the exact value of K that will provide me with those 3 specific poles?


texts: Why do I need to remove a part of the insulation on a copper wire on a simple electric motor?

texts:
Why do I need to remove a part of the insulation on one end of a copper wire in making a simple coil electric motor?
How does removing only a part of the insulator makes the motor spin freely?
Reference at step 3.
I know why the coil spins. What I'm confused on is: If I insulate only a part of end of the wire, wouldn't it stop getting electric current so it wouldn't spin anymore, or is it because of the momentum where a second of not getting current doesn't affect it's spin to continue the cycle?


texts:
I want to know the output impedance of the ATmega64.
Could anyone help me?
There 's nothing with this name in its datasheet.


texts: Transformer in 127V AC - 5V DC Converter

texts:
There is a transformer in this 127V AC to 5V DC Converter. I am trying to get one of them. But I don't know what kind of transformer is and I am unable to find it in my city.

Also, it is so small. When I ask in the local electronics shops about a transformer capable of converting 127 V to 5 V. They give me a very big transformer. So I don't know how it is possible that this little transformer do the same. The circuit specifications are these:

Thanks


texts: Porting a linker script from STM32F1 to STM32F2

texts:
I am trying to port PyMite from STM32F1 to STM32F2. One of the files that I am assuming must be changed is called stm32f10x.ld. I have looked around for an equivalent of this (called stm32f2xx.ld?) but haven't found anything.

I'm now thinking that I should maybe port "by hand" the linker script. Below is the original linker script. What kind of changes should I be making to have it work for STM32F2?

MEMORY
{
    sram (W!RX) : ORIGIN = 0x20000000, LENGTH = 64k
    flash (RX) : ORIGIN = 0x08000000, LENGTH = 512k
}

SECTIONS
{
    .text :
    {
        . = ALIGN(4);
        _text = .;
        PROVIDE(stext = .);
        KEEP(*(.isr_vector))
        KEEP(*(.init))
        *(.text .text.*)
        *(.rodata .rodata.*)
        *(.gnu.linkonce.t.*)
        *(.glue_7)
        *(.glue_7t)
        *(.gcc_except_table)
        *(.gnu.linkonce.r.*)
        . = ALIGN(4);
        _etext = .;
        _sidata = _etext;
        PROVIDE(etext = .);
            _fini = . ;
                *(.fini)

    } >flash

    .data : AT (_etext)
    {
        . = ALIGN(4);
        _sdata = .;
        *(.ramfunc .ramfunc.* .fastrun .fastrun.*)
        *(.data .data.*)
        *(.gnu.linkonce.d.*)
        . = ALIGN(4);
        _edata = .;
    } >sram

        .ARM.extab :
        {
            *(.ARM.extab*)
        } >sram

        __exidx_start = .;
        .ARM.exidx :
        {
            *(.ARM.exidx*)
        } >sram
        __exidx_end = .;

    .bss (NOLOAD) : {
        . = ALIGN(4);
        /* This is used by the startup in order to initialize the .bss secion */
        _sbss = .;
        *(.bss .bss.*)
        *(.gnu.linkonce.b.*)
        *(COMMON)
        . = ALIGN(4);
        _ebss = .;
    } >sram

    end = .;
    PROVIDE( _estack = 0x20010000 );
}


texts:
is the following a legitimate way to create an xor gate?

simulate this circuit – Schematic created using CircuitLab

The AND with the two NOT inputs would be a NOR, but I'm seeing with just two gates -- AND + NOT -- if the below is a valid way to build an XOR gate or if I'm missing something. The above would eventually decompose into:

simulate this circuit


texts: AC/DC wall adaptor as LTSpice Analog behavior model (ABM)

texts:
Suppose a circuit shuld be supplied ( in real life ) from a wall mount AC/DC adaptor.
The adaptor has a nominal voltage of 12VDC 500mA.
With no load the adapter puts out 21.6V.
After some measurement I got the following table:

RLoad [Ohm] 10,15,20,25,30,40,infinite
Vout  [ V ]  8.9,10.65,11.68,12.76,13.47,14.5,21.6

This behavior is not linear. It can not be corrected by simply defining the RSER param of a Voltage Model.
The idea now was to create a lookup table controlled ABM for souch kinds of problem.
I tried a couple of approaches, but until now I didn't found an accepable solution.
Does anyone know how to do this?

@eric-best At first thanks for this nice workout. It is an other way then that I have tested. In my approach I've used a table driven Current Source to simulate the voltage drop over the unknown internal resistance (or what ever there is). The principle is the same. But interesting are the results.

I have compared the two ways:

POLY() is accurate enough in the higher current range.
POLY() does not give correct results with higher N then 3 ( internal mathematics).
POLY() does not reach the open circuit voltage of 21.6V.
POLY() coefficients are not simple to calculate for anybody.
( In LTspice I did not build an extra symbol for the CCVS, I have used the h and voltage symboles as they are )

How I earlier sayd my approach was to use TABLE() with the measurement results directly ( if possible ).
Until now I had to calculate the currents and voltage drops too.
Using the G element there was no need in a second sensing element.

The results of booth methods are good enough to live with.

It's not a worldshaking problem, but there are open questions left for me:

Why the POLY() approch is not reaching the end voltage?
Would it be possible to use a (Rload-Vout) or (Iload-Vout) measurement Table directly without need of any calculations for those thematics?
How does the Vsense usage works ( How to understand the LTspice documentation: .."If Rser is specified, the voltage source can not be used as a sense element for F, H, or W elements. However, the current of any circuit element, including the voltage source, can be plotted" ). I varied the Rser parameter with no changes in results? How we can measure a current without a resistance (R=U/I). If LTspice uses the default resistance of 1 mOhm - Is the resulting current in mA?

Here are the used Polygons for copy/paste.

POLY(1) Vsense 0.5697982962 20.92860263 -8.457254531
POLY(1) Vsense 0.4672178026 26.54996705 -26.39132582 13.56945918
POLY(1) Vsense 0.4139399263 32.98359788 -64.61080090 83.62201904 -39.64013413
POLY(1) Vsense 0.3542818621 46.00217170 -192.0837945 495.3489076 -576.4823748 243.6369093
POLY(1) Vsense 0.30168772 60.17959708 -382.1055614 1404.340777 -2561.011487 2256.757338 -768.3701871
POLY(1) Vsense 0.2681545356 71.76790957 -666.9676308 3779.956148 -11532.04145 19155.40279 -16248.50254 5485.440917
POLY(1) Vsense 0.2692168921 70.737601 -604.0536898 2982.773424 -7231.820543 7198.237513 17361491 -8409.758072 4318.103511
POLY(1) Vsense 0.2332032155 262.7327821 -13154.45379 183971.7826 -1177803.233 4137056.068 -8504379.619 10210527.6 -6630524.829 1797473.57
POLY(1) Vsense 1.36649385 343.1448432 -14848.77844 188571.9347 -1011044.411 2506906.395 -1789852.306 -4764049.177 12230508.69 -10829322.17 3493319.375

Best regards.


texts: I will have several devices with atmel microcontrollers which I'm going to connect to PC using RS-232. Is there any way to connect several devices into one RS-232 port? (Let's assume RS-232 can handle amounts of data I need to transmit). Maybe there is some other good way for me that is not based on RS-232?


texts:
I've been looking around on the internet and I can't find anything in depth on how the cable/connection functions. I've only been able to find simple pin out descriptions.

If someone can link me or point me in the right direction, I would be very grateful.


texts: How to control bi-directional logic line bypassing the open-collector stage?

texts:
The uBlox Leon G100 GSM modem has a bi-directional RESET_N line (active-low) that controls the reset of the modem but also indicates whether the modem is up or down (modem out MCU in).

Because the RESET_N line can be driven by modem only up to 1.88V we need some level shifting, like one presented in the datasheet:

Is that possible to control the RESET_N line (MCU out modem in) with the same MCU line with no impact on modem out MCU in direction? Of course, this wiring is not enough (connecting collector to ground will have no effect on the base-side).

Is the wiring below any option? It will make modem to draw current from MCU when the MCU input is in high impedance which should not be a problem.

The reason is saving 1 GPIO. I think replacing the 22k pull-up with an internal MCU's pull-up would be an option too.


texts:
I'm absolutely new to this subject and I have no idea how to start, save for the fact that I need an microcontroller for this.

I want to toggle the power between modules/devices I want to hook up to another device.

Push button once: Turn on bluetooth, toggle RGB LED to blue and play sound 1.
Push button twice: Turn off bluetooth, turn on USB port, toggle RGB LED to green and play sound 2.
Push button thrice: Turn on bluetooth and USB port, toggle RGB LED to red and play sound 3.
Push button for 5 seconds: Turn on bluetooth and pair it (to get into the bluetooth modules pairing mode, you just have to push a button on it) and play sound 4.

Where do I start? Is an ATtiny85 sufficient for this?


texts: What is meant by "plant" in control system? Does it also means systems like DC motor or it only includes large systems like chemical (fertilizer or cement) plant?