Ads

Tampilkan postingan dengan label Arduino Tutorial. Tampilkan semua postingan
Tampilkan postingan dengan label Arduino Tutorial. Tampilkan semua postingan

Selasa, 30 Oktober 2018

Tutorial for Making Software VBNET Arduino Part 2

welcome to erwinproject, this time the admin will discuss the Tutorial for Making VBNET Arduino Part 2 Software. Here I will explain starting from compiling forms in visual basic to coding to connecting to Arduino using serial. let's look at the tutorial below.
  1. The first step is to build a GUI (graphical user interface) or arrange the components needed.

  2. make sure to know the address (name) of the component.

  3. Add Component (drag and drop) "SerialPort" in toolbox . Now press F7 to write program or code.
    ' CODE BY ERWINPROJECT
    ' thanks theme :
    ' - Valley Theme by Earn
    ' - Mono Theme by Vengfull
    ' - Aether Theme made by AeroRev9
    
    Imports System.IO
    Imports System.IO.Ports
    Imports System.Threading
    Imports System.Diagnostics
    
    Public Class Form1
        Dim receivedData As String = ""
    
        Function ReceiveSerialData() As String
            Dim Incoming As String
            Try
                Incoming = SerialPort1.ReadExisting()
                If Incoming Is Nothing Then
                    Return "nothing" & vbCrLf
                Else
                    Return Incoming
                End If
            Catch ex As TimeoutException
                Return "Error: Serial Port read timed out."
            End Try
    
        End Function
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            For i As Integer = 0 To _
             My.Computer.Ports.SerialPortNames.Count - 1
                ComboBox1.Items.Add( _
                My.Computer.Ports.SerialPortNames(i))
            Next
        End Sub
    
        Private Sub AetherButton1_Click(sender As Object, e As EventArgs) Handles AetherButton1.Click
            If ComboBox1.Text = "" Then
                MsgBox("SELECT PORT !")
            ElseIf AetherTextbox1.Text = "" Then
                AetherTextbox1.Text = 9600
            Else
                If SerialPort1.IsOpen Then
                    SerialPort1.Close()
                End If
    
                Try
                    With SerialPort1
                        .PortName = ComboBox1.Text
                        .BaudRate = AetherButton1.Text
                        .ReadBufferSize = 500
                        .Parity = IO.Ports.Parity.None
                        .DataBits = 8
                        .StopBits = IO.Ports.StopBits.One
                        .Handshake = IO.Ports.Handshake.None
                    End With
                    SerialPort1.Open()
                Catch ex As Exception
                    MsgBox(ex.Message)
                End Try
            End If
        End Sub
    
        Private Sub AetherButton2_Click(sender As Object, e As EventArgs) Handles AetherButton2.Click
            Try
                SerialPort1.Close()
                MsgBox("Disconnect from COM")
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
        End Sub
    
        Private Sub MonoFlat_Toggle1_ToggledChanged() Handles MonoFlat_Toggle1.ToggledChanged
            If MonoFlat_Toggle1.Toggled = False And SerialPort1.IsOpen Then
                SerialPort1.Write("LED 1 OFF")
    
            ElseIf MonoFlat_Toggle1.Toggled = True And SerialPort1.IsOpen Then
                SerialPort1.Write("LED 1 ON")
            End If
        End Sub
    
        Private Sub MonoFlat_Toggle2_ToggledChanged() Handles MonoFlat_Toggle2.ToggledChanged
            If MonoFlat_Toggle2.Toggled = False And SerialPort1.IsOpen Then
                SerialPort1.Write("LED 2 OFF")
    
            ElseIf MonoFlat_Toggle2.Toggled = True And SerialPort1.IsOpen Then
                SerialPort1.Write("LED 2 ON")
            End If
        End Sub
    
        Private Sub MonoFlat_Toggle3_ToggledChanged() Handles MonoFlat_Toggle3.ToggledChanged
            If MonoFlat_Toggle3.Toggled = False And SerialPort1.IsOpen Then
                SerialPort1.Write("LED 3 OFF")
    
            ElseIf MonoFlat_Toggle3.Toggled = True And SerialPort1.IsOpen Then
                SerialPort1.Write("LED 3 ON")
            End If
        End Sub
    
        Private Sub MonoFlat_Toggle4_ToggledChanged() Handles MonoFlat_Toggle4.ToggledChanged
            If MonoFlat_Toggle4.Toggled = False And SerialPort1.IsOpen Then
                SerialPort1.Write("LED 4 OFF")
    
            ElseIf MonoFlat_Toggle4.Toggled = True And SerialPort1.IsOpen Then
                SerialPort1.Write("LED 4 ON")
            End If
        End Sub
    End Class
    
  4. Press Start to run your aplication .

Jumat, 26 Oktober 2018

Tutorial for Making Software VBNET Arduino Part 1

Hi friend erwinproject, on part 1 this time we will discuss about making software with visual basic net. here I use visual studio, if you use visual basic 2010 the syntax is the same.
the initial step of making sure you have the software below.
Download Visual Studio 2012 [here]
we just started to manufacture the software:
  1. Create a new project file in visual studio, select windows application form and then write the name of the project then press OK.

  2. After that the blank form appears as shown below, then right-click on your project name in the Solution Exploer column, click add, then press Exiting Item, then enter the theme script below.

    [ Download Script Skin ] ( AeroV9, Mono, Valley )
  3. After you download the Script skin above. you enter into the visual studio do step no 2. after that click build on the tab above. then press rebuild as shown below.

  4. Then check in the Toolbox section new components will be ready to use. as shown below
  5. Then select the component that says "Valley Theme". to select the components, namely by drag and drop components.
