Git Product home page Git Product logo

arduino-monitor's Introduction

Arduino-Monitor

A monitor system with multiple features using an Arduino Mega 2560

Short and quick readme until I have more time to go over this!

Features:

  • Serial Communications (both for debugging and commands)
  • Powermode features for low power usage/standby
  • Read current and voltage every 100ms (readOnce, readAverage, readMin, readMax and reset stores)
  • Read ambient light every 100ms (readOnce, readAverage, readMin, readMax and reset stores)
  • Read sound signal every 100ms using fft (readFundamentalFrequency, readVolume, readAverageVolume, readMinVolume, readMaxVolume, readFrequencyWaveform and reset stores)
  • Visual Basic program to interface with arduino

Overview

The arduino is designed to allow the automated testing of instrument cluster software.

Hardware

hardware

Communications

Serial communication baud rate = 9600

Libraries

Will add later, for now just look at the code and find online...

Functions

Power Mode

Prerequisites

None

Command String

Command Sub-command
PM XX

Function

Sub Command Meaning Comment
Never Received Power Off Power Off
0 Power Off Power Off (Low current mode)
1 On Ready for use

Voltage Measurement Functions

Prerequisites

PM = 1

Operation

The voltage at the input pin is read every 100ms and the store values (Minimum, Maximum, Average) are updated.

The Average value is calculated by using the previous 5 scheduled read values, if less than 5 reading have been taken since power on or receipt of a "Store Reset" command then the average is calculated using only the available data. i.e. if only 3 records are available they are added together then devided by 3.

Command String

Command Sub-command
MVM XX

Function Overview

Request Response
Command Meaning
Never Received Nothing
MVM ,0 Nothing
MVM ,1 Read Once
MVM ,2 Read Average
MVM ,3 Read Minimum
MVM ,4 Read Maximum
MVM ,5 Reset Stores
MVM 6 -> 255 Nothing

Function Descriptions

Read Once

Reads the current voltage (on demand) from the input and returns the value at a resolution of 0.1v per bit in a 16bit number (xx = MSB,yy = LSB).

Read Average

Reads the current stored Average value is returned at a resolution of 0.1v per bit in a 16bit number (xx = MSB,yy = LSB).

Read Minimum

Reads the Minimum voltage that has been seen since the "Reset Stores" command was received (or since Power On:- PM = 1), the value at a resolution of 0.1v per bit in a 16bit number (xx = MSB,yy = LSB).

Read Maximum

Reads the maximum voltage that has been seen since the "Reset Stores" command was received (or since Power On:- PM = 1), the value at a resolution of 0.1v per bit in a 16bit number (xx = MSB,yy = LSB).

Reset Stores

Resets the stored valus for minimum and maximum to zero (Voltage), returns 1 if reset was successful, 0 if not successful.


Current Measurement Functions

Prerequisites

PM = 1

Operation

The current at the input pin is read every 100ms and the store values (Minimum, Maximum, Average) are updated.

The Average value is calculated by using the previous 5 scheduled read values, if less than 5 reading have been taken since power on or receipt of a "Store Reset" command then the average is calculated using only the available data. i.e. if only 3 records are available they are added together then devided by 3.

Command String

Command Sub-command
MCM XX

Function Overview

Request Response
Command Meaning
Never Received Nothing
MCM ,0 Nothing
MCM ,1 Read Once
MCM ,2 Read Average
MCM ,3 Read Minimum
MCM ,4 Read Maximum
MCM ,5 Reset Stores
MCM 6 -> 255 Nothing

Function Descriptions

Read Once

Reads the current (on demand) from the input and returns the value at a resolution of 0.1ma per bit in a 16bit number (xx = MSB,yy = LSB).

Read Average

Reads the current stored Average value is returned at a resolution of 0.1ma per bit in a 16bit number (xx = MSB,yy = LSB).

Read Minimum

Reads the Minimum current that has been seen since the "Reset Stores" command was received (or since Power On:- PM = 1), the value at a resolution of 0.1ma per bit in a 16bit number (xx = MSB,yy = LSB).

Read Maximum

Reads the maximum current that has been seen since the "Reset Stores" command was received (or since Power On:- PM = 1), the value at a resolution of 0.1ma per bit in a 16bit number (xx = MSB,yy = LSB).

Reset Stores

Resets the stored valus for minimum and maximum to zero (Current), returns 1 if reset was successful, 0 if not successful.


