Eighth Week

Eighth
class

Eighth week and the classes continue to surprise me, every week there is something really new and above all complex for me, this time we continue with the part that for me is the most difficult of all, electronics, here I will show you a little of everything I did.
This week I have worked in greater depth the theoretical part because unfortunately the machine has had problems to perform new work, however I have generated a research on my components and circuits that I have been designing.

My week

New Toys


About my components, here in Lima I have only got a few, thanks to that I have been able to do different works but I take this opportunity to mention that this week, on Monday March 22nd I got a package from Barcelona with a very interesting kit of many things and tools that I have needed a lot, I am really happy about that and I show some pictures of what I have to work the rest of the Fab Academy. 🥰





My package




¡Surprise!




My first soldering kit 🥰




Digital Caliper




All components in the world




New tools






10

First Assignment

Grupal Assignment

In this new stage of the fab academy we have as a group task to demonstrate and compare toolchains and development workflows for alternative embedded architectures. Stefany Casanova and I started researching about this and we managed to understand the potentialities of the different microcontrollers we chose.

The research conducted is shown below:

Teamwork

Grupal


Stefany Casanova and I decided to use the ATtiny 1614 microcontroller for our final boards, however at first we were doing our first tests with the Attiny 85, so here we will share the research we did with both.

But first, what is a microcontroller? A microcontroller is an integrated circuit that contains a central processing unit (CPU), memory units (RAM and ROM), input and output ports and peripherals. These parts are interconnected inside the microcontroller, and together they form what is known as a microcomputer. A microcontroller is a complete microcomputer encapsulated in an integrated circuit.




ATtiny85






Diagram




Pinout




Pinout




ATtiny 85 detailed pinout



What does each one mean?


VCC - GND: They mean direct current voltage and ground respectively, the VCC usually means that you must connect the positive terminal of the direct current source you are going to use, in the case of GND it is a 0V reference.
PB0 - PB1 - PB2 - PB3 - PB4 - PB5: In this microcontroller every pin except power pin. ALL input/output pins are connected to bidirectional Input/output register through internal pull-up registers. Any pin can be used for input or output purpose but first, it should be described in a program which function it should follow.

ATtiny 1614


The ATtiny1614 microcontroller is part of the 8-bit AVR family of microcontrollers manufactured by Microchip. This model is popular for its energy efficiency, compact size and processing power, making it ideal for embedded and low-power applications. Its main features, architecture and functionalities are described below:




Diagram




Pinout



Main features of the ATtiny1614

Architecture:


- Based on 8-bit AVR architecture with RISC instructions.
- High performance AVR core that executes instructions in one clock cycle.
- Support for vector interrupts and configurable priority.

Memory:


- Flash: 16 KB, system programmable.
- SRAM: 2 KB.
- EEPROM: 256 bytes for non-volatile data storage.

Peripherals:


- Up to 14 GPIO (General Purpose Input/Output) pins.
- Integrated UART, SPI and I2C (TWI) for serial communication.
- 10-bit ADC with multiple channels (8 ADC channels).
- Analog comparators.
- PWM (Pulse Width Modulation) for control of motors and LED lights.
- 16-bit and 8-bit timers with different operation modes.




Diagram




Pinout


Operating voltage:


- Wide operating range from 1.8 V to 5.5 V.

Clock:


- Internal oscillator up to 20 MHz.
- Possibility of using an external oscillator for higher accuracy.

Power consumption:


- Designed for low power consumption applications.
- Power saving modes, such as:
. Sleep Mode: Reduces consumption to a minimum while keeping peripherals active.
. Power-Down Mode: Maximum power saving.

Programming:


- Programmable via UPDI (Unified Program and Debug Interface).
- Compatible with development tools such as Atmel Studio and Microchip MPLAB.

Programming:


- Designed for low power consumption applications.

Architecture:


- 8-bit AVR core:
. Ability to perform basic arithmetic calculations and operations with high efficiency.
. RISC instruction set optimized for performance and compact code size.
- Register bank: General Purpose Registers (GPR) that allow operations to be performed without accessing RAM, increasing execution speed.
- Memory space: Segmented memory for programs (Flash), data (SRAM) and non-volatile storage (EEPROM).
- Peripherals and buses: Peripherals are connected to the core through internal buses to facilitate fast communication between them.

Functionalities:


- Digital control: Ideal for applications such as control of LED lights, motors or sensors.
- Data acquisition: Integrated ADC to convert analog signals to digital (such as temperature, light or pressure sensor readings).
- Serial communication: Ability to interface with other devices via UART, SPI and I2C.
- Timing and signal generation: Timers to perform scheduled tasks, PWM signal generation for external device control.
- Low power applications: Ideal for systems that require continuous battery operation, such as portable devices or IoT sensors.

Common applications


- IoT (Internet of Things) projects.
- Home automation controllers.
- Portable devices.
- Sensors with local processing.
- Intelligent lighting systems.
- Educational electronics and compact prototypes.

Conclusions on the ATtiny1614 microcontroller