enough of these part 1 software builds, for part 2 will definitely be updated periodically. thanks .

Kamis, 25 Oktober 2018

Enter AT Command HC-05 Mode with USB TTL


Hi, ErwinProject's friend, we will discuss HC05 this time. This time we will also "Enter AT Command HC-05 Mode with USB TTL".

USB to TTL or often also called USB to UART is one of the many types of converter cables that we often encounter when playing in the field of microcontrollers and micro communications to computers. This USB to TTL cable allows users to make electronic devices such as the microcontroller can communicate with the computer.
Then, what is the AT Command for the HC-05 module? One small example with AT Command on the Bluetooth HC-05 Module is knowing the software version, knowing or renaming the HC-05 module, knowing or changing the HC-05 module password and also knowing or changing the serial module HC-05 communication speed (Baudrate) .


Alat dan Bahan yang dibutuhkan :

  • 1x USB TTL (For example, I use CP2102)
  • 1x Bluetooth HC-05 Module
  • Jumper cable to taste
  • Breadboard (Project Board)
  • Hyper Terminal Software, click DOWNLOAD
  • To see AT Command Set, CLICK HERE



Langkah - Langkah :

1.) cable configuration as shown below.

Cable Configuration Description :

  • VCC on USB TTL is connected to VCC on HC-05
  • VCC on USB TTL is connected to KEY on HC-05
  • GND on USB TTL is connected to GND on HC-05
  • RX on USB TTL is connected to TXD on HC-05
  • TX on USB TTL is connected to RXD on HC-05


2.) After that, plug in your USB TTL on the USB port on the PC.
3.) Then Download and install the Hyperterminal Software on your Windows.
4.) If the Hyperterminal Software has been installed, run the Software, then click File -> Properties


5.) Then open the Device manager from your windows, and see the USB TTL COM Port that is reduced.

6.) When detected, let's switch back to Hyperterminal Software and Set COM Port


7.) After setting COM Port, click Configure, then Set Bits per second to 38400, then OK


8.) When you have set Port, then we click the Settings tab, then click ASCII Setup again.


9.) Checklist on "Send line ends with line feed" and "Echo typed character locally" then click OK


10.) When finished, you can already send AT commands via Hyperterminal.

Thank you for visiting, good luck, hopefully useful.

imagesource : www.boarduino.web.id

Selasa, 23 Oktober 2018

Measure temperature and humidity with Arduino DHT11


Welcome to the erwinproject web, this time the erwinproject admin will share the arduino + DHT 11 code. DHT11 is a Temperature and Humidity sensor, it has a digital signal output which is calibrated with a complex temperature and humidity sensor. This technology ensures high reliability and excellent stability in the long run. The microcontroller is connected to a high performance of 8 bits. This sensor includes resistive elements and NTC temperature measuring devices. It has excellent quality, fast response, anti-interference capability and high cost performance advantages.
Each DHT11 sensor has a very accurate calibration feature from the calibration chamber humidity. The calibration coefficients are stored in OTP program memory, the internal sensor detects the signal in the process, we must call it the calibration coefficient. Integrated serial single-cable interface system to be fast and easy. Small size, low power, signal transmission distance of up to 20 meters, so that various applications and even the most demanding applications. This product is a single 4-pin pin package line. Convenient connection, special packages can be provided according to user needs.

Spesification : 
  • Supply Voltage: 5 V
  • Temperature range: 0-50 ° C error ± 2 ° C
  • Humidity: 20-90% RH ± 5% RH error
  • Interface: Digital

download this library "here"

#include<dht.h>
dht DHT;

// if you require to change the pin number, Edit the pin with your arduino pin.

#define DHT11_PIN A1 

void setup() {

  Serial.begin(9600);

  Serial.println("welcome to TechPonder Humidity and temperature Detector");
}

void loop() { // READ DATA

  int chk = DHT.read11(DHT11_PIN);

  Serial.println(" Humidity " );

  Serial.println(DHT.humidity, 1);

  Serial.println(" Temparature ");

  Serial.println(DHT.temperature, 1);

  delay(2000);

}
So, a tutorial from Erwin Project about Arduino DH11 Thanks for reading.

Tag :
  • Arduino DHT
  • Arudino Coding

Selasa, 05 Juni 2018

Read the voltage using Arduino


Read the voltage using Arduino - this time admin posted How to read voltage (volts) using Arduino.
In this tutorial, the basic is the use of analogue on Arduino. The recommendation from the input on the Arduino that I share can read from 0.01 vdc to 5 vdc (recommendation). If you want to use more than you can use prisoners (resistors) or can also be called divider dividers. then enter with an additional formula according to the resistor value. but this time the admin shared the 5 VDC max input.

Schematic:


Source Code [Raw

#define pinTeg A0
void setup() {
  Serial.begin(9600); 
}

void loop() {
  readTeg(); // MEMANGGIL PROGRAM
}

// PROGRAM MEMBACA TEGANGAN
void readTeg(){
  int ValueTeg = analogRead(pinTeg);
  float tegangan = ValueTeg * (5.0 / 1023.0);
  Serial.print("Tegangan : ");
  Serial.print(tegangan);
  Serial.println(" Volt");
  delay(100);
}

Or Download File Source Code

Note :
Here I use pin A0 on Arduino as input volt
Enough the tutorial "Reading voltage using Arduino" Thank you.