Ambient Light Measurement Functions

Prerequisites

PM = 1

Operation

The ambient Light at the input pin is read every 100ms and the store values (Minimum, Maximum, Average) are updated.

The Average value is calculated by using the previous 5 scheduled read values, if less than 5 reading have been taken since power on or receipt of a "Store Reset" command then the average is calculated using only the available data. i.e. if only 3 records are available they are added together then devided by 3.

Command String

Command Sub-command
MLM XX

Function Overview

Request Response
Command Meaning
Never Received Nothing
MLM ,0 Nothing
MLM ,1 Read Once
MLM ,2 Read Average
MLM ,3 Read Minimum
MLM ,4 Read Maximum
MLM ,5 Reset Stores
MLM 6 -> 255 Nothing

Function Descriptions

Read Once

Reads the ambient Light (on demand) from the input and returns the value at a resolution of 0.1ma per bit in a 16bit number (xx = MSB,yy = LSB).

Read Average

Reads the ambient Light stored Average value is returned at a resolution of 0.1ma per bit in a 16bit number (xx = MSB,yy = LSB).

Read Minimum

Reads the Minimum ambient Light that has been seen since the "Reset Stores" command was received (or since Power On:- PM = 1), the value at a resolution of 0.1ma per bit in a 16bit number (xx = MSB,yy = LSB).

Read Maximum

Reads the maximum ambient Light that has been seen since the "Reset Stores" command was received (or since Power On:- PM = 1), the value at a resolution of 0.1ma per bit in a 16bit number (xx = MSB,yy = LSB).

Reset Stores

Resets the stored valus for minimum and maximum to zero (ambient Light), returns 1 if reset was successful, 0 if not successful.


Sound Measurement Functions

Prerequisites

PM = 1

Operation

The Sound Signal at the input pin is read on demand and the calculated values are returned using the response message.

Every 100ms a reading of sound volume is taken and the store values (Minimum, Maximum, Average) are updated.

The Average value is calculated by using the previous 5 scheduled read values, if less than 5 reading have been taken since power on or receipt of a "Store Reset" command then the average is calculated using only the available data. i.e. if only 3 records are available they are added together then devided by 3.

Command String

Command Sub-command
MSM XX

Function Overview

Request Response
Command Meaning
Never Received Nothing
MSM ,0 Nothing
MSM ,1 Read Fundemental Frequency
MSM ,2 Read Volume Level
MSM ,3 Read Average Volume Level
MSM ,4 Read Minimum Volume Level
MSM ,5 Read Maximum Volume Level
MSM ,6 Read Frequency waveform
MSM ,7 Reset Stores
MSM 8 -> 255 Nothing

Function Descriptions

Read Fundemental Frequency

Reads the fundamental frequency of the current input signal (on demand) and returns it in the response message at a resolution of xxyy = Frequency in 1hz per bit (xx = MSB,yy = LSB).

Read Volume Level

Reads the Sound Level (on demand) from the input and returns the value at a resolution of 1 ADC count per bit (xx = MSB,yy = LSB).

Read Average Volume Level

Reads the Sound Level stored Average value is returned at a resolution of xxyy = Frequency in 1hz per bit (xx = MSB,yy = LSB).

Read Minimum Volume Level

Reads the Minimum Sound Level that has been seen since the "Reset Stores" command was received (or since Power On:- PM = 1), the value at a resolution of xxyy = Frequency in 1hz per bit (xx = MSB,yy = LSB).

Read Maximum Volume Level

Reads the maximum Sound Level that has been seen since the "Reset Stores" command was received (or since Power On:- PM = 1), the value at a resolution of xxyy = Frequency in 1hz per bit (xx = MSB,yy = LSB).

Reset Stores

Resets the stored valus for minimum and maximum to zero (Sound Level), returns 1 if reset was successful, 0 if not successful.

Read Frequency waveform

Reads the frequency and volume of the current input signal (on demand) and returns it in the response message according to the table below.

Data Item Value Meaning Resolution
0 MSMR6 Id of the response message N/A
1 1 Frequency band Number 1 N/A
2 xx Sound Level Sound Volume in 1 ADC count per bit.
3 2 Frequency band Number 2 N/A
4 xx Sound Level Sound Volume in 1 ADC count per bit.
……
256 128 Frequency band Number 128 N/A
257 xx Sound Level Sound Volume in 1 ADC count per bit.

arduino-monitor's People

Contributors

kingmercian avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.