//This example code shows how to use Flux's API (https://docs.flux.ai/reference/api-overview) to add an LED simulator model to a part.
//It also changes the symbol to signal schematic users when the LED is turned on and when it's turned off based on simulator data.
//You can find this part in use in the Astable multivibrator example in your profile.
//Assigning the object ID of the terminals in the schematic editor to two variables
const anodeTerminalId = "63b04c1b-436c-3804-2af5-f29f2e88399c"; // Anode terminal ID
const cathodeTerminalId = "e5f77de8-474b-cc14-8e87-78778e0da1c6"; // Cathode terminal ID
//Get terminal objects by ID.
const anodeTerminal = flux.getNodeById(anodeTerminalId, "elementTerminal");
const cathodeTerminal = flux.getNodeById(cathodeTerminalId, "elementTerminal");
//Create the output nodes that will be visible to users in the simulator tab on the schematic
const outputVoltage = flux.createOutputNode("vout");
const inputVoltage = flux.createOutputNode("vin");
const current = flux.createOutputNode("I");
const voltageDrop = flux.createOutputNode("vdrop");
//Setting up basic parameters of an LED. You can modify these parameters and see how the simulation changes when you put it in a project
const seriesResistance = 0.42;
const emissionCoefficient = 3.73;
const saturationCurrent = 93.2e-12;
fede223
copilot
- LM2577 - Boost Converter IC
- Inductor (L1) - A value like 100µH is common.
- Diode (D1) - Schottky diode (such as 1N5819)
- Input Capacitor (C1) - Typically 100µF, rated for voltage above input supply.
- Output Capacitor (C2) - Typically 100µF, rated for voltage above desired output.
- Feedback Resistors (R1, R2) - To set the output voltage.
Basic Connections- Connect LM2577:VIN to one side of C1, L1; connect other side of C1 and L1 to GND.
- Connect LM2577:SW to D1:kathode, and one side of L1.
- Connect D1:anode to VOUT.
- Connect LM2577:VOUT to one side of C2; connect other side of C2 to GND.
- Connect R1 between LM2577:VOUT and R2; connect other end of R2 to GND; connect middle node of R1 and R2 to LM2577:FB.
Assumptions and Notesfede223
copilot
- Connect LM2577:VIN to one side of C1, other side of C1 to GND.
- Connect LM2577:SW to one side of L1 and to D1:kathode, other side of L1 and D1:anode to VOUT.
- Connect LM2577:VOUT to one side of C2, other side of C2 to GND.
- Connect R1 between LM2577:VOUT and the junction with R2.
- Connect R2 from the junction with R1 to GND.
- Connect the junction of R1 and R2 to LM2577:FB.
Next Steps: