Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interfacing PIC16F877A with VB to display ADC Readings

Status
Not open for further replies.

noel_t

Junior Member level 3
Joined
May 31, 2011
Messages
30
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,288
Activity points
1,592
View attachment VB.rarIn fact, I am working on a project ( Data Acquisition system for Solar Panel) which collects all the data (from the sensors e.g. light, temperature, voltage, current) and after processing by Microcontroller (PIC Microcontroller) will display them on the LCD. It is also required to show/display these Four (4) parameters in the computer screen.
Therefore, as per need of the project, I selected Visual Basic to do it for me.
I have already completed the interfacing part (All the necessary codes-C Language for transmitting data from PIC to the UART-USB), and it is successfully transmitting data to the computer.( It is tried by LABVIEW)

What I need is to configure my VB file to receive the data from USB and show it on the specified textbox( which is designed by VB).

Since I have not done the VB design and my friend helped me to do it, I am having some difficulties by working with it. I am getting errors and the measured values which supposed to be displayed in the defined text box can not be showed.

Please help me to eliminate the errors and give me your advice on how I can establish the communication between the VB and Microcontroller.

Here are the errors I am getting.
--------------------------------------------------------------------
I get this error “Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: startIndex”
' Text display routine, which appends the received string to any text in the Received TextBox.
Private Sub Display()
Temperature.Text = New String(stringtoparse, 1, 5)
Light.Text = New String(stringtoparse, 6, 5)
Volt.Text = New String(stringtoparse, 11, 5)
Current.Text = New String(stringtoparse, 16, 5)
------------------------------------------------------------------------
 

The string is shorter than the "start point" parameter, poss empty string
(stringtoparse, 11, 5)

Maybe stringtoparse isn't 16 long.... Set a breakpoint on that line, and check values in stringtoparse (wave the mouse over it) to check whats in there matey
Neal
 
i also make the same project with you .. "monitoring system for solar panel". my problem is i don't have the coding for PIC 16F877A. can you please help me ?
can i've your coding for pic ? i also don't know how to connect my hardware to the PIC 16F877A.
 

i also make the same project with you .. "monitoring system for solar panel". my problem is i don't have the coding for PIC 16F877A. can you please help me ?
can i've your coding for pic ? i also don't know how to connect my hardware to the PIC 16F877A.


Yes I help you :) but please give me more details about the technical objectives of your project. Input/outputs and your sensors.
 
  • Like
Reactions: halina

    halina

    Points: 2
    Helpful Answer Positive Rating
My input is from solar panel (12volt). Then i connect it to boost converter (DC to DC), from converter i connect it to inverter. the input from inverter is 12volt to 230volt. my big problem is i dont know how to display the voltage and current from load using PIC 16F877A. when i study about this, majority just used LCD to display the volt and current. But i need to display it on PC. It is possible to u, to help me with the simple coding ?:-D
 
  • Like
Reactions: noel_t

    noel_t

    Points: 2
    Helpful Answer Positive Rating
Yea the time you display it on LCD It's possible to display it on the PC too. But I wonder that you are talking about AC voltage of ranging between 12V to 230V. PIC only accepts MAX voltage drop on its input 5V and the time you go beyond this it will damage the IC. and It is my question that How you want to Process the signal of that range to fit to your PIC input. Because In my project I did not use any inverter and directly I fed the DC voltage source from the solar panel to the Microcontroller!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top