Skip to content

10. Input devices

Basic Knowledge of Input Devices

  1. Some Functions that we can use There are many functions that we can use to design our input device including sound, step response, vibration, force, angel, pressure, pulse, air pollution, etc.

  2. Physical Computing The signal input into microcontroller program and then output. USB cable input and GRBL

  3. Microcontroller(MCU: the brain of an electronic device.

    A microcontroller (MCU for microcontroller unit) is a small computer on a single metal-oxide-semiconductor (MOS) integrated circuit (IC) chip. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable input/output peripherals.

  4. Input Devices

  5. Gas sensor, color sensor, accelerometer, IR sensor, LDR, flex sensor and rain sensor.

  6. Digital Input: 0 V to 5 V eg. Button

  7. Analog Input:

    An analog input converts a voltage level into a digital value that can be stored and processed in a computer.

  8. Temperature Sensor The ambient temp is 19C in the sensor then a voltage of 2.3V is generated which MCU can read the value from designated pin.

  9. Analog PIN and ADC

    Analogue-to-Digital Converters, (ADCs) allow micro-processor controlled circuits, Arduinos, Raspberry Pi, and other such digital logic circuits to communicate with the real world. In the real world, analogue signals have continuously changing values which come from various sources and sensors which can measure sound, light, temperature or movement, and many digital systems interact with their environment by measuring the analogue signals from such transducers.

ADC(analog to digital converter) reads the voltage on pins and convert to value ranging from 0 to 1023, total 1024 values.

Sample code

  var a = analogRead(pin)// needed to be assigned to same variable 
  int tempt = 0;
  1. TX/RX or FTDI working with Computer The communication from our board to the computer is happening via the TX/RX lines to our USB-Serial converter. FTDI is a company who produces the most well-known USB-Serial converter chips and hence many converters are known simply as FTDI cables or converters. TX and RX are abbreviations for Transmit and Receive, respectively.

  2. ISP Programming

    It is In-Circuit Serial Programming. This is a different kind of serial compared to TTL serial. It is SPI (Serial Peripheral Interface Bus) and uses 3 main wires to communicate for programming. When you program an Arduino’s processor using ISP, usually the entire processor chip memory is erased, including the bootloader area, and your sketch is written. So, when you upload a sketch to the Arduino using ISP, the Arduino no longer has a bootloader on it. This means the next sketch you upload to it must also be uploaded using ISP.

for further learning please check a great introduction of FTID and ISP. link

Code Example

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

NTC Temperature Sensor

In a meter need cnd vcc and signal with rest for reference. NTC change the temperature with rest inside the sensor. another rest sharing same input and to to vcc have another system r2 r3 as constance values for calibration.

The Arduino will measure the voltage at a point between the thermistor and a known resistor. This is known as a voltage divider.

-reference

This time I design a board with temperature sensor

Problem

It took me an afternoon to figure out the reason why it print smaller size of the board.

Attiny 412

So this time we change microcontroller from attiny45 to attiny 412.

Code

Test the board with blink code

Input device: using the temperature sensor LM35 Temperature:

Source file:

At412 Board Brd file At412 Board Sch file Code

At412 file At412 file

trace outline

Group Assignment

Test the input.


Last update: April 27, 2021