LP_Relay Controller_UI

A place to showcase LattePanda creations!
User avatar
LNC-SPN
Posts: 28
Joined: Thu May 19, 2016 7:04 pm
Location: Valencia, Spain
Contact:

Sat Jul 15, 2017 3:55 pm

Hi LattePanda community!
I have made an application to control up to 8 relays, It also has the voice synthesizer.
Using Visual Studio 2017 (C# .NET) and a modfied LattePanda.CustomFirmata library.
LP_Relay Controller_UI
DExnDFoXUAAGctQ.jpg
LattePanda Relay Controller UI (Image)
DExnDFoXUAAGctQ.jpg (148.87 KiB) Viewed 8771 times
Image
You can change the Pin and the text of each Relay. The configuration and status of each relay will be saved when you close the program. Also the voice settings.

I have a thread on twitter where there is a demo video:https://twitter.com/hardNsoft_81/status ... 2860551168

Project Repository
@ gitHub: https://github.com/lncspn/LP_Relay-Controller_UI

Last Compiled Executable
https://github.com/lncspn/LP_Relay-Cont ... ler_UI.exe
Last edited by LNC-SPN on Tue Oct 31, 2017 10:01 am, edited 8 times in total.

User avatar
ED209
Posts: 222
Joined: Tue Apr 19, 2016 3:31 pm

Tue Jul 18, 2017 12:08 pm

Hey good job. Are you building a smart home project to control the home devices?

User avatar
LNC-SPN
Posts: 28
Joined: Thu May 19, 2016 7:04 pm
Location: Valencia, Spain
Contact:

Tue Jul 18, 2017 2:03 pm

Many thanks ED209!

My next step for smart home should be to include radiofrequency & Infrared devices control, time scheduling, and voice recognition.

All this would be fine but I'm learning, and it's hard for me.

I appreciate your reply. Greetings. ;)

User avatar
tyjjr
Posts: 94
Joined: Thu Apr 21, 2016 5:38 am

Fri Jul 28, 2017 2:47 pm

Wow, really nice work!!!!

How do you control the arduino? How fast it can be? i'm looking for a same solution!

User avatar
LNC-SPN
Posts: 28
Joined: Thu May 19, 2016 7:04 pm
Location: Valencia, Spain
Contact:

Sat Aug 05, 2017 4:07 pm

Hi tyjjr! Many thanks!

This program uses the LattePanda.Firmata library to control the Arduino. It connects by default to 57600 baud.
The speed of response in the relay is instantaneous even using the voice synthesizer, the synthesizer uses a new thread.

User avatar
kisron86
Posts: 3
Joined: Wed Aug 16, 2017 6:20 pm

Wed Aug 16, 2017 6:23 pm

wow great project !!!
can you give me some example code to sending data analog in thingspeak.com ? please email me kisron86@gmail.com thank you

User avatar
LNC-SPN
Posts: 28
Joined: Thu May 19, 2016 7:04 pm
Location: Valencia, Spain
Contact:

Tue Aug 22, 2017 3:22 pm

kisron86 wrote:wow great project !!!
can you give me some example code to sending data analog in thingspeak.com ? please email me kisron86@gmail.com thank you
Many thanks kisron86!
I can't tell you couse I have not tried yet.

Sample code (DHT sensor, you need a modified Firmata library)

Code: Select all

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Net;
using System.Threading;
using LattePanda.Firmata;


