Silicon ChipJMP007 - Ultrasonic Garage Door Notifier - August 2024 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Bringing Practical Electronics (PE) magazine into the fold
  4. Feature: Tracking and Locating Devices by Dr David Maddison
  5. Project: The Styloclone by Phil Prosser
  6. Feature: Electronics Manufacturing in Oz Part 1 by Kevin Poulter
  7. Project: Dual Mini LED Dice by Nicholas Vinen
  8. Project: JMP007 - Ultrasonic Garage Door Notifier by Tim Blythman
  9. Project: JMP009 - Stroboscope and Tachometer by Tim Blythman
  10. Review: Altium Designer 24 by Tim Blythman
  11. Project: Beer Can Filler by Brandon Speedie
  12. Project: 180-230V DC Motor Speed Controller Part 2 by John Clarke
  13. Vintage Radio: HMV 42-71 receiver by Marcus Chick
  14. Serviceman's Log: Use the force, Dave by Dave Thompson
  15. PartShop
  16. Market Centre
  17. Advertising Index
  18. Notes & Errata: WiFi DDS Function Generator, May & June 2024
  19. Outer Back Cover

This is only a preview of the August 2024 issue of Silicon Chip.

You can view 45 of the 104 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 "The Styloclone":
  • Styloclone PCB, case version [23106241] (AUD $10.00)
  • Styloclone PCB, benchtop version [23106242] (AUD $12.50)
  • Sound clips, 3D printing files and spreadsheet for the Styloclone (Software, Free)
  • Styloclone PCB patterns (PDF download) [23106241-2] (Free)
  • Styloclone panel cutting and 3D printing files (Panel Artwork, Free)
Articles in this series:
  • Electronics Manufacturing in Oz Part 1 (August 2024)
  • Electronics Manufacturing in Oz Part 1 (August 2024)
  • Electronics Manufacturing in Oz Part 2 (September 2024)
  • Electronics Manufacturing in Oz Part 2 (September 2024)
Items relevant to "Dual Mini LED Dice":
  • Dual Mini LED Dice PCB, white, for TH LEDs [08103241] (AUD $2.50)
  • Dual Mini LED Dice PCB, white, for SMD LEDs [08103242] (AUD $2.50)
  • Dual Mini LED Dice PCB, black, for TH LEDs [08103241] (AUD $2.50)
  • Dual Mini LED Dice PCB, black, for SMD LEDs [08103242] (AUD $2.50)
  • Dual Mini LED Dice kit (TH LED version) (Component, AUD $17.50)
  • Dual Mini LED Dice kit (SMD LED version) (Component, AUD $17.50)
  • Dual Mini LED Dice PCB patterns (PDF download) [08103241-2] (Free)
Items relevant to "JMP007 - Ultrasonic Garage Door Notifier":
  • Firmware for JMP007 - Ultrasonic Garage Door Notifier (Software, Free)
