texts: Simulink "ideal switch" block changes output unexpectedly

texts:
I am attempting to simulate a DC motor circuit on Simulink. I have built the block diagram mainly according to a tutorial, and am confused about an aspect of it. The main circuit has a DC power source in series with an "ideal switch" block (triggered by a stair generator), a resistor to limit the inrush current, and the separately excited/permanent magnet DC motor block. When I cut out the switch block and just have the power source in series with the resistor etc. the circuit behaves roughly as expected, but when the switch block is added in, the response suddenly has massive current spikes (~10^4A rather than ~40A), often followed by large negative currents. My best explanation for why these negative currents are happening is that for some reason the initial massive currents are spinning the motor up very fast which increases the motor back emf to much larger than the supply voltage, but I am at a loss to explain the initial high current.

In the tutorial there is a second resistor which goes from between the switch and normal resistor to ground. This seems to fix the problem caused by inserting the switch, but I don't understand why. The value of the resistor here does not affect the scope results unless it is above about 8500 ohms (but below this, it could be 10ohms or 8000ohms and still show the same results as no switch and no resistor), where it starts to behave more like it does without the second resistor there - like it's tending towards an open circuit.

Can anyone explain why adding in the switch causes such strange results? I've read the help section on the block but am not much the wiser, and the results are similar, but not identical if I use a breaker block rather than a switch. Further, why does the added resistor to ground then fix it?

Plot of the armature current without switch block in circuit

Plot of the armature current with switch block in circuit

*Edit: A block diagram of the system, StartingResistance3 is the current-limiting resistance, StartingResistance2 is the resistance going to ground that fixes the changes that come with the switch.


texts: GND/Vss of 2 circuits with independent power supplies, and usage of scope/logic-analyzer

texts:
Probably an elementary electronics question.

If I would like to trace waveforms from 2 different circuits with independent power supplies, s.a. an RF transmitter which uses a 9V battery and the RF receiver which uses a wallwart (regulated) supply. I want to observe the transmit & receive pins together, but what do I do about GND ? Should I connect the GND probe of my logic-analyzer to one of the 2 circuits or to both -- how ?


texts: Driving torque and load torque of a pmdc motor

texts:
This question is a follow up to the question I had asked on electric torque of DC motors

I've done my research but couldn't find a satisfactory answer. I would appreciate if the answer was told with a fundamental concept to it.

Shown in the figure is a simple pulley system with a weight attached to it. The centre of the pulley (of radius, say R) is connected to the output shaft of the PMDC motor.

When I switch on the supply, the motor starts to rotate and produces a torque called the driving torque. The weight attached also produces it's own torque because it's a force acting at radial distance. Let this torque be the load torque.

My teacher says that as the pulley rotates at constant velocity, the torque produced by the motor = the torque due to the load (as there is no acceleration).

My question is this: if the torque due to the weight = the torque due to the motor, shouldn't the weight be stationary? How does it move up? Obviously the torque due to the motor has to be greater than the torque due to the weight to lift it off the ground right?

Moreover, how does the motor draw the right amount of current, thereby maintaining constant torque to keep the velocity constant? How does it not accelerate the weight by producing more torque than the load?


texts: Has there been any practical experiments conducted with HP Labs fabricated TiO2 memristor? How would I know?


texts: Why Intel 8080 CPU chip required three voltages (+5, -5, +12 V)?

texts:
Why Intel 8080 CPU chip required three voltages (+5, -5, +12 V) ?

In wikipedia article I found:

  The 8080 integrated circuit used non-saturated enhancement load nMOS gates, demanding extra voltages (for the load-gate bias). It was manufactured in a silicon gate process using a minimum feature size of 6 µm.

... but where can I read more about this?


texts: Replacing a schematic component by a connector

texts:
I'm currently designing a pcb in EAGLE (v7.4) for a school project and I've included a potentiometer for gain control. However, I will not be placing the potentiometer directly on the board. I want to connect it with a wire to board 1x3 molex connector. This is my current schematic:

I would like to replace my molex connector symbol with a potentiometer symbol. Is there a way to place virtual components (and replace them with my connector)? This would make my schematic more readable.

Thanks


texts: When using the K155ID1 IC, some numbers of Nixie tubes do not emit properly

texts:
I'm beginner of electronics. (Please understand that I have used Google Translator.)
I connected the IN-14 Nixie tube to the K155ID1 IC. But the numbers in the Nixie tube do not completely emit. When MPSA42 transistor is used, even the higher current limiting resistor normaly emits light, but now it does not emit light completely even when the resistance of the current limiting resistor's value is lowered. Strangely enough, however, the number 6 was completely luminescent.

And here's the circuit diagram.

 I connected the cathode of each Nixie tube to each pin of K155ID1, and the BCD input was operated by a switch that connected a 4.7k pullup resistor. The Nixie tube was powered by about 180VDC.
Please tell me how to make the Nixie tube digit flash perfectly.


texts:
I don't understand, I have seen many people use the 74HC595 to drive 5V across 8 5mm green LEDs via 220Ohm resistors at the same time, whereas the datasheet says that the maximum Vcc current is 70mA. This should add up to in excess of 100mA...

I'd like to drive a 7 segments display via a 8 bit shift register, so if there is a reason why it works, I'd like to know. The 7 segments I've found draw 20mA per segment, but so do 5mm green LEDs!

Example: http://jumptuck.com/2011/11/03/how-to-drive-595-shift-registers-with-avr-hardware-spi/


texts: Voltage divider to sense voltage on arduino

texts:
I am working on a DC voltmeter for monitoring my solar panels. Total voltage of my panels can go up to a maximum of 50 volts. I designed a voltage divider with 100k and 10k resistors. For full voltage it gives 4.54 volts on arduino pin.

The problem that I am confronting is that the behaviour of the voltage is not linear. It gives perfect value for one input voltage but changes drastically for other input voltages. I have seen some pages on instructables that suggest that I am neglecting the something related to impedance issues of arduino pins but I could not get it. My simulation on proteus works perfectly but in practical design I could not got to any point. Kindly help me regarding high impedance voltage reading on arduino pins.


texts: Back to back MOSFETs and current sensing

texts:
I am looking into a circuit which has to do the following. A square wave goes in and a square wave goes out. I need to measure the current of the outgoing side because it is likely that the the load may be shorted. If the current exceeds 2.5 A for longer than 50 ms, I need to shut the outgoing wave off and a led must burn so I can see that there is a shortcircuit. The off situation has to last about 5 seconds before a new attempt is made to turn the system on again.
To turn the outgoing wave on and off, I want to use the back to back mosfet circuit which I found online. I believe that this part of the the circuit will work.
The current sensing is what bothers me. The general idea is that the current running through the load is leaded through R_SHUNT via rectifier D3. So the current through the shunt is always in the same direction. I believe that rectifier D4 will cause problems.
If pin 2 of DCC_IN is high and pin 1 is LOW. The current will flow through R_LOAD to the left upper diode of D3, to R_SHUNT and than instead of going through D3 again and the mosfets, the current will propably bypass this via bottem right diode of D4.
If pin 2 of DCC_IN is low and pin 1 is HIGH. The current will flow through the mosfets, through the upper right diode of D3, through R_SHUNT and than through the bottem left diode of D4 causing a direct short.
Assuming I am correct about the the current flows. Bridge D4 has to go. But if D4 is gone, can I still feed my voltage regulator and 5 V line?

The other circuit I drew, uses an ACS712 current sensor. I believe that this circuit might work, but will it? I am aware that the circuit needs some extra capacitors and schottky diodes (to relieve the internal diodes of the MOSFETs)
Will the second circuit work like I want? And if not, can I make it to work or should I do something else?

The load itself exist out of model trains. These can draw more than the maximum allowed current during accelarations (DC motor run currents).
A digital central typically cuts the power when a short circuit lasts longer than 50~100ms. This circuit needs to react slightly faster than the digital central to prevent the central from powering everything down. Essentially this circuit is intended to act as a digital fuse to prevent entire layouts from powering down and to identify the location of the shortcircuit. I could probably also live with a current of max 1A.


texts: Oscillations in parallel-RLC network with a limiting VCCS

texts:
Here is a parallel-RLC network (where G = 1/R is the admittance) with a limiting VCCS. The characteristic of the VCCS is shown in Fig (b), where the slope is G1. The problem asked is as follows:

Find the condition on slope of the VCCS for oscillations to start.
In Fig (c), assuming Vo = A sin(wt), determine and plot the amplitude of the fundamental component of i as A is varied from 0 to Infinity.
What will be amplitude of oscillation of the circuit in part (a) of the figure, in steady state?

I've found that the slope of the VCCS should be greater than or equal to G in order for oscillations to start. I also obtained the expression for the first fourier coefficient of i (assuming that's the "fundamental component" asked) in terms of A for the circuit in Fig (c).
The part I'm struggling with is how to find the amplitude of oscillations of the circuit in Fig (a). My best guess would be Imax/G for the amplitude of Vo, but I don't know how to prove it analytically.


texts: what does "series" denote, e.g.: PS, PM, PW, H, etcetera

texts:
I am replacing 8 polarized electrolytic 105°C temp. capacitors in my 1994 Lexus LS 400 ECU (Engine Control Unit.)

An ECU engineer stated adamantly that we should use low ESR and PW series caps. The PS and H series caps that I got from Mouser and Digikey are in fact low ESR. I used 6 PS series, one H series, and one VHT series from Frys. I do not know if the cap from Frys is low ESR.

Will I have trouble or is the series not as important as the well educated engineer would have us believe?

P.S. I finished this morning, reinstalled ECU and all the symptoms I was having are gone:

Check Engine light
Hunting for idle
Stalling out at 2000RPM on hard acceleration
And hopefully bad mileage as car was running rich all the time; won't know
the answer to that until I have used a tank of gas

So, what I want to know is:

How critical is series and low ESR?
What exactly does series relate/pertain to?


texts:
How can I implement a digital circuit using boolean logic gates?

As you see, on each rising edge, an oscillation happens and signal returns back to HIGH logic level after oscillation. This is also the same for falling edge.


texts:
I took apart a bank token (Digipass 550 manufactured by Vasco) and this is part of the board, you can see the screw hole with the gold plating together with what looks like a PCB inductor and something that looks similar to a spark gap?

Edit: Device stopped working after removing these screws, called the bank and they mentioned that once taken apart the device auto-destroys


texts: Using pointer of a function's returned value

texts:
I would like to know if there are possibilities to change the following code:

static void ser_tx_ready_ISR(void)
{
    /* put data in tx buffer */
    if ((Rb_state(&serial_tx_buff) != RB_E_ERR_EMPTY) && (Rb_used_size(&serial_tx_buff)>=1))
    {
        Uart_put_char(Rb_retrieve_byte(&serial_tx_buff));
    }
}

where the important part is the Rb_retrieve_byte(struct ring_buff *_this) which returns a uint8_t.

