The designed embedded system takes a weight on earth and shows the weights on other celestial bodies of our solar system. The device is designed and constructed using microcontroller AT89S52. It can give better understanding about gravity. The system calculates the mass and acceleration due to gravity (g) for other celestial bodies and displays the corresponding weight (force). Fig. 1 shows the author’s prototype.
Suppose your weight on earth is 50.5 kg, your weight on other celestial bodies of our solar system would be as given in Table II.
Circuit and working
AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller. It provides 8k bytes of Flash, 256 bytes of RAM, 32 I/O lines, three 16-bit timer/counters, a six-vector two-level interrupt architecture, a full-duplex serial port, on-chip oscillator and clock circuitry. Power-on reset is provided by the combination of resistor R17 and capacitor C3. Switch S6 is used for manual reset. A 12MHz crystal along with two 33pF capacitors provides basic clock frequency to the microcontroller.
Port 0 and port 2 of IC1 are used for multiplexing the 7-segment displays (DIS1 through DIS8). The port 1 and port 3 are used for scanning the keyboard buttons, except switch S6. Transistors (T1 through T8) and resistors (R1 through R8) are used for digit selection. The 7-segment displays used are LTS542, which are common-anode type. Eight current-limiting resistors (R9 to R16) of 100Ω each are used.
The pin connections between the matrix keyboard and IC1, with key functions, are shown in Table III.
The codes to display different numbers on even and odd 7-segment displays are shown in Table V.
The source program for the microcontroller is written in C language and compiled using Keil µVision4 compiler. The generated hex code is burnt into the microcontroller using a suitable programmer. On reset/power-on, the microcontroller executes the main function.
Construction and testing
A single-side PCB for the celestial weigh calculator is shown in Fig. 3 and its component layout in Fig. 4. Assemble the circuit on PCB to save time and minimize assembly errors. Carefully assemble the components and double-check for any overlooked error.
Download PCB Pattern and Component Layout PDF: Click Here
Download Source Code: Click Here
To test the circuit for proper functioning, verify correct 5V supply for the circuit at TP1 with respect to TP0.
The author works in the department of Physics, Hemchandracharya North Gujarat University, Patan, Gujarat