Arduino Real Time Data

Download Report

Transcript Arduino Real Time Data

Arduino Real Time Data
Download Arduino Mega2560:
http://arduino.cc/en/Main/ArduinoBoardMega2560
Download Arduino Processing:
http://playground.arduino.cc/Interfacing/Processing
Note: This was done but not employed. Firmata DB was for UNO.
Download PLX-DAQ:
http://www.parallax.com/tabid/393/Default.aspx
Blog on PLX-DAQ-n-Arduino:
http://robottini.altervista.org/arduino-and-real-time-charts-in-excel
Brief PLX-DAQ Code Used in Arduino Sketches. I think this all of it:
LABLE - Used to define the column headings.
Syntax: Serial.println (“LABEL, INT_COLUMN”);
DATE, TIME - Allows the serial port to send data to Excel.
Syntax: Serial.print (“DATE, TIME,”); Serial.println (val);
Note: Serial.print (“DATE, TIME,”) must be used before
each Serial.println();
ROW, SET, k, - This allows control over the row that excel
accepts data.
Syntax: Serial.println(ROW, SET, #);
The column control: Serial.print(“,”) ; Like CSV
Short Ardunio Script Placing Arduino Reads into Excel Meter
Box7_ino.txt
OpenDocument Text
Double click to open, 233 line sketch, reading analog pins A(15:0] and sending it to ECEL. Need win2k or better.
14 bit decode of up/dwn counters to display CLK, and write A5A5 to nibs 7:4 and read that into nibs 3:0.
Use bench_mon.xlsm found in plx.
NOTES:
The Arduino code writes to columns 1-3 (A-C) and ECEL maps
columns B to G and to C to I .Column A is the “DATA, TIME, “
This is needed to have EXCEL read the incoming data.
ECEL Snapshot
Supplies
5V
5.00
V
0.00
mA
12V
3.44
V
0.00
mA
V-V
2.26
V
0.00
mA
N12V
4.99
V
0.00
mA
Measured
A1-2
0.00
V
5.00
V
A3-4
0.00
V
5.00
V
A5-6
0.00
V
5.00
V
A7-8
5.00
V
5.00
V
Main Clock
10.00
813.74
BASE
CLK
MHZ
HZ
NIBS [15:0]
Data R
-
-
-
- H
A
5
A
5 H
Data W
A
5
A
5 H
-
-
-
- H
8 Nibs can be read or written: pic shows a write of A5A5 and
reading same. The value to R/W is CSV file read by script.
The frequency will be the decode of up/down counters used
to generate CLOCK with base frequency of either 10 or 20
MHZ crystal module and I really need the “BOX” to finish this.
Reads of 12 analog ports with wait of 5mS B/W reads plus
40mS at end of reads allows about 10 reads/s.
The box colors are based on the data received , set in EXCEL.
Supply : 0<=5V consider a 5% de-rating.
Supply >5v are a 10% de-rating.
All values read outside their de-rating show RED.
The voltages monitored were 5V, 3.3V and 0V and the one
pot V- OUT seen in the V-V supply where the color green/red
was base on value V>= 0 = green and anything else is red.
All current values were tied to 0V where 0-0.9 = green and
any measurement above or below this range is red.
The Measured value has no constraints and will always be
green.
Must! open xcel to blank sheet. Connect to data port then
move meter sheet to first page (blank out Meter).
EXCEL Data Sheet Used
THE BOX
10:15:41
10:15:41
10:15:41
10:15:41
10:15:41
10:15:41
10:15:40
10:15:40
10:15:40
10:15:40
10:15:41
AM
AM
AM
AM
AM
AM
AM
AM
AM
AM AM A
5.00
0.00
3.44
0.00
2.26
0.00
5.00
0.00
0.00
5.00
0.00
4.99
0.00
4.99
5.00
5.00
1.22 kHZ
-
Supplies
10 MHZ
A 5A 5
5A
5- - - -
5V
5.00
V
0.00
mA
12V
3.44
V
0.00
mA
V-V
2.26
V
0.00
mA
N12V
5.00
V
0.00
mA
Measured
A1-2
0.00
V
5.00
V
A3-4
0.00
V
4.99
V
A5-6
0.00
V
4.99
V
A7-8
5.00
V
5.00
V
Main Clock
10.00
1.22
BASE
CLK
MHZ
kHZ
NIBS [15:0]
Data R
-
-
-
- H
Data W
A 5 A 5 H
A 5 A 5 H
-
This is the excel DB used. The DATE,TIME, field A1 , measured value 1-2=B2-3.
You must use the downloaded excel worksheet it contains VB code that allows Aduino
access, or this one. Sheet : bench_mon2.xlsm.
-
-
- H
ARDUINO & PROCESSING
Download Processing:
http://processing.org
Download Arduino Processing:
http://playground.arduino.cc/Interfacing/Processing
Copy folder arduino to processing folder
C:\downloads\processing-2.0.1-windows32\processing-2.0.1\modes\java\libraries
Enter processing and add font: “Arial-BoldMT-14”, <Tools><Create Font>
Add sketch box_proc_pde.txt making the box.
box_pr oc_pde.txt
box_pr oc_ino.txt
Click R-W to change the 32 bit bus status.
Click Log to allow data log.
Change The 32 Bit Bus
The meter will default to all
read: r,r,r,r,r,r,r,r . Click R-W
and the box below will popup, make your entry and
cliclk OK. The board is
currently wired upper 2
bytes to the lower 2 bytes,
so it will read what it
writes.
Data Log
Click the Log button and the box
below will pop-up suggesting a file
name of the current date and time.
Accept it or change to your
preference. This will write out a CSV
file containing the measurements and
settings of the box.
CSV File
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.26
8.26
8.26
8.26
8.26
8.26
8.26
8.26
8.26
8.26
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
8.25
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.21
9.22
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.43
2.43
2.43
2.43
2.43
2.43
2.43
2.43
2.43
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
2.44
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.01
1.01
1.01
1.01
1.01
1.01
1.01
1.01
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.02
1.01
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
2.05
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
4.99
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
610.39
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
HZ
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
MHZ
Summary of Box Details Listing Ports Used and the Data Transieved
Would Like to Employ SPLC780D 40X4 LCD Display
CSV Values Sent to Serial Port
Idenity ~Value chars
Duib Port
5V
5.00
5V_I
1.65
12V
8.25
12V_I
1.65
V-V
14.96
V-V_I
1.65
N12V
3.96
N12V_I 1.65
A0
1.65
A1
1.65
A2
5.00
A3
5.00
A4
3.33
A5
3.33
A6
5.00
A7
4.99
CLK
610.39
FREQ
HZ
BASE
10
FREQ
MHZ
NR7
F
NR6
F
NR5
F
NR4
F
NR3
F
NR2
F
NR1
F
NR0
F
NW7
NW6
NW5
NW4
NW3
NW2
NW1
NW0
R-W7
r
R-W6
r
R-W5
r
R-W4
r
R-W3
r
R-W2
r
R-W1
r
R-R0
r
4
4
5
4
5
4
5
4
4
4
4
4
4
4
4
4
6
3
2
3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
D[13:2,14,15]
D[52,50,48,46]
D[44,42,40,38]
D[36,34,32,30]
D[28,26,24,22]
D[53,51,49,47]
D[45,43,41,39]
D[37,35,33,31]
D[29,27,25,23]
D[52,50,48,46]
D[44,42,40,38]
D[36,34,32,30]
D[28,26,24,22]
D[53,51,49,47]
D[45,43,41,39]
D[37,35,33,31]
D[29,27,25,23]
-
I/O
Serial1 Display
Port Chars
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
14
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
94
A0
A1
A2
A3
A4
A5
A6
A7
A8
A9
A10
A11
A12
A13
A14
A15
4
4
5
4
5
4
5
4
4
4
4
4
4
4
4
4
6
0
2
0
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
165
165
165
165
Add
Units
Chars
Space( )
V
mA
V
mA
V
mA
V
mA
V
V
V
V
V
V
V
V
2
3
2
3
2
3
2
3
2
2
2
2
2
2
2
2
0
4
3
4
2
0
0
0
0
0
0
2
2
0
0
0
0
0
0
2
kHZ
MHZ
R
H
W
H
Port Value
16 1/0
0
1
5
2
.
3
0
4
0
5
V
1
5
0
0
.
.
.
0
0
0
0
1
5
V
V
V
6
7
8
1
9
6
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
5 m A
1 2 . 3 5 V
1 6 5 m A
1 0
M H Z
1
0
0
6
.
.
5 m A
0 2 V
0 6 V
~ 1 2
0
0
.
.
.
1 5 V
0 3 V
0 7 V
1 6 5 m A
0 . 0 4 V
0 . 0 8 V
6 1 0 . 3 9
H Z
R > ~ ~ ~ ~ A B C D
H
W > A B C D ~ ~ ~ ~
H
SPLC Character Chart
Serial Port
CHARS PORTS
105
94
Serial2 Port
Chars
158
194