Now, I would like to change that line by using a (rb_type)Rb_retrieve_byte(struct ring_buff *_this, uint8_t* char_ptr), but still doing it inline combined with (void)Uart_put_char(uint8_t c). So I can read back more optimally the status of the last RB access returned from the function, without using another rb API for that. The only way seems passing through reference.

Is it possible to pass the Uart_put_char(uint8_t c) as a parameter, with some reference wizard, to provide the pointer of char_ptr? I think I need to provide the reference pointer of the argument of c to the ring buffer retrieve, but I don't know how to do it without using a supporting variable, which may slow down the ISR. I just try to understand if it is really just not possible.

Or assembler with inline pointers is the only way? It is for an ATmega328p, but the code here is the application, not the HAL, so I was liking the idea of keeping it generic.


texts: Half-Adder determine which bits were true

texts: I have a pet project I've been working on for a while, converting an old classical piano into a digital piano, mostly for the learning experience. I started first with an arduino but found it too slow to keep up with a decent tempo. I'm taking my first FPGA course in university currently, and was thinking that an FPGA might hold the solution to my problem. I need a way of sending a little information as possible, preferably an 8bit number that the arduino can use to determine exactly which midi signal to send to the computer. I was thinking that an 8-bit half adder would provide a sufficient range of values, (88 keys, a number for each key, and the extra left unused) but I don't know what to add to the circuit to tell the arduino which signals were set to true to create a particular number. Is there something I can add to this circuit, or another way to conceptualize it so I can determine exactly which key was pressed to create a given output?


texts: How to calculate\estimate thermocouple junction of a solder junction between a PCB and a component

texts:
Thermal junctions between two dissimilar metals on a PCB can create voltages. How do I estimate or bound (by estimating a max voltage via a max temperature) the thermocouple effect on a pcb?

Most solders don't list a number for the Seebeck coefficient. AOE does list Sn-Pb solder as 5uV/C but not lead free (Sn 97%).

How can I calculate the thermocouple effect for lead vs lead free solders? Is there a way I can minimize this effect?


texts: How to impart a charge on dust particles?

texts:
I am planning on building a simple electrostatic air filter, from scratch. From what I understand, the dust in the air is given a charge as it flows through an inlet section and is collected by mesh of opposite charge as the air flows out through an outlet region.

I am wondering how exactly is the dust imparted a charge?

I didn't get what I wanted from google, possibly because I couldn't phrase it properly.


texts: Simultaneous write and read to/from a FIFO

texts: Could someone, please, clarify whether or not I could simultaneously read and write from the soft FIFO described in this document on p.157? It does say that I can use separate read and write clocks. I assume, this feature is rather for being able to read and write with different clock rates. But how about read and writes simultaneously? Is it even a common practice to have simultaneous r/w access to FIFOs?


texts: Why is the linear voltage regulator going hot although within its specification?

texts:
I'm having an issue with my NCP718 voltage regulator overheating to the point of thermal shutdown. I have attached a photo of my schematic. I am inputing ~15-20v and outputting 4V from the reg. The reg is rated to 300mA and I am drawing about 50mA at idle according to my switch mode power supply.

Even at such a low current draw the regulator gets too hot to touch and eventually shuts down. Any tips would be greatly appreciated, I am a little stuck right now!


texts: Through-hole wire-wound resistor footprint in EAGLE

texts:
I think the EAGLE component search algorithm is stupidly written because whenever I try to search for a specific component it won't show up, then I have to manually search each one in its own category and it's really annoying.

I am trying to find the footprint for the through-hole wire-wound resistor. I have found that resistor-power.lbr contains those footprints but I couldn't find it in my library.

Any help would be appreciated.


texts: Turn on a device if voltage drops below a configurable level?

texts:
Consider a Li-Po battery that has to be protected from damage by going below 3V.

What would be the easiest, lightest, smallest ways to e.g. turn on a warning LED or buzzer (using the same battery supply) if the voltage drops below a configurable threshold?

For a single Li-Po a configurable range of 3.0 - 4.0V would make sense, for a 3S Li-Po the range would start at 9.0V.


texts:
I want to connect my Arduino Uno to an ESP8266 without adding an external 3.3V power supply, so that I can have more I/O for switching LED's and relays.
Adding a capacitor will solve the problem?


texts:
I am developing robot for a project. For that i have to control 5 servo motors of different types. Here are my servos..

Power Pro MG995 (4.8 V to 7.2 V)

Savox SW-0250MG (4.8  V to 6V)

And my battery is

DUPU 1500mah lipo battery

Before try to use my battery, i powered Savox servos with an Arduino board (5 V ouput). Servos work fine. Then i replace savox servos with MG995 servos. But they don't work as expected. That mean they are not rotate as I coded. Servo stops some times. Kind of a power problem. I think it is due to low voltage (5 V since it can operate up to 7.2 V).

Then I buy my lipo battery and I still unable to reduce 8.4 V into 6 V.

Can someone suggest me a method.
It I able to do that, will I able to run MG995 servos as expected??

Any help would be greatful
Thank you in advance!!!


texts: why do i measure a potential difference when I put my two electrodes in a water bottle?

texts: I have a multimeter adjusted in DC tension mode. When I put my two wire connections inside a water container, I measure +120 mV or sometthing less but never zero. Why do I measure a potential difference ?


texts:
I just opened up an old piece of electronics. While salvaging, I found a board with this waxy stuff on it? What is this and what is its use?

P.S. The substance I am talking about is the lightly tanned wax on the top right of the board.


texts: Glitching on UART RX line with RS485 transceiver

texts:
I have a custom PCB which has a RS485 transceiver chip interfaced to a Nordic microcontroller.
I essentially have a daisy-chained arrangement of RJ-11 ports which are carrying the RS485 A/B signals as shown below. This means that depending on which port is used, the A and B signals can be reversed.
Here is the SP3483 RS485 transceiver chip circuit diagram. I use a Invert signal from the microcontroller GPIO and a XOR gate to handle the RS485 A/B inversion.
When I scope the RX signal using the logic analyzer, for the case in which A/B are inverted, I receive the bytes correctly.

However in the case where I don't need to use the invert signal, I see a lot of glitching on the RX line and hence I get UART frame errors. For comparison, it's the same byte as above.

Does anyone have ideas on why the RX line is glitching in one of the configurations?
Thanks
EDITED:
I just found out that other than glitching for the non-inverting case, the RX signal(probed at the DO pin of transceiver) also gives me frame errors, like below:

Basically, the RX signal is low instead of being pulled back high after a frame ends, and hence it's recognizing the low signal as an additional byte, which is incorrect.
EDITED again:
Here is the scope shot of the case in which A/B lines are swapped. I use logic 1 on the INV_IPN XOR signal, and I am able to decode this case correctly.

**To conclude, during idle:

In the normal A/B scenario, DO pin should go high but its going low.
But in the inverting configuration(A/B swapped) the DO pin should go
low, which it is.**


texts: Multiple Trinamic TMC5130 drivers with stallguard2

texts:
I'm using two TMC5130 breakout boards with STM32F4 board. I control each with separate SPI channels, which works fine.
I can get them to move, change settings, etc.
StallGuard is used as sensorless homing.
I can also get stallguard to work with either of them, but there is a problem;
TMC drivers are identical and stepper motors are also identical. But same settings don't work the same on the drivers, it would seem.
For example; if I spin both motors with 20k steps/min, the StallGuard treshold (SG_VALUE ) value is not the same (for one stepper is 100 and for the other 400).
I have to use 3 (SGT) for one stepper and 4 (SGT) for other stepper. Also, if I choose the value too low, the stepper ramps up for few degrees and then stops. (?)
How is it possible that identical settings (current, and other parameters) cause the StallGuard to behave differently?
Any info would be appreciated!


texts:
I am currently testing a 16-bit DAC and a 18-bit ADC. In many tests I have found the ADC to get "stuck" at codes, especially at the ends of the input range.

Both the DAC and ADC operate in bipolar mode and are interfaced with analog circuitry that amplifies/attenuate and also provide common mode offset and clipping to ensure that signal fits the differential inputs on the ADC. The data converters are connected to a micro controller with SPI. The data is transferred from the micro controller to a PC with a serial port.

I am using the ADC to sample the output of the DAC in order to test precision and noise etc. The resulting data should be straight line when the DAC is used as x-values and the corresponding ADC samples plotted on the y-axis.

Note that the full scale range is different: The DAC outputs voltages between -20.48 and 20.4794. The ADC reads voltages between -16.384 and 16.3839.

The plot below shows the samples from the ADC when the DAC is set from 0 to 65535 in steps of 1 LSB. The total number of samples is 65536.

Zooming in at the center of the full scale range (x-span: 1000, y-span: 5000), the plot looks like this (a little noisy, but otherwise OK):

However, zooming in at the lower part of the full scale range, stuck codes are clearly visible:

The same can be said about the upper samples:

Note that all three plots are on the same scale but different areas.

Looking at a segment of the data is interesting (keep in mind that the analog interfaces introduces some gain and offset error):

One can clearly see, that the ADC is stuck even though the resolution of the 18-bit ADC is better than the 16-bit DAC.

Even more interesting is that the difference between two stuck codes, like 255648-255712 = -64 and 255712-255808 = -96, seems to be in multiples of 32. That rules out any problems with the analog interface, I think.

To show the problem better, I made a plot of the difference between one sample and the next sample over the entire full scale range:

The plot clearly shows that stuck codes does not occur at the center of the full-scale range. Moving towards the ends of the range, stuck samples become more and more obvious.

In order to solve the problem, I tried to slow the SPI-communication and also sampling at lower speeds. This did not make any difference. I also wonder if the problem could be the conversion of the 18-bit ADC output from Two's Complement to Offset Binary. I use this code to do the conversion, which I believe is correct:

uint32_t y = (131072 ^ Y >> 6) & 0x3FFFF; // Y is 18-bit Two's Complement

So, what could cause this problem? I have also checked the voltage reference, decoupling and other analog issues that might cause the problem. Still the stuck codes are multiples of 32, it looks to me like the problem is digital rather than analog.

Any help or ideas are appreciated! Thanks in advance :-)


texts: How to find transfer function from a graph

texts: I need help to find the transfer function of the system from this input/output graph:


texts: Which is better, single inverter or buffer + inverter?

texts:
I am trying to make a circuit that inverts a scaled (resistive divider) voltage using op-amps.  I have come up with two ways to do it, but I'm not sure which one is better and why.  I'm not particularly worried about saving cost or components, so which one of these designs is better?  I'm most worried about signal integrity.

I plan on adding some filtering caps and potentially a clamp, but from the basic design standpoint, which looks better?

Single Inverter vs. Buffer + Inverter


texts: Remote Wireless 4CH Switch On/Off - Data PIN Network Cable

texts:
Planning Stage

I'm in the planning stages of making a wireless on/off switch that will basically cut off pin 6 on a network cable. I know little about electronics and I've attempted to learn as much as I can before coming here, so bare with me If I make no sense.

