Chat
Step 3: Retrieve the Values of the Current Limiting Resistors Step 4: Calculate the Current Through the LEDsNote: The datasheet for NCD0603C1 is not available, but we will use similar values as NCD0603R1 due to the same manufacturer and similar characteristics.
Python
# Constants V_source = 3.3 # Supply voltage in volts V_f = 2.0 # Forward voltage in volts I = 20e-3 # Desired current in amperes (20mA) # Calculate the current limiting resistor R = (V_source - V_f) / I R
Python
# Constants V_source = 3.3 # Supply voltage in volts V_f = 2.0 # Forward voltage in volts I = 20e-3 # Desired current in amperes (20mA) # Calculate the current limiting resistor R = (V_source - V_f) / I R
Python
import matplotlib.pyplot as plt # Defining the components components = { "RP2040": {"voltage": 3.3, "current": 100e-3}, # Assuming average operating current "LoRa-E5": {"voltage": 3.3, "current": 50e-3}, # Operation current considering max 10dBm transmission "SPH0645LM4H-B": {"voltage": 3.3, "current": 600e-6}, # Data from project "W25Q128JVSIQ": {"voltage": 3.3, "current": 25e-6}, # Typical standby current "RT8059GJ5": {"voltage": 3.3, "current": 100e-6}, # Assumption "CN3063": {"voltage": 3.7, "current": 1e-3}, # Typical current during operation "LED (Green)": {"voltage": 3.3, "current": 20e-3}, # Typical emission current "LED (Red)": {"voltage": 3.3, "current": 20e-3}, # Typical emission current } # Calculate power consumption for each component power_consumption = {k: v['voltage'] * v['current'] for k, v in components.items()} # Calculate total power consumption total_power = sum(power_consumption.values()) # Create percentages for the donut chart power_percentage = {k: (v / total_power) * 100 for k, v in power_consumption.items()} # Plotting the donut chart fig, ax = plt.subplots(figsize=(10, 7)) wedges, texts, autotexts = ax.pie(power_percentage.values(), labels=power_percentage.keys(), autopct='%1.1f%%', startangle=140, pctdistance=0.85) centre_circle = plt.Circle((0,0),0.70,fc='white') fig.gca().add_artist(centre_circle) ax.axis('equal') plt.title("Power Consumption Distribution of AvocAudio Components") plt.show()
commentFileId-4a6842ff1cf09f6bc9db24ccb7bc6c30f9b98c2763eb9e9bd86d86e302713a28
Code Interpreter Playground: AvocAudio: A tinyML community board
collinsemasi
copilot
collinsemasi
copilot
V=3.3V
/tmp/ipykernel_12/3418592907.py:40: UserWarning: FixedFormatter should only be used together with FixedLocator ax[1].set_xticklabels(labels, rotation=45, ha='right')commentFileId-9c90385dbe5a3910ba7684c812a8b9465c2ced2fb5792c5db35acd8b39eaf49a
Table