S Input Devices
April,04, 2018

Input device

this week assignement are:

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

Choosing the flex sensor


for this week project i decided to use a flex sensor (here the datasheet), it's a resistor, it will change the value from the bending i will give to it. So for Using it you have to use to make a voltage divider circuit it's pretty simple to do. When you understood how to make it you can start to make your new board. i looked at the documentation of the Echo Hello board for a starting point, of my new board, i removed the button and use the same pin for implemant the Flex Resistor, i add an other resistor for makig the voltage divider too.

Making your schematics

when i did this part, i had to make my board. i choose to start from the beggining and replace the component some at the same place other at a new place. fo the Flex resistor i made the resistor at the end of hte board for beeing able to solder it easly.

time to export it for cutting it: Like always: we are cutting at 4mm/sec, -0.03 cut depth. Solder your board and Voilaa!

the code

When the board is finish we have to upload the code to it. for that i'm using an arduino as an ISP. it's working great.
  • Pin13(arduino) to SCK
  • pin12 (arduino) to MISO
  • Pin11(arduino) to MOSI
  • Pin 10(arduino) to RESET
  • 5V to VCC
  • Gnd TO Gnd
when everything is plug correctly you can transform your arduino on Fab isp.
GO on file> example>arduinoISP
Upload the file into your arduino. then choose the Attiny 44 into the board manager, choose the internal clock to 8Mhz, change the programmer to Arduino as isp. burn the bootlader and you can upload a blink code for checking if your board is working ! when everything is good is time to upload your code for beeing able to read a value. when you using an Attiny44 you can't use the SerialPrint. but you can use the SoftwareSerial Library. it will work great. for using it. you have to tell on your code where will be the TX And RX PINOUT. when you did it . plug an FTDI and open the serialprint. !

--

file of the week.

here you'll find the file of the week

For downloading
right click and save as

--