Chat

Welcome to Flux

Treat Flux like your intern. Tell it what you'd like to build and it'll get to work. You can also ask it questions, brainstorm ideas, and teach it your preferences. Learn More

Explain project
Write a project description
Find schematic issues
Create a test plan

Ready.


Looks like ESP-NOW is a good way to get battery data from one device to another

Looks like ESP-NOW is a good way to get battery data from one device to another
2y
Someone is typing...
is LRCLK the same as WS for I2S?

@copilot is LRCLK the same as WS for I2S?
2y
Yes, LRCLK (Left-Right Clock) in an I2S interface is the same as WS (Word Select) or sometimes referred to as LRC (Left Right Clock). This clock signal is used to indicate whether the data being sent is for the left or right audio channel. In the I2S protocol:
  • When LRCLK (WS) is high, data for the right channel is being sent.
  • When LRCLK (WS) is low, data for the left channel is being sent.
This line toggles at half the sample rate frequency, marking the start of each audio sample frame. It ensures that the digital-to-analog converters (DACs) or analog-to-digital converters (ADCs) can correctly allocate the incoming data to the appropriate channel, maintaining proper stereo audio playback or recording.

1

2y
Someone is typing...
20
Will likely use these parts: LED LED Cone

Will likely use these parts: LED LED Cone
1y
Someone is typing...
23
03/29/24 Test Results with 3V-3.7V forward Voltage LED: From a human perspectiv...

1y
@copilot please analyze the previous test result and give me some ideas for why this modified CC buck boost converter is not regulating to the set 2.5A
1y
Based on the oscilloscope trace you've provided, it appears that there is a short transient where the output voltage overshoots to 3.3V before settling down to 2.49V, which is below the desired forward voltage for driving the LED 3V3V to 3.7V3.7V based on the specifications you provided. The LED is designed to operate at a constant current of 2.5A2.5A and a forward voltage within this range, which is not being achieved in this case.
Here are some possible reasons for the observed behavior:
  1. Insufficient Loop Stability: The control loop for the buck-boost converter may not be properly compensated, leading to an unstable response. This could be the result of improper selection of loop compensation components or incorrect control loop design. You should check the compensation network around the feedback pin and potentially adjust the phase margin and gain margin to achieve stable operation.
  2. Inrush Current: The initial overshoot could be due to inrush current as the LED and associated components charge up when power is first applied. You may need to adjust inrush limiting components or the soft-start settings on the converter to manage this transient better.
  3. Inadequate Output Filtering: The capacitor responsible for filtering the output may either have a low capacitance or high Equivalent Series Resistance (ESR), which could cause poor transient response and an inability to maintain the output voltage under dynamic loads. Make sure the output capacitors are sized correctly for the expected load currents and have low ESR.
  4. Incorrect Feedback Network: If the voltage divider or current-sense components in the feedback network are not sized appropriately, the feedback to the PWM controller will be incorrect, causing it to regulate at the wrong voltage/current. Verify that the feedback network is set up to regulate the output at the desired setpoint.
  5. Load Switching Transients: If there's any sort of abrupt load switching happening, it could cause momentary drops in voltage. Such drops could also be due to poor handling of transient loads that the control loop is unable to respond to quickly enough.
  6. Inductor Saturation: If the inductor used in the converter is saturating, this could lead to an inability to maintain the set current. Make sure the inductor is rated for the peak currents expected in the design.
  7. Incorrect or Faulty Components: There is a possibility that some of the critical components, such as power MOSFETs or diodes, are not operating as intended. This could be due to incorrect part selection, components outside their normal operation range, or faulty parts.
  8. Board Layout: Lastly, inadequate PCB layout can contribute to poor regulation and transient response. Ensure that high-current paths are kept short and thick, ground planes are solid and contiguous, and that critical components are placed appropriately to minimize parasitic inductance and resistance.
To troubleshoot, compare the behavior and component values to the typical application circuit provided in the buck-boost converter datasheet. You may need to experiment with different component values or add additional compensation to the control loop. Additionally, measure other important signals, like the feedback voltage, inductor current, and switch node voltage, to gain more insight into the operation of the converter during the transient period.
1y
Someone is typing...
36
size based on equation: (222\*VDD-100)

634kOhms for 3.3V power
2y
size based on equation: (222*VDD-100)
2y
Someone is typing...
19
what is R13 in the voltage divider with a ratio of 5V/3.3V assuming R14 is 10kO...

The purpose of R13/R14 is to monitor the 5V bus so the user can't turn on the flashlight when it's charging
1y
@copilot what is R13 in the voltage divider with a ratio of 5V/3.3V assuming R14 is 10kOhms
1y
To create a voltage divider that outputs 3.3V from a 5V source with R14 as the resistor connected to ground and having a value of 10kΩ, we need to calculate the value of R13, which is the resistor connected to the 5V supply. The voltage divider formula is given by:
Vout=Vin×R14R13+R14V_{out} = V_{in} \times \frac{R_{14}}{R_{13} + R_{14}}
Rearranging the formula to solve for (R_{13}):
R13=R14×(VinVout1)R_{13} = R_{14} \times \left(\frac{V_{in}}{V_{out}} - 1\right)
Plugging in the known values ((V_{in} = 5V), (V_{out} = 3.3V), (R_{14} = 10k\Omega)):
R13=10kΩ×(5V3.3V1)R_{13} = 10k\Omega \times \left(\frac{5V}{3.3V} - 1\right)
R13=10kΩ×(1.5151)R_{13} = 10k\Omega \times (1.515 - 1)
R13=10kΩ×0.515R_{13} = 10k\Omega \times 0.515
R13=5.15kΩR_{13} = 5.15k\Omega
Therefore, to achieve the desired voltage divider ratio of 5V to 3.3V with R14 being 10kΩ, R13 should have a value of approximately 5.15kΩ.
1y
whats the next highest E96 resistor for a 5.1k resistor
1y
The E96 resistor series provides 96 standard values for each decade of resistance. Looking at the E96 series, the standard value immediately higher than 5.1kΩ is 5.11kΩ.
1y
Someone is typing...
25
Could build our own CC buck converter with the ESP32-C3. Max PWM is 40MHz with 1...

