Skip to content

10. Input devices

This week I worked on Input devices. I decided to try to use a sound sensor since I am thinking to use it in my final project.

Individual Assignment of this week is to:

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

Link to Group assignment

In the group work, I monitored signals in Oscilloscope and wrote the work we done on the Group Assignment page.

Digital / Analog

There are two types of sound sensor. One is digital and the other is analog.

What is the difference?

  • Digital shows On and Off
  • Analog has information of status between On and Off

Reference

I am thinking to create a robot Pet as a Final project. It will come to in front of “Mom” when “Mom ” clapped hands. To realize it, I thought that I needed to have a sound sensor to catch sounds of clapping to actuate it.

I’ve chosen a digital because of two reasons;

  • One is that I should use 1 series of ATtiny. Niel’s example uses Tiny1614 for digital and Tiny45 for analog.
  • The other is that I would like to use the sound to “Switch-on” to actuate next move and no need to produce sounds to hear.

Digital Sound sensor I2S

What is I2S?

  • I2S stands for Inter-IC Sound Interface, is an electrical serial bus interface.
  • I2S is pronounced eye-squared-ess.
  • I2S is a standard device used for connecting digital audio devices together.

What is Protocol?

I2S has its Protocol. Protocol is a standardized set of rules for formatting and processing data. Protocols enable computers to communicate with one another.

How to use I2S protocol in Arduino?

  • We can use the I2S protocol on SAMD21 based boards (i.e Arduino or Genuino Zero, MKRZero or MKR1000 Board).
  • I2S library is available in Arduino Library Manager. When we use the protocol in Arduino, we need install it beforehand.

I2S library

In addition, to use this library, we need include below statement in a program.

  • ”” #include “”

Creating a sensor kit

Parts list

  • ATtiny1614
  • CMM-4030D-261 I2S
  • R1 : Resister 100k
  • C1 : Capacitor 1uF
  • C2 : Capacitor 0.1uF
  • C3 : Capacitor 10uF
  • Voltage Regulator SOT23 Small Outline
  • FTDI - SMD-Shape
  • UPDI 3POS SMD Shape

I2S : CMM-4030D-261-I2S-TR

Learned from Datasheet

  • SD trace should have a 100k pulldown resister.
  • VDD should be decoupled to Pin 6 with a 0.1uF and a 10uF capacitor.
  • Max power supply 3.6V, should have voltage regulator to adjust voltage from 5V to less than max.

Use only one I2S.

Max voltage 3.6V. Power supplies from PC( 5V) then a voltage regulator should be placed.

DigiKey

Datasheet is available in DigiKey above.

Link to download site of schematic of this part is available in Documents & Media section EDA/CAD Models of DigiKey. You can choose Eagle format.Selection menu popped up when try to download.

Document & Media

Download site

ATtiny1614

This is my first time to use this IC. So I looked into its information.

Datasheet of this part is available in DigiKey below. DigiKey

Voltage Regulator : SOT - 23

Datasheet is available in below DigiKey.

DigiKey

Working on EAGLE

I started to design PCB by using EAGLE by referring to the example in the class page of Input Device. Major changes was that I put 3 pins instead of 2 pins for UPDI because I would like use a connector which I made in previous session to upload programs from my PC.

I tried “Reflow” to solder I2S. Put small amount of solder to bottom of the part and also a little to PCB as well. Then heated the boundary of both to fix.

All soldering done, but I could not upload program. I found that there were some missing connections although all ERC / DRC errors were cleared.

Green lines should have been created.

Corrections made on the board.

Learning from this : Before milling, I should have checked connections of a board by referring to corresponding schematic.

Programing

Tiny1614 doesn’t have processor of I2S protocol directly. I did some research to find samples of tiny 1614 and I2S but couldn’t find any. So I followed the sample program in class site which was written by Neil.(I2S protocol by software). I could successfully loaded it to my board.

ino. file

Result

Here is what I read on Serial Plotter. The microphone caught various sounds around. I put comments about remarkable changes on the pic.

Files

Eagle Files

Ref

I2S Warning


Last update: July 3, 2021