Wireless Switch

I purchased a wireless receiver 4ch remote switch which has VT OUT STATUS(No idea what this is), D0, D1, D2, D3, GND, +5v. I believe D0, 1D1, D2 and D3 represent +v5 output when triggered which would then complete a circuit to output to a LED or 5v component.

The Problem

It is my understanding the current way this receiver works is that it completes a voltage circuit therefor outputting 5v and most likely useless to turn on a LED. However, I need the circuit to be constantly on until toggled off. From what I learned reading various sources I've learned some what about relays but unable to find out if complete a circuit other than one that has power running through it. Basically all I want to do is turn off PIN 6 on a data network cable when pressed.

The Question

Using the current setup what do I need to be able to disable communications on PIN6 of a network cable (please note that I have PCB ports and everthing, Just need some guildance in accordance with turning the wireless +5v switch into a block data switch.

Would this work?

simulate this circuit – Schematic created using CircuitLab


texts: Can anyone tell me why the output of the full wave rectifier reached the limit (3.51V)? (Input voltage: Amptitude=4V; Power supply: 5V) Thank you.


texts:
I'm thinking about making my own laser security system (think mission impossible). So I was thinking I'd use a laser diode to shine a beam across a doorway into a light dependent resistor that's on the high side of a voltage divider and look for that signal to go low and raise an alarm if it does.

So I've done some quick research for parts and I'm surprised at how expensive laser diodes seem to be: Do I really need to use a "laser diode" to satisfy my requirement to shine focused light across say a 3 foot gap, or is there some other component that is cheaper and gets the same effect?

Does my LDR concept on the "receiver" side of the gap make sense or is there a better way? I guess my biggest concern is that it won't respond (resistance won't rise) fast enough when the beam is broken and I'll fail to pick it up as a logic low. If that's the case I imagine what I'll want instead is something like a photo-transistor rather than an LDR.


texts: Is routing signal traces under components a good idea

texts:
This is my first attempt to route a 4 layer board. But I was curious if routing signal traces under components like this is a good idea? Allowed? Or what?

These are 0603 components.


texts: Sallen-Key filter for PT100 RTD measurement

texts:
I am going to build temperature sensing system using PT100 sensor (and later Raspberry PI 3). I refer my work to Microchip note AN687 Precision Temperature-Sensing With RTD Circuits.
On the page 4 is shown circuit I want to build:

I am beginner. I have a question: why values of resistors R8, R9, R10 are like they are? I researched some about Sallen-Key filter but didn't find identical circuit. In other words - how values of elements were calculated?


texts: What are these two components ? I can't identify them

texts:
I'm having a hard time finding what these two components are.i can't find them anywhere.
The first one is 3 leg MOSFET which has PDB marking on it and DD on the silkscreen
The second one i can't identify it has this marking
16.0
RG5 8M

The text on the silkscreen says Q1

I need to find a similar package crystal


texts:
I am evaluating a couple products -- lighting ballasts -- and noticed one of them seems to use G-10 as the PCB laminate.  I assume that the beige, solder-mask-free top layer is the clue.

Top:

Bottom:

Given that FR-4 is Flame Retardant, whereas G-10 is not, I prefer to stay away from the latter laminate.  But I cannot say for sure if the second board uses FR-4 or not.

Top:

Bottom:

It appears that the second board has more of the FR-4 look to it (that pale green), but that could just be a top-layer solder mask.

Am I on the right track here?  Is it even possible to tell the difference between G-10 and FR-4 like this?


texts: AAA batteries solar charging help needed

texts:
I have a project running on 2 regular AAA batteries, I'd like to
convert it to NiMH or NiCd rechargable batteries using solar power.
I wanna use a panel like this:
http://www.amazon.com/gp/product/B008DFW1WE/ref=oh_details_o00_s00_i01

It's cheap and it's slow on I enough. I know that you can't exceed 0.1C
recharge for NiCD at temps below -18C

So I'm looking for a slow constant 3.3V chip for that.

Space is limited. This is an outdoor project. We designed it initially for 2 alkaline AAAs, but later thought it would be nice to use rechargable AAAs (NiCd or NiMH, doesn't matter) and if solar is n/a, a user can switch it back to regular AAAs.

I've found this chip http://www.st.com/web/en/resource/technical/document/datasheet/CD00287506.pdf

There is also EV board for it with more info: STEVAL-ISV006V2
Is this a good idea?

Any advise would be appreciated.


texts: how to mark polarities to write loop equations

texts:
Need a help to mark polarities to get loop equations or any other method get equations without marking polarities.

simulate this circuit – Schematic created using CircuitLab


texts: How should I separate the DGND and AGND?

texts:
I would like to plane a PCB with mixed signals. I have the tms320f2809 with BGA footprint. I started to read some documentation "PCB Layout Recommendations
for BGA Packages"

I got some question regarding the PCB design:

In mixed signal PCB the analog and digital ground has to be separated like the following image:

The tms320f2809 has a high speed ADC which requires an analog supply. Which layer and how should I route the analog sources(1V8,3V3) and grounds for the MCU ADC?

I can place the passive components on the 4th(bottom) layer. Can I place there the crystal oscillator as well?


texts: How to power STM32F103C8T6 in a 'real' project?

texts:
I'm sorry for this probably very generic question, but I cannot find a good answer.

I have several STM32(F103C8T6, a.k.a. Blue Pill), which I now power via a ST Link (giving 5V via USB).

The STM32 itself works on 3.3V.

However, I want to use later not USB power, since it should work 'standalone' with an adapter.

Of course it depends on the hardware attached to it, but let's say I don't need much extra (much less than 1A), I think the default way is to:

Get a 'generic' 220/240V AC -> 12 V DC adapter
Buy a female adapter plug and connect the adapter to it.
Connect the wires from the female adapter plug (12V) to a buck converter?
Connect the buck converter output to the STM

However, I was wonder:

Is it needed to use both an adapter and the converter? Or should I buy a dedicated 5V adapter (which are much less common I think)
In case I need a buck converter, I see many types.

The cheapest is e.g. this ... would this work? And in case not, what (kind/type) should I buy?


texts: Difference between GND and - on power supply?

texts:
I'm trying to power a Emlid RTK gps through its DFS connector.  There is a GND pin and a 5V pin.  I'm going to connect the 5V to '+' on my power supply but what do I connect the GND to?  GND or '-' on my power supply?  My power supply has the following 3 knobs:

-
GND
+


texts: TP4056 - Li-lon Battery Charger temperature problem

texts:
I bought an TP4056 component for develop a Li-lon Battery Charger.
While I was designing the circuit that was in the datasheet file I realized that the value of two resistors (R1 and R2) was not specified.
How do I calculate the value of these resistors?

The datasheet file: TP4056 DATASHEET

The datasheet schematic:


texts: How to implement frequency sweep in transient mode in LTspice?

texts:
Below the sinewave generator SineAC outputs a fixed 1Vpp 200Hz sine wave in LTspice:

This output goes to another circuit and I can see the output of the entire system in time domain at a particular set frequency, in this case 200Hz.

But is it possible to vary/sweep the frequency of SineAC signal generator above along time(not AC analysis)? The reason is, I would like to see the output of the system in time domain when the frequency changes.

I searched but couldn't find an answer here.


texts: Does anyone have a manual or spec regarding an NEC JAPAN D78P0308GF

texts:
As the headline states.

It seems to be hard to get! The uC is in a Siemens Landsi & Gyr Dialog.
Power measurment equipment 3-phase ZMD120AMer53


texts:
I have constructed the usbasp programmer that is described on the https://www.fischl.de/usbasp/ website. I uploaded the firmware to the atmega8  using an arduino uno and avrdudess I set the hfuse to 0xc9 and lfuse to 0xef, the firmware uploaded.

I then put the atmega8 chip into my diy programmer and plugged it into a USB port on my computer. I am getting a message "usb device not recognised". I downloaded Zadig 2.4 to install the driver but when I click on all options I get a message similar to the windows "usb device no recognised".

I used a multimeter to check all my connections on the continuity setting and all appears to be ok. When I power up the programmer the leds don’t work. I removed the atmega8 and shorted the led to ground both leds lit up.

Any help would be appreciated!
Thanks to all.


texts: Connection between std_logic and std_logic_vector(0 downto 0)

texts:
I am  trying to connect one of my VHDL blocks to a Xilinx generated block (a dual port RAM).

The problem is that the write enable of the RAM is defined as an std_logic_vector(0 down to 0) instead as a std_logic and I do not know how to connect them.

The RAM block:

component bloque_4
    port(
        ...
        wea : in  std_logic_vector(0 downto 0);
        ...
        );
    end component;

Whereas the component that tries to write into that memory is:

component bloque_3
    port(
        ...
        write_en_b3 : out std_logic;
        ...
        );
    end component;

In the test bench I wrote for testing the connection I defined a signal for establishing the communication between the two of them:

signal write_en_b34 : std_logic;

So far things are great, the problem comes when I try to map the write_en_b34 signal to the wea port.

uut: bloque_4
    port map (
        ...
        wea => write_en_b34,
        ..
        );

I understand there is a type mismatch, but I do not know how to solve it. So, how could map a std_logic_vector(0 downto 0) to a std_logic??


texts: Design and build a single board computer

texts:
I want to learn how to design and build a single board computer like the
Raspberry Pi. I saw a DIY project on Hack-A-Day and design something
like the board in the DIY project but a bit more customized. Are the any websites,
books or tutorials to learn the basics and to design your own single board computer?


texts: What does 80% or 60% of Fresnel zone mean?

texts:
This refers to the link https://en.wikipedia.org/wiki/Fresnel_zone
In the link it is mentioned that:

The rule of thumb is that the primary Fresnel zone would ideally be 80% clear of obstacles, but must be at least 60% clear.

The question is what is 80% or 60% is it the volume or the cross-sectional area or something else?


texts: How to use common mode choke inductors? (differential vs common mode)

texts:
I have yet to undestrand exactly how to use common mode chokes inductors, according to the datasheet they have 2 operation modes like in the picture common mode and differential mode, however im afraid i dont understand the datasheet itself

As you can see, the inductor has 4 terminals, each pair its made of isolated wiring, and theres is a ferrite inside the windings to make sure it complies with its datasheet inductance however

1) what is the intended use for common mode? (what kind of aplications)

2) what is the intended use for differential mode?


texts: Proteus gives unrecognized attribute 17 for stm32 Hello World in C

texts:
Here is my simple C program for the stm32, I tested it on QEMU, it flashes the led successfully. But when I try to load the main.elf file into the MCU on Proteus, I get errors.

main.c

extern void *_estack;

void Reset_Handler();

void *vectors[] __attribute__((section(".isr_vector"), used)) = {
    &_estack,
    &Reset_Handler
};

int main();

//void __attribute__((naked, noreturn)) Reset_Handler() {
void Reset_Handler() {
    main();
}

typedef unsigned int u32;

