Input Devices

- Measure something: add a sensor to a microcontroller board that you have designed and read it.

sensor hall effect

In this assignment for input, I used a sensor of hall effect the circuit is based in the fab academy page but I chance some things, first I added a resistor and led for see the effect of sensor, the circuit was edited in the software eagle and the programing in Arduino.

First to try and understand the functioning, with the datasheet recognize all the pinout of sensor, the programing for the test using an example of Arduino “AnalogReadSerial” is used to receive a signal analog and this connect at Arduino mega and all the data see in serial option in Arduino, for this example in the programing used the value in entry analog for the LED light up, the value has to overcome the 520 to the signal pass at LED.

In the moment to make the plaque I tried with the circuit of example in the fab academy with a little change with the connection with a led also for the connection of the LED use a jumper for occupy a pin which is only used in the programing and the last program tried in Arduino mega previously, but I had problems with the attiny 45 an error did not know how to fix and decide to change of attiny 45 at attiny 44.

For the edit the circuit use the software eagle to change the microprocessor, this change modifies some pins of input and output but the more pins that have the attiny 44 facilitated the connection of LED because I didn't use the jumper to function it, in the program you must change the pin of the attiny and for the other taste if you want to do it make sure to use the correct pins of the micro, for the last burn the bootloader and uploading the program at micro.

Learning outcomes:

- Demonstrate workflows used in circuit board design and fabrication

The design and fabrication is explained in the process, this assignment was for a final project plaque test, because in the final project need control de analog value and with this process I can see and have an activation range.

- Implement and interpret programming protocols

In the first line of the program is for declare a type of variable with an any name, in this case the variable is for a pin for a led and after the name gives the corresponding value, in my case the value of the pin to use.

Next, in void setup declare the function of the variable, output or input, is the mode of the function of pin, in the case of the sensor you must declare like input because this device receives information, and with output is for you need send a pulse a device or anything.

The serial.begin is for see the information of sensor but this command only run if you work with a Arduino module.

Then, the void loop is a cycle or a process to the programmer will do until it finishes his work, this process can repeat sometimes. Inside of void loop first declare a reading of the analog value, first the type of variable “int” name “sensorValue” = reading “analogRead” pin “A0” don’t forget the ; at final of all the commands.

The command delay is to use like a pause in the time for a time you can specify that time between parenthesis.

Next the command if is a conditional the function is if the condition is met the command allow the access to the process within the conditional, but if it does not comply the conditional go to the rest of the program.

And in the last is to activate or disactivate the LED, with “HIGH” the LED is on and with “LOW” the LED is off.

Have I:

Described your design and fabrication process using words/images/screenshots.

The description is in the process of the first objective with text, image and screenshots.

- Explained the programming process/es you used and how the microcontroller datasheet helped you.

If you need information for the microcontroller you can see the >>datasheet<< for attiny 44.

- Explained problems and how you fixed them

In the documentation, I show a problem with a microcontroller attiny 45 and I decided chance for a attiny 44.

Measurements

Connection of the oscilloscope with the input board for the measures.

In the first measure of analog pin of sensor hall when the boar is energized begin in 2.56v and in the moment to bring a magnet the voltage change to 3.20v.

Measure of the digital pin of the led, is activate when the value of the sensor arrives at the one indicated in the programming.

Included original design files and code

Dwonload files

Files in Repo