Silicon ChipMaking Android Apps with App Inventor - February 2021 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: New computer technology
  4. Feature: Radio Time Signals throughout the World by Dr David Maddison
  5. Feature: Follow-up: Quantum-dot Cellular Automata by Dr Sankit Ramkrishna Kassa
  6. Project: Battery Multi Logger by Tim Blythman
  7. Project: Arduino-based Adjustable Power Supply by Tim Blythman
  8. Serviceman's Log: A feline-themed cautionary tale by Dave Thompson
  9. Project: Electronic Wind Chimes by John Clarke
  10. Feature: Making Android Apps with App Inventor by Roderick Wall
  11. Feature: Making a Compact Virtual Electronics Workbench by Tim Blythman
  12. Feature: Upgrading your Computer to the latest CPU by Nicholas Vinen
  13. PartShop
  14. Feature: El Cheapo Modules: LCR-T4 Digital Multi-Tester by Jim Rowe
  15. Vintage Radio: Philips 1952 BX205 B-01 AM/SW battery valve radio by Charles Kosina
  16. Market Centre
  17. Notes & Errata: Busy Loo Indicator, January 2021; Mini Digital AC Panel Meters, January 2021; Radiating test antenna for AM Radios, Circuit Notebook, January 2021; Vintage Battery Radio Li-ion Power Supply, December 2020; Colour Maximite 2, July-August 2020
  18. Advertising Index
  19. Outer Back Cover

This is only a preview of the February 2021 issue of Silicon Chip.

You can view 34 of the 112 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Follow-up: Quantum-dot Cellular Automata":
  • QCA follow-up: Potential Energy Explanation (Software, Free)
Articles in this series:
  • Quantum-dot Cellular Automata (August 2019)
  • Quantum-dot Cellular Automata (August 2019)
  • Follow-up: Quantum-dot Cellular Automata (February 2021)
  • Follow-up: Quantum-dot Cellular Automata (February 2021)
