Phyzix — 100+ physics instruments in your pocket

Phyzix — 100+ công cụ vật lý trong túi

Students carry laboratories in their pockets without realizing it. Every smartphone ships an accelerometer, a gyroscope, a magnetometer, a barometer, a microphone and a light sensor, all sampling real physics at rates that would have required rack-mounted equipment a generation ago. Phyzix exists because most of those sensors hide behind opaque APIs and never appear in a homework problem. We expose them as readable instruments with SI units, time histories and export paths, plus simulations where the equation sits beside the motion, so the graph connects to the formula instead of replacing it. The short pitch lives on the app page. This is the long version.

Phyzix is a bench full of handheld meters, not a gamified quiz app with badges for memorizing constants. Benches get messy. What ours promises is honesty about sample rate limits and axis conventions, which is about the least an instrument can do. The app ships in English and Vietnamese because uranashel builds from Ho Chi Minh City classrooms as much as from garage sensor debugging.

Live instruments and what they teach

Mechanics views draw three-axis acceleration and angular rate into ring buffers holding 30 to 120 s of history. You can scrub back through the trace. Export produces comma-separated values ready for any spreadsheet, which is still how most lab reports get plotted, and nothing in that pipeline is exotic. That is deliberate. A trace you can scroll teaches more than a number you can only glance at.

The wave tools run a microphone FFT beside a pair of tone generators. Play 440 Hz on one phone and 443 Hz on another and the room fills with a slow 3 Hz throb, because f_beat = |f1 − f2| and the ear sums what it cannot resolve. Meanwhile the spectrum shows two clean peaks. Your head insists there is one wobbling tone; the plot politely disagrees, and that gap between perception and measurement is the whole lesson. If transforms are new territory, FFT made readable walks through the math at whiteboard speed.

Field views render magnetometer vectors and compass roses, including raw and calibrated plots side by side. Walk into a steel parking structure and the raw trace smears into an ellipse while the calibrated one holds its circle a little longer, then gives up too. That is soft-iron distortion made visible, the same distortion Wheria fights in production every day; the compass calibration story covers what fighting it actually takes.

Environment, astronomy and the fine print

Environment panels read barometric pressure and ambient lux. The footer documents the actual achieved sampling rate in small print, because iOS and Android throttle sensors differently once the screen locks, and a chart labeled 100 Hz that quietly delivers 40 Hz corrupts every conclusion drawn downstream. Astronomy stubs expose device attitude for rough sky orientation demos. They are rough. They still settle which way west is.

Math utilities convert units and enforce significant figures, so students stop reporting ten decimal places copied from a calculator that has no idea what the meter's least count is. The unit converter refuses to invent precision for the same reason: feed it 3 significant figures and 3 come back.

Bench notes: what the sensors are worth

Before trusting any instrument view we measured the hardware itself. Method: 7 phones from the office shelf, 3 iPhone and 4 Android, each resting on a foam block for 10 minutes while logging every sensor at its maximum requested rate. The numbers below come from that run, and they seed the noise-floor bands Phyzix shades onto its charts.

  • Accelerometer: 15 to 40 mm/s² RMS noise per axis at a nominal 100 Hz. The newest phone did best; a 2019 budget Android did worst.
  • Gyroscope: bias drift between 0.5 and 2 °/min after a 2-minute warm-up.
  • Barometer: 0.3–1 Pa RMS, which against roughly 12 Pa per metre of altitude means the pressure trace wanders by a coffee mug's height while the phone sits perfectly still.
  • Magnetometer: about 0.4 µT RMS on top of Ho Chi Minh City's roughly 43 µT background field.
  • Achieved rates: requesting 100 Hz returned anywhere from 47 to 104 Hz depending on device and thermal state.

None of this makes phone sensors bad. It makes them instruments with a spec sheet, and the app's job is to print the spec sheet where you can see it. The barometer line alone carries a full post: the barometer math derives what 0.3–1 Pa of noise does to floor detection when a garage storey stands 3.2 m tall.

Simulations that show their working

Interactive models cover projectile motion with optional drag, simple harmonic oscillators, a double-slit intensity toy and RC charging curves. These are not AAA game physics. Each model renders its differential equation or discrete update rule next to the animation, so a learner changes the initial velocity and watches the parabola respond while the symbols responsible stay on screen.

The drag model is the honest kind. Quadratic drag gives dv/dt = g − (k/m)·v·|v|, which has no closed-form trajectory, so the app integrates with semi-implicit Euler at a fixed 1/120 s step and admits as much in the caption. The oscillator shows x'' = −(k/m)·x with ω = √(k/m). The slit toy plots I(θ) ∝ cos²(π·d·sin θ/λ). The RC panel draws V(t) = V₀·(1 − e^(−t/RC)) and marks t = RC, where the curve crosses 63% of its final value. Phyzix shares conceptual DNA with Wheria's Kalman demo and Sonarish's spectrum view here: make the computation visible instead of wrapping it in a black box.