LEDs are perfect for the classic isolated load CC using a buck/boost converter
2y
Could build our own CC buck converter with the ESP32-C3. Max PWM is 40MHz with 1 bit resolution. Could theoritically get 12 bit resolution at 3MHz maximum output frequency. Most hard switched - low power bucks operate around there. The ADC on this thing just sucks too hard for active soft switching
2y
Someone is typing...
3
roast my design

@copilot roast my design with sass
1y
Ah, the Lethal Company Pro Flashlight Power Board V1 - a name that promises danger and illumination in equal measure. Let's take a torch to this schematics and see what kind of shadows it casts, shall we?
  1. "Ultra bright" LED Dream vs. Reality Check:
    • Oh, we're aiming for "super bright", are we? Well, using a SST-40 LED is a decent choice for blinding any nearby nocturnal wildlife or unsuspecting pedestrians. But I hope you're not planning on using those for reading bedtime stories. Just remember, with great power (draw) comes great responsibility... and thermal management. Don't let your flashlight turn into an inadvertent hand warmer.
  2. Buck Converter with PID Control - By DIY Hobbyists, For DIY Hobbyists:
    • A DIY microcontroller buck converter with PID duty cycle control for brightness adjustment? Ambitious! It's like deciding to knit your own parachute on the way down. Admirable, really, but have you considered simply using an off-the-shelf driver? It's like cooking - sometimes, semi-homemade is just fine.
  3. Wirelessly Transmits Battery Life... To (Maybe) Ubo:
    • The caveat of "maybe use Ubo to receive this” gives me the same vibe as my diet plans: optimistic but fundamentally flawed. It's the electronic design equivalent of saying, “I might go to the gym later... or maybe just watch Netflix.”
  4. Sound... in a Flashlight:
    • Incorporating a speaker to make a click noise is the kind of feature that screams "because we can" rather than "because we should." It's almost as useful as a chocolate teapot. Let’s just hope folks don’t start using your flashlight as an impromptu musical instrument.
  5. The License to Shine:
    • I spotted that you've slapped a Creative Commons Attribution 4.0 International License on this majestic piece of work. Planning on starting a trend? “Open-source flashlights" - now that’s a movement I can get behind! Just don't expect to see your illumination innovation lighting up the catwalks of Paris anytime soon.
  6. Adding a Button:
    • You noted "TODO: ADD A BUTTON!!" as if you just remembered flashlights typically need an on/off switch. A stroke of brilliance! A button! Why didn’t Edison think of that? Here’s to hoping it’s not forgotten like the lyrics to a song sung only in showers.
  7. The Power of Assumptions:
    • The assumption-based design practice here is avant-garde – like painting a landscape before confirming if trees exist. "Assuming typical values" is the design equivalent of "eyeballing" a recipe. Sometimes it results in a masterpiece; other times, well, you get a salty cake.
In closing, your project teeters on the edge of genius and... the other thing. For a flashlight that seems designed to guide someone through a journey as perilous as its own creation process, I must applaud your courage. Just remember, every great invention started as a "what if?", proceeded through "what the heck?", and concluded with "well, it hasn't exploded yet." Looking forward to seeing this luminary legend come to light – literally.

1

1y
@copilot roast my design
1y
Reviewing your Lethal Company Pro Flashlight Power Board V1 design, here are some insights and opportunities for improvement. Overall, it's a promising project with a lot of potential. My observations are made to help refine and enhance its design, functionality, and reliability. Keep in mind that these critiques are meant to be constructive and are typical of the iterative design process.
General Observations
  • DIY Microcontroller Buck Converter for Constant Current Source: Designing a DIY buck converter with PID control for driving a high-power LED like SST-40 is ambitious. While using a microcontroller for PID control adds flexibility, it also introduces complexity and potential for instability if not properly tuned. The choice of the XIAO ESP32-C3 microcontroller is sensible for its compact size and wireless capabilities. However, ensure you have implemented proper filtering on the ADC inputs to achieve stable current measurements, especially in a noisy environment like a switching power supply.
Power Management
  • Battery Charger Integration (U3: TP4056): It's a good choice for 1S Lithium-Ion charging, but your design would benefit from clearer indication and management of the battery's state of charge. Ensure there's a precise battery voltage monitoring circuit to safely handle charging and discharging, especially if you intend for this device to be "ultra-bright" and draw considerable current.
  • Battery Voltage Monitoring (VBATT_MON_10/43): Including a resistor divider for voltage measurement is a good practice. However, considering the accuracy and the range of voltages you want to monitor, ensure the resistors R12 and R11 are chosen with precise values and tolerances. Additionally, consider the power dissipation on these resistors, given your application's high-power nature.
