Notifications
Clear all

Reporting data from Arduino to PC

5 Posts
5 Users
7 Likes
796 Views
(@hayttom)
Member
Joined: 4 years ago
Posts: 61
Topic starter  

Although I'm far from finished with my model railway train lift, not to mention all the unrelated aspects of my railway, I am dreaming onward...  I've just bought a Waveshare Barcode Scanner Module and have the idea of scanning barcodes stuck underneath my rolling stock to generate histories of my train compositions and runs.  I can't imagine a slicker way of presenting bar codes to a scanner than having them hauled across by a train.  I have absolutely no need for this information but am interested in the challenge and then the data analysis (which I'm expert at).

How should I gather and export the data from an Arduino to my computer?

 

#H&WTR

#Model Railroad

 

 

Tom


   
Quote
(@yurkshirelad)
Member
Joined: 3 years ago
Posts: 493
 

You could run MQTT or a web server on your PC and send data to it. I wonder if Home Assistant could support this?

Another option might be https://thingspeak.com/, though I haven't used it; I've seen it in various YouTube videos.


   
hayttom and Centari reacted
ReplyQuote
Centari
(@centari)
Member
Joined: 4 years ago
Posts: 44
 

@hayttom, if you don't need the data real-time, you could also log it to an SD card, then transfer it.


   
hayttom reacted
ReplyQuote
WhitneyDesignLabs
(@whitneydesignlabs)
Member
Joined: 3 years ago
Posts: 99
 

@yurkshirelad Thingspeak is really cool.  My experiment with it is temperature logging (yeah, I know, novel idea eh...) But it was good learning, and works.  My future plan was to use it for reporting metal casting temps of a furnace, Thingspeak, temp logger, but now it just reports the temp of my kitchen. Having said that, I think it would be a great way to log bar codes passing by on a trainset.

 

Imagine by thought, create, don't wait, Scott.


   
Centari and hayttom reacted
ReplyQuote
(@jfabernathy)
Member
Joined: 3 years ago
Posts: 141
 

Based on my recent project, collecting data from micro-controllers and posting/saving it somewhere can be useful and relatively easy to setup. From the MCU side, if you pick one that has WiFi capability like the ESP32 you can use PubSubClient Arduino library to post the data in MQTT protocol very simply. The biggest issue is deciding what format the data take so the database will allow the types of searches you want. 

On the server side that collects the data I used a Raspberry Pi 4 and I setup the IOT_Stack that Andreas did a video on awhile back. IOTstack

I just picked Mosquitto MQTT broker to receive the data from the MCUs, NodeRed to setup the data flows, influxDB to timestamp and store the data, and grafana to give me a GUI to plot all the data in many forms.

I documented what I did for temperature and humidity data remotely but any kind of data would work similarly MQTT-humidity-and-temperature

If your code won't compile, have another glass of bourbon. Eventual the problem will be solved.


   
YurkshireLad and Centari reacted
ReplyQuote