Three labs that fit in one class period

The stairwell altimeter. Hydrostatics says Δh = ΔP/(ρg), and near sea level ρg comes to roughly 12 Pa per metre. Log pressure while climbing one storey of our test garage, 3.2 m per floor, and the trace steps down by about 38 Pa. Students then invert the formula, recover the floor height and discover their error bars are set by that 0.3–1 Pa RMS barometer noise. And the whole lab fits in one flight of stairs.

The beat generator. Two phones, two tones 3 Hz apart, one microphone watching the spectrum. Then narrow the gap to 1 Hz and time each beat with the stopwatch that also lives in the app.

The shake-proof step counter, or rather the version that is not shake-proof yet. Phyzix ships a deliberately naive pedometer view for teaching:

// teaching version, deliberately naive
mag = |accel|                  // magnitude, gravity included
for s in mag:
    if s > threshold and isLocalPeak(s):
        if timeSinceLastStep > 0.25 s:
            steps += 1
// shake at 5 Hz: threshold passes, refractory passes,
// the counter climbs. This bug is the curriculum.

Walk normally and it counts. Shake the phone and it also counts, enthusiastically. The fix, band-passing to walking cadence near 1–3 Hz before picking peaks, is what production pedometers do, and the step detection post derives why the band sits there.

Bilingual labels and classroom reality

Every label, help sheet and error string exists in English and Vietnamese. ktuyen reviews the physics terminology so translations use "gia tốc" rather than colloquial shortcuts that confuse students once they open a textbook. The same discipline drives the platform rule: if a feature ships on iOS, it ships on Android, with parity checks documented in shipping iOS and Android at the same time.

Classroom logistics stay boring on purpose. Teachers mirror a phone to the projector for demonstrations; students capture CSV for homework plots. There is no account gate, no advertisement SDK and no requirement for classroom Wi-Fi, which matters in rooms where the router is a rumor. You buy the app once on the store. We do not sell curriculum licenses that expire when a semester ends.

For deeper sensor theory, including why an accelerometer resting on a table reads 9.81 m/s², read sensor hacking 101. For the privacy expectations shared across every uranashel sensor app, see why everything runs on your phone. Phyzix logs stay on the device.

From classroom to garage

The same accelerometer trace a student shakes for a homework plot is the sensor Wheria uses to count steps underground. Phyzix makes that continuity explicit. You watch naive peak picking fail when you shake too fast, then read how the production code band-passes walking cadence instead. Magnetometer ellipsoid plots explain why compass badges turn yellow in steel garages. The microphone FFT ties forward to Sonarish's baseline diffs and backward to the Nyquist lecture you half remember.

One pocket lab, many apps. Nobody is repackaging homework here. The physics underneath is shared, and students deserve to see it.

Học sinh mang cả phòng thí nghiệm trong túi mà không hay. Smartphone nào cũng có gia tốc kế, con quay, từ kế, áp kế, micro và cảm biến ánh sáng, tất cả lấy mẫu vật lý thật ở tốc độ mà một thế hệ trước phải nhờ thiết bị gắn rack. Phyzix ra đời vì phần lớn cảm biến đó nấp sau API mờ mịt, chẳng bao giờ ló mặt trong bài tập về nhà. Mình mở chúng thành dụng cụ đọc được: đơn vị SI, lịch sử theo thời gian, đường export. Kèm theo là các mô phỏng đặt phương trình ngay cạnh chuyển động, để đồ thị nối với công thức chứ không thay công thức. Bản giới thiệu ngắn nằm ở trang app. Bài này là bản dài.

Phyzix là cái bàn đầy đồng hồ đo cầm tay, không phải app quiz gamification phát huy hiệu vì thuộc lòng hằng số. Bàn thí nghiệm thì hay bừa. Cam kết duy nhất: thành thật về giới hạn sample rate và quy ước trục. App ship song ngữ Anh Việt, vì uranashel xây sản phẩm từ lớp học TP.HCM nhiều ngang từ những buổi debug cảm biến dưới hầm xe.

Dụng cụ đo trực tiếp và bài học kèm theo

Màn cơ học vẽ gia tốc ba trục và tốc độ góc vào ring buffer giữ 30 đến 120 s lịch sử. Kéo ngược trace xem lại được. Bấm export là có file CSV, mở bằng spreadsheet nào cũng xong, mà báo cáo lab đến giờ vẫn vẽ kiểu đó. Pipeline này chẳng có gì cao siêu. Chủ đích là vậy: một trace cuộn xem lại dạy nhiều hơn một con số chỉ kịp liếc.

