FabLab Cept

INPUT DEVICE

This week assignment was to design a board for input device and measure something using sensors.

My final project requires me to use distance sensor to activate led and motors for various measures of a person approaching the installation. Hence, I decided to use a distance sensor which can give signals to change the colour of led based on distance of any object from the sensor.

1. The first step was to design a schematic for the board. Gautam helped me deciding the components and connections needed for the circuit.

So, I am using Attitiny 44-SSU as controller, ultrasonic sensor for input device to detect range of motion and RGB led to give different output based on the data from ultrasonic sensors.

2. Next thing was to convert the schematic to board. Till now I have never used auto-routing method to generate connections. So, I decided to explore it this time and found it quite helpful. The first step here was to try and arrange components with minimum cross-connections. I tried few options and then decided to opt for auto-routing

3. Click on the auto-routing icon in the bottom left tool-bar, deselect "continue editing job" and set the "16. Bottom" to N/A which implies that we are using only one sided board.

The program gives 5 options and tells us percentage of optimization. Clicking on the highest percentage gives you the board with maximum connections working and evaluating this board one can get an idea of which connection is remaining and then we need to work out different permutations and combinations to achieve a complete 100% optimized board. Here are two of my trials before I could finally get 100% optimized connections.

4. Finally after few attempts I achieved 100% optimization board. You can find the milling files here.

5. The next step was to program the board. I found a reference code online and modified it to function as per my requirement

I assigned the Pin values from the schematic as follows:

 

Red : led =8

Green : led2 = 9

Blue : led3 = 10

tripPin = 3

echoPin = 2

The next step was set the distance range for lighting up the led.

The idea was to set the other 2 colours off when 1 colour is turned on.

Hence for a given distance range, 1 LED is "LOW" and other 2 LEDs are "OFF" for that instance.

After few trial and errors, the code was working.

Here is the file

The idea was to set the other 2 colours off when 1 colour is turned on.

Hence for a given distance range, 1 LED is "LOW" and other 2 LEDs are "OFF" for that instance.