Week 10

Another electronics week and another opportunity for me to gain more experience on how electronics work. This week is about input devices which it technically all kind of sensors that can be used for my final project,This week' assignment:

1. Group assignment: probe an input device's analog levels and digital signals.

2.Individual assignment: measure something: add a sensor to a microcontroller board that you have designed and read it.

Learning outcomes

Group Assignment:

Oscilloscope:

The oscilloscope is an instrument commonly used analyze the signal waveform of input devices , The device plots the instantaneous signal voltage as a function of time on a graph so it is really useful for debugging because it visualized the signal that is coming from the input device.The horizontal sweep of any oscilloscope is measured in seconds per division (s/div),and The vertical deflection is measured in Volt per division(V/div).

PIR motion sensor:

For the group assignment we decided to measure the PIR motion sensor signal using the oscilloscope to visualize the signal and to have a better understanding how this sensor works:

Kicad Design:

UltraSonic Sensor:

An ultrasonic sensor is a device that uses ultrasonic sound waves to determine the distance to an object. it sends and receives ultrasonic pulses that transmit information about an object's proximity using a transducer. it is one of the most reliable ways to sense proximity and track speeds.

The way this device work is kind of simple, it sends waves that goes through the air and bounces back to the sensor as it encounters an obstacle or target. The distance can be determined by multiplying the travel time by the sound speed. To know more about this device check out this link.

Programming it:

I will be using my FABISP programmer that I made in week4 to program the sesnsor then I will connect it to an USB to FTDI cable to communicate with it.it took me alot of time to understand how to do it but I finally did and here are the steps :

  1. Check that everything in your board is working as intended and that there is no circuit shortage and most importantly check that your microcontroller is in the right direction because mine was in the wrong direction and I ended up blowing the sensor (use the multimeter).
  2. Connect your board to the programmer
  3. Now because my USP Tiny programmer did not have the tx and rx library I had to write a code that can define this library:
  4. Identify what pin is your sensor connected to and this is a very helpful image that can help you understand what pin number to use.
  5. Now the code is ready, make sure everything is connected properly then hit upload using programmer.
  6. After we programmed the board it is time to communicate with it so I will be using a TTL-232r-5v cable and I had to install the driver for it so I can have the port to see the serial monitor.
  7. Finally testing the sensor:

code explanation:

Problems I faced this week:

All the design files are here:

download »