Nhóm công cụ sóng chạy FFT micro cạnh hai tone generator. Phát 440 Hz máy này, 443 Hz máy kia, cả phòng nghe tiếng phập phồng chậm 3 Hz vì f_beat = |f1 − f2|: tai cộng gộp thứ nó không tách nổi. Trong khi đó phổ hiện hai peak tách bạch. Đầu bạn khăng khăng chỉ có một tông đang lắc lư còn đồ thị thì lịch sự phản đối. Khoảng cách giữa cảm nhận với phép đo chính là trọn bài học. Chưa quen transform thì FFT made readable đi từng bước với tốc độ bảng trắng.

Màn từ trường vẽ vector từ kế và hoa la bàn, plot raw với calibrated đặt cạnh nhau. Bước vào hầm xe khung thép, trace raw méo thành ellipse, bản calibrated ráng giữ vòng tròn thêm một lúc rồi cũng đầu hàng. Méo soft-iron hiện nguyên hình ngay trước mắt, đúng thứ méo Wheria phải chống trên production mỗi ngày; chuyện hiệu chuẩn la bàn kể cuộc chiến đó tốn những gì.

Môi trường, thiên văn và dòng chữ nhỏ

Panel môi trường đọc áp suất khí quyển và lux xung quanh. Footer in tần số lấy mẫu thực đạt bằng chữ nhỏ, vì iOS với Android bóp cảm biến theo kiểu khác nhau khi màn hình khóa; biểu đồ dán nhãn 100 Hz mà thực chạy 40 Hz sẽ kéo sai mọi kết luận phía sau. Stub thiên văn mở attitude của máy cho demo định hướng bầu trời loại thô. Thô thật. Nhưng vẫn đủ chốt hướng tây nằm phía nào.

Tiện ích toán đổi đơn vị và ép chữ số có nghĩa, để học sinh thôi chép mười chữ số thập phân từ máy tính vốn chẳng biết least count của cây thước là gì. Bộ đổi đơn vị cũng từ chối bịa thêm độ chính xác: đưa vào 3 chữ số có nghĩa thì nhận lại đúng 3.

Sổ tay bench: cảm biến đáng giá bao nhiêu

Trước khi tin bất kỳ màn đo nào, mình đo chính phần cứng. Cách làm: 7 điện thoại trên kệ văn phòng, 3 iPhone với 4 Android, mỗi máy nằm yên trên khối mút 10 phút trong lúc log mọi cảm biến ở tốc độ xin tối đa. Số bên dưới lấy từ đợt đó, đồng thời là mặc định cho dải noise floor Phyzix tô lên chart.

  • Gia tốc kế: noise 15 đến 40 mm/s² RMS mỗi trục ở 100 Hz danh định. Máy mới nhất tốt nhất; một máy Android giá rẻ đời 2019 tệ nhất.
  • Con quay: bias drift 0,5 đến 2 °/phút sau 2 phút chạy ấm máy.
  • Áp kế: 0,3–1 Pa RMS. So với chừng 12 Pa mỗi mét cao độ, trace áp suất tự trôi cỡ chiều cao cái cốc cà phê dù máy nằm im hoàn toàn.
  • Từ kế: khoảng 0,4 µT RMS trên nền từ trường TP.HCM cỡ 43 µT.
  • Tốc độ thực đạt: xin 100 Hz, nhận từ 47 đến 104 Hz tùy máy và độ nóng.

Không có nghĩa cảm biến điện thoại tệ. Chỉ có nghĩa chúng là dụng cụ có spec sheet. Việc của app là in spec sheet ra chỗ nhìn thấy được. Riêng dòng áp kế đủ dựng nguyên một bài: toán áp kế tính xem 0,3–1 Pa noise phá khâu nhận tầng thế nào khi mỗi tầng hầm cao 3,2 m.

Mô phỏng chìa phép tính ra ngoài

Mô hình tương tác gồm ném xiên có tùy chọn lực cản, dao động điều hòa, đồ chơi cường độ hai khe và đường nạp RC. Không phải vật lý game AAA. Mỗi mô hình in phương trình vi phân hoặc quy tắc cập nhật rời rạc ngay cạnh animation; người học đổi vận tốc ban đầu, nhìn parabol đáp lại trong khi đám ký hiệu gây ra thay đổi vẫn đứng nguyên trên màn hình.

