viewof num_sensors = Inputs.range([100, 10000], {value: 3800, step: 100, label: "Number of sensors"})
viewof sensor_cost = Inputs.range([50, 500], {value: 250, step: 10, label: "Sensor cost ($)"})
viewof install_hours = Inputs.range([0.5, 4], {value: 2, step: 0.5, label: "Installation hours per sensor"})
viewof labor_rate = Inputs.range([30, 100], {value: 50, step: 5, label: "Labor rate ($/hour)"})
viewof gateway_cost = Inputs.range([500, 5000], {value: 2000, step: 100, label: "Gateway cost ($)"})
viewof sensors_per_gateway = Inputs.range([50, 500], {value: 200, step: 50, label: "Sensors per gateway"})
viewof software_integration = Inputs.range([50000, 500000], {value: 150000, step: 10000, label: "Software integration ($)"})
viewof annual_revenue = Inputs.range([1000000, 200000000], {value: 80000000, step: 1000000, label: "Annual revenue benefit ($)"})Barcelona Parking TCO Calculator
Barcelona Parking TCO Calculator
animation
applications
smart-parking
Try Change Number of sensors, then press Calculate TCO.
Observe After Calculate TCO, watch Year 0 Investment, Annual Operating, and 5-Year TCO.
Explain Explain why Number of sensors changes Per-Sensor TCO after Calculate TCO.
Technical boundaries. The model repeats annual operating and hidden costs over 5 years. Battery replacement, sensor failures, software licensing, and staff cost use fixed assumptions.
Barcelona Parking TCO Calculator
Use this calculator to estimate the total cost of ownership for a smart parking deployment similar to Barcelona’s system.
hardware_cost = num_sensors * sensor_cost
installation_cost = num_sensors * install_hours * labor_rate
num_gateways = Math.ceil(num_sensors / sensors_per_gateway)
gateway_total = num_gateways * gateway_cost
year0_total = hardware_cost + installation_cost + gateway_total + software_integration
// Annual operating costs
battery_replacement = num_sensors * 0.20 * 20
gateway_connectivity = num_gateways * 30 * 12
cloud_hosting = num_sensors * 0.50 * 12
software_licensing = 25000
staff_cost = 65000
annual_operating = battery_replacement + gateway_connectivity + cloud_hosting + software_licensing + staff_cost
// Hidden costs
sensor_failures = num_sensors * 0.05 * 350
network_troubleshooting = 10 * 500
software_updates = 12000
integration_maintenance = 18000
annual_hidden = sensor_failures + network_troubleshooting + software_updates + integration_maintenance
// 5-year TCO
annual_total = annual_operating + annual_hidden
tco_5year = year0_total + (annual_total * 5)
per_sensor_tco = tco_5year / num_sensors
// ROI calculations
revenue_5year = annual_revenue * 5
net_benefit = revenue_5year - tco_5year
roi_percent = (net_benefit / tco_5year) * 100
payback_days = (tco_5year / annual_revenue) * 365
{
const colors = {
navy: '#1F2937',
teal: '#0F766E',
orange: '#B45309',
blue: '#1D4ED8',
gray: '#4B5563',
purple: '#7E22CE',
red: '#B91C1C'
};
return html`
<div style="background: #f8f9fa; padding: 20px; border-radius: 8px; margin: 20px 0;">
<div class="iot-cases-calc-heading">5-Year TCO Analysis</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px;">
<div style="background: white; padding: 15px; border-radius: 6px; border-left: 4px solid ${colors.navy};">
<div style="font-size: 0.85em; color: ${colors.gray};">Year 0 Investment</div>
<div style="font-size: 1.5em; font-weight: bold; color: ${colors.navy};">$${year0_total.toLocaleString()}</div>
</div>
<div style="background: white; padding: 15px; border-radius: 6px; border-left: 4px solid ${colors.teal};">
<div style="font-size: 0.85em; color: ${colors.gray};">Annual Operating</div>
<div style="font-size: 1.5em; font-weight: bold; color: ${colors.teal};">$${annual_total.toLocaleString()}/yr</div>
</div>
<div style="background: white; padding: 15px; border-radius: 6px; border-left: 4px solid ${colors.orange};">
<div style="font-size: 0.85em; color: ${colors.gray};">5-Year TCO</div>
<div style="font-size: 1.5em; font-weight: bold; color: ${colors.orange};">$${tco_5year.toLocaleString()}</div>
</div>
<div style="background: white; padding: 15px; border-radius: 6px; border-left: 4px solid ${colors.blue};">
<div style="font-size: 0.85em; color: ${colors.gray};">Per-Sensor TCO</div>
<div style="font-size: 1.5em; font-weight: bold; color: ${colors.blue};">$${per_sensor_tco.toFixed(0)}</div>
</div>
</div>
<div class="iot-cases-calc-heading">Cost Breakdown (Year 0)</div>
<table style="width: 100%; background: white; border-radius: 6px; overflow: hidden; margin-bottom: 20px;">
<tr style="background: ${colors.navy}; color: white;">
<th style="padding: 10px; text-align: left;">Component</th>
<th style="padding: 10px; text-align: right;">Cost</th>
</tr>
<tr style="border-bottom: 1px solid #eee;">
<td style="padding: 10px;">${num_sensors} sensors @ $${sensor_cost}</td>
<td style="padding: 10px; text-align: right;">$${hardware_cost.toLocaleString()}</td>
</tr>
<tr style="border-bottom: 1px solid #eee;">
<td style="padding: 10px;">Installation (${install_hours}h @ $${labor_rate}/h)</td>
<td style="padding: 10px; text-align: right;">$${installation_cost.toLocaleString()}</td>
</tr>
<tr style="border-bottom: 1px solid #eee;">
<td style="padding: 10px;">${num_gateways} gateways @ $${gateway_cost}</td>
<td style="padding: 10px; text-align: right;">$${gateway_total.toLocaleString()}</td>
</tr>
<tr style="border-bottom: 1px solid #eee;">
<td style="padding: 10px;">Software integration</td>
<td style="padding: 10px; text-align: right;">$${software_integration.toLocaleString()}</td>
</tr>
<tr style="background: #f8f9fa; font-weight: bold;">
<td style="padding: 10px;">Total Year 0</td>
<td style="padding: 10px; text-align: right;">$${year0_total.toLocaleString()}</td>
</tr>
</table>
<div class="iot-cases-calc-heading">ROI Analysis</div>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px;">
<div style="background: white; padding: 15px; border-radius: 6px; border-left: 4px solid ${colors.teal};">
<div style="font-size: 0.85em; color: ${colors.gray};">5-Year Revenue</div>
<div style="font-size: 1.5em; font-weight: bold; color: ${colors.teal};">$${revenue_5year.toLocaleString()}</div>
</div>
<div style="background: white; padding: 15px; border-radius: 6px; border-left: 4px solid ${colors.purple};">
<div style="font-size: 0.85em; color: ${colors.gray};">Net Benefit</div>
<div style="font-size: 1.5em; font-weight: bold; color: ${colors.purple};">$${net_benefit.toLocaleString()}</div>
</div>
<div style="background: white; padding: 15px; border-radius: 6px; border-left: 4px solid ${roi_percent > 0 ? colors.teal : colors.red};">
<div style="font-size: 0.85em; color: ${colors.gray};">ROI</div>
<div style="font-size: 1.5em; font-weight: bold; color: ${roi_percent > 0 ? colors.teal : colors.red};">${roi_percent.toFixed(0)}%</div>
</div>
<div style="background: white; padding: 15px; border-radius: 6px; border-left: 4px solid ${colors.orange};">
<div style="font-size: 0.85em; color: ${colors.gray};">Payback Period</div>
<div style="font-size: 1.5em; font-weight: bold; color: ${colors.orange};">${payback_days.toFixed(0)} days</div>
</div>
</div>
<div style="margin-top: 15px; padding: 12px; background: ${colors.navy}15; border-radius: 6px; font-size: 0.9em; color: ${colors.navy};">
<strong>Key Insight:</strong> Operating costs represent ${((annual_total * 5 / tco_5year) * 100).toFixed(0)}% of total 5-year TCO. The per-sensor TCO ($${per_sensor_tco.toFixed(0)}) is ${(per_sensor_tco / sensor_cost).toFixed(1)}× the initial sensor cost.
</div>
</div>
`;
}