Ads

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

Senin, 22 Oktober 2018

Source Code Control Arduino dengan VB.NET


Hi friend erwinproject, this time I will share the visual basic application code to control the Arduino microcontroller. some features that I entered into this application. including having a login system at the beginning when running this application. The login system uses the database as a reference so that users can enter the core form. The database used is using "Microsoft Access". This software has 2 accesses, namely access as "user" and "admin". Software connects with Microsoft Access files in the .mdb file. There are 5 tabs in the main form:
  1. User tab, used to add, edit and delete users
  2. Information Tab: Contains how to use software.
  3. Control tab: to control the Arduino microcontroller
  4. Tab monitoring: for monitoring data from the Arduino microcontroller in real time
  5. Tab coding: for this tab only users with admin status can access this tab. this tab contains Arduino Coding.

for editing the source I use Visual Studio 2012. The source code link can be downloaded below:

if there are problems please comment below (politely) or through the contact form. thanks.

Tag :

  • Visual Basic Arduino
  • VBNET
  • Arduino VB

Selasa, 31 Juli 2018

Tracking Circle with OPENCV Camera


Detection and Tracking circles with the Camera using Opencv - this time admin posts Detect and Tracking circles with Camera using Open CV or can be called Tracking Hough Circle with Camera.
In this tutorial, we will definitely be faced with a camera, for sample open camera coding, can be seen in the previous article "Access webcam camera with Open CV". This article is a combination of loop detection and camera. wow, how about it, sir? so we can detect circles in realtime with the camera and issue the position value of the circle in realtime, of course. Just look at the coding below.

Source Code [Raw
import cv2

videoCam = cv2.VideoCapture(1)

while True:
    cond, frame = videoCam.read()
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT, 1.2, 100)

    if circles is not None:
        circles = np.round(circles[0, :]).astype("int")
        for (x,y,radius) in circles:
            cv2.circle(frame, (x,y),radius, (0,255,0), 4)
            cv2.rectangle(frame, (x - 5, y - 5), (x + 5, y + 5), (0,128,255),1)
            nilaix = str(x)
            nilaiy = str(y)
            nilair = str(radius)
            if radius > 10:
                print('nilai x = ' + nilaix + ' | nilai y = ' + nilaiy + ' | nilai radius = ' + nilair)

    
    cv2.imshow('Original Video', frame)
    
    
    #cv2.imshow('Gray Video', gray)

    k = cv2.waitKey(1) & 0xff
    if k == ord('q'):
        break

videoCam.release()
cv2.destroyAllWindows()

Note :
Here I use Video Capture (1). because "0" for cameras on laptops, and "1" for external cameras.
Thanks For Reading tutorial "Detection and Tracking circles with the Camera using Opencv" .

Tag :

  • OpenCv Camera
  • OpenCV Pyhton Camera
  • Opencv python tracking circle