Sound Badge With Touch Sensor.

by Markus Opitz in Circuits > Wearables

4919 Views, 77 Favorites, 0 Comments

Sound Badge With Touch Sensor.

Title-1.jpg

This is a project for slightly more experienced Arduino users.

According to my own project Fine Little Sound Brooch I am trying to make the circuit a little smaller and more refined. I removed the button and used a capacitance switch instead. The housing of the circuit must be given a conductive surface.

The DFPLayer cannot be equipped with a capacitive switch on its own, we need a microcontroller for that. The Attiny85 chip seemed to me to be the smallest and most economical controller. It is my very first project with that chip.

Supplies

IMG_3260.JPG

Attiny85 chip

DFplayer

10 MOhm resistor

180mA LiPo battery (or 3V coin cells)

Metal pill box/ peppermint candy box

2 small strong magnets

Breadboard

Arduino nano and IDE for programming

Setup the Attiny85 for Programming

DF-2.jpg
IMG_3261.JPG
Prog1.jpg
Prog2.jpg

The Attiny85 is the pure chip. To programme it we need the help of a microcontroller. I use Arduino nano, but Arduino Uno or ESP8266 should also work.

To program it, we set up the circuit on a breadboard according to the plan. The Attiny85 can be operated at 5V or 3.3V. Some sources claim that the Arduino needs a capacitor between GND and RST (reset) to switch the Attiny into flash mode. But sometimes it works without it.


Alternatively, you can use an Attiny programmer with USB port instead of the Arduino nano.


  • Install Arduino IDE
  • Connect the Nano to your computer, open Arduino IDE, select Nano board
  • Open the Arduino ISP sketch from the File menu [File > Examples > ArduinoISP] and upload it.
  • File > Preferences > Additional Boardmanager > type in: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json


  • Tools > Board manager > type "attiny" > install "attiny"
  • Tools > Boards > ATtiny Microcontrollers - ATtiny 25/45/85
  • Settings are know: ATtiny 25/45/85 ATtiny85 Internal 1Mhz Port Com... Arduino as ISP


  • Restart Arduino IDE

Programming the Attiny85

Load the sketch Attiny85Player.ino to the chip. Unfortunately the Attiny85 has no serial connection so you can't see what's going on.

Principle: The Attiny measures the current between the two pins of the 10 MOhm resistor. If there is a discharge on the wire, the ATtiny85 reacts and sends the command to play an mp3 file to the DFplayer.

If everything works after programming, we can place the chip in a smaller circuit (Step 4) and put it in the connector box.

Downloads

Try Out the Circuit

Copy a few short mp3 files onto a micro SD card and put it into the DFPlayer. Make sure that the files have been saved with high volume.

Power up the circuit and touch the loose wire of pin 3. Now the 1st mp3 file should be played. If not, it may helps to change the level variable in the ino-sketch.

Making It Smaller

DF-1.jpg
IMG_3262.JPG
IMG_3263.JPG

Preparation:

Usually the Player is delivered with pins already soldered. These must first be removed with the soldering iron to save space.

Then you can solder the cables to the connections. To avoid short circuits you should use insulated cables, heat shrink tubing and hot glue.

I leave it to your imagination and skill to solder the circuit as small as possible.

The Shell

box.jpg
IMG_3264.JPG
Vorlage.jpg
Ergebnis.jpg

Actually, it doesn't matter which housing you use. The main thing is that it is made of metal or has a conductive surface somewhere. (Sheet metal, metal foil, conductive paint.)

I use a peppermint candy tin from which I removed the paint with sandpaper.


The piezo speaker is attached to the inside of the lid with tape. It uses the box as a resonating body. Fix the on/off switch on a side and connect the pin3-wire to the metal surface of the badge/box.

Now decorate, paint (leave the electrically conductive part free), engrave, stick on, ...

Attaching to the Clothes

IMG_3284.JPG
IMG_3285.JPG

Finally, we need the two magnets. One magnet is attached on the back of the inside at a suitable place, with hot glue or superglue. Once the glue has set, the badge can be attached to a pullover or jacket with the second magnet.

Addition: the Battery

A word about the battery and its connection::

I made a plug-in connection with Dupont pins. You'll find a good tutorial here:

https://www.instructables.com/Make-a-Good-Dupont-P...


You can now disconnect the battery, charge it with a LiPo charger and then reinsert it.

Bonus: Your Car - a Capacitive Sensor

Attach the brooch to the car. If the badge has a conductive connection to the car, the whole car is the switch! And now let your car speak.

Bonus 2: Just a Plain LED

Someone asked for a simple LED instead of an mp3 player. Here is the sketch.

Downloads