Items relevant to "Battery Multi Logger":
  • Battery Multi Logger PCB [11106201] (AUD $5.00)
  • PIC16F1455-I/SL programmed for the Microbridge [2410417A.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC32MX170F256B-I/SO programmed for the Battery Multi Logger [1110620A.hex] (Programmed Microcontroller, AUD $20.00)
  • DS3231MZ real-time clock IC (SOIC-8) (Component, AUD $8.00)
  • DS3231 real-time clock IC (SOIC-16) (Component, AUD $7.50)
  • 2.8-inch TFT Touchscreen LCD module with SD card socket (Component, AUD $25.00)
  • SMD resistor - 15mΩ ±1% M6332/2512 3W (CRA2512-FZ-R015ELF or similar) (Source component, AUD $2.00)
  • Matte/Gloss Black UB3 Lid for 2.8-inch Micromite LCD BackPack (PCB, AUD $5.00)
  • Battery Multi Logger software [1110620A.hex] (Free)
  • Battery Multi Logger PCB pattern (PDF download) [11106201] (Free)
Articles in this series:
  • Battery Multi Logger (February 2021)
  • Battery Multi Logger (February 2021)
  • Battery Multi Logger - Part 2 (March 2021)
  • Battery Multi Logger - Part 2 (March 2021)
Items relevant to "Arduino-based Adjustable Power Supply":
  • Arduino-based Adjustable Power Supply PCB [18106201] (AUD $5.00)
  • SMD resistor - 15mΩ ±1% M6332/2512 3W (CRA2512-FZ-R015ELF or similar) (Source component, AUD $2.00)
  • MCP4251-502E/P dual 5kΩ digital potentiometer (Component, AUD $3.00)
  • Arduino-based Adjustable Power Supply Software (Free)
  • Arduino-based Adjustable Power Supply PCB pattern (PDF download) [18106201] (Free)
Articles in this series:
  • Making a Compact Virtual Electronics Workbench (February 2021)
  • Arduino-based Adjustable Power Supply (February 2021)
  • Making a Compact Virtual Electronics Workbench (February 2021)
  • Arduino-based Adjustable Power Supply (February 2021)
Items relevant to "Electronic Wind Chimes":
  • Electronic Wind Chimes PCB [23011201] (AUD $10.00)
  • PIC16F1459-I/P programmed for the Electronic Wind Chimes [2301120A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Electronic Wind Chimes software [2301120A.hex] (Free)
  • Electronic Wind Chimes PCB pattern (PDF download) [23011201] (Free)
Articles in this series:
  • Electronic Wind Chimes (February 2021)
  • Electronic Wind Chimes (February 2021)
  • Electronic Wind Chimes - Part 2 (March 2021)
  • Electronic Wind Chimes - Part 2 (March 2021)
Items relevant to "Making Android Apps with App Inventor":
  • TDR Android app (made using App Inventor) (Software, Free)
Items relevant to "Making a Compact Virtual Electronics Workbench":
  • Arduino-based Adjustable Power Supply PCB [18106201] (AUD $5.00)
Articles in this series:
  • Making a Compact Virtual Electronics Workbench (February 2021)
  • Arduino-based Adjustable Power Supply (February 2021)
  • Making a Compact Virtual Electronics Workbench (February 2021)
  • Arduino-based Adjustable Power Supply (February 2021)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)

Purchase a printed copy of this issue for $10.00.

Making Android Apps with App Inventor The Android logo is Copyright Google Inc. App Inventor is a free, cloud-based tool that lets you make your own Android apps. It’s maintained by MIT and is run through most standard web browsers. Roderick Wall shows you how it can be used to make a simple TDR (time domain reflectometry) calculator for your phone, which can help with testing electrical cables for faults. By Roderick Wall T he Massachusetts Institute of Technology (MIT) in the USA has released a free “App Inventor”. This allows you to use blocks to design applications that run on Android phones and tablets. I used it to create a TDR (time domain reflectometry) calculator, which calculates the distance to a fault in a transmission line, as in the TDR Dongle project from December 2014 (siliconchip.com.au/Article/8121). You can download my Silicon Chip TDR Android calculator app from siliconchip.com.au/Shop/6/5733 – see the end of this article for hints on how to install it on a phone or tablet. Building an App I used the following steps to design and create the TDR application. You can use a similar procedure to make your own custom Android application. App Inventor is a cloud-based tool, which means you can build applications right in your web browser. The website offers all the support you need to learn and how to develop basic applications. Start by opening the following link in your browser: https://appinventor.mit.edu/explore/ get-started MIT also has an App Inventor Community forum where you can ask ques- tions about your project. See https:// appinventor.mit.edu/explore/library While designing your project, if you run into a problem, try doing a Google search like “App Inventor How to X” (where X is replaced with your query) for quick answers to your questions. There is lots of information on how to use App Inventor on the internet. Fig.1 shows the first window of the MIT App Inventor. To start a new project, click “My Projects” and select “Start new project”. Note that you can download a source code file for the project (with a .aia file extension) that can be shared with your friends. It is a good idea to use this method to View your projects Start new project Provides a .aia file of your current project which can be shared Fig.1: starting a new project in App Inventor is quite simple and the interface isn’t as complex as most programming IDEs. 74 Silicon Chip Australia’s electronics magazine siliconchip.com.au Adds another screen Change screens in the Designer window Components Select the device the application will run on Generate Blocks code Design and move components onto the phone screen Fig.2: the App Inventor main window is where most of the work happens. It is important to familiarise yourself with the Palette panel at the far left. save your project often, in case something goes wrong. Be careful with the delete button. If you delete a control in the Designer window, it will also delete the code blocks that were attached to it in the Blocks window. There is no way to undo or redo in App Inventor. After you provide details of the device your application is optimised for, look at the two buttons at the top right of the window (see Fig.2). The “Designer” button goes to the screen where you can move and drag components onto the phone screen. The “Blocks” button goes to a screen where you can generate the code blocks for the project. Fig.3 shows the components that are used to design the TDR Calculator application. This was done by dragging components from the left side of the Designer window onto the phone screen. You can add a component later by dragging it into a space between two components which are already on the screen. There is a list of the components and their properties on the right side of the Designer window. You can edit the properties of each component as required for your project, including customising their names. As I have selected Screen1 here, the properties for components on Screen1 are displayed. For the TextBox components for RefTime, VelocityFactor, Result1 and Result2, I have set the “NumbersOnly” property so that only numbers can be entered in those fields. Tips and tricks: • Enter the screen title into the Screen Property Title box, not in the About Screen box. Button Label Invisible labels that are used in the Blocks code Set Set Notifier Set Invisible spacer TextBox App icon Load files from PC Fig.3: in the Designer window, elements are dragged & dropped from the User Interface (UI) box at left onto the screen/ viewer. Placed objects are then listed under the Components/Media panel at right. siliconchip.com.au Australia’s electronics magazine February 2021  75 Select Media Drag onto screen Sound1 is selected Fig.4: selecting the Media sub-panel at left lets you add your own sound/video files etc to your application. • The two non-visible Notifier components are used to notify that the entered Reflection time and/or Velocity Factor data was not valid. • Three invisible labels (Result1, Result2 and LabelFLAG_T_F) are used by the Blocks code to store calculation results and status. Do not select the property “Visible” setting for these three components. However, they can be made visible while troubleshooting your code to see what the results are. Sounds After selecting “Media” components (see Fig.4), drag the two non-visible sound components onto the screen. Select the Sound1 component, and in the property window, select the BlopMark.mp3 sound file after uploading it from your computer. Do the same for the Sound2 component, but this time select SoundStart.mp3. Making the block code Fig.5 shows some of the code blocks used to build the app, not yet put together. You drag the generic blocks on the lefthand side of the window into the main part of the window to add them. Fig.6 shows the blocks once they have been put together to form the code needed to drive Screen1 in the TDR App. When the Calculate button is pressed, first the LabelFLAG_T_F status flag is set to “F” (false). Both the Reflection Time and Velocity Factor inputs are checked to ensure that they have been entered and are within the valid ranges. If there is an error, the “LabelFLAG_T_F” is set to “T” (true) and a notification is sent to the user. It then checks to see if LabelFLAG_T_F is “F”, indicating that there was no error. It then divides Reflection Time (RefTime) by 1,000,000,000 (one billion) to convert nanoseconds 2 Control Empty space 3 Logic 1 2 3 All these smaller blocks are combined together to form the larger block below (not all are labelled). The dashed lines indicate what block fits where. 4 4 VelocityFactor 1 BtnCalculate This is then updated with some math blocks. Fig.5: in the Blocks window, built-in procedures like logic, math, variables etc are selected from the left-most menu and dragged onto the Viewer. These pieces can then be combined into more complex nodes performing multiple functions. Blocks are combined based on their shapes and what open space they have. 76 Silicon Chip Australia’s electronics magazine siliconchip.com.au Fig.6: part of the Blocks screen for the TDR (time domain reflectometer) calculator. Most of the program is made from conditionals, and some basic programming knowledge can help to understand it, but it is not required. Main program Check if the velocity factor is equal to 0, less than 1 or greater than 100, if so display and set an error (“Invalid Data”) otherwise continue the program. Error flag (initially set to false) Check if the reflection time is equal to 0, less than 1 or greater than 10 digits long, if so display and set an error otherwise continue the program. Play Sound1 (1) Convert reflection time from nanoseconds to seconds (2) Convert velocity factor from percentage to decimal value. This is then multiplied by the reflection time and the speed of light which gives us the distance to the reflection point and back (3) Divide the result by two to get the distance to the reflection point (in metres) (4) If there’s an error clear the final result into seconds. The Velocity Factor is divided by 100 to convert it from a percentage to a decimal, eg, 75% becomes 0.75. To calculate the distance to the reflection point and back, the Velocity Factor is multiplied by the Reflection Time and the speed of light (C). Result2 is divided by two to obtain the distance to the reflection point in the transmission line where the fault has been located (see Fig.6). You can also add and view comments in the code. Right-click on the background and select “Show All Comments” to see them. To add a comment, click on the question mark (?) and then on the block, and write a comment for it (see Fig.7). Right click on the Viewer background to open this menu Click the “?” to add comments Show and hide all comments Fig.7: comments can be added to sections of a program by clicking the question mark (?) symbol on blocks. Generally, comments are useful if you need to come back to the program months later or for describing complex functions. siliconchip.com.au Australia’s electronics magazine February 2021  77 Button Image Invisible labels acting as spacers Objects can be made visible or invisible Fig.8: Labels can be set to invisible and then used to help separate other interface elements. Fig.8 shows the second screen (Screen2) in this application. To add a screen, click the “Add Screen” button at the top left of the window (see Fig.2). Click “OK” to accept the “Screen2” name, or give the screen a name and click OK. Add the required components for Screen2 as shown, and edit their properties as required. Next, select “Connectivity” components and move (drag) the ActivityStarter components onto the phone screen (Fig.9). These will be shown as non-visible components. ActivityStarter components are used in Screen2 Blocks code to go to the Silicon Chip website. Fig.10 shows the Blocks code for Screen2 and what it does. Note that there is a build problem with the website address being swapped, but works correctly when set up as shown. When the application has been tested in App Inventor and is complete, the project .apk file can be built and downloaded onto your computer or Android phone. As shown in Fig.11, click “Build” and select “App (store .apk to my computer)” to download onto your computer. Or select “App (provide QR code for .apk)” to get the download address to paste into the phone browser. Instead of using the QR code to download the application onto an Android phone, you can copy the download address that is under the QR code into your phone browser and download it. Before you can install the app, go to phone settings and then under Security, set the phone to allow the applications to be installed from Unknown Sources. Then use a File Manager to open the .apk file to install the application. Once the application has been installed, do not forget to go back and disable installation from Unknown Sources. Uploading your app to the Google Play Store After having finished developing Fig.9: the ActivityStarters are used, in this case, to go to a website. ActivityStarter Located in the Connectivity dropdown menu 78 Silicon Chip Australia’s electronics magazine siliconchip.com.au your application, you need a way for other people to use it. The best way to do this is to publish your application on Google Play Store. This is quite an extensive task, involving many steps. But once you submit your application to Play Store, it will be easy for other people to install it. The following web page describes the steps to upload your application to the Play Store: https://techzillo. com/publish-android-app-googleplay-store/ As listed on that page, the main steps are: 1. Sign up for Play Publisher 2. Add information about your app 3. Upload your app’s APK file 4. Set a content rating for your app 5. Add pricing and distribution information 6. Publish your app Each of these steps has up to a dozen sub-steps. But the overall, the procedure is straightforward. Google Play Publisher is used to publish the application onto Play Store. You can sign up for this at https://play.google.com/ apps/publish/signup/ It costs around US $25. Search in the App Inventor community Forum for “Play Store” and “bundle” for more information, as you will not be using Android Studio to create your application. You can find dozens of tutorials on other features of MIT App Inventor at https://appinventor.mit.edu/explore/ SC ai2/tutorials Fig.10: this is the code for ActivityStarter shown in Fig.9; it simply goes to the listed website when one of the buttons are pressed. You also have a back button to return to the original screen. Generate a QR code to download the APK from, or you can go directly to the provided hyperlink Or you can generate the APK directly. Fig.11: once you’ve built the app then you can generate the APK file which is used to install it. siliconchip.com.au Australia’s electronics magazine February 2021  79