void delay(u32 x) {
    while (x) {
        x--;
        int y = 100000;
        while (y) y--;
    }
}

#define mem(a, b) *((u32*)(a + b))

int main() {
    u32 LED = 1 << 12;
    u32 r3 = 0x40021000;
    mem(r3, 24) = mem(r3, 24) | 16;
    r3 = 0x40011000;
    mem(r3, 16) = LED;
    mem(r3, 4) = (mem(r3, 4) & 0xFFF0FFFF) | 0x30000;

    while(1) {
        mem(r3, 20) = LED;
        delay(700);
        mem(r3, 16) = LED;
        delay(300);
    }
}

main.ld

ENTRY(main)
MEMORY
{
  FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 128K
  RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 20K

}

SECTIONS
{
        .text :
        {
                KEEP(*(.isr_vector))
                *(.text)
                *(.text.*)
                *(.rodata)
                _sidata = .;
        } >FLASH

        /* Initialized data will initially be loaded in FLASH at the end of the .text section. */
    .data : AT (_sidata)
    {
                _sdata = .;
                *(.data)                /* Initialized data */
                _edata = .;
        } >RAM

        .bss : {
                _sbss = .;
                *(.bss)         /* Zero-filled run time allocate data memory */
                _ebss = .;
        } >RAM

    _estack = ORIGIN(RAM) + LENGTH(RAM);
 }

Compilation steps:

set -e
CFLAGS="-Wl,-T./main.ld -nostartfiles -fno-common -O0 -g -mcpu=cortex-m3 -mthumb"
arm-none-eabi-gcc $CFLAGS -o main.elf main.c
arm-none-eabi-objcopy -Obinary main.elf main.bin

Error log from Proteus


texts: Power analysis of a simple circuit and battery lifetimes

texts:
I only do electronics stuff as a hobby so forgive my simple question.

I have a simple IR LED/photodiode detector circuit hooked up to an arduino microcontroller. It's not important but the purpose is a drip monitor. I want to put this circuit in a box and hook up a battery supply rather than my computer. I was wondering how to go about estimating the lifetime of this circuit and how long I should expect to wait before thinking about replacing the battery. Is power consumption the only factor to worrry about here.

How do I calculate the power consumption for the entire circuit? I know P = I*V = I^2*R but that's only for a single element. Is there an easy way to measure the power for the whole circuit? Also, how do I measure the power for the Arduino? It has many pins so I'm not sure how to measure the voltage and current "across" it.


texts: Can't run PIC24EP128MC206 at rated speed

texts:
I got a PIC24EP128MC206 because of its rated speed of 70 MIPS.  (For whatever reason, it is rated in MIPS, while most other PIC24s are rated in MHz.)

Since my understanding is that one instruction on the PIC24 takes one Fcy clock cycle, I am trying to configure the clock so Fcy is as close to 70 MHz as possible.  However it seems I can only run it at about half the rated speed -- around 31.5 MHz.  Anything higher than that, and the PLL stops doing its thing.

I am using the internal FRC clock, since I don't need exact timing anywhere (not using UARTs for example).  The nominal FRC frequency is 7.37 MHz, which can be adjusted from 6.52 MHz to 8.20 MHz using the OSCTUN register.

As a reference, I am using the PIC24EPXXXGP/MC20X datasheet.  Here is the relevant section on setting up the clock:

and here is my setup code:

// configuration fuses for PIC24EP128MC206

_FICD( ICS_PGD1 & JTAGEN_OFF )
_FWDT( FWDTEN_OFF )
_FOSC( POSCMD_NONE & OSCIOFNC_OFF & IOL1WAY_ON & FCKSM_CSECME )
_FOSCSEL( FNOSC_FRC & IESO_ON )
_FGS( GWRP_OFF & GCP_OFF )

int main(void)
{

    RCONbits.SWDTEN = 0;            // Disable Watch Dog Timer

    // configure Oscillator
    // Fosc= Fin*M/(N1*N2), Fcy=Fosc/2
    // with default 7.37 MHz FRC clk, Fcy = approx 7.37*34/(2*2*2) = 31.3 MHz

    PLLFBD = 32;                   // M=34      (ANYTHING HIGHER DOESN'T WORK)
    CLKDIVbits.PLLPRE = 0;         // N1=2
    CLKDIVbits.PLLPOST = 0;        // N2=2

    __builtin_write_OSCCONH(0x01);  // set up to switch to FRC+PLL
    __builtin_write_OSCCONL(OSCCON | 0x01);  // do the switch

    while(OSCCONbits.COSC != 0x00); // wait for switch to take place
    while(OSCCONbits.LOCK != 1){ };     // wait for PLL lock

Fsys = 34*7.37/2 = 125.29 which is near but not below the acceptable range of 120 to 340 MHz.

With the values show above the clock works and I get a nice output of around 31.5 MHz as measured using the CLKO pin (which is the same as Fcy, the instruction cycle clock).  The 31.5 MHz compares well with my calculated value of 31.3 MHz above, given that the 7.37 MHz FRC clock may be off somewhat.

I would like to use an M value of 76, which would give me an instruction cycle time of 70 MHz.

But if I make the value of M any higher than 34, the PLL becomes unstable and the clock output reverts to around 3.70 MHz, which is half of the FRC frequency (implying the PLL circuit is out of the picture).  When it is running, I can sometimes see some flashes of the higher frequency on the scope, as if the PLL is trying to start up and can't stabilize.  As one can see from my code sample, I am waiting for the PLL lock before continuing.

UPDATE: This seems somehow related to the final frequency, not the PLL Fsys frequency. I tried the following combination and it also worked:

PLLFBD = 120;                  // M=122     (ANYTHING HIGHER DOESN'T WORK)
CLKDIVbits.PLLPRE = 1;         // N1=3
CLKDIVbits.PLLPOST = 0;        // N2=4

which results in a PLL frequency of 300 MHz a Fcyc of 37.46 MHz (measured, 37.7).

I was a little concerned maybe you couldn't run at 70 MIPS using the internal FRC, but the datasheet for the PIC24E oscillator says "the FRC postscaler output can be used with the internal PLL to boost the system frequency (FOSC) up to 140 MHz for 70 MIPS instruction cycle execution." so I'm not trying to do the impossible.

Another UPDATE: I tried a second board and got the same results -- I can't seem to set Fcy to a frequency higher than 40 MHz without the PLL dropping out.  I also tried hooking up a buffered 24 MHz clock into OSC1 and configuring the system to use that as a extral clock (EC) with PLL.  Exactly same results.

How can I get a faster clock to work?

FINAL UPDATE: Turns out that the person doing the board layout put a 0.1 uF cap on VCAP without looking at the datasheet and I never caught it either. I swapped that out with a 10 uF 16v low ESR (datasheet called for 4.7 uF or higher) and now I can run at 70 MIPS.  See accepted answer re how I found this was the problem.


texts: Selecting Voltage Divider Resistor and OpAmp For Temp Sensing With NTC Thermistor

texts:
I've been doing some reading on here about measuring temperature with NTC thermistors and using the Steinhart-Hart Equation.

However I am still a bit confused about the selection of a resistor to put in a voltage divider with the thermistor. Should I select a resistor value that is the same as the thermistor's resistance at the centre of my range of interest (200F) to maximise the sensitivity?

Also do I need an opamp or inamp to remove any noise common to both thermistor leads as the thermistor probe will be in an espresso machine boiler, so I expect some mains and switching noise ?

If I use a precision voltage reference for the thermistor, my current understanding is that I must use that same voltage for the ADC, is this correct?


texts:
I am trying to downshift a 5V TTL signal to 3V logic signal using NTB0102 level shifter. The connection is described below:

However, my oscilloscope measurements are distorted. Even the input signal (out of the microcontroller pin-pin connected) does not look like a true TTL 0-5V signal:

Placing caps on VCC does not help. Reversing the propagation way (0-3V input to 0-5V output) also produces ugly picture. Pulling UP/DOWN microcontrollre's output pin does not make a difference. Any ideas about what's going on?

The layout:

After someone suggested using 10x probes, I have an improvement in the output signal, but it still does not like a square wave:


texts: Oscilloscope measurements on device connected to a AC/DC wall-plug

texts:
I had a discussion with my colleges regarding Oscilloscope measurements and DUT (device under test) isolation. Specifically a device connected to a AC/DC wall-plug.

I think I am aware of the concepts and I have read  How is using a transformer for isolation safer than directly connecting to the power grid?,  Why do we need an isolation transformer to connect an oscilloscope? and Isolation transformer and scope when troubleshooting SMPS.

From my understanding, if you have the DUT behind an isolation transformer, one has to be potentially careful not to connected the scope GND to the DUT, because there may be a large potential difference between GND/PE (normally connected on the scope side) and the DUTs "GND reference".

A common way I often used to circumvent this problem is to use the “channel A minus B” pseudo-differential approach. Another would be to float the scope / disconnect PE which is obviously a safety risk but may be a acceptable approach when working with low voltages.

Back to the question:
A college asked why it seems that there is no need to consider the "isolation issue" when measuring on a DUT that is powered from a wall plug, since those use an isolation transformer as well.
My initial thought was that there may be a Y-cap between primary and GND that serves as kind of a potential reference. However thinking about that, one would want to connect that cap to neutral not to phase which can't be guaranteed.

If wall-plugs do not have some reference to the primary side, wouldn't it be even an issue to, say connect a USB cable to some wall-plug powered device, effectively connecting PE to "some" potential? Am I just missing something obvious here?


texts: How x86-64 Intel CPU understands how many bytes load into a register

texts:
I have the following byte code one the left and and its byte representation on the right:

mov    eax, 0x1    ; 0:  b8 01 00 00 00
mov    ebx, 0x2    ; 5:  bb 02 00 00 00
add    eax, ecx    ; a:  01 c8

I am not sure that I understand correctly how CPU loads this byte code from cache to registers.

Here is my vision of the process. Let's assume that this byte code already in L1 cache.

As far as I understand:

CPU reads single byte b8 and understands that this opcode means for him that he needs to load to the EAX register very next 32 bits [quick question: does CPU load this byte to the register or not?]
Therefore, CPU loads from cache to EAX next 4 bytes 01 00 00 00
CPU reads single byte bb and understands that this opcode means for him that he needs to load to the EAX register next 32 bits
Therefore, CPU loads from cache to EBX very next 4 bytes 02 00 00 00
CPU reads single byte 01 and understands that he needs to read one more byte to figure out what registers should be sumed.
So he reads the very next byte c8 and understands that he needs to sum values in EAX and EBX registers

If my idea is correct it means that CPU reads from cache  not only 32 bit word per read, but although 1 byte per read. Am I correct?

If not, please provide me explanation how CPU executes this hex code.


texts: Covering exposed contacts on a toggle switch

texts:
I need to mount a mini toggle or rocker switch to the outside surface of a box. For various reasons I cannot drill a hole, so the entire switch needs to be freestanding or glued to the surface. (There is a small hole for the wires to go into the box, but that's it.)

I remember seeing self-contained switches with nice plastic back covers, but I can't find any such components on the market. Can anyone recommend a good way to cover up the exposed contacts and even provide a nice flat surface?


texts: Can tesla valve concept work for electrons?

texts:
This is a Tesla Valve. It works by diverting liquid or gas back on itself when it is flown in one direction and allowing a smooth flow in the other direction.

Can the same concept be used to create a semiconductor? Why?


texts:
Probably a silly question I know but I'm not all that good when it comes to wiring but at the same time don't want to blow myself, or my car up!

I have a set of sidelights/ daytime lights that take a feed from the cars loom and turn the lights on when I a) unlock the doors (they remain lit for a short period of time) b) turn the sidelights on.

