How to make a heat sensor at home?

In this section, I will tell you how to measure values such as heat and humidity. Basically, we have some requirements.

Arduino Uno or make connections to the device as shown in the figure. Then open the Arduino IDE and compile the project in the Arduino IDE and transfer it to the device using the following codes.

#include <dht11.h>
int DHT11_pin=2;
dht11 DHT11_sensor;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  int chk = DHT11_sensor.read(DHT11_pin);
  

  int data=Serial.read();

  if(data=='1')
  {
    Serial.println((float)DHT11_sensor.humidity, 2);
  }
  else if(data=='2')
  {
    Serial.println((float)DHT11_sensor.temperature, 2);
  }
  else if(data=='3')
  {
    Serial.println(DHT11_sensor.dewPoint(), 2);
  }
}

When you enter “1” value from the serial port screen and enter, it will give the humidity value. If you type 2 through the serial port screen, it will give the temperature. We used dewPoint function as a third option. You can improve too. The values you receive are a 3. in the batch application, you can start using it by connecting to the serial port screen.

We wrote a program in Turkish. Name of the program: Temperature Sensor.

This program is a simple program that automatically reads values through Arduino Uno. Values async as realtime as Form1.in our cs file, we read from the serial port and print live to the screen.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO.Ports;
using System.Threading;
using System.Globalization;

namespace HararetSensoru
{
    public partial class Form1 : Form
    {
        SerialPort sp;
        float nem;
        float sicaklik;
        float cig;
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string[] ports = SerialPort.GetPortNames();

            foreach(string port in ports)
            {
                listBox1.Items.Add(port);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            button1.Enabled = false;

            if (listBox1.SelectedItem != null)
            {
                sp = new SerialPort(listBox1.SelectedItem.ToString(), 9600, Parity.None, 8, StopBits.One);
                sp.Open();

                ReadValues();
            }
            else
            {
                button1.Enabled = true;
                MessageBox.Show("Port seçtin mi?", "ROM port hatası", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

        }

        private async void ReadValues()
        {
            await Task.Run(() =>
            {
                while (true)
                {
                    SetStatus("Okunuyor...");
                    sp.Write("1");
                    nem = (float)Math.Round(float.Parse(sp.ReadLine(), CultureInfo.InvariantCulture.NumberFormat));
                    ChangeLabel1Text(nem.ToString()+" %");
                    ChangeProgressBar1((int)(nem));

                    sp.Write("2");
                    sicaklik = (float)Math.Round(float.Parse(sp.ReadLine(), CultureInfo.InvariantCulture.NumberFormat));
                    ChangeLabel2Text(sicaklik.ToString()+" 'C");
                    ChangeProgressBar2((int)(sicaklik));

                    sp.Write("3");
                    cig = (float)Math.Round(float.Parse(sp.ReadLine(), CultureInfo.InvariantCulture.NumberFormat));
                    ChangeLabel3Text(cig.ToString()+" %");
                    ChangeProgressBar3((int)(cig));
                    SetStatus("Okundu.");

                    System.Threading.Thread.Sleep(1000); // time to sleep thread
                }
            });
        }

        private void ChangeLabel1Text(string value)
        {
            if (label1.InvokeRequired)
            {
                label1.Invoke(new Action<string>(ChangeLabel1Text), value);
                return;
            }
            label1.Text = value;
        }


        private void ChangeLabel2Text(string value)
        {
            if (label2.InvokeRequired)
            {
                label2.Invoke(new Action<string>(ChangeLabel2Text), value);
                return;
            }
            label2.Text = value;
        }

        private void ChangeLabel3Text(string value)
        {
            if (label3.InvokeRequired)
            {
                label3.Invoke(new Action<string>(ChangeLabel3Text), value);
                return;
            }
            label3.Text = value;
        }

        private void ChangeProgressBar1(int value)
        {
            if (progressBar1.InvokeRequired)
            {
                progressBar1.Invoke(new Action<int>(ChangeProgressBar1), value);
                return;
            }
            if(value > 100)
            {
                value = 100 / (value / 100);
            }
            progressBar1.Value = value;
        }

        private void ChangeProgressBar2(int value)
        {
            if (progressBar2.InvokeRequired)
            {
                progressBar2.Invoke(new Action<int>(ChangeProgressBar2), value);
                return;
            }
            if (value > 100)
            {
                value = 100 / (value / 100);
            }
            progressBar2.Value = value;
        }

        private void ChangeProgressBar3(int value)
        {
            if (progressBar3.InvokeRequired)
            {
                progressBar3.Invoke(new Action<int>(ChangeProgressBar3), value);
                return;
            }
            if (value > 100)
            {
                value = 100 / (value / 100);
            }
            progressBar3.Value = value;
        }

        private void SetStatus(string value)
        {
            toolStripStatusLabel1.Text = value;
        }


        .....
    }
}

As you can see, the Program simply lists serial ports, reads the selected ROM, sends 1,2,3 values to the device, measures the values, and prints them on the screen.

You can download the project files below.

Good improvements.

Developer Rights Manifesto

I’m publishing a developer rights manifesto. They can read and support this manifesto for the purpose of not using developers as slaves.

These developer rights cover the rights of all software or hardware developers. These rights include clauses that cover the process of compliance between the employer and the employer. Each employee who accepts these rights is considered a member of this association and is obliged to comply with the compliance process. The purpose of these rights is to address common clauses that protect the employer and the worker doing the work. In the event of a problem with these articles, no matter what the circumstances, the members of the association may change unanimously. All developers who accept this manifesto accept the obligations under which the rights are granted.

Read more “Developer Rights Manifesto”

Manifesto Part 1: Refusing to live with the judgment of the mind.

Everyone prefers a poor quality life today. Almost everyone is living the same style of life like each other’s clone. We accept the impositions brought by the system. We are all born, sent to school by force and receive education. Afterwards, we drift into a working life and run after jobs that are not related to us from morning to evening. In this process, we go to the military, we don’t actually have to, but once the system has imposed on us, we have to do it. We continue to do various jobs and live the lives that others have imposed on us.

Read more “Manifesto Part 1: Refusing to live with the judgment of the mind.”

Onix OS First Version Released (1.0)

After two years of daily updates and studies, we announce the first version. This version is a stable version. After a long period of work and losses, we have prepared a clean version by updating a lot of things, eliminating ambivalence and conflict. This version is good for all of us.

Read more “Onix OS First Version Released (1.0)”

OnixOS New Daily Update (92e9c15)

In this update, we finished the installation script we had been working on for a long time and integrated the other scripts. Additionally came the” O Language ” update.

New Onix Console Installer

The Onix installation tool starts by typing “Onix-install”. Then you can set up by watching the process as in screenshots.

O Language Update

The work and updates we’ve been doing on “O Language” are now in place and you see the result as in the screenshots.

We are ready for the next Beta because a lot of things are sitting down after this update.

Updated Download Links:

Web Sites