Articles in this series:
  • Wired Infrared Remote Extender (May 2024)
  • Symbol USB Keyboard (May 2024)
  • Wired Infrared Remote Extender (May 2024)
  • Thermal Fan Controller (May 2024)
  • Symbol USB Keyboard (May 2024)
  • Thermal Fan Controller (May 2024)
  • Self Toggling Relay (June 2024)
  • Self Toggling Relay (June 2024)
  • Arduino Clap Light (June 2024)
  • Arduino Clap Light (June 2024)
  • Lava Lamp Display (July 2024)
  • Digital Compass (July 2024)
  • Digital Compass (July 2024)
  • Lava Lamp Display (July 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • IR Helper (September 2024)
  • IR Helper (September 2024)
  • No-IC Colour Shifter (September 2024)
  • No-IC Colour Shifter (September 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • BIG LED clock (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • BIG LED clock (January 2025)
  • Transistor tester (February 2025)
  • Wireless flashing LEDs (February 2025)
  • Transistor tester (February 2025)
  • Wireless flashing LEDs (February 2025)
  • Continuity Tester (March 2025)
  • RF Remote Receiver (March 2025)
  • Continuity Tester (March 2025)
  • RF Remote Receiver (March 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
Items relevant to "JMP009 - Stroboscope and Tachometer":
  • Firmware for JMP009 - Stroboscope (Software, Free)
Articles in this series:
  • Wired Infrared Remote Extender (May 2024)
  • Symbol USB Keyboard (May 2024)
  • Wired Infrared Remote Extender (May 2024)
  • Thermal Fan Controller (May 2024)
  • Symbol USB Keyboard (May 2024)
  • Thermal Fan Controller (May 2024)
  • Self Toggling Relay (June 2024)
  • Self Toggling Relay (June 2024)
  • Arduino Clap Light (June 2024)
  • Arduino Clap Light (June 2024)
  • Lava Lamp Display (July 2024)
  • Digital Compass (July 2024)
  • Digital Compass (July 2024)
  • Lava Lamp Display (July 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • IR Helper (September 2024)
  • IR Helper (September 2024)
  • No-IC Colour Shifter (September 2024)
  • No-IC Colour Shifter (September 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • BIG LED clock (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • BIG LED clock (January 2025)
  • Transistor tester (February 2025)
  • Wireless flashing LEDs (February 2025)
  • Transistor tester (February 2025)
  • Wireless flashing LEDs (February 2025)
  • Continuity Tester (March 2025)
  • RF Remote Receiver (March 2025)
  • Continuity Tester (March 2025)
  • RF Remote Receiver (March 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
Items relevant to "Beer Can Filler":
  • Drilling diagrams for the Beer Can Filler project (Panel Artwork, Free)
Items relevant to "180-230V DC Motor Speed Controller Part 2":
  • 180-230V DC Motor Speed Controller PCB [11104241] (AUD $15.00)
  • 180-230V DC Motor Speed Controller PCB pattern (PDF download) [11104241] (Free)
  • 180-230V DC Motor Speed Controller lid panel artwork and drilling templates (Free)
Articles in this series:
  • 180-230V DC Motor Speed Controller (July 2024)
  • 180-230V DC Motor Speed Controller (July 2024)
  • 180-230V DC Motor Speed Controller Part 2 (August 2024)
  • 180-230V DC Motor Speed Controller Part 2 (August 2024)

Purchase a printed copy of this issue for $12.50.

Mini Projects #007 – by Tim Blythman SILICON CHIP Ultrasonic Garage Door Notifier If you’re like us, there will have been times you’ve left home and couldn’t remember if you shut the garage door. Wonder no more with this device, which emails you hourly, telling you whether it’s open or closed. It will also tell you if there’s a car parked in the garage or not. Since the emails come on the hour, you will know if the device is offline. T he Garage Door Notifier monitors the status of your car and garage (see Fig.1). It has an ultrasonic distance sensor that, with the correct placement, can detect a few different states. If the garage door is open, the sensor detects the door at a close distance. If the door is closed, the sensor can monitor the distance to whatever is in the garage. If a car is present, the distance it measures will be lower. It sends an email every hour, reporting its status. We had that application in mind when designing this circuit, but we think our readers will come up with many other uses. For example, distance sensors can also measure the liquid level in a tank, so you could adapt it to monitor the amount of water in a rainwater tank. Fig.2 shows the circuit diagram of the Notifier. It’s basically just a WiFi Mini ESP8266 Main Board connected to an Ultrasonic Distance Sensor. The ESP8266 processor on the board connects to a WiFi network and uses NTP (network time protocol) to get the current time. When it is due to report, on the hour, it activates the sensor to measure the distance. It then assembles a report and fires off an email. If you don’t see the email when it is due, you know something is amiss, like a power outage. Circuit details We previously covered the operation of the Ultrasonic Distance Sensor in the December 2016 issue of Silicon Chip (siliconchip.au/Article/10470) as part of our series on electronic modules. This sensor must be powered from 5V. When a high pulse is sent to its TRIG pin, it emits a ping from one of its ultrasonic transducers, which reflects off a nearby surface. When the other ultrasonic transducer receives the reflected ping, the sensor produces a high pulse on the ECHO pin. The time between the pulses depends on the distance (and speed of sound); thus, the distance can be inferred from the delay. The WiFi Mini (also known as the D1 Mini) is a small module integrating an ESP8266 processor with WiFi, plus a USB-serial converter. It’s one of the most compact WiFi boards that does not require any external parts to program. We previously used these modules in Silicon Chip projects like the Clayton’s GPS Time Source from April 2018 (siliconchip.au/Article/11039) and the Smart Tariff Super Clock from July 2018 (siliconchip.au/Article/11137). The ESP8266 processor has 3.3V I/O pins but the sensor must be powered from 5V. The TRIG pin on the sensor will respond to a 3.3V signal, so we can directly connect the ESP8266’s D2 digital output on the WiFi Mini to the TRIG pin on the sensor. We have placed a 10kW resistor between the 5V ECHO output on the ultrasonic module and the D1 digital input pin on the WiFi Mini out of caution. There are widespread reports that the ESP8266’s I/O pins are tolerant of 5V, but the resistor is cheap insurance Fig.1: this shows how the Garage Door Notifier can detect both the position of the garage door and the presence of a car inside the garage by measuring a distance. This assumes you have a tilting or segmented door; the position of a roller door could be sensed with a different arrangement but it probably couldn’t detect the car at the same time. We expect readers will think of other applications for this device. siliconchip.com.au Australia's electronics magazine August 2024  55 Screen 1: this shows how you add an SMTP user to your SMTP2GO account. The SMTP settings shown here will already be set in the sketch. and limits the current into that input pin should it be clamped at 3.3V by an internal diode. Software The software is written for the Arduino IDE and does not require any external files beyond those included with the ESP8266 board profile. The sketch connects to a WiFi network and uses NTP to get the time. If a WiFi network is connected and the time has been correctly set, the onboard LED lights. The software checks the time, and when it detects that the hour has rolled over, it takes a measurement and uses the SMTP2GO service to send an email. The internal time is rechecked daily using NTP to avoid any drift that might occur long-term due to crystal tolerances. The sketch is divided into several smaller helper functions, simplifying the main program We bridged adjacent pads, as shown here, to connect the wires to the ultrasonic sensor. Check that the header pins are attached and the shield is orientated correctly. 56 Silicon Chip loop. The Notifier sends a lot of debugging data to the serial port at 115,200 baud and can also be manually triggered (for testing) through that serial port. SMTP2GO We previously used the SMTP2GO service (www.smtp2go.com) for the WebMite-based Watering System Controller from Silicon Chip, August 2023 (siliconchip.au/Article/15899). SMTP­ 2GO is an online service that makes sending emails easy from less-capable devices like microcontrollers. SMTP stands for Simple Mail Transfer Protocol. It is the internet protocol that is used for sending email. SMTP2GO has a free tier that allows 1000 emails per month; an email per hour works out at under 800 emails in We used short lengths of insulated wire and one 10kW resistor to connect the ultrasonic sensor’s pins to the correct pins of the WiFi Mini and its prototyping shield. Take care that this is correct as some wires carry 5V and some 3.3V. a month, so that should be sufficient. There are paid tiers if you need to send more frequent emails. To use SMTP2GO, you need to set up an account using an existing email address. We have heard that some ‘free’ email providers, such as Gmail, are not allowed, so we recommend checking if you can set up an account before starting your build. Once you have registered, you must set up an SMTP user (Dashboard → Sending → SMTP Users → Add SMTP User; see Screen 1). The SMTP username and password need to be placed in the sketch and authenticated as part of the sending process, so make sure to record them when you create the SMTP user. The SMTP user account differs from the main SMTP2GO account; multiple Fig.2: the circuit is simple. If you didn’t want it permanently soldered, you could probably rig this up with jumper wires in a few minutes. Australia's electronics magazine siliconchip.com.au SMTP users could be created under the same SMTP2GO account if you have multiple Notifiers. Testing SMTP You can test the SMTP2GO account using the WiFi Mini on its own. You will need to install the ESP8266 board profile into the Arduino IDE. If you don’t already have the IDE, it is a free download from www.arduino.cc/en/ software/ To install the board profile, add https://arduino.esp8266.com/stable/ package_esp8266com_index.json to the Additional Board Manager URLs field of the Arduino Preferences window. The “ESP8266 by ESP8266 Community” board profile can then be installed from the Board Profiles window – we used version 3.1.2. Choose “WeMos D1 R2 and Mini” as the board type and select its serial port. Drivers can be downloaded from the Jaycar XC3802 product web page if needed. Now download the sketch from siliconchip.au/Shop/6/428 and open it in the IDE. Six #defines near the start of the sketch must be customised. STASSID and STAPSK correspond to the WiFi network name and password; set them to correspond to your home network. SMTPUSER and SMTPPASS correspond to the SMTP user account you set up earlier. The SMTPFROM field must be the same as the email address used to set up the SMTP2GO account. The SMTPTO field is the intended recipient; we set this to be the same as the SMTPFROM field. The default SMTPHOST and SMTPPORT values should work, but if you run into problems, check that they match those shown in Screen 1. Now upload the sketch and open the Serial Port Monitor in the IDE at 115,200 baud. Within the first minute, you should see the first eight lines of Screen 2 appear, and the blue LED on the WiFi Mini should light up. If the WiFi network doesn’t connect, check that the STASSID and STAPSK values are correct. Typing ‘~’ on the serial monitor will trigger an email, even if the sensor is not connected. If everything is working, you will see something like the remainder of Screen 2. The three-digit codes are SMTP status codes. Those in the range 2xx and 3xx indicate that no error has occurred. siliconchip.com.au Parts List – Garage Door Notifier (JMP007) 1 WiFi Mini ESP8266 Main Board [Jaycar XC3802] 1 Ultrasonic Distance Sensor [Jaycar XC4442] 1 WiFi Mini Prototyping Shield [Jaycar XC3850] 1 10kW ½W axial resistor [Jaycar RR0596] 1 micro-USB cable for power [Jaycar WC7723] Assorted short pieces of insulated wire Screen 2: the serial port output of a working Notifier should look like this; the three-digit SMTP codes at bottom left will help diagnose problems with email transmission. A 4xx is likely a server error; you should retry. Codes in the 5xx range mean that there is a client (Notifier) problem with the SMTPUSER, SMTPPASS, or SMTP­ FROM fields. Check and edit these, then upload the sketch again. Construction We assembled this project with a prototyping shield, although it is simple enough to be done on a breadboard or even directly soldered. See the photos for the layout we used; refer to the circuit diagram, Fig.2, to check your wiring. Remember the 10kW resistor for the ECHO pin. We poked the wires through the shield to solder to the sensor pins on the underside. You may also need to attach header pins or sockets to the WiFi Mini or shield. Power up the assembled Notifier and check that it works as before. You can use the ‘t’ command on the serial Australia's electronics magazine console to test the sensor; this will generate a report but not email it. Check that the sensor reports distances correctly; if so, then all is working. Customisation Changing the doReport() and getStatus() functions is the easiest way to modify the contents of the emails that are sent. To send daily emails, move the doReport() function call down into the section that checks for the day changing, about seven lines lower. If you are skilled with Arduino, you should have no trouble using our helper functions to create your own Notifier, produce custom reports and perhaps monitor other sensors. You will have to work out the power and mounting options; a USB power supply and micro-USB cable should be sufficient for power delivery. Fig.1 should give you an idea of where to mount the unit. SC August 2024  57