- Efficiency and simplicity: The ATtiny1614 stands out for its 8-bit AVR architecture, which combines simplicity and efficiency, offering performance suitable for basic control and processing applications. Its RISC instruction set ensures that operations are fast and optimized, executing in a single clock cycle.
- Compact and versatile design: Its small size and flexibility in the configuration of its 14 GPIO pins make it ideal for projects that require integration in tight spaces or portable systems, such as IoT devices or simple electronic controls.
- Robust peripheral capabilities: Includes peripherals such as 10-bit ADCs, timers, serial communication (UART, SPI, I2C) and PWM generation, enabling its use in a wide range of applications, from motor control to analog signal processing.
- Low power consumption: Designed for low-power applications, the ATtiny1614 features power-saving modes that extend battery life, making it ideal for portable and sustainable projects.
- Ease of programming and development: Its compatibility with modern interfaces such as UPDI and tools such as MPLAB X or Atmel Studio makes it easy to program and debug, being accessible for beginners and professionals alike.
- Practical applications: This microcontroller is highly functional in interactive and entertainment projects, such as controlling LEDs, sensors, motors and measurement devices. It is especially useful in systems that do not require more complex processors or large memory capacities.
- Cost-benefit ratio: It offers a cost-effective solution without compromising important functionalities, being a preferred choice for educational projects, prototypes and simple commercial devices.

Other AVR series microcontrollers (Microchip):

ATtiny816/814:


Features:
- Same 8-bit AVR architecture.
- Flash memory of 8 KB (for the ATtiny816) and 4 KB (for the ATtiny814).
- Less SRAM and EEPROM memory compared to the ATtiny1614.
- UPDI compatible for programming and debugging.
Differences:
- Fewer GPIO pins.
- Similar peripheral functionality, but less expandability.

ATtiny3216/3217:


Features:
- 32 KB of Flash memory (twice as much as ATtiny1614).
- More GPIO pins (up to 20 pins).
- Same peripheral capabilities: ADC, PWM, timers, and serial communication.
- Ideal for projects requiring more memory capacity.
Differences:
- More expensive and physically larger.

10

Second Assignment

Individual Assignment

After previous research and getting my board operational during board design week, I finally got up the nerve to use some sensors to test its operation, below I share my tests.

Working

Individual

To test the operation of my board and to practice with some new sensors, I was encouraged to test two types of flows, it is important to mention that each test process took me considerable time because I had to research about the programming of each sensor.

As part of the contribution to my final project, it is possible that I will use some of these flows to make it possible.
The PIR sensor will allow me to detect the user's movement but I also investigated that the infrared sensor could have the same functionality, and maybe even more accurate than the first one. We'll see how it goes!




My board - Ottino Move


First test


As first functionality I wanted to test the PIR sensor, I will analyze this sensor in detail in the Input Devices week. As output of the system I chose a small fan that I had within reach. My system finally worked and here I will share the code I used and the evidence.

PIR
 
			

//Mayra Ascencio Calderón	
/*
Blink*/

// the setup function runs once when you press reset or power the board
const int RadarPin = 0; // digital input pin to hook the sensor to
const int ledPin =  8; // LED instalado en la placa
const int motorDC =  1; // Se define la salida del motor, en el caso de usar el octoacoplado cambiar por 2

int value = 6; // variable to store the value coming from the sensor

void setup() {
// initialize digital pin LED_BUILTIN as an output.

pinMode(ledPin, OUTPUT); // salida digital led de placa
pinMode(motorDC, OUTPUT); // salida digital PWM, motor
pinMode(RadarPin, INPUT); // entrada digital, sensor PIR
}

// the loop function runs over and over again forever
void loop() {

value = digitalRead(RadarPin);

// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (value == HIGH) {
	// turn LED on:
	digitalWrite(ledPin, HIGH);
	digitalWrite(motorDC, HIGH);
} else {
	// turn LED off:
	digitalWrite(ledPin, LOW);
	digitalWrite(motorDC, LOW);
}

}
		
		

Second test


As a second example I used an infrared sensor that helped me to measure the proximity of an object, something similar to the functionality of my PIR sensor. These sensors are related to my final project so I decided to try them both. As an output I am placing a servo motor.

TCRT5000 tracker sensor module
 
			

						#include 
							const int sensor = 0;
							const int boton = 10;
							const int led1 = 8;
							int s1,s2;
							Servo servo1;
							const int pinservo1=1;
							
							void setup() {
							pinMode(boton,INPUT);
							pinMode(sensor,INPUT);
							pinMode(led1,OUTPUT);
							servo1.attach(pinservo1); 
							
							}
							
							void loop() {
							s2=digitalRead(boton);
							s1= digitalRead(sensor);
							
							if (s1==1)
							{
							servo1.write(0);
							}
							else
							{
							
							servo1.write(90);
							}
							if (s2==1)
							{digitalWrite(led1,HIGH);
							
							}
							else
							{
							digitalWrite(led1,LOW);
							
							}
							
							delay(200);
							}