Mô hình lực cản thuộc loại thành thật. Cản bậc hai cho dv/dt = g − (k/m)·v·|v|, không có nghiệm dạng đóng, nên app tích phân bằng semi-implicit Euler bước cố định 1/120 s và ghi thẳng điều đó vào caption. Dao động hiện x'' = −(k/m)·x với ω = √(k/m). Hai khe vẽ I(θ) ∝ cos²(π·d·sin θ/λ). Panel RC vẽ V(t) = V₀·(1 − e^(−t/RC)), đánh dấu mốc t = RC nơi đường cong chạm 63% giá trị cuối. Chỗ này Phyzix chung DNA với demo Kalman của Wheria và view phổ của Sonarish: phơi phép tính ra thay vì bọc hộp đen.

Ba bài lab gói trong một tiết học

Đo cao bằng cầu thang. Thủy tĩnh cho Δh = ΔP/(ρg), gần mực nước biển ρg rơi vào khoảng 12 Pa mỗi mét. Log áp suất khi leo một tầng hầm xe thử nghiệm của studio, mỗi tầng 3,2 m, trace tụt chừng 38 Pa. Học sinh đảo công thức, suy ngược chiều cao tầng, rồi phát hiện thanh sai số của bài mình bị chốt bởi đúng 0,3–1 Pa RMS noise áp kế. Sai số thật, từ dụng cụ thật, trong một nhịp cầu thang.

Máy tạo beat. Hai điện thoại, hai tông cách nhau 3 Hz, một micro nhìn phổ. Xong thu hẹp còn 1 Hz và bấm giờ từng nhịp bằng cái stopwatch cũng nằm sẵn trong app.

Máy đếm bước chống lắc, đúng hơn là bản chưa chống được. Phyzix kèm một view pedometer cố tình ngây thơ để dạy:

// bản dạy học, cố tình ngây thơ
mag = |accel|                  // độ lớn, còn nguyên trọng trường
for s in mag:
    if s > threshold and isLocalPeak(s):
        if timeSinceLastStep > 0.25 s:
            steps += 1
// lắc 5 Hz: vượt threshold, qua refractory,
// bộ đếm cứ leo. Bug này chính là giáo trình.

Đi bộ bình thường thì đếm đúng. Lắc máy cũng đếm, còn đếm hăng hơn. Cách sửa, lọc band-pass về nhịp bước quanh 1–3 Hz trước khi bắt peak, đúng như pedometer production làm; bài step detection chứng minh vì sao dải nằm đúng chỗ đó.

Nhãn song ngữ và thực tế lớp học

Mọi label, help sheet và chuỗi báo lỗi đều có bản tiếng Anh lẫn tiếng Việt. ktuyen duyệt từng thuật ngữ vật lý để bản dịch dùng "gia tốc" thay vì lối nói tắt đời thường, thứ khiến học sinh rối khi mở sách giáo khoa về sau. Kỷ luật đó chạy thẳng vào quy tắc nền tảng: feature nào ship trên iOS thì ship trên Android, kèm checklist parity ghi trong ship iOS và Android cùng lúc.

Hậu cần lớp học giữ mức nhàm chán có chủ đích. Giáo viên chiếu điện thoại lên projector để demo; học sinh xuất CSV về nhà vẽ bài tập. Không cổng tài khoản, không SDK quảng cáo, không đòi Wi-Fi lớp học; khoản cuối quan trọng ở những phòng mà router chỉ là lời đồn. Mua app một lần trên store. Studio không bán license giáo trình hết hạn theo học kỳ.

Muốn lý thuyết cảm biến sâu hơn, gồm cả vì sao gia tốc kế nằm yên trên bàn vẫn đọc 9,81 m/s², đọc sensor hacking 101. Kỳ vọng privacy chung cho mọi app cảm biến của uranashel nằm ở vì sao mọi thứ chạy trên điện thoại. Log của Phyzix ở lại trên máy.

Từ lớp học xuống hầm xe

Trace gia tốc học sinh lắc để vẽ bài tập cũng chính là cảm biến Wheria dùng đếm bước dưới hầm. Phyzix cố tình phơi mạch nối đó ra. Bạn nhìn peak picking ngây thơ fail khi lắc quá nhanh, rồi đọc cách code production lọc band-pass theo nhịp đi bộ. Plot ellipsoid từ kế giải thích vì sao badge la bàn ngả vàng trong hầm khung thép. FFT micro nối xuôi tới baseline diff của Sonarish, nối ngược về bài giảng Nyquist bạn nhớ mang máng.

Một phòng lab bỏ túi, nhiều app. Chẳng ai đóng gói lại bài tập ở đây. Vật lý bên dưới là của chung và học sinh xứng đáng được nhìn tận mắt.