LED Driving Circuit
  • Constant Current Source for LED: Using a buck converter with a current amplifier in the feedback path (as noted in your description) is smart for maintaining constant current through the LED despite varying battery voltage. However, ensure you've accounted for the efficiency and thermal management of this setup. Heat sinking and thermal vias may be necessary, especially if driving the LED at the high currents required for it to be "super bright."
Audio Feedback
  • I2S Class D Amp (IC2: MAX98357A): Your choice to use the MAX98357A for audio feedback is excellent. Its simplicity and effectiveness with I2S input make it an ideal choice. Ensure the configuration (with the use of the GAIN_SLOT and ~SD_MODE pins) matches your desired volume and shutdown behavior.
Wireless Transmission
  • Battery Life Wireless Transmission: You've noted the desire to wirelessly transmit the battery life. Ensure the ESP32-C3's BLE functionality is optimized for low power consumption. Implementing a service to periodically send battery state could be a way to balance functionality and power efficiency.
User Interface
  • Adding a Button: You've mentioned the need to add a button but haven't specified its function. Ensure that the button has debouncing, either in hardware or software, to improve reliability. Consider its function: will it cycle through brightness levels, turn the device on/off, or activate different modes?
PCB Design and Layout
  • Grounding and Power Distribution: Ensure your PCB layout tightly manages the ground paths to reduce noise, especially important in high-power LED applications and when dealing with sensitive analog measurements for battery monitoring.
  • Component Spacing and Orientation: Without seeing the actual layout, it's critical to place components logically to minimize the path length for critical signals, particularly those involving the high-current LED driver and sensitive analog circuits for battery monitoring.
Component Considerations
  • Passive Components: You've opted for 0402 and 0603 packages for most passive components, which is reasonable, but ensure these components can handle the current, especially in the LED drive path and the power input stages. High-power circuits may require larger or higher-rated components to ensure reliability.
This review focuses on high-level aspects without delving into the minutiae of your schematic, as details on specific connections and voltages are not elaborated. Nonetheless, this examination covers crucial areas for reconsideration and potential improvement. Remember, iterative design is key in electronics; each revision brings you closer to a robust, efficient, and functional design.
1y
Someone is typing...
26
No load, 4V input, buck operation Yellow is input, Purple is output @copilot ex...

1y
Based on the scope capture provided, here is the measurement data in a table format:

Table


ChannelMean VoltagePeak-to-Peak Voltage
CH1 (Yellow)-2.50 V400.00 mV
CH2 (Purple)-3.37 V880.00 mV
Please note that the mean voltage values are negative, which may indicate that the probe is inverted or the waveform is referenced to a higher potential than the probing point. The peak-to-peak voltage is a measure of the waveform's full vertical excursion and represents the difference between the maximum and minimum values of the waveform.
1y
The time scale for the oscilloscope capture provided is 5 microseconds per division ($5 µs/div$). This setting can be observed at the top center of the oscilloscope screen, where it says "M 5.00us".
1y
1y
Based on the oscilloscope capture, here's the information extracted and presented in a table format:

Table


MeasurementSource (Channel)Value
Mean (yellow)CH2 (input)4.01V
Mean (purple)CH2 (output)3.37V
Pk-Pk (yellow)CH2 (input)320.00mV
Pk-Pk (purple)CH2 (output)520.00mV
Please note that "Mean" refers to the average voltage level, while "Pk-Pk" refers to the peak-to-peak voltage, indicating the full range of voltage swing on the respective channels. The colors mentioned correspond to the channels displayed on the oscilloscope screen.
1y
Someone is typing...
33
https://files.seeedstudio.com/wiki/XIAO\_WiFi/pin\_map-2.png

Image

https://files.seeedstudio.com/wiki/XIAO_WiFi/pin_map-2.png
2y
Someone is typing...
16
what is VFB for IC1?

that corresponds to a 87.2kOhms and a roughly 3.3V output voltage
1y
in the modded board, I am going to bypass the current sense amplifier with parallel 100kOhm and 680kOhm resistors for R1 to get a CV output.
1y
@copilot what equation is needed to set the output voltage using the feedback resistors?
1y
To set the output voltage using the feedback resistors for the TPS63020 buck-boost converter (IC1), you need to use the following equation:
R1=R2(VOUT0.5V1)R1 = R2 \cdot \left(\frac{V_{OUT}}{0.5V} - 1\right)
Where:
  • R1 is the resistor connected between VOUT and FB
  • R2 is the resistor connected between FB and GND
  • VOUT is the desired output voltage in volts
The typical current through the FB pin is 0.01uA, and the voltage across R2 should be 500mV for proper regulation. To minimize the effect of the FB pin current on the output voltage, the current through the resistor divider should be at least 100 times greater than the FB pin current. A typical value for R2 is 200kΩ.
For example, if you want a 3.3V output:
  • Choose R2 = 200kΩ
  • Calculate R1 using the equation: $R1 = 200kΩ * (3.3V / 0.5V - 1) = 1.12MΩ$