namespace DHT
{
    class Program
    {
        const string WRITEKEY = "THINGSPEAK_KEY_HERE";     //Thingspeak Key
        const int DELAY = 20;                           //Delay time for send packet to Thingspeak
        const int GET_TEMPERATURE = 0x47;
        const int GET_FAHRENHEIT = 0x48;
        const int GET_HUMIDITY = 0x49;
        static void Main(string[] args)
        {
            Arduino arduino = new Arduino();
            while (true)
            {
                Console.WriteLine("Receiving sensor data...");
                //
                arduino.DHT(GET_TEMPERATURE);           //For Fahrenheit : GET_FAHRENHEIT
                Thread.Sleep(2000);
                string temp = arduino.STRING_DHT;
                //
                arduino.DHT(GET_HUMIDITY);
                Thread.Sleep(2000);
                string hum = arduino.STRING_DHT;
                //
                try
                {
                    string rec = "";
                    string strUpdateBase = "http://api.thingspeak.com/update";
                    string strUpdateURI = strUpdateBase + "?key=" + WRITEKEY;

                    strUpdateURI += "&field1=" + temp;
                    strUpdateURI += "&field2=" + hum;

                    HttpWebRequest request = WebRequest.Create(strUpdateURI) as HttpWebRequest;
                    request.Timeout = 5000;
                    request.Proxy = null;
                    //request.Accept = "application/xrds+xml";  
                    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
                    WebHeaderCollection header = response.Headers;
                    var encoding = ASCIIEncoding.ASCII;
                    using (var reader = new System.IO.StreamReader(response.GetResponseStream(), encoding))
                    {
                        rec = reader.ReadToEnd();
                        Console.WriteLine("The data was successfully sent. Node Number: " + rec);
                        Console.WriteLine(DateTime.Now.ToString("dd/MM/yyyy - HH:mm:ss") + "      Temperature: " + temp + " °C" + "       Humidity: " + hum+" %");
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error: " + ex.Message);
                }
                Thread.Sleep(1000);
                for (int i = 0; i <= DELAY; i++)
                {                 
                    Console.Write(".");
                    Thread.Sleep(1000);
                }
                Console.WriteLine();
            }
        }
    }
}
There's a ThingSpeak .NET Class
https://cobwebsonmymind.wordpress.com/2 ... net-class/

There's a .NET C# library for ThingSpeak
https://github.com/DrHlus1/thingspeak-.net-library

Hope I've helped.

User avatar
LNC-SPN
Posts: 28
Joined: Thu May 19, 2016 7:04 pm
Location: Valencia, Spain
Contact:

Sat Sep 09, 2017 6:38 pm

Now im testing the Desktop App Converter to port the Relay Controller UI to Windows Store. :)

Image

Everything is working. The conversion results in a 64-bit App.
Need a new icon-logo, to make it look better in the store and in the app.

Image

User avatar
ED209
Posts: 222
Joined: Tue Apr 19, 2016 3:31 pm

Thu Sep 14, 2017 9:31 am

LNC-ORNA wrote:
Sat Sep 09, 2017 6:38 pm
Now im testing the Desktop App Converter to port the Relay Controller UI to Windows Store. :)

Image

Everything is working. The conversion results in a 64-bit App.
Need a new icon-logo, to make it look better in the store and in the app.

Image
Hoho! Nice try. Is it hard to deal with the Microsoft application review process?

User avatar
LNC-SPN
Posts: 28
Joined: Thu May 19, 2016 7:04 pm
Location: Valencia, Spain
Contact:

Fri Sep 15, 2017 6:49 pm

To publish my App to Windows Store I need to register as an App Developer, and pay for publish :cry: if your Apps are Free with no Ads or not.

This is the last email I've received from microsoft:
Dear Luis,

Thank you for your interest in using Desktop Bridge to bring your app or game to the Windows Store. Now that you’ve submitted your information to our team, we’d like to give you a quick rundown on the process:

Our team will be doing the following:

Step 1: Review the information you've submitted and reach out to you if we have any questions.
Step 2: Verify your app or game's compatibility with the Desktop Bridge and work with you to address any concerns.
Step 3: Enable your Dev Center account with the correct permissions and assist in getting your app or game published to the Windows Store.
Your next step is to register on the Dev Center to create your publisher account.

Stay tuned for further updates from the Desktop Bridge team. We'll be in touch soon.

Post Reply