What I would like is for them to turn on when I unlock the car, and then to remain on while the engine is running (which I have a relay to handle). My concern is that if I have an active feed from both my sidelights being on and the relay from the battery - will this overload the circuit and thus cause irreparable damage to my car or my lights? If it won't cause any damage - which would be the best way to achieve this?

Basic diagram of what I am getting at here (yes, no question would be complete without one) -

I look forward to your thoughts.


texts: Difference between parallel adder and serial adder when adding two binary numbers

texts: I am having a hard time understanding difference between parallel adder and serial adder when adding two binary numbers. Wikipedia does not have any information, and google image search is bringing me almost nothing. Can anyone help me here?


texts: I wanted to print the negative artwork from a PCB that I've designed. The problem is that I couldn't find that option in Altium Designer. I found that I can create a solid layer and then play with the colors of the print. But I wanted something better. I found that Altium can export a Gerber with negative, but I couldn't put the holes and the negative affects all the page (I wanted to negate only the PCB, so I don't waste too ink). What Can I do? Thanks!


texts: If my circuit is electrically isolated, do i have to worry about a polarizing effect on my sensor's output?

texts:
If I am making a conductivity sensor one of the things it need to watch out for is polarizing the water.

easiest way to do this is have the output output signal of the sensor have a +/-0.2V square wave.

i was wondering if i electrically isolate the output circuit with an isolated DC-DC power supply, can i just have the circuit output a 0-0.4V square wave (or in my case a 2.3-2.7V square wave), since its floating with respect to the water anyways?


texts: Can you put a curved slot in PCB in Altium 18?

texts:
I am trying to put a curved slot in a PCB in Altium 18. This is to give a blanking panel on the PCB which we can "pop-out". As the hole we're trying to blank out is circular, I need this slot to be curved.

It's easy to put a hole in a PCN, or a straight slot, or a board cut out using straight lines. Is a curved slot possible? Or a curved cut out?

The only work around I've found so far is to do a cut out made up of loads of very small straight lines, which is far from ideal.

EDIT: one option would be to draw an arch on the route layer, I shall attempt this and see if it will do the job.


texts: PWM Mosfet (and help identifying the right one)

texts:
I am building a project to control a 12 V, 10 A heating system from a Raspberry Pi.

I have identified that I need to use a MOSFET transistor and I will control the output by using pulse width modulation (PWM).

Obviously there is a lot of choice in transistors and I want confirmation from the community that I'm going in the right direction or help with what I have done wrong.

Gate voltage should be no higher than 3.3 V.

Gate current cannot be higher than 8 mA.

I plan to control the output wattage with PWM (I don't know how that effects the discharge of the transistor?) at a voltage of 12 V and maximum drain current of 10 A.

So the transistor I have looked at is 2N6764.

Now I haven't been able to find anywhere in the UK that sells them so is there a better fit (and how do I identify)?


texts: Biasing circuit schematic - MABC-001000-DP000L

texts:
I am trying to design a bias controller circuit using MABC-001000-DP000L. I am unable to find the full schematic of the same. Has any one used MABC-001000-DP000L for designing bias circuit?
Edit:-
I have updated datasheet link


texts: Blasting copper off a substrate with a 808nm laser diode- viability

texts:
So, I'm working on a way to produce PCBs for small jobs, and I thought that lasers might be a good way to go, as etching seems to be very difficult from small traces, needed for many microcontrollers.

I started by searching the absobance spectrum of copper, as the metal itself is very reflective. A quick search turned out that the absorbance of copper rests right around 800nm. Thus I came to the conclusion that an 808nm etching diode would probably be best.

My question to you, is weather or not the laser qould actually remove material, or if the copper will take on the heat? 808nm lasers are very focusable,and I plan on having an estimated power of 360KW/cm2 (40W diode at .112mm2 dot)..
I've worked with many lasers before, ranging from IR to UV, and I know enough safety to know that 808 modules are generally beasts.


texts: risks of going with a very low reference voltage for a comparator

texts:
Objective

Digitization of pulses of width 10ns-150ns repeating at a rate of 1Hz - 50Khz

Current from photo diode of these pulses ranges from 50uA - 100mA, so i want to do the I-V conversion just using a 50ohm resistor, to read voltage ranging from 2.5mV - 5V

Approach :

i want to avoid further amplification of the signal to avoid saturation and to maintain pulse width

i would just put a high speed comparator like LMH7322 after the 50ohm resistor and using a voltage reference of 1mV produced from a (1V LDO output and potential divider circuit)

Problem Statement:

my question is ,i did not see some one sensing low light current using this approach rather went for using a TIA, how safe is going with very low reference voltages like 0.5mV to 1mV ?, my intention is i can cover a large dynamic range using this technique


texts:
I asked a very bad question related to this yesterday, sorry - this is more comprehensive and makes more sense.

this is the manual for the nexys 4 FPGA i'm using https://reference.digilentinc.com/reference/programmable-logic/nexys-4-ddr/reference-manual - the relevant section is 16 - mono audio output

based on this manual, I have set the audio output to a pulse-width modulated square wave in order to try to produce a tone (the idea is that I will eventually play a short tune in the background of an arcade game I'm building for a university project). Although there are no errors or anything, I'm not hearing anything when I plug headphones into the audio output.

I'm wondering if I'm going about this the right way and whether anyone has any tips on how to produce a sound output - any sound, really, and I can build from there.

I really appreciate any help


texts: OpAmp Comparator Circuit Design for High/Low voltage measurement

texts:
I am new to this. I want to make a circuit to measure the voltage from (0 ~12 V),  which can have 2 op-amps as comparator to give the output positive, when the voltage goes from 8 V to 12 V and give output negative when the voltage goes from 0 V to 4 V. The reference voltage should be 6 V (+/-2 V). Please suggest me the basic circuit using 2 op-amps.

Input voltage: 0 to 12 V
Reference voltage is 6 V
Higher limit : 8 V
Lower limit : 4 V

Means, when I increase the input voltage from 6 V, it should not show any change until it crosses 8 V and when its more than 8 V, it should show HIGH VOLTAGE.
Similarly, like when i down the input voltage from 6 V, it should not show any change in output until it cross the 4 V and when its lower than 4 V. it should show LOW VOLTAGE.

Thanks.

Table 1. Function table for OP to edit.

V_IN        V_OUT
----------- ----------
0 - 4 V     Negative
4 - 8 V     0 V
8 - 12 V    Positive

Please Refer this Circuit and suggest me the corrections, if any. Thanks


texts: Is there a convention for figuring out the MSB and LSB on a counter IC?

texts: Taking a look at the 74LS169, for instance, this IC has output pins Qa - Qd. I notice a lot of data sheets like these do not always specify which pin is the MSB or LSB of the count. Other than hooking it up and testing on a breadboard (or tracing through diagrams/schematics), is there something else to look for in the data sheets? I would think that D would be MSB and A would be LSB, but how often is that the case?


texts: LCD displaying only cursor but not characters after clock change

texts:
I am using a 20x4 LCD on PortC of an ATmega32. I have disabled JTAG and I am using the LCD library by Newbiehack.com. Until recently everything (characters included) was displaying fine. Then I changed my MCU to 16 MHz and LCD was not displaying anything. So I used a new MCU at 1MHz with JTAG disabled but is shows only cursor but not any characters.

I can get the cursor position to change but still can't get it to display data, even using the same code as before. I tried using a new LCD but still same problem persists: no data displayed. How do I solve this?


texts: How to perform small value approximation for sqrt(x) on FPGA

texts:
I am trying to implement a fixed point routine which involves computing the value of \$ \sqrt{x} \$ for small \$x\$ that approaches \$0\$. The target architecture is an FPGA. One problem is that this function does not lend itself easily towards the use of Taylor's expansion. One can see that for small values of x, the slope of \$\sqrt{x}\$ goes to infinity when \$x\$ approaches \$0\$, therefore evaluating the function using a power series involves multiplying huge coefficients with a small \$x\$. This method is therefore numerically unstable.

Using an iterative approach, the Newton-Raphson yields the following iterative equation: \$x_{n+1} = \frac {x_{n}}{2}- \frac{\alpha} {2x_{n}}\$, where we are trying to approximate \$\sqrt {\alpha}\$. But once again, since \$\alpha\$ is small, \$x_{n}\$ would likewise have to be small for the solution to converge. Since the equation involves dividing a small number by another small number, chances are that fixed point arithmetic would fail.

With that, I would like to know how to implement small value approximation for \$\sqrt{x}\$ using fixed point arithmetic, either using precomputated coefficients or iterative methods.


texts: Software to make a simple Pinout Diagram

texts: I would like to make a simple diagram showing the pin outs of all of the pins on a board that I have. I would like to do something like the image in this post. All of the answers to this question either covered electrical schematic software, or doing it completely from scratch. Is there any type of software where I can specific the dimensions of a header, and label each pin? I do not mind something even as simple as this:


texts: Is there any specific application for an indirect band gap semiconductor?

texts: I know that direct band gap semiconductors are very attractive for optical emission, and even though indirect band gap are used as well, I keep wondering: is there any technology that specifically makes use of an indirect bandgap semiconductor? In other words, is there any piece of hardware that simply wouldn't work (or it would, but very poorly) if the material it was based on, wasn't an indirect bandgap semiconductor?


texts: How to put Sim808 and a microcontroller on the same PCB?

texts:
I'm families with Arduino (Nano and mini) and GSM modules and I've recently Learn about Altium Designer and I've designed (and ordered) a few simple PCBs and I've learned about Micro controller and their features and I've assembled GSM tracker with Arduino mini and GSM module.

But now, I want to put the GSM module(sim808 module with castellated edges) and micro controller on a same PCB board so it could be smaller without extra circuits like speaker or microphone.

My question are:

1- As I'm not families with all PIC micro controller(I prefer PIC because I have It's Programmer) , What DIP or SMD, PIC model is suitable for this project ? Is there any sample schematic with that Micro (Arduino style like it have a lot of schematic samples) That you don't need to read all four hundred page datasheet, which you can just  ignore the part that we don't need on the sample schematics to connect it to another module.

2- I've downloaded SIM8080 datasheet, It shows How to connect each part like power supply or UART, but is there any full schematic to start with?

3- Is it cause issues putting micro and GSM module on the same board, like noise or impedance matching?

PS: There is no SIM808 module with full board in the area but I can buy that castellated edge module and I know there are some GSM/Micro controller on the same board, but There is no shipping where I live so its better to build it.


texts: MOSFET blowing when soft starting a motor

texts:
I have a small SMD MOSFET [AO3400A] powering a small 12VDC motor which draws 1Amp in normal running mode (higher on turn-on but I can't easily measure that). When turning on this motor, it trips the power surge protection in my PSU. When I pre-load the PSU with other components, there's no trip-out. So, I want to soft start it, with as few components as possible.
I have built the attached circuit which works perfectly for non-inductive loads (eg 70W LED COB); the light comes on slowly. However, with a motor it blows the MOSFET so that when 3v3 is removed the motor continues to run (at half speed). Interestingly [with a new MOSFET], when the 20k resistor bypassed the motor starts immediately, and then ramps down as the cap discharges ... as expected. But why would adding RP3 to slowly charge the capacitor cause the MOSFET to blow?
Using a STP16NF06 TO220 MOSFET does not have this problem.
The PSU is rated 150W, and others on my desk of the same model don't trip... but I need to design to deal with the odd sub-standard PSU. In normal running the PSU is fine up to 12 amps.
I am powering the 3V3 with a microcontroller so I could in theory use a PWM start, but would that prevent the inrush current problem? I would suspect not.


texts: Sampling analog signal at 100khz with raspberry pi

texts: I want to sample a ultrasonic wave at 100 Ksps. Currently i am using Raspberry pi and an external adc communicating with each other vis I2S at 96Khz. Since raspberry pi cannot support higher speed data transfer through conventional serial protocols I want to add a microcontroller in between raspberry pi and adc which can sample the signal at 100ksps and send the digitized signal to raspberry pi via UART protocol. Is it possible to send 100k samples of 16 bit data over UART in a second to a raspberry pi and also any recommendations for the microcontrollers would be appreciated.


texts: What material are old coaxial cables made from?

texts:
I'm asking about the old long white coaxial cables that are used on tvs.  I notice the white insulation jacket is harder than the soft pvc jackets that most electrical devices use.

Specifically what material is it and does it off gas anything like the pvc jackets do even if in small amounts.


texts: Can I remove the whip antenna of an Xbee Pro S2B and attach an external antenna?

texts:
My project needs a lot more range and I was wondering if I could desolder the whip antennas of the Xbee and solder on ufl connectors. I'm aware that xbees do come out of the box with ufl connectors but sadly they aren't available where I'm from and my deadline won't allow me to order online.

I was wondering if I could switch out the whip antenna and attach ufl connectors to use these following antennas. Xbee is 2.4Ghz

1)Patch antenna - https://www.sparkfun.com/products/11320

2)Duck antenna (with a ufl to Rp-sma converter ofcourse) - https://www.sparkfun.com/products/558