So to set a 3.3V output, you would use R1 = 1.12MΩ and R2 = 200kΩ. Let me know if you need any other assistance!
1y
@copilot what is VFB for IC1?
1y
Based on the information provided in the schematic, IC1 is a TPS63020DSJR buck-boost converter from Texas Instruments. The VFB pin is the voltage feedback input for the adjustable output voltage versions of this chip.
The typical value of the voltage at the FB pin is 500mV when the output voltage is regulated properly[1]. The VFB pin must be connected to a resistive voltage divider between VOUT and GND to set the output voltage on adjustable versions. On fixed output voltage versions, VFB must be connected directly to VOUT[2].
In this schematic, IC1_FB net is connected to the FB pin of IC1. This net is also connected to a resistive divider formed by R2SET and the output of the current sense amplifier U2M. Therefore, the VFB voltage in this design will depend on the resistor values and the output current.
Some key points about the VFB pin on IC1:
  • Typical voltage is 500mV for proper regulation[1]
  • Must be connected to resistor divider for adjustable output voltages[2]
  • Connects to VOUT directly on fixed voltage versions[2]
  • Connected to current sense amplifier output in this specific design
[1] Page 3
1y
Someone is typing...
39
In the image below, the purple signal is the 3.3V output of the buck boost conve...

1y
Based on the provided image and the description of the purple (channel 1) and yellow (channel 2) waveforms, it seems that the purple waveform represents the 3.3V output voltage of the buck-boost converter (Module1), and the yellow waveform represents the Power Good (PG) output signal from the same buck-boost converter.
The behavior of the PG pin can be summarized as an indicator of whether the output voltage is within the nominal operating range. When the output voltage is above 95% of the nominal voltage, the PG pin typically goes high impedance, signaling that the output is good. When the output voltage falls below typically 90% of the nominal voltage, the PG pin is driven low, indicating that the output is not good.
Specific behavior based on the excerpt would be:
  • When the converter is enabled and VIN is present, the PG output is valid.
  • The PG pin goes low; either when the output voltage falls below typically 90% of the nominal voltage, t... (the message cuts off but it's implied that it indicates a fault condition if the voltage drops this low).
Observing the given oscilloscope image, we cannot make quantitative assertions about voltage levels, but the qualitative behavior shows that the output voltage reaches a steady level and the PG signal is low, indicating that the output voltage may not be within the nominal range or that there is some other condition causing the PG pin to indicate a fault. Without more context or a clear depiction of voltage levels, it's difficult to diagnose the specific issue beyond this generalized behavior.
1y
@copilot thanks for the explanation. Looks like I forgot to put a pullup resistor there
1y
You're welcome! Yes, many Power Good (PG) outputs on integrated circuits are open-drain or open-collector, which means they require an external pull-up resistor to output a high signal. These pins can only sink current to pull the voltage low; they cannot source current to drive the voltage high.
The presence of a pull-up resistor ensures that when the converter's output is within the valid range, the PG pin goes to a high logic level, thereby providing a clear indication of the power status. Without the pull-up resistor, the PG pin will be floating when it should indicate a high state, resulting in an undefined voltage level on the pin which may be interpreted incorrectly by downstream circuits.
Adding a pull-up resistor to the PG pin, connected to a stable voltage rail (often to the same voltage rail that the PG pin is monitoring, but it can be any stable voltage appropriate for the logic level of the downstream circuits) should resolve the issue and allow for proper monitoring of the buck-boost converter's output.
The value of the pull-up resistor might typically range from 4.7kΩ4.7k\Omega to 100kΩ100k\Omega, depending on the requirements of the circuit, such as power consumption and the input characteristics of whatever logic is reading the PG signal.
1y
Someone is typing...
28
V1 Mistake: Forgot to put pullup resistor on PG of this buck boost converter.

V1 Mistake: Forgot to put pullup resistor on PG of this buck boost converter.
1y
Someone is typing...
29
I want f to be greater than 400kHz. D = 0.02, Vout = 3.3V, Iout=2.5A. What value...

2y
The formula in the image provided relates the Right-Half-Plane Zero (RHPZ) frequency (( f_{RHPZ} )) to the duty cycle (D), output voltage (( V_{\text{out}} )), output current (( I_{\text{out}} )), and inductance (L). Given your specifications, where ( D = 0.02 ), ( V_{\text{out}} = 3.3V ), and ( I_{\text{out}} = 2.5A ), we can rearrange the formula to solve for ( L ) to ensure that ( f_{RHPZ} ) is greater than 400kHz.
First, let's rearrange the formula to solve for ( L ):
L=(1D)2×Vout2π×fRHPZ×IoutL = \frac{(1 - D)^2 \times V_{\text{out}}}{2\pi \times f_{RHPZ} \times I_{\text{out}}}
Now, plugging in the values:
L=(10.02)2×3.3V2π×400kHz×2.5AL = \frac{(1 - 0.02)^2 \times 3.3V}{2\pi \times 400kHz \times 2.5A}
Calculating ( L ):
L=(0.98)2×3.3V2π×400kHz×2.5AL = \frac{(0.98)^2 \times 3.3V}{2\pi \times 400kHz \times 2.5A} L=0.9604×3.3V2π×400kHz×2.5AL = \frac{0.9604 \times 3.3V}{2\pi \times 400kHz \times 2.5A} L=3.169322π×105×2.5L = \frac{3.16932}{2\pi \times 10^5 \times 2.5} L3.169321.5708×106L \approx \frac{3.16932}{1.5708 \times 10^6} L2.018×106HL \approx 2.018 \times 10^{-6} H L2.02μHL \approx 2.02 \mu H
To keep the ( f_{RHPZ} ) greater than 400kHz, you would need an inductor with an inductance of at least ( 2.02 \mu H ). However, to avoid operating right at the edge of the desired frequency range, you may want to use a slightly larger inductance value.
Remember to verify the inductor's current rating and choose one that can handle the expected current without saturation.
2y
It appears there was some confusion in my previous calculation. After re-evaluating the calculation and confirming with the Wolfram Alpha result provided, you are correct that the inductance (L) required to keep the frequency (f) above 400kHz, given the specified parameters, would be:
L=(0.98)2×3.3V2π×400000Hz×2.5AL = \frac{(0.98)^2 \times 3.3V}{2\pi \times 400000Hz \times 2.5A}
Plugging these values into the equation should indeed result in an inductance of approximately 0.5 microhenries (0.5uH) to maintain the desired frequency. Let's double-check the math:
L=(0.982)×3.32π×400000×2.5L = \frac{(0.98^2) \times 3.3}{2\pi \times 400000 \times 2.5} L=0.9604×3.32π×400000×2.5L = \frac{0.9604 \times 3.3}{2\pi \times 400000 \times 2.5} L=3.169322π×1000000L = \frac{3.16932}{2\pi \times 1000000} L5.04413×107HL \approx 5.04413 \times 10^{-7} H L0.504uHL \approx 0.504 uH
As per the Wolfram Alpha result, the inductance required would be indeed around 0.5uH, which is consistent with the output you obtained. This value is for the right-half-plane zero frequency (f_RHPZ), which you would want to be above the 400kHz operating frequency.
It's important to note that when choosing or designing inductors for a switching power supply, other factors such as peak current handling, DC resistance (DCR), and saturation characteristics must also be considered to ensure reliable operation.
2y
Someone is typing...
10
please provide me with c macros of the format #define MACRO\_NAME VALUE where th...

please provide me with c macros of the format #define MACRO_NAME VALUE where the MACRO_NAME is the net label and the VALUE is the pin name of U4
1y
Here are the requested C macros for the U4 pin connections in your project:
#define I2S_BCLK GPIO3_A1_D1 #define I2S_DIN GPIO2_A0_D0 #define I2S_LRCLK GPIO4_A2_D2 #define LED_CC_2_5A_PG D9_MISO_GPIO9 #define LED_CC_2_5A_EN D10_MOSI_D10 #define I2C_SDA GPIO6_SDA_D4 #define I2C_SCL GPIO7_SCL_D5 #define VBATT_MON_10_43 GPIO5_A3_D3 #define _3_3V_BUCK_BOOST_PG D8_SCK_GPIO8 #define SW_DIGITAL GPIO21_TX_D6 #define _5V_MON_50_33 D7_RX_GPIO20
Let me know if you need anything else!
1y
Someone is typing...
34
Buck converter CC reference design

Buck converter CC reference design
2y
Someone is typing...
5
IC1 is a buck boost converter that uses a current sense amplifier to set a curre...

@copilot IC1 is a buck boost converter that uses a current sense amplifier to set a current-based set point to create a CC source. I'm not confident about the feedback path, nor am I confident about the enable pin. Can you please create a test plan in table form to validate the cases that this circuit will operate under? No load , 2.5A, 3.3V load. In all cases, I want to check ability to regulate, and that there are no overshoots in the transient.
1y
Here is the test plan with the requested changes:

Table


Test CaseLoad ConditionExpected BehaviorMeasurements
1No load- Converter maintains output voltage at $3.3V$- Output current is close to $0A$- No overshoot during enable/disable- Output voltage- Output current- Transient response
2$2.5A$ constant current load- Converter regulates output current at $2.5A$- Output voltage adjusts to maintain constant current- No overshoot during load transients- Output current- Output voltage- Transient response
3$3.3V$ constant voltage load- Converter regulates output voltage at $3.3V$- Output current adjusts to maintain constant voltage- No overshoot during load transients- Output voltage- Output current- Transient response
4Enable/disable functionality- Converter enables and disables cleanly without overshoots or undershoots- Output current and voltage remain stable during enable/disable events- Enable/disable behavior- Output voltage- Output current
5Feedback path validation- Current sense amplifier U2M accurately measures output current- Feedback voltage at IC1 FB pin corresponds to expected current setpoint- Current sense amplifier output- Feedback voltage at IC1 FB pin
To perform these tests:
  1. Set up the circuit with appropriate test points to measure output voltage, output current, and key feedback signals.
  2. Use a programmable load or electronic load to simulate the different load conditions $($no load, constant current, constant voltage$)$.
  3. Use an oscilloscope to capture transient responses during load changes and enable/disable events.
  4. Verify that the measured output voltage, output current, and feedback signals match the expected behavior for each test case.
  5. If any issues are observed, debug the feedback path and enable circuitry to ensure proper operation of the constant current buck-boost converter.
Let me know if you have any other questions or if you'd like me to clarify any part of the test plan!
1y
@copilot IC1 is a buck boost converter that uses a current sense amplifier to set a current-based set point to create a CC source. I'm not confident about the feedback path, nor am I confident about the enable pin. Can you please create a test plan to validate the cases that this circuit will operate under? No load , 2.5A, 3.3V load. In all cases, I want to check ability to regulate, and that there are no overshoots in the transient.
1y
Here is a test plan to validate the operation of the IC1 buck-boost converter circuit under different load conditions:
Test Case 1: No load
  1. Disconnect any load from the LED_CC_2.5A output.
  2. Apply power to the circuit $VBATT$.
  3. Check that the LED_CC_2.5A output voltage is at the expected set point $measure with multimeter$.
  4. Monitor the LED_CC_2.5A output with an oscilloscope during startup to check for any voltage overshoots or instability.
  5. Toggle the EN pin $R4$ and observe clean startup and shutdown of the output voltage.
Test Case 2: 2.5A constant current load
  1. Connect an electronic load in constant current mode set to 2.5A on the LED_CC_2.5A output.
  2. Apply power to the circuit $VBATT$.
  3. Check that the LED_CC_2.5A output current is regulating at 2.5A $measure with multimeter or electronic load readback$.
  4. Monitor the LED_CC_2.5A output with an oscilloscope during startup to check for any current or voltage overshoots or instability.
  5. Toggle the EN pin $R4$ and observe clean startup and shutdown of the output current.
  6. Vary the electronic load current up and down between 0-2.5A and verify the output current tracks the setting.
Test Case 3: 3.3V constant voltage load
  1. Connect a 3.3V constant voltage load on the LED_CC_2.5A output $use a power resistor or electronic load in CV mode$. Size the load resistance to draw less than 2.5A.
  2. Apply power to the circuit $VBATT$.
  3. Check that the LED_CC_2.5A output voltage is regulating at 3.3V $measure with multimeter$.
  4. Monitor the output with a scope during startup to check for overshoots or instability.
  5. Toggle EN and observe clean startup and shutdown.
  6. Vary the load current up and down $by changing the load resistance or electronic load setting$ and verify the output voltage remains at 3.3V.
Additional tests:
  • Monitor the PG output $IC1 pin 14$ during the above tests and verify it indicates power good.
  • Check the current sense amplifier $U2M$ output during the tests, especially 2.5A loading. Verify it is providing the correct feedback signal to IC1.
  • Test operation at the limits of the input voltage range.
Let me know if you have any other questions! The key things to check are the feedback path operation, transient response, enable functionality, and general circuit stability under the different loading scenarios.
1y
Someone is typing...
40
what is the minimum common mode operating voltage to power the analog circuitry ...

welp. this is why my SMPS isn't regulating...
1y
@copilot what is the minimum common mode operating voltage to power the analog circuitry for U2M?
1y
According to the recommended operating conditions for the ZXCT1110 $which U2M is$, the minimum common-mode input voltage range $VS+$ is 2.5V[1].
[1] Page 2
1y
Someone is typing...
38
can play mp3s on SPIFFs using this library But maybe should also include SD Car...

can play mp3s on SPIFFs using this library
But maybe should also include SD Card just in case.
2y
Someone is typing...
17
With only 50mW through the sense resistor, consider an alternative that is sligh...

With only 50mW through the sense resistor, consider an alternative that is slightly more thermally stable: WSL12068L000FEA (75ppm/C vs 100ppm/C)
2y
Someone is typing...
7
Can you calculate Ipeak? Iout is about 2.5A, D is about 0.02 and VIN is 2.8V. Th...

Copilot calculated Ipeak to be around 3.2A. Our 7A inductor is well suited for this application
2y
2y
To calculate IPEAKI_{PEAK}, we can use the equation provided in the image you attached. We have the following known values:
  • IOUT=2.5AI_{OUT} = 2.5\,A
  • η=0.8\eta = 0.8
  • D=0.02D = 0.02
  • VIN=2.8VV_{IN} = 2.8\,V
  • f=2,400,000Hzf = 2,400,000\,Hz
  • L=0.000001HL = 0.000001\,H (1uH)
Now, we can plug these values into the formula:
IPEAK=IOUTη×(1D)+VIN×D2×f×LI_{PEAK} = \frac{I_{OUT}}{\eta \times (1 - D)} + \frac{V_{IN} \times D}{2 \times f \times L}
Calculating the first term 2.5A0.8×(10.02)\frac{2.5A}{0.8 \times (1 - 0.02)}:
=2.5A0.8×0.98= \frac{2.5A}{0.8 \times 0.98} =2.5A0.784= \frac{2.5A}{0.784} =3.1888A= 3.1888\,A
Now calculating the second term 2.8V×0.022×2,400,000Hz×0.000001H\frac{2.8V \times 0.02}{2 \times 2,400,000Hz \times 0.000001H}:
=0.056V4.8A= \frac{0.056V}{4.8\,A} =0.0000117A= 0.0000117\,A =11.7μA= 11.7\,\mu A
Adding both terms to find IPEAKI_{PEAK}:
3.1888A+0.0000117A3.1888\,A + 0.0000117\,A 3.1888A\approx 3.1888\,A
Rounded to four significant figures, and considering the second term is negligible, IPEAK3.1888AI_{PEAK} \approx 3.1888\,A.

1

2y
Someone is typing...
9
R1MON @ 2.5A = 2.5\*0.008 = 0.02V U2M\_IOUT @ 2.5A = 0.004\*0.02 = 0.00008 A V...

R1MON @ 2.5A = 2.5*0.008 = 0.02V
U2M_IOUT @ 2.5A = 0.004*0.02 = 0.00008 A
VIC1_FB @2.5A = 15.8e3*8e-5 = 1.264V
1y
Someone is typing...
37
design me a voltage divider for a battery monitor. My LiIon cell goes up to 4.2V...

try to do something were you prioritize the voltage when the flashlight turns off to report the battery state.
1y
wow good job
1y
@copilot design me a voltage divider for a battery monitor. My LiIon cell goes up to 4.2V and my ADC has a max input voltage of 1V
1y
Designing a voltage divider for monitoring a lithium-ion battery with a maximum voltage of 4.2V using an ADC (Analog-to-Digital Converter) with a maximum input voltage of 1V involves choosing appropriate resistor values that scale down the battery voltage to within the ADC's input range without significantly loading the battery. The voltage divider equation can be used for this purpose:
Vout=Vin×R2R1+R2V_{out} = V_{in} \times \frac{R_2}{R_1 + R_2}
where:
  • (V_{out}) is the output voltage to the ADC (target is 1V),
  • (V_{in}) is the input voltage from the battery (maximum is 4.2V),
  • (R_1) is the top resistor connected to the battery,
  • (R_2) is the bottom resistor connected to the ground.
Given that (V_{out} = 1V) and (V_{in} = 4.2V), we need to select (R_1) and (R_2) such that the ratio (\frac{R_2}{R_1 + R_2}) equals (\frac{1}{4.2}). However, to minimize the power consumption and not to load the battery significantly, we'll choose resistor values in the higher range (e.g., in the kΩ range).
Assuming typical resistor values:
Let's choose (R_2\ = 10kΩ). We can calculate (R_1) as follows:
R2R1+R2=14.2\frac{R_2}{R_1 + R_2} = \frac{1}{4.2}
Solving this for (R_1) gives:
R1=R2×(VinVout1)R_1 = R_2 \times \left(\frac{V_{in}}{V_{out}} - 1\right)
Substituting the given values:
R1=10kΩ×(4.21)R_1 = 10kΩ \times (4.2 - 1)
R1=10kΩ×3.2=32kΩR_1 = 10kΩ \times 3.2 = 32kΩ
However, since 32kΩ is not a standard resistor value, you can use standard E12 series values close to 32kΩ, such as 33kΩ.
Components for the voltage divider:
  • For (R_1): Choose 33kΩ (closest E12 value)
  • For (R_2): Use 10kΩ
Connection Summary:
  1. Connect BT1:(+) to R1:1 (where R1 is 33kΩ).
  2. Connect R1:2 to R2:1 (where R2 is 10kΩ) and to the ADC input.
  3. Connect R2:2 to GND.
Important Considerations:
  • Power Consumption: This voltage divider will continuously draw current from the battery. The current ((I_{VD})) through the voltage divider is given by (I_{VD} = \frac{V_{in}}{R_1 + R_2}). For 4.2V across 43kΩ, this results in a current of approximately 97.67μA, which is acceptable for most applications but should be minimized for low power applications.
  • Loading Effect: Ensure the input impedance of the ADC is significantly higher than (R_2) (at least 10 times higher) to minimize loading effects.
  • Periodic Measurement: If power consumption is a concern, consider using a high-side switch to connect the divider to the battery only during measurement intervals.
This setup will allow you to monitor the battery voltage through the ADC without exceeding its maximum input voltage specification.
1y
Someone is typing...
24
PG is open drain and needs a pullup resistor on the 3.3V net for the ESP32-C3

PG is open drain and needs a pullup resistor on the 3.3V net for the ESP32-C3
2y
Someone is typing...
11
C1
Capacitance
0.1u F
LED_CC_2.5A
VINA
C9
Capacitance
0.1u F
U2M
GND
R1IMON
Resistance
8m Ω
Power
1 W
+3.3V
C2C
Capacitance
22u F
Voltage
10 V
U4
C2A
Capacitance
22u F
Voltage
10 V
+3V3
R2SET
Resistance
15.8k Ω
C2D
Capacitance
22u F
Voltage
10 V
IC1_FB
C2B
Capacitance
22u F
Voltage
10 V
+5V
C10
Capacitance
10u F
+3.3V
LED_CC_2.5A
IC1
IC1_FB


  • Ground
    A common return path for electric current. Commonly known as ground.
  • Net Portal
    Wirelessly connects nets on schematic. Used to organize schematics and separate functional blocks. To wirelessly connect net portals, give them same designator. #portal
  • Power Net Portal
    Wirelessly connects power nets on schematic. Identical to the net portal, but with a power symbol. Used to organize schematics and separate functional blocks. To wirelessly connect power net portals, give them the same designator. #portal #power
  • Generic Resistor
    A generic fixed resistor for rapid developing circuit topology. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard resistor values: 1.0Ω 10Ω 100Ω 1.0kΩ 10kΩ 100kΩ 1.0MΩ 1.1Ω 11Ω 110Ω 1.1kΩ 11kΩ 110kΩ 1.1MΩ 1.2Ω 12Ω 120Ω 1.2kΩ 12kΩ 120kΩ 1.2MΩ 1.3Ω 13Ω 130Ω 1.3kΩ 13kΩ 130kΩ 1.3MΩ 1.5Ω 15Ω 150Ω 1.5kΩ 15kΩ 150kΩ 1.5MΩ 1.6Ω 16Ω 160Ω 1.6kΩ 16kΩ 160kΩ 1.6MΩ 1.8Ω 18Ω 180Ω 1.8KΩ 18kΩ 180kΩ 1.8MΩ 2.0Ω 20Ω 200Ω 2.0kΩ 20kΩ 200kΩ 2.0MΩ 2.2Ω 22Ω 220Ω 2.2kΩ 22kΩ 220kΩ 2.2MΩ 2.4Ω 24Ω 240Ω 2.4kΩ 24kΩ 240kΩ 2.4MΩ 2.7Ω 27Ω 270Ω 2.7kΩ 27kΩ 270kΩ 2.7MΩ 3.0Ω 30Ω 300Ω 3.0KΩ 30KΩ 300KΩ 3.0MΩ 3.3Ω 33Ω 330Ω 3.3kΩ 33kΩ 330kΩ 3.3MΩ 3.6Ω 36Ω 360Ω 3.6kΩ 36kΩ 360kΩ 3.6MΩ 3.9Ω 39Ω 390Ω 3.9kΩ 39kΩ 390kΩ 3.9MΩ 4.3Ω 43Ω 430Ω 4.3kΩ 43KΩ 430KΩ 4.3MΩ 4.7Ω 47Ω 470Ω 4.7kΩ 47kΩ 470kΩ 4.7MΩ 5.1Ω 51Ω 510Ω 5.1kΩ 51kΩ 510kΩ 5.1MΩ 5.6Ω 56Ω 560Ω 5.6kΩ 56kΩ 560kΩ 5.6MΩ 6.2Ω 62Ω 620Ω 6.2kΩ 62KΩ 620KΩ 6.2MΩ 6.8Ω 68Ω 680Ω 6.8kΩ 68kΩ 680kΩ 6.8MΩ 7.5Ω 75Ω 750Ω 7.5kΩ 75kΩ 750kΩ 7.5MΩ 8.2Ω 82Ω 820Ω 8.2kΩ 82kΩ 820kΩ 8.2MΩ 9.1Ω 91Ω 910Ω 9.1kΩ 91kΩ 910kΩ 9.1MΩ #generics #CommonPartsLibrary
  • Generic Capacitor
    A generic fixed capacitor ideal for rapid circuit topology development. You can choose between polarized and non-polarized types, its symbol and the footprint will automatically adapt based on your selection. Supported options include standard SMD sizes for ceramic capacitors (e.g., 0402, 0603, 0805), SMD sizes for aluminum electrolytic capacitors, and through-hole footprints for polarized capacitors. Save precious design time by seamlessly add more information to this part (value, footprint, etc.) as it becomes available. Standard capacitor values: 1.0pF 10pF 100pF 1000pF 0.01uF 0.1uF 1.0uF 10uF 100uF 1000uF 10,000uF 1.1pF 11pF 110pF 1100pF 1.2pF 12pF 120pF 1200pF 1.3pF 13pF 130pF 1300pF 1.5pF 15pF 150pF 1500pF 0.015uF 0.15uF 1.5uF 15uF 150uF 1500uF 1.6pF 16pF 160pF 1600pF 1.8pF 18pF 180pF 1800pF 2.0pF 20pF 200pF 2000pF 2.2pF 22pF 20pF 2200pF 0.022uF 0.22uF 2.2uF 22uF 220uF 2200uF 2.4pF 24pF 240pF 2400pF 2.7pF 27pF 270pF 2700pF 3.0pF 30pF 300pF 3000pF 3.3pF 33pF 330pF 3300pF 0.033uF 0.33uF 3.3uF 33uF 330uF 3300uF 3.6pF 36pF 360pF 3600pF 3.9pF 39pF 390pF 3900pF 4.3pF 43pF 430pF 4300pF 4.7pF 47pF 470pF 4700pF 0.047uF 0.47uF 4.7uF 47uF 470uF 4700uF 5.1pF 51pF 510pF 5100pF 5.6pF 56pF 560pF 5600pF 6.2pF 62pF 620pF 6200pF 6.8pF 68pF 680pF 6800pF 0.068uF 0.68uF 6.8uF 68uF 680uF 6800uF 7.5pF 75pF 750pF 7500pF 8.2pF 82pF 820pF 8200pF 9.1pF 91pF 910pF 9100pF #generics #CommonPartsLibrary
  • Generic Inductor
    A generic fixed inductor for rapid developing circuit topology. *You can now change the footprint and 3D model at the top level anytime you want. This is the power of #generics
  • Terminal
    Terminal
    An electrical connector acting as reusable interface to a conductor and creating a point where external circuits can be connected.
  • RMCF0805JT47K0
    47 kOhms ±5% 0.125W, 1/8W Chip Resistor 0805 (2012 Metric) Automotive AEC-Q200 Thick Film #forLedBlink
  • 875105359001
    10uF Capacitor Aluminum Polymer 20% 16V SMD 5x5.3mm #forLedBlink #commonpartslibrary #capacitor #aluminumpolymer #radialcan
  • CTL1206FYW1T
    Yellow 595nm LED Indication - Discrete 1.7V 1206 (3216 Metric) #forLedBlink

Inspect

Lethal Company Pro Flashlight Power Board V1

Lethal Company Pro Flashlight Power Board V1
Description

Created
Last updated by markwuflux
1 Contributor(s)
markwuflux

Controls

Availability & Pricing

DistributorQty 1
Digi-Key$9.13–$12.61
LCSC$5.31–$5.36
Mouser$13.90

Assets