Paul Gröneveld @ Fab Academy 2016 >>> Input devices

<<<< go back


This week our assignment is about input devices. In comparison with the assignment three weeks ago this assignment focusses on analogue sensors for input devices. It would be nice to choose the sensors already in the direction of the main project / final assignment. In the lecture we had explanation on a verity of sensors and thee day after the lecture we had a nice local presentation from our local instructor Emma about different sensors and their background. For the assignment it is also important to produce a board digitally and physically so we gain more experience in that. Basically in the input device assignment we have to add a sensor to a micro controller board we have designed and read data from it.

I found it not easy to choose sensors from the list because I would like to combine it in the final project. After a thought I decided to go for a temperature sensor that can be used to measure the temperature in the beehive. When I have this up and running I like to make a boards with end switches. These I will need for the end stoppers for my final project. If there is some more time I want to test with a distance sensor. It would also be very interesting to find out what I can do with the camera sensor, because in my project there is a side project where pictures are taken and they need to be analysed. After analysing the machine will get instructions what to do with the hive. This last topic might be big and difficult....


A few weeks ago I already made a FABKIT. The idea is to use this kit and connect different sensors to the FABKIT. It should have the same functions as an Arduino Uno. Before it is possible to use the Fabkit I first check if there is access to the micro controller. Therefore I connect the FABTiny to the FABKIT. To do this first a wire connection between the two boards has to be made. Here fore I made a wire sketch which is presented in the picture below.


Check access to chip

The picture below is a print screen from the cmd window. The chip gives back it's signature. This means it should be possible to burn the bootloader and send code to the chip.



The next step is burning the bootloader by using the Arduino IDE software. Here comes a tricky part. From Arduino IDE I had may errors when trying to burn the boorloader. The message was: "avrdude: stk500_getsync(): not in sync: resp=0x00". Searching on this topic there were not many clear solutions and comments like "This is a comlete nightmare....." One of the suggestions was running it as administrator on a Mac. I tried this on Windows 7, but it did not work. Finally one of my Fablab colleagues said I show use in Arduino IDE the Arduino Uno as the board in stead of the Fabkit. This works! So I was able to burn the bootloader.

BTW, after warnings in different tutorials I installed a previous version of Arduino IDE 10.4. Following the instructions the FABKIT production. Remark: To my opinion is is quite a jungle how to find out what is the way to solve problems. It probably has to be like that. But when you are producing your own boards the tutorials vary for MAC, Windows (different versions), Arduino IDE (many versions). Very often there is a difference between the tutorial and the systems you use. This often results in a showstopper, like not being able to upload a sketch. When you only use Arduino hardware I expect many of these problems will be solved.


Distance sensor

To start with a relatively simple sensor I connected the distance sensor to the FABKIT. The sensor has four pins, VCC, GND, TRIG and ECHO. The TRIG and ECHO can be connected together to one pin on the FABKIT, in this case pin D7.


Below picture shows the distance sensor. One "cylinder" sends out a signal. An object on a certain distance will reflect this signal and the other cylinder will receive the reflected signal. By measuring the time it takes for the signal to reflect, it is possible to calculate the distance between the sensor and the object. Very similar to the way bats are navigating in the dark.


Below picture shows how it all is connected. The serial communications (FTDI) is connected from the board to the USB port from the computer.


In Arduino IDE a new library can be installed for the distance sensor. The name of the library is NewPing_v1.7, which I downloaded as a zip file. The way how to place it at the right locations differs per version of Aruino IDE. Below picture shows the added library.


The video below shows how the sensor gives back the date throught the serial communication.

The temperature sensor

The measuring of the temperature can be done with a temperature sensitive resistor. The simple non accurate way of measuring is just place the sensitive resistors in a serial connection with a normal resistor and measure the voltage gain or drop. However to make it more accurate with regards to for instance voltage input fluctuation (differences) it is possible to calibrate the varying measurement with a static measurement. The static value comes from two static resistors with are also placed in serial. A higher measurement due to a higher input VCC voltage is now eliminated by the comparison value. The picture below shows the basic schematic.


1st Step - Board schematic in Eagle.

The design of the board was given with a picture of the ..... From this picture the schematic was reconstructed. The result is displayed in the picture below. The board is based on a ATtiny45 micro controller. The NTC component will be attached to the analogue input ? located in pin PB3 next to the reset pin. The Design Rule Check (DRC) gave a warning that the junctions were not defined, so I change these into real junctions with a dot. The DRC also gives a warning that the values of all resistors and capacitors are not defines, so I change that too. Below picture shows the initial sketch.


After DRC the sketch looks like the picture below.


For the electrical Rule Check the software Eagle gave the following message, which is good.


Bill of Materials for temperature sensor

<Explain shortly how the NTC component works.>

2nd step - Board Layout in Eagle

The board layout was configured from the different components and connections. Designing the traces was done manually. Because the traces are very close to each other underneath the ATtiny 45 the grid size had to be smaller, 0.02 inch


3rd step - Milling the board

The board was milled on an LPKF machine from our electronics department in Enschede (Saxion).


Steps to take in producing the board.

4th Step - Soldering Process

After milling I started stuffing the board. Soldering the SMD-components goes better each time. I also like to use the "MicroCapture Pro". Without this I am not sure if I will be able to solder the board.

Problem: When I started on the next step I noticed that the board misses an important copper trace. On the left in the picture below the given board is shown. On the right the board layout I made is shown. All the green traces are similar to each other. The red trace on the left board is not present on the right board.



This problem could be solved by soldering a wire to the board as shown in the picture below.


5th Step - Programming

First step here is checking if the Chip gives back its signature. Unfortunately it gives an error.... Like shown below.


After measuring the complete board twice the conclusion was that the Chip should be the problem. I replaced the chip and indeed this was the solution. See the picture below.


Here you see the bootloader was burned.


What I still want to do:

Connect the temperature sensor and the distance sensor together. Use it to measure the temperature from a wooden stove at a variable distance.

Files for downloading

Distance sensor 1
Distance sensor 2
Serial read
Eagle files temperature board

From this site directly:

temperature board
distance ping