What is Virtual Smoke Sensor
The virtual smoke sensor module lets you simulate a smoke sensor right on your computer! I built it using Processing, a platform that makes it easy to design interactive visuals. You can watch particles float across the screen, mimicking smoke, and even adjust how the sensor behaves by tweaking various settings. Plus, it can communicate with other devices using serial communication system. This program is perfect for learning, testing, or demonstrating how a smoke sensor works.
This program demonstrates how a smoke sensor reacts to various gases, such as smoke, methane, and carbon dioxide. You can observe how the gases spread and how close they need to be to the sensor to trigger an alarm.
The program also provides readings that change based on the concentration of the gas and the sensitivity of the sensor. You can adjust these settings to see how they influence the readings.
Virtual Smoke Sensor Key Features Breakdown
This application offers a user-friendly, interactive graphical interface for simulating a virtual smoke sensor. Key features of this simulation include:
- Gas Selection: Choose between Smoke, Methane, CO2, and Ammonia for simulation.
- Adjustable Intensity: Control the density and rise speed of the gas particles.
- Real-Time Interaction: Move the smoke source dynamically to see the impact on the sensor output.
- UI Elements: Sliders, dropdowns, and buttons make configuration intuitive.
- Sensor Output: Displays the simulated sensor readings and voltage based on current conditions.
- Serial Interface: Simulates connection to real hardware for testing.
- Visual Feedback: Particle colors and sensor behavior reflect the selected gas and settings.
Simulation Settings and Their Functionality:
The Simulation Settings allow users to control various aspects of the virtual smoke sensor and the behavior of the simulated gas/smoke particles. These settings interact directly with the simulation, affecting the output of the sensor and the visual representation of particles in the simulation area. Here’s a detailed explanation:
1. Smoke Intensity Slider
- Functionality:
- This slider controls the number of particles emitted in the simulation.
- A higher value increases the density of particles, simulating a more intense smoke or gas emission.
- Range:
0
(no particles) to100
(maximum particle density).
2. Smoothing Factor Slider
- Functionality:
- Determines how quickly the sensor responds to changes in particle density.
- Implements a moving average or similar technique to smooth out rapid fluctuations.
- Range:
0.0
(no smoothing, sensor output updates instantly) to1.0
(extreme smoothing, very slow response).
3. Gas Sensitivity Slider
- Functionality:
- Adjusts how strongly the sensor reacts to particles.
- Simulates the sensor’s calibration to detect gas concentrations.
- Range:
0.0
(no sensitivity, sensor output remains low) to5.0
(maximum sensitivity).
4. Gas Type Selection
- Functionality:
- Allows users to select the type of gas to simulate.
- Each gas type has unique properties and visual indicators (e.g., particle color and behavior).
- Gas Types:
- Smoke: Default type, gray particles.
- Methane: Cyan particles.
- CO2: Red particles.
- Ammonia: Green particles.
5. Toggle Button for Smoke Simulation
- Functionality:
- A switch to start or stop the emission of smoke/gas particles.
Serial Connection Settings
This section configures serial communication settings for hardware integration, including selecting the COM port and baud rate. A user-friendly interface with dropdowns and a dynamic button simplifies the process of establishing and terminating the serial connection.
Arduino Interface with Virtual Smoke Sensor App
Let’s connect an Arduino with this virtual smoke sensor app and display sensor values on a 16×2 LCD. To achieve this, we need to integrate the simulation with physical hardware via serial communication and implement appropriate Arduino programming.
Required Components:
- Arduino board (e.g., Arduino Uno, Nano, or similar)
- Virtual Smoke Sensor app
- 16×2 LCD
- Jumper wires and a breadboard
- USB cable for Arduino connection
Wiring the LCD:
Connect the LCD to your Arduino as follows:
- RS to Arduino pin 12
- E to Arduino pin 11
- D4 to Arduino pin 5
- D5 to Arduino pin 4
- D6 to Arduino pin 3
- D7 to Arduino pin 2
- VSS to GND
- VDD to 5V
- V0 to a 10k potentiometer (for contrast adjustment)
- RW to GND
- A (LED anode) to 5V (through a current-limiting resistor)
- K (LED cathode) to GND
Arduino Code:
Here is the code that reads data from the serial input, parses it, and displays the gas type, sensor value, and voltage on a 16×2 LCD:
Download the Virtual Smoke Sensor App
I have provided two versions of the application for Windows 64-bit systems. Please read the following notice carefully to decide which package best suits your needs.
1. Application with Java Included
- File Size: Larger (includes Java Runtime Environment).
- Use This If:
- You do not have Java installed on your computer.
- You are unsure whether Java is installed or which version is installed.
- You want a simple, hassle-free setup that works out of the box.
- Zip File Size = 137.5MB
2. Application Without Java Included
- File Size: Smaller (does not include Java).
- Use This If:
- You already have Java installed on your system.
- Your Java version is compatible with the application.
- You want to save disk space or download time.
- Zip File Size = 6.2MB
Password for the ZIP Files:
The password for extracting the ZIP files is electronicstree.com.
How to Check if Java is Installed on Your System:
- Windows: Open Command Prompt and type
java -version
. - If a version is displayed, Java is installed. Ensure it matches the version required by the application (Open JDK17).
Recommendation:
If you are unsure, I recommend downloading the Application with Java Included for a smoother experience.
For any issues or questions, feel free to contact me.
Note:
This project is open source, and you can find it on GitHub.