texts:
I have a stepper motor that has 1.3Nm holding torque.
Im using TB6560 driver at 3A phase current and half step mode.
And also Im using Arduino for generate step signal for the driver.
If I generate a pulse 1000uS HIGH and 1uS LOW, I can get good torque from motor.But,more vibrations.If I decrease the HIGH time, I can get low torque and less vibrations.

I need more torque and less vibrations for my application.

I cant understand how motor torque depend on pulse HIGH time.
Someone can explain and give a proper solution for my problem  gratefully appreciated.


texts: Wiring Parallel and Series Simultaneously

texts: Is it possible to connect 3 sealed lead acid batteries in both parallel and series at the same time like in the diagram below?


texts: Board occasionally resetting when dropped or knocked

texts:
I have a board that consists of

Arduino pro mini (ATMega328P, ceramic resonator, tactile reset button)
SD card
I2C sensors
LTC3525 boost converter (IC, inductor, caps)

Very occasionally, if the board is accidentally dropped or knocked it will reset. Unfortunately I cannot seem to reproduce the problem, but it has happened on multiple boards.

Any ideas what the problem could be? My guess is the force of the drop actuates the reset button, or perhaps stops the resonator for a split second.

Edit: The board also has 2 x AA battery holders.


texts: Is it possible to implement SOP with 4 terms by only 3 NAND gates?

texts:
if I have a truth table for ABC and output Z

ABC Z
000 1
001 1
111 1
110 1

SOP=A'B'C'+A'B'C+ABC+ABC'

the most straight forward way will be 3 AND,1 NAND,1 OR
.But, I was told this can be done with 3 NANDS...
I tried simplified it, I got A'B'+AB...which can be done with 3 NANDS
but,is it make sense to ignore input c?

Can someone help?

Thanks


texts: Distinguish between hardware or firmware issue

texts:
I'm writing a firmware for CC3220SF from TI using a custom board I've designed. I'm facing a weird behavior and I'm not sure if it's hardware or firmware related.

Here I'm looking for some hints about how you would investigate further in such a situation.

Basically, my application follows this pattern:

wakes up from hibernation
reads the internal RTC
acquires some sensors
sends them to a Cloud
read again the RTC if needed
goes back into hibernation

nothing new, I know.
The problem is, sometimes, the readings from RTC are wrong. With "wrong" I mean during subsequent calls (even in the same active window) the read values are in the future (i.e. 2022) but after that come back to the correct ones.

An example from my logs:

[SYS] SlDateTime_t: 2017/11/28 23:16:5
[SYS] struct tm: 117/10/28 23:16:5
[SYS] time_t   : 1511910965
...
[SYS] SlDateTime_t: 2022/3/1 9:58:17
[SYS] struct tm: 122/2/1 9:58:17
[SYS] time_t   : 1646128697
...
[SYS] SlDateTime_t: 2017/11/28 23:16:9
[SYS] struct tm: 117/10/28 23:16:9
[SYS] time_t   : 1511910969

here the code I'm using to test it:

time_t _GetEpoch(void)
{
    _i16 ret;
    _u8 pConfigOpt = SL_DEVICE_GENERAL_DATE_TIME;
    _u16 pConfigLen = sizeof(SlDateTime_t);

    SlDateTime_t dateTime = {0};
    ret = sl_DeviceGet(SL_DEVICE_GENERAL, &pConfigOpt, &pConfigLen, (unsigned char *) &dateTime);
    ASSERT_ON_ERROR(ret);

    struct tm t;
    time_t t_of_day;

    t.tm_year = dateTime.tm_year - 1900;
    t.tm_mon = dateTime.tm_mon - 1;
    t.tm_mday = dateTime.tm_day;
    t.tm_hour = dateTime.tm_hour;
    t.tm_min = dateTime.tm_min;
    t.tm_sec = dateTime.tm_sec;
    t.tm_isdst = -1;
    t_of_day = mktime(&t);

    UART_PRINT("[SYS] SlDateTime_t: %d/%d/%d %d:%d:%d\r\n", dateTime.tm_year, dateTime.tm_mon, dateTime.tm_day, dateTime.tm_hour, dateTime.tm_min, dateTime.tm_sec);
    UART_PRINT("[SYS] struct tm: %d/%d/%d %d:%d:%d\r\n", t.tm_year, t.tm_mon, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec);
    UART_PRINT("[SYS] time_t   : %lld\r\n", t_of_day);

    return t_of_day;
}

My thoughts:

I'm asserting against errors returned from sl_DeviceGet(), hence the function is executed correctly
from the logs you see the error is in the SlDateTime_t structure that is returned by the sl_DeviceGet() function, hence is not related to mktime or my other part of the code
on the other hand, if the next reading is correct, it doesn't seem an hardware problem because I would expect a corruption of the values also in the next readings. Instead they are correct.

The last test was an infinite loop where I read 100 times the RTC, then go to hybernation and again. The results confirmed that one reading among the 100 is wrong. The others are correct!

UPDATE

After puzzling over a bit, I discovered the following:

with the test code I got 250 wrong values in less than 60k readings
the difference between a wrong value and the immediately before or next correct reading is always 134.217.728 seconds in the future.


texts: Converting raw gyro (L3GD20H) values into angles

texts:
As per my understanding, in order to convert the raw gyro values into angles, I need to first multiply the raw values of each axis with the sensitivity level.
Example:
//Convert Gyro raw to degrees per second

   rate_gyr_x = (float) gyrRaw[0] * G_GAIN;

   rate_gyr_y = (float) gyrRaw[1]  * G_GAIN;

   rate_gyr_z = (float) gyrRaw[2]  * G_GAIN
source : http://ozzmaker.com/2014/12/11/berryimu/

In order to calculate the angle, I need to multiply the rate with the loop period.
Example:
  gyroXangle+=rate_gyr_x*DT;

  gyroYangle+=rate_gyr_y*DT;

  gyroZangle+=rate_gyr_z*DT;

Source.
But I don't understand why the angle values are added with previous values.
In my problem, I trying to write a program to balance an inverted pendulum. I have a timer which will interrupt the main program once in every 30ms. Once in every 30 ms, I will run  a function to read the gyro values and compare the read value with reference. Based on the difference, the speed and direction of motor will be adjusted.
In order to get the reference angle and the newly read angle, I have multiplied the raw gyro values with the sensitivity level and multiplied that result with 0.03s (as my loop period is 30 ms) to get the  sngle value. But in the reference link I have provided above the author has added the angles (integrated over time.) Just multiplying the rate (degrees/sec) with loop period will give the angle, but then why do we have to sum it up over time?
How can you use this summed up angle for comparison against the reference angle?
Am I missing something?


