Back to Topics
Term 2 DA10-1

Data Collection

Learning Objectives

  • Distinguish between primary and secondary data sources
  • Identify qualitative and quantitative data types
  • Understand ethical considerations in data collection
  • Apply appropriate data collection methods

What is Data?

Data refers to raw facts and figures that have not yet been processed or analyzed. When data is organized and given context, it becomes information.

Example: "25" is data. "The temperature is 25°C" is information because it has context and meaning.

Types of Data

Quantitative Data

Numerical data that can be measured or counted.

  • • Temperature readings
  • • Number of students
  • • Test scores
  • • Prices and costs

Qualitative Data

Descriptive data that cannot be easily measured with numbers.

  • • Opinions and feelings
  • • Colors and textures
  • • Descriptions
  • • Categories (e.g., "satisfied", "neutral")

Data Sources

Primary Data

Primary data is data you collect yourself, directly from the source, for your specific purpose.

  • Surveys - Questionnaires distributed to gather responses
  • Interviews - Direct conversations with individuals
  • Observations - Watching and recording behaviors or events
  • Experiments - Controlled tests to collect specific measurements
  • Sensors - Electronic devices that capture data automatically

Secondary Data

Secondary data is data that has already been collected by someone else for a different purpose.

  • Government statistics - Census data, economic reports
  • Academic research - Published studies and papers
  • News reports - Journalism and media coverage
  • Existing databases - Company records, historical data
  • Online sources - Websites, APIs, public datasets

Primary Data Advantages

  • • Specific to your needs
  • • Current and up-to-date
  • • You control the quality
  • • Know exactly how it was collected

Secondary Data Advantages

  • • Faster to obtain
  • • Often free or low cost
  • • Larger sample sizes available
  • • Historical data accessible

Data Collection Methods

Surveys and Questionnaires

Best practices for effective surveys:

  • Use clear, simple language
  • Avoid leading or biased questions
  • Include a mix of question types (multiple choice, rating scales, open-ended)
  • Keep surveys concise to improve completion rates
  • Test your survey before distribution

Observations

When observing:

  • Define what you're measuring beforehand
  • Record data systematically
  • Be consistent in your methods
  • Consider whether your presence affects behavior

Automated Data Collection

Digital systems can collect data automatically:

  • Web analytics - Tracking website visits and user behavior
  • IoT sensors - Temperature, motion, light sensors
  • Transaction logs - Recording purchases and activities
  • Social media APIs - Gathering public posts and trends

Data Quality

Good data should be:

  • Accurate - Free from errors
  • Complete - No missing values
  • Consistent - Same format throughout
  • Timely - Current and relevant
  • Valid - Measures what it's supposed to

Ethical Considerations

When collecting data, you must consider:

Privacy

  • Only collect data you actually need
  • Inform people about what data you're collecting
  • Store data securely
  • Don't share personal data without permission

Consent

  • Get permission before collecting personal information
  • Explain how the data will be used
  • Allow people to opt out
  • Be especially careful with data from minors

Bias

  • Ensure your sample represents the population
  • Avoid questions that lead to certain answers
  • Consider who might be excluded from your data
  • Be transparent about limitations

Key Terminology

  • Data - Raw facts and figures without context
  • Information - Data that has been processed and given meaning
  • Primary data - Data collected firsthand for a specific purpose
  • Secondary data - Data collected by others, used for a different purpose
  • Quantitative - Numerical, measurable data
  • Qualitative - Descriptive, non-numerical data
  • Sample - A subset of a population used for data collection
🏠

Project Connection

In Simpson's House...

Every time someone taps a button in the Simpson's House app, a data event is generated — a device name, a command, and a timestamp. IoT systems are fundamentally data collection systems, and the concepts you learn here explain how that data is structured, typed, and used.

Data Types in MQTT

Payloads arrive as bytes — data types matter immediately

When the Pi receives an MQTT message, the payload is raw bytes. The Python code must decode it to a string (payload.decode()) before comparing — a direct application of data types.

Continuous Data Collection

IoT devices generate streams of events automatically

Every button press, door open, and LED toggle is a data point. A real smart home generates thousands of events per day — temperature, motion, power — all structured data waiting to be analysed.

Structured vs Unstructured

MQTT payloads are structured: topic + payload + timestamp

Each MQTT message has a predictable structure — a topic string, a payload string, and a timestamp from the broker. This is structured data, ready to be logged and queried.

Data Quality

What happens if the payload is unexpected?

If the Pi receives "on" instead of "ON", the light stays off. Data quality — consistent formatting, validation, and error handling — is essential in any IoT system.

Explore the full Simpson's House project →