In this tutorial, you will learn how to create an alarm circuit, let’s name it Smart Alarm. The alarm will go off when the device detects when something gets close to it. We will create this circuit incrementally, starting with a super simple version and then we will continue adding functionalities to it. The goal of this tutorial is to introduce you to the Smart Logic Simulator.
Before we start, please have a look at the simulation interaction modes.
There are four modes available:
- View mode — allows you to interact with a circuit, clicking buttons, etc
- Edit mode — allows you to manipulate your circuit. You can move components and add more of them.
- Remove mode — allows you to remove components and connections
- Connect mode — allows you to wire up components together
Open the Smart Logic Simulator, go to Your Circuits taband create a new project.
Enter Edit Mode and open components list by clicking oval blue button in the bottom right corner.
Our basic version of the Smart Alarm circuit will comprise the 5Mhz Clock component, a Proximity Sensor component, and the Vibration component. Find those components on the list and click on them to add them to our circuit.
Now exit components list and enable Edit Mode. Now you can drag components around, place them like on the image below.
Enter Connect Mode and connect all components like in the picture below.
Click on the Clock’s output connector and then on the Proximity Sensor input connector labeled Clock. Then connect the Close output to the Vibration input.
Test the circuit
Hover your hand over your device’s Proximity Sensor, located next to the earpiece.
In this step, we will make Smart Alarm stay vibrating even after you take your hand away from the Proximity Sensor. Without further ado, let’s remove the connection between Proximity Sensor and Vibration. Enterthe Remove Mode, thentap one of the connectors of a wire connecting Proximity Sensor and Vibration. Additionally you can move the Vibration component a bit to make space for a new component.
Add SR Latch and Pulse Button components and place them and connect like on the image below.
SR Latch is a one-bit memory bistable component that has two inputs, one which will SET the component, meaning the output will be HIGH) and one which will RESET the component, meaning the output will be LOW.
Second Generation Smart Alarm
Now you can test the circuit once again. As you can see, Vibration will not stop even after you take your hand away. To stop it click Pulse Button that acts as a reset in our alarm system.
Before we add a Speaker component, let’s do something cool. We will make our alarm pulsing, so the vibration will switch on and off periodically.
Add 1Hz Clock and AND Gate and reorganize the circuit like on the image below. Clock and SR Latch outputs to the AND Gate inputs. Now, after hovering your hand over the Proximity Sensor, a vibration will be pulsing.
And finally, add Speaker component and Toggle Button that will allow us to enable the alarm to make a sound. Connect everything like in the image below. 1Hz Clock output to the Speaker input labeled 2048 and Toggle Button to the Speaker input labeled Play.
Don’t forget to enter View Mode and enable Toggle Button if you want an alarm to generate a sound.
Now you can test the ultimate version of your Smart Alarm. It will vibrate and make a sound after anyone gets close to your phone.
If you have questions, please leave a comment in the section below 🙂