Team 9

Electric Field Mapper

Build an app that calculates the electric force between charges (Coulomb's Law), the electric field strength at a point, and the electric potential.

🎯 Learning Goals

  • Master Coulomb's Law and inverse-square relationships
  • Understand Electric Field (E) and Potential (V) differences
  • Work with very large (k) and very small (q) numbers
  • Implement repulsive vs attractive force logic

🌎 Why This Matters

Electrostatics is how your touchscreen works, how laser printers print, and how the atoms in your body stay together. It is the force that governs the internal world of technology and matter.

📖Understanding Electrostatics

Theory Masterclass
"

Electrostatics is the study of electric charges at rest. Key Concepts: Electric Charge (q): Property of matter that causes it to experience a force in an electromagnetic field. Measured in Coulombs (C). - Protons have positive charge (+1.6 × 10⁻¹⁹ C) - Electrons have negative charge (-1.6 × 10⁻¹⁹ C) Coulomb's Law: The force between two point charges is directly proportional to the product of the charges and inversely proportional to the square of the distance between them. F = k × (q₁ × q₂) / r² k (Coulomb's constant) ≈ 8.99 × 10⁹ N·m²/C² Electric Field (E): The region around a charged particle where a force would be exerted on other charges. E = k × q / r² (field due to a single charge q at distance r) Electric Potential (V): The work done per unit charge in bringing a positive test charge from infinity to a point. V = k × q / r

Mathematical Foundation

fxF = k × (q₁ × q₂) / r²
fxE = k × q / r²
fxV = k × q / r
fxk ≈ 8.99 × 10⁹ N·m²/C²
fx1 μC = 10⁻⁶ C (Microcoulomb)

🎨Part A — Designer View (UI Design)

Open MIT App Inventor → Switch to Designer view. Follow each step below to build the interface.

1

1. Screen Basics

• In the **Properties** panel (right) for **Screen1**. • Set **Title** to "Electric Field Solver". • Set **AlignHorizontal** to Center. • Set **BackgroundColor** to black.

2

2. Input Fields

• From **Palette** -> **User Interface**, drag 2 **TextBoxes**. • Rename them: 'ChargeTxt' and 'DistTxt'. • Set both to **NumbersOnly**. • Give hints: "Charge (μC)" and "Distance (m)".

3

3. Action Button

• Drag a **Button** renamed 'CalcEBtn'. • Set text to "FIND FIELD STRENGTH". • Change **BackgroundColor** to Purple and **TextColor** to White.

4

4. Result Display

• Drag a **Label** renamed 'ResultLbl'. • Set **TextColor** to Cyan and **FontSize** to 22.

🧩Part B — Blocks View (Logic & Calculation)

Switch to Blocks view. Now add the logic that makes your app actually work.

1

1. Switch to Blocks

• Look at the top right of your screen and click the **Blocks** button.

2

2. The Field Formula

• Formula: E = k * q / r². • Click **CalcEBtn** (Gold) and drag 'when CalcEBtn.Click'. • Click **ResultLbl**. Drag the green 'set ResultLbl.Text to' and snap it inside. • Go to the **Math** drawer (Blue). Drag out '*', '/', and '^' blocks.

3

3. Snapping the Math

• Create the logic: [9000000000] * [ChargeTxt.Text] / ([DistTxt.Text] ^ 2). • Use the Blue **Math** '^' block for the square (power of 2).

4

4. Adding Units (N/C)

• Go to the **Text** drawer (Bright Pink). Drag a 'join' block. • Join your result with the text " N/C".

🧪Testing Your App

  • q1=1μC, q2=1μC, r=1m → F ≈ 0.00899 N
  • Try negative charges: Force magnitude stays same, but it should be noted as 'Attractive'.
  • Check distance = 0: Show an error (cannot divide by zero).

🚀Bonus Challenges

Extra credit — impress your instructor

  • Add a Canvas that draws the charges and vectors showing force direction.
  • Add multiple charges and calculate net force at a point.
  • Create a 'Potential Map' where tapping a Canvas shows the potential at that spot.