MustafaMulla29/bluetooth-connected-pedometer
It defines a PCB footprint and schematic symbol for a row of solder pads used as wire connection points, featuring customizable spacing and label annotations.
- Version
- 0.3.0
- License
- unset
- Stars
- 0
Use with the tscircuit CLI
tsci is the tscircuit CLI. Install it with npm install -g tscircuit.
tsci clone MustafaMulla29/bluetooth-connected-pedometer # download the package files into ./bluetooth-connected-pedometer
tsci add MustafaMulla29/bluetooth-connected-pedometer # add it to your project as @tsci/MustafaMulla29.bluetooth-connected-pedometerIn a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.
scripts/power_budget.py
#!/usr/bin/env python3
"""Design estimate, not a measured battery-life result. Current at battery input."""
import argparse, json
p = argparse.ArgumentParser()
p.add_argument('--capacity-mah', type=float, default=100)
p.add_argument('--usable', type=float, default=.8)
p.add_argument('--views-per-day', type=float, default=30)
p.add_argument('--seconds-per-view', type=float, default=5)
p.add_argument('--display-ma', type=float, default=20)
p.add_argument('--gauge-ua', type=float, default=50)
a = p.parse_args()
if min(a.capacity_mah, a.usable) <= 0 or a.usable > 1 or min(a.views_per_day, a.seconds_per_view, a.display_ma, a.gauge_ua) < 0:
p.error('Use a positive capacity, usable fraction in (0,1], and nonnegative currents/times.')
duty = min(1, a.views_per_day*a.seconds_per_view/86400)
items = {
'CC2340R5 module standby allowance': 2.0,
'BMA400 step counter': 4.0,
'BQ27427 gauge': a.gauge_ua,
'BQ25186 battery-only typical': 4.0,
'TPS22917 display switch off allowance': .1,
'TPS7A02 allowance': .1,
'Radio events average (assumed)': 15.0,
'MCU processing average (assumed)': 10.0,
'Bus activity, leakage, tolerances allowance': 5.0,
'OLED duty cycle': a.display_ma * 1000 * duty,
}
ua = sum(items.values())
print(json.dumps({'assumptions': vars(a), 'average_current_ua': items,
'total_average_ua': round(ua, 3), 'runtime_days': round(a.capacity_mah*a.usable/(ua/1000)/24, 2)}, indent=2))