texts: Synthesis Verilog Delay (#x), syntax question

texts:
I used an IP from Lattice FPGA and looked in their code.
they use this bullets of verilog code there:
 // -----------------------------------------------------------
// gclk gate control2 on falling edge to prevent runt
// -----------------------------------------------------------
always @(negedge hclk or negedge reset_n) begin
  if (~reset_n) begin
        gate_clk_ctl2 <= #1 1'b1;
  end
  else begin
        gate_clk_ctl2 <= #1 !orc_ack_1d;
  end
end

....
..
.
 //-------------------------------------------------------------------
// Latch data and address into internal reg clocked by hclk
//-------------------------------------------------------------------
always @(posedge hclk or negedge reset_n) begin
  if (~reset_n) begin
        reg_di[25:0] <= #1 26'h0000000;
  end
  else begin
if (pc_rdy_pulse) begin
          reg_di[25:0] <= #1 sreg_di[25:0];
        end
  end
end

I don't understand this syntax
what this "#1" doing? what this logic does?
I know #x in verilog is delay.. but this is synthesizable code, so I dont understand how does it work.
Thanks.


texts: How both live and neutral wires can have such small voltage difference in relation to the ground in this faulty wiring?

texts:
So basically the case of my washing machine was causing a mild shock on touch when it was connected to the wall outlet. I took a multimeter and checked voltage from the case to the ground, and it turned out to be about 30V . Initially I thought that it's some kind of short in the machine, but I figured that I can check voltages in the outlet just in case, and lo and behold, everything seems to be wrong in all outlets in the whole bathroom. I don't know which endpoint is live and which neutral, because it's an old house and the order of these is all over the place, but my results were:

1 > 2 = 230V - that's normal
1 > ground = 8V - hmm...
2 > ground = 30V - hmmmmmm...

I know I need electrician and I will get one, but just out of curiosity - what does it tell me exactly? I expected one result related to the ground to be much higher than the other, how it's possible that the difference is so low if the difference between #1 and #2 is so high? How it's even theoretically possible?


texts: What is the purpose of an IO shield on a computer case?

texts: What purpose does the IO shield on computers serve?  I have been reading a lot of articles (mostly forums) on the internet and can't seem to find a definitive answer.


texts:
I'm experiencing a very typical issue with data corruption in a flash chip in a not so typical way.  I'm using the M25P16 16Mb serial Flash chip by Micron to log historical data on my device over SPI.

The Logging works wonderfully with one known error, and thats when the power to the device cycles during a Flash Opperation.

I expected the last data block written to the Flash to be corrupted but in reality it seems the entire Sector becomes corrupted!

Here is what I mean by corrupted, every data block I write to Flash recieves a checksum, if a corrupted data block is being read, all the data is correct EXCEPT the low word of the checksum.  The low word of the checksum always returns 0x0000.

For example a checksum of 0xA533037E being written to flash will be read as 0xA5330000.

Now for the weird part, if this problem is occuring and NEW DATA is written to flash the same thing happens for the new data!

How I have been solving this problem is by erasing all of the data and starting over.  This seems to solve the problem in an not-so-great way.

My Question is this: For Serial Flash, if a corruption occurs, do you think it is the entire sector that becomes corrupted or just a data point?  Does this seems like "typical" behavior for corrupted values?

Any input is appreciated :)

Addendum
Here is the link to the data sheet for the flash:

Micron - 16Mb Serial NOR Flash


texts:
Given a circuit like the one on the picture, I am very confused on how to reduce it to a simpler form(I do it because at this point I am more comfortable with solving circuits which  are all in one piece, meaning all the conductors are connected graphically). However, for this diagram I am unsure how to do it. I did reduce it to a simpler form, but I guess it can be done much better since the way I did it the Iteration method for solving the diodes would be quite a mess.
The way I tried to simplify it:

Now from the diagram of mine it is easy to guess which of the diodes is in forward bias and which one is not. Is my correction alright?


texts: Is VBUS sensing necessary for USB on a self-powered device?

texts:
I'm currently designing a self-powered PCB with a STM32L432KCU6 and USB. After having done some research, it seems that it is necessary to connect the VBUS pin for detection purposes. However, is it also needed if I want not to use the detection feature? I would prefer establishing the USB connection by clicking on a button instead of automatically establishing it when VBUS is sensed.

I'm sorry if this is a trivial question, but I don't have much experience with USB so far.

simulate this circuit – Schematic created using CircuitLab


texts: Best practice for probing capacitance sensitive test point in a switching supply?

texts:
I need to probe the hot side of a switching supply between the  drive transistor and inductor (Marked TP on diagram). I tie my scope ground to the device ground with short fat wire and when probing with a high quality probe I can hear a perceptible change in the inductor whine presumably due to the stray impedance of the probe being close in value to a 100pF capacitor that is part of the circuit. I am trying to measure the charge/discharge time of the charge pump and estimate the steady state of the inductor on a live circuit and I am afraid I am skewing the result.

A simplified diagram:

simulate this circuit – Schematic created using CircuitLab


texts: Charging a Li-Ion battery with a photovoltaic cell during constant current phase

texts:
I have a 3.7V, ~1500mAh Li-Ion battery that I am planning to charge with a small photovoltaic cell that will output roughly 100mA when under full sunlight. As I understand it, a Li-ion battery should be charged at a constant current of about 0.5C until its voltage has reached 4.2V, at which point it should be charged at a constant voltage. (I realize fully charging this battery will take 15+ hours)

My question is what will be the effects on battery life if this battery is being charged at 100mA/1500mA = 0.067C during the constant current phase? Keep in mind that the PV cell will not always be under full sunlight, meaning the output current will fall below 100mA and vary. Follow up question: will variations at low (<.067C) charging rates during the constant current phase cause substantial harm?


texts:
Edit: Sorry! Please bear with me, this is my first post! Well, it seems that placing a buffer before certain fuzzes can chance their sound. However, placing an inductor after the buffer cancels this effect ("unbuffers"): http://www.muzique.com/lab/pickups.htm Sure, ditching the buffer would too but sometimes you can't or don't want to: http://www.muzique.com/lab/imp.htm . I wonder if a simulated inductor has the same effect, this could be useful for resonance adjustment and guitar synths.
OLD: I would like to use a floating active inductor to "unbuffer" a guitar signal before a fuzz, made from off-the-shelf parts.
After an exhaustive web search, the models I found either requires custom parts or is too technical. Eventually I heard of a "3-OTA conventional simulated inductor", but I could't access the schematic.
So, does anyone know any circuits for this purpose? Low noise and ajustability would be nice.


texts: Measuring 0805 Capacitor values under 1nF

texts: Other than investing in an expensive tweezer type meter for SMD components, what would be a good method for the layman to find the capacitance of an 0805 ceramic capacitor whose value is below 1nF? My Fluke meter can only measure to 1nF...


texts: How to enter bootloader on a Embedded Linux System with no keyboard?

texts:
I am trying to reflash a microcontroller.

An instruction in the manual states that:

  Power up the owa4x and press the space bar to enter the bootloader prompt
  Insert the uSD card with the images to flash
  Confirm a FAT32 formatted SD card is accessible

I only SSH into this microcontroller and as such it does not have a keyboard to press the space bar or a screen to see anything. If I am able to SSH I assume it's already booted up and too late to go to the bootloader, but prior to it I can't do anything because it's not booted yet.

How can I do an equivalent of that operation through SSH route?

Manual doesn't provide anymore insight.

Thank you for your help.


texts:
I am working with the CAN bus and need some help with decoding message data.

Here is a sample of the data that I'm seeing on the CAN bus.

root@petalinux:/var/volatile/tmp# /tmp/candump -n 10 can0
  can0  4E5   [4]  F0 16 00 00
  can0  665   [8]  40 78 60 00 00 00 00 00
  can0  5E5   [8]  4B 78 60 00 DB 00 00 00
  can0  665   [8]  40 64 60 00 00 00 00 00
  can0  5E5   [8]  43 64 60 00 E4 7D 5E 00
  can0  665   [8]  40 41 60 00 00 00 00 00
  can0  5E5   [8]  4B 41 60 00 27 02 00 00
  can0  665   [8]  40 41 60 00 00 00 00 00
  can0  5E5   [8]  4B 41 60 00 27 02 00 00
  can0  665   [8]  40 6C 60 00 00 00 00 00
root@petalinux:/var/volatile/tmp#

I can't figure out how to trace the data back to a particular CAN bus message.

My device has a node ID of 101 (base 10) and it is a StepIM stepper motor. Here is a reference to the manual - http://servotronix.com/wp-content/uploads/dlm_uploads/2015/05/stepIM_CANopen_fw0.0.2.85_Rev.1.3.pdf. So let's try and decode the last message from above. That would be "can0  665   8  40 6C 60 00 00 00 00 00"

I can't seem to figure out how to translate the hex string "*40 6C 60.." into a command the document for the stepper motor knows about...


texts: calculation for the response of fourth order transfer function from step input

texts:
I need some help to verify my calculation. Following is the transfer function of a control circuit
$$H(s)=\dfrac{1+0.145s+0.0019s^2}{1+\dfrac{0.8}{150 }s+\dfrac{1}{150²}s²}×\dfrac{1}{1+0.0012s}×\dfrac{1}{1+0.008s}$$

I simulated the above by plotting its step response the settling time I found is 79ms, this is a fourth order system, do I need to handle it differently?  Is this the time when the output of the filter will become equal to the step input magnitude?


texts:
I am trying to analyze a circuit where AOZ1014 buck converter is used to generate 7.5V and negative voltage(-5V) is generated with following arrangement.

As shown above Lx pin of AOZ1014 ( left sided pin of inductor L2 )is assigned to 7905 regulator with C33,D16 and D18 arrangement. Here, as per my consideration, D18 is for suppressing +ve peak to ground since we need -ve input to 7905 IC.

What is the purpose of D16, R57 and C33 here? How changing C33 will change my output voltage?

I used same concept with TP5430 Buck regulator as shown.

But I am getting random results in my case here. Sometimes it is regulating as per my requirement but randomly misbehaves with loading 7.5V to 1.5V and -5V to -2v. Am I correct in assigning C33 pin to in between of C31 and L2? Can someone guide me to make it work.

Thanks in advance.


texts:
I am needing to understand is PV cells work on light in general or only sunlight?
I have a project that needs to use pv cells inside to harness ambient light and focussed/captured  LED source light to regenerate battery cells in a display... is this possible ?
I need to generate enough battery energy to power 56W of LED's for 12 hrs and cyclically regenerate with some grid recharge as necessary but am trying to understand the lack of efficiency of a system like this ?


texts: How do I fix this issue where Altium wants to print multiple pages?

texts:
I am trying to print out a PCB scaled 1:1 in order to ensure that my components and mounting holes are lined up perfectly. I've followed these exact instructions to do so: How to export and print the PCB in Altium

I am able to get the PCB properly scaled. However when I go to print Altium insists on spreading out my board across multiple pages. As you can see in the picture below, it is like Altium wants to justify the verical half way line with the left side of the page 2.

I just would like to have one page printed. If that's not an option, a way to export a 1:1 scale print to another program would suffice. I would appreciate any advice on solving this issue.


texts: What does the circuit look like to switch two lights using two switches into four different states?

texts:
At my workplace there's a room with two entrances, each featuring a push button light switch, A and B. There are two ceiling mounted lights, 1 and 2.

Switch A switches both lights on/off. Funny enough, if both lights are on, switch B switches off a single light (2). Now in this state, switch A "flips" the state of the two lights (2 goes on, 1 goes off).

| SW-A | SW-B || LAMP1 | LAMP2 |
+------+------++-------+-------+
| on   | on   || on    | on    |
| off  | on   || off   | off   |
| on   | off  || on    | off   |
| off  | off  || off   | on    |
+------+------++-------+-------+

I don't know if these are 3-way or 4-way switches.

Just out of academic curiosity: how exactly is this - obviously flawed - circuit possibly implemented?

