Posted by Peter Bell on 11/01/2021 19:19:03:
…
If I wanted to get some simple data from it s rate would it need to beat seconds?
What would equipment would I need to do this?
Dont have a PC in the workshop.
Peter
I do it with a Serial USB connection to a headless RaspberryPi as described by John, but I'm familiar with Linux which might be too much for just data collection.
An alternative would be an SD Card Reader module, many other examples available, about £6.
Easy to wire and there's a library. Rather than send character data to the Serial Port, or as well as, the Arduino opens a file on an SD Card and writes lines of data to it.
When needed, the card is ejected and plugged into a PC. It should be recognised automatically and can then be opened with a spreadsheet. Most spreadsheets will recognise each line as a row of numbers, and import them as rows and columns. Then the spreadsheet can do the usual maths and graphs etc.
Probably only necessary to capture one number per tick – the time in microseconds since the previous tick. But it's easy to add info from other sensors:
At tick:
- set tickTime = Now
- period = tickTime -previousTime
- previousTime = tickTime
- get temperature
- Serial.print( period )
- Serial.print( "," )
- Serial.println( temperature )
Very similar for the SD card.
In setup:
File dataFile = SD.open("datalog.txt", FILE_WRITE);
In loop():
String dataString = String(period) + "," + String( temperature);
if (dataFile) {
dataFile.println(dataString);
}