Controlling Arduino with Database from PC : possible ? how?

hi all,

dealing with modell railway i would like to control cars,locomotives, roadways with switches by a database and application on pc/laptop,
arduino only to manage hardware, and pc for logical issues

guess : this might be possible !

which way or method : rx/tx-communication or what ?

What do you mean by this ^
What do you mean by logical issue
Arduino can handle most of the things

hi amitf,

in my nearly 30 years of experience with database-applications
(relational databases) i know
about the big amount of storage !

guess , it makes no much sense, to transport this affort on arduino..
for me, arduino is for hardware-issues, not logical managing data

is there any database product usable on arduino with Little space ?

so you want to store the data from arduino to your pc right ?

also you want to directly control car with your pc ( are you going to make car with arduino ?) as you said you want to control car and other stuff

sorry, english is Not my mother-tongue :unamused:

the cars and roadway and switches should be directly controlled by arduino,
but selection of them and special funcion at a time should be controlled by
application with data from database and this should work bidirectional ,
because status information must go back to database !

so i have to find out whether this could be done wifi - technology or similar,
knowing there are wfi-shields for arduino.

But i have no experience with this :thinking:

you can use bylnk app for it

and you have to use wifi shield with arduino or you can use esp8266/esp32
they have inbuilt wifi

hi,
as i dont have much overview with interfaces between PC and Arduino or ESP..,
just i'm looking to LAN-Shield for Arduino, hope i can manage informations on PC
and control hardware of model-railway with arduino.
have some experience with mySQL and Java / PHP, so the pc seems to be helpful
and have great monitor :grinning:

Which OS are you using.

PLX-DAQ provides a ready made interface for MS Excel PLX-DAQ version 2 - now with 64 bit support! (and further new features)

hi,
mostly used Windows 7,10,11
but Linux is not "off bounds"

what is "PLX-DAQ" ?

Check the link, it gives two way access to an Excel spread sheet on Windows.

An alternative might be to dumb down the PC software a little and to create a database of locomotive movements on an SD card, this is something that the mcu's are quite good at.

Heck YES

Just decide on what you want to translate on the Arduino side. You could send "Toot" from PC to Arduino and have the Arduino board blow the whistle.
Or you could send "toot toot" for two toots.
Or toot could == 2, then you could send the single character "2" to blow the whistle.
Essentially, the Arduino must parse each command, the execute on that serial input translation.

Rough idea of power from a very old rainy day project of mine:

Don't Cross The Streams (FP scientific calculator serial co-processor) - Community / Exhibition / Gallery - Arduino Forum

There is a little bit of a complication in how this would all get done. The Arduino must initiate the communication with the PC by sending a message that it is ready for the next instruction. Then the PC can decide what to send and when to send it. When the pc sends the next instruction to the Arduino, the Arduino will execute the command and send back to the PC that it is ready for the next command.

The ready command from the Arduino can also send any status information necessary.

This "protocol" can be expanded to allow the Arduino to send other status messages to the PC.

hi all,

as a bit of protocol : the arduino will get one or more commands from pc
and has to collect them as a joblist as long as the are fullfilled

but on a railway flow its possible, that not all jobs could fullfilled ..
this status is to send back to pc
the app on pc has to decide what to do , i.e. to stop arduino doing anything in a worse case..

the database has to check the singularity of trains and roadways and warants, that all pairs and roadways are complete !

no train may be lost (thats what happened by human error on real systems !)

thats my philosophy of the railway-system : no train may belost, it allways remains in system
independent of human mind !

Is Lynx with Labview still available? That use to be an easy, free USB control interface to an UNO at one time but I can't find much on it now.

hi,

do you mean labview from national instruments ?

i worked with labview 20 years ago on job, but this software has a different goal..

with a relational database one can do more with data
than excel or other spreadsheets or most measuring software tools : ..i.e.warant the singularity of data (even of dupels)
and building dependancy controlled information pools !

Hello lupus51
Design and code a software communication protocol between database and selected Arduino simply.

This seems so obvious that I wonder if I'm missing the point of the question. But an Arduino comes with a serial port, and you can use that to communicate with a PC. If a human user can see output from the Arduino on a monitor, and send input to it that way, then a computer could do the same. Write your code on the PC, have it tell the Arduino what to do and make the Arduino tell the computer what the current status of the hardware is. It should be possible to control a large and busy system within the time allowed by messages over the serial port.

Do you know about the Model Electronic Railway Group? If you joined (you do have to pay!) then you could discuss this kind of project.
https://www.merg.org.uk/

I do. Create your tables in SQL, Access or whatever and export them to Excel. Labview can read the Excel files and transfer that information to the Arduino.

Have the Arduino interpret this information as actions. You can control as many actions as you want with a large bank of shift registers.

Getting realtime status back to the database application to perform realtime adjustments would be a different matter

I can foresee at least 6 months full time to design, program and get this working. Do you have that much time to devote to the project?

This could be an option
https://raspberrytips.com/best-database-raspberry-pi/