(Disclaimer: I'm a physician, not any kind of engineer)


texts: Electric potential and the flow of electrons in a battery

texts:
I started reading about electricity a few days ago and there are some things that confuse me. What I want to ask about here is the apparent contradiction in two facts that I have read, they are:

Electrons flow from the negative end of a battery to the positive end.
Electrons flow from higher electric potential to lower electric potential.

The negative end of a battery is supposed to be "ground" which is the reference point to measure voltage from. The negative end is defined as being 0 volts while the positive end is 9 volts (if we use a 9V battery as an example). So then why do electrons flow from the low volt end to the high volt end, shouldn't it be the other way around given fact number 2 listed above?

I may very well have misunderstood something and made factual errors in my claims above, but just a week ago I knew pretty much nothing about how electricity works, so please forgive me.


texts:
I'm new to VHDL and I'm having a problem with my code that I can't seem to fix. We're supposed to do this using either selected signal assignment or table lookup. Mine is kind of a combination of the two since we are supposed to use don't cares for inputs that will not happen.

The code is basically supposed to give the same output for either 2's complement input or offset binary. So, for instance, decimal number 7 is "1111" in offset binary and "0111" in 2's complement. Both forms should generate an output of "1111100000" depending on the value of the switch oe ('1' for offset binary, '0' for 2's complement).

I've debugged my code as much as I can at this level and I do not understand what I'm doing wrong.

Active-HDL is currently giving me errors at lines 48 and 55. I'm getting two "simple expression expected" errors.

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity pitch_decoder_2 is

    port(d, c, b, a : in  std_logic;
         ob         : in  std_logic;
         led        : out std_logic_vector(9 downto 0));

end pitch_decoder_2;

architecture myarch of pitch_decoder_2 is

    type tbl is array (15 downto 0) of std_logic_vector(9 downto 0);

    constant table : tbl := (
        "1111100000",                   --  7
        "1111100000",                   --  6
        "1111100000",                   --  5
        "1111100000",                   --  4
        "0111100000",                   --  3
        "0011100000",                   --  2
        "0001100000",                   --  1
        "0000100000",                   --  0
        "0000110000",                   -- -1
        "0000111000",                   -- -2
        "0000111100",                   -- -3
        "0000111110",                   -- -4
        "0000111111",                   -- -5
        "0000111111",                   -- -6
        "0000111111",                   -- -7
        "0000111111");                  -- -8

    signal input : std_logic_vector(3 downto 0);
    signal tmp   : std_logic_vector(2 downto 0);
begin
    input <= std_logic_vector' (d, c, b, a);
    tmp   <= std_logic_vector' (c, b, a);

    with input select

        led <= table(to_integer(unsigned(d & tmp)))
        when "0000" | "0001" | "0010" | "0011" |
        "0100" | "0101" | "0110" | "0111" |
        "1000" | "1001" | "1010" | "1011" |
        "1100" | "1101" | "1110" | "1111"
        and ob = '1',

        table(to_integer(unsigned(not d & tmp)))
        when "0000" | "0001" | "0010" | "0011" |
        "0100" | "0101" | "0110" | "0111" |
        "1000" | "1001" | "1010" | "1011" |
        "1100" | "1101" | "1110" | "1111"
        and ob = '0',

        "----------" when others;

end myarch;

Also, if you have any tips on how I can improve the code while maintaining the assignment instructions, please feel free to suggest anything.


texts: Building an oscillator out of discrete gates

texts:
I want to buid an ocsillator out of discrete XOR gates, I want to acheive 80MHz.

I've tried building one from SN74LVC2G86, but rise/fall times I get is about 25ns. Datasheet does not specify the rise/fall times for this part, but in recommended operation conditions it gives numbers like 10ns/V @ 3.3V - this somewhat agrees with my measurements.

Is stray capacitance on my board affecting the circuit or is LVC family not good for a task like this?

This is my circuit and PCB:


texts:
In a common mode choke, my understanding is that common mode currents will produce fluxes that add together, which increases the effective inductance between them and so attenuating these currents.

When differential currents are flowing through the common mode choke, the fluxes will flow in opposite directions, so that there is no coupling and the individual fluxes will cancel for a net 0 flux, effectively making the inductance appear very low if at all.

So when I am looking at specs for common mode chokes with an inductance specification, does this rating pertain to common mode signals only?  That is my guess, but I'm still trying to get a better understanding.


texts: Mass storage mode for an SD card connected to a MSP430G2553 chip?

texts:
Right now I have a program that stores values obtained from the on chip ADC to a SD card.  The card is connected like the diagram shown in this PDF:

Interfacing the MSP430 With MMC/SD Flash Memory Cards

I am planning to connect a UART-to-USB chip (FTDI or MAXIM's) so I can send data to a PC as well.

So the question is, is it possible for the PC to read the SD card through the microcontroller similar to the way that MP3 players act like mass storage devices when they are connected to PC?

Here's a diagram for clarity:

[SD card] <--> [MSP430G2553] <--> [FTDI chip] <--> [PC]

Thanks.


texts: How can I break one circuit when another one's current draw is high?

texts:
A layperson here.   I own a small RV park, as well has a nice large Motor Home.  Most of my guests have the same set up in their Motor Homes as I do.  The Microwave and the Hot Water Heater are on a switch that allows you to have only one on at a time.

Very problematic in that you have to keep remembering to switch back to the Hot Water Heater every time you microwave a cup of water. This has been the same setup on my last 3 Motor Homes. Plus you NEVER have the clock set on your Microwave.

I installed a bathroom fan timer with a relay, to I can quickly twist the timer and be confident that the Hot Water Heater will go back on a short time after I use the Microwave. Can anyone help me (an electronically minded layperson), with a circuit that would let the Microwave draw enough current for the clock, but as soon has you hit the Start button and it drew say over 100 watts, the Hot Water Heater circuit would temporarily cut out. I hope this explanation made sense.

Also note that RV water heater are not like home heaters, in that they have a small element that draws about 700 watts. Maybe someone even knows of something on the market that can be used or modified?

=============================================

OK, I am sorry for not getting back and thanking you for your help.  My Father died days after I posted this and I am just now getting back to this project.

I had told my dad what I had posted here, and he ask that it I made one for my Motor Home, that I make one for his too. His has been sold, but I still want mine to work this way.

I had decided a few days ago to just get this done.

I took the below schematic to a local (local for where I was traveling,) Old TV repair guy, along with some notes I took at radio shack.  My intent was to asked the repair guy if the parts I was going to buy would work for the above diagram.  I just didn't want anything to be way off.

He said that the Bridge Rectifier would not pass through the AC current, therefor the Microwave would not work. So the circuit would not work?

So I back here to ask the experts about that.

I think you understand what I am looking for,,, When the Microwave goes from the small low watt internal light draw, to the vastly different full power cooking draw, I want a relay to open, breaking the circuit to the Hot Water Heater, so that the amp draw cant be the combination of the two.  I am OK with the relay I just don't know about sensing the draw.


texts: Instability in photodiode amplifier circuit

texts:
I'm using a UV LED and a Schotky photodiode sensitive to UV light to get an estimate of the concentration of a vapor that passes through the space between the UV LED and UV diode, but I'm having trouble with the amplifier circuit. I must say that I don't have a good grasp of the working of operational amplifiers and have been trying to learn.
At first I was just using a UV detection PCB board with this schematic:

I noticed that the C2 capacitor would cause the output voltage to lag behind sudden changes in UV illumination for about 1 second.
I built my own version of this circuit with SMT components and without the C2 capacitor, but that makes the output to oscillate, especially at relatively low UV light intensities. See the schematic of my PCB below:

I experimented adding small ceramic through hole capacitors to the board by soldering them to the SMT terminals at locations C1 or C2 below. I tried either C1 or C2 alone or both together, with values ranging from 2 pF to 100 nF (a lot of soldering and desoldering and testing). At most I was able to dampen the oscillation without making the circuit response to changes in input too sluggish, but now the output seems to asymptotically approximate a baseline with constant UV illumination but to take many minutes to do so. See below for location of these capacitors:

And here is a picture of what my PCB looks like with a capacitor soldered at C2:

I don't have access to a decent oscilloscope, but here is the output of the analog to digital converter, with C1 = 10 nF and C2 = 22 nF immediately after turning the UV LED on. I managed to damped the oscillations, but the output takes a very long time to stabilize. This graph is the output of the adc pin that reads the output of the amplifier circuit, it has about 2 seconds of output on it, if I let it running for a few minutes with the constant LED illumination it would stabilize at a value.

My question is, how can I modify this circuit so that it responds fast (say, output is stable in 100 ms or less), and without oscillations?
Edit: datasheet of photodiode: https://cdn-shop.adafruit.com/datasheets/1918guva.pdf


texts:
Is is possible to connect to a BLE device without thesaid device being discoverable?
I don't seem to have to search for a device to be able to connect to it (just knowing it's address), but I don't seem to be able to connect unless I first put the device in discoverable mode first.

I want to be able to connect to a device just knowing it's address, but that device should not appear if you scan for it.


texts: Does the place of the primary matter in a transformer?

texts: Does it matter whether I wind the primary or the secondary first? I imagine with the primary inside the secondary you'll have less leakage. Is that right? Other reasons to put the primary or secondary first?


texts: What are the pins of a MOSFET in a TO220 package?

texts: I have an IRF3205 MOSFET in a TO-220 package, and I would like to know where the drain, gate and source are. I can't find this information.


texts: Need help deciphering markings on an electrolytic capacitor

texts: I have a capacitor which is marked with "1200uF200wv". What does the "w" mean?


texts: Wiring a voltage specific device onto a constant current circuit?

texts:
I've got a bunch of LEDs wired in series to a constant current driver. The driver runs the circuit at 500mA to 700mA (I can vary it up or down a little) and can supply 50 to 100 volts, maximum 60 watts. I'm using about 63 volts and 53 watts.
I found a temperature probe that calls for 4 to 28VDC. No mention of a current rating. Can I wire the probe into the LED circuit or do I need to find a separate power supply?
Why I'm confused:
From reading other threads, I believe that I'm okay supplying half an amp to the device even if the device would normally only require a fraction of that. However, if the probe consumes anything close to its maximum 28 volts, the circuit's wattage will exceed the driver's rating. How much voltage will the device "ask for?"


texts: Are there any performance effects of using radiation hardened memory units?

texts: Are there any performance related effects of using radiation hardened memory units as compared to non-hardened ones having the same configuration except the protection it should provide from radiation damage? (read write speed, date reliability)


texts: What would happen if an ideal voltage source was connected to an ideal wire?

texts: I've seen it mentioned in discussion that an ideal wire doesn't exist (all wires have resistance), but even if it did, an ideal voltage source doesn't exist (all batteries have internal resistance); but what if both existed and they were connected together in a circuit?


texts: Signal sampling at different points in a signals path without degrading the signal?

texts:
I am passing signals through an organic substrate & recording the response at different locations via differential probes that feed into my DAQ  a Pico 24. See diagram below for set up. The sampled signals are in the order of 10s of mV.
I would like to also sample the output from the Op Amp so that I can get accurate time alignment of inputs & outputs. This is now at the limit of my electronics knowledge. Would this just be a matter of putting an appropriate resistor in the red question mark box?