INPUT DEVICES
This week, I will work on probing the analog levels and digital signals of an input device. During the process, I will use a multimeter and an oscilloscope to measure and analyze the different signals that the device will generate.First, I will focus on the analog signals. I will observe how changes in the input affect the output of the device and identify patterns in the waves that I measure. This will help me understand better how continuous signals behave and their importance in data processing.
Next, I will move on to the digital signals. Here, I will notice that the variations will be more discrete and easier to interpret. I will learn to differentiate between high and low levels and how these translate into useful information for the system.
Reflecting on this experience, I will realize how fundamental it is to understand both analog and digital signals for the design and improvement of electronic devices. Each type of signal will have its own relevance and applicability, and this exercise will provide me with a clearer view of how they interact in a system. I am excited to apply this knowledge in future projects.
My input
For this task, I have decided to use a humidity sensor instead of a temperature sensor to measure the plant's moisture levels. My goal is for the LED to turn on automatically when the plant is dry. I will use an appropriate soil moisture sensor to detect the moisture levels, and a microcontroller such as the ATtiny to process this information and activate the LED when needed.This type of sensor uses two metal electrodes placed in the soil. The electrical resistance between them varies depending on the amount of water: the higher the moisture, the lower the resistance, as water allows for better electrical conduction. When the soil is dry, the resistance is much higher. The microcontroller evaluates these changes to assess how wet or dry the soil is.
Design to my input circuit
Squematic diagram
The circuit uses an ATtiny45 microcontroller, with an LED that lights up via PB0 and a moisture sensor that sends data to PB4. It also includes programming pins and power connections.
- The core of the circuit is an ATtiny45, connected to 5V at the power pin (VCC) and ground (GND).
- The digital input/output pins are labeled PB0 to PB5. In the schematic, PB0, PB1, PB2, and PB3 are being used.
- The pins MOSI (PB0), MISO (PB1), and SCK (PB2) are connected to a connector (J3), likely used to program the ATtiny45 via the SPI protocol.
- The RESET (PB5) pin is also connected to the connector, allowing the ATtiny45 to be reprogrammed.
- An LED (D1) is connected to PB0 through a current-limiting resistor (R1). This serves as a visual indicator, for example, to show when the moisture level is low or when the sensor is active.
- PB4: Pin of the ATtiny45 likely configured to read data from the moisture sensor.
- PWR_5V: Provides 5V power to the sensor.
- GND: Ground connection.
Explication
ATtiny45 Microcontroller:
Programming:
LED Indicator:
Moisture Sensor Connection:
At the bottom, there is another connector labeled J1, with the following connections:Now that we have the circuit ready, we will proceed to cut our PCB using the appropriate tool. You can download the circuit file from the following link:circuito para cortar nuestra PCB
The next step will be cutting the board using the Roland Monofab. Once cut, I will proceed to solder the components in their proper places on the circuit. This was the final result of the process, with the board assembled and ready for testing or adjustments.
Digital input: A digital input recognizes only two states: high or low, represented by the binary values 1 and 0. It is designed to detect the presence or absence of voltage, making it ideal for simple devices like buttons and switches. Digital inputs offer clear and precise readings, being useful for straightforward binary signals. For the analog input, a temperature and humidity sensor was used to capture environmental data. The sensor measures humidity levels, and based on the values received, it triggers a LED. If the sensor detects low humidity, indicating the plant is dry, the LED lights up as a warning signal.
For this task, I used the PCB I made duringWeek 4: Electronics Production. The function of my PCB will be to supply the necessary voltage to the input board and load the code that will read sensor data and turn on a LED.
With the code completed, I will proceed to make the connections on my Week 4 PCB to supply the necessary voltage. By connecting the corresponding pins, they will act as bridges, ensuring the system works properly.
Once everything is finished, I will test my input circuit to analyze its operation in detail and observe how the data changes in response to humidity.
video funcionando
Final reflections
As final reflections, this project allowed me to better understand the integration between hardware and software, from creating the PCB to programming it to read sensor data and activate the LED. It was an opportunity to deepen my knowledge of handling analog inputs and the importance of precise design to ensure proper circuit operation. Testing helped me visualize how environmental conditions affect the readings, reinforcing the usefulness of such systems in monitoring applications.