กลับไปหน้ารวมไฟล์
the-talking-iot-toaster-3fb0fe-en.md

Initially this was started as a little fun project, simply to frustrate a friend, however it has been so much fun its worth sharing!

What we wanted was a take on the classic "Talkie Toaster" from the TV Show Red Dwarf, which would be able to constantly ask toast related questions every time someone was nearby. We also wanted it to respond to being shouted at as well, so we added a few more parts to the project.

It was also a chance to try out our PCB Etching, but this could be assembled on a breadboard / strip board just as easily.

In the future we will further integrate it with other IoT peripherals and services, and this tutorial will get us well on our way...

Project Perspective

The Talking IoT Toaster is a whimsical yet sophisticated entry into the world of smart home appliances. By modifying a standard toaster with an Arduino and sensors, you create a kitchen companion that interacts with you.

Technical Implementation: Giving a Voice to Bread

The project relies on two core communication layers:

  • Audio layer: The TMRpcm library plays pre-recorded WAV files from an SD card, providing the toaster's voice through a small speaker.
  • Sensor layer: A PIR sensor detects when someone is nearby to start a "conversation," and a microphone module listens for a shouted response to continue the dialogue.

General Hardware

To achieve this project we needed a wide array of hardware, anything marked with a (*) can be omitted unless you are trying to build the project in its entirety.

Hardware Infrastructure

  • Arduino Nano: The primary controller managing sensor input, audio playback, and LED feedback.
  • PIR Sensor: Detects motion to initiate an interaction.
  • Microphone Sound Sensor: Listens for audio responses from the user.
  • SD Card Module: Stores the WAV audio files for playback.
  • Audio Amplifier & Speaker: Outputs the toaster's spoken lines.
  • LEDs: Provides visual feedback during operation.

Sound

As our project is all about the sounds we need to convert them into a format we can use on our Arduino with our chosen library (TMRpcm).

All sound encoding can be done reliably using Audacity.

If your tracks are stereo you will need to downmix them to mono (as we only have one speaker) using the option on the Tracks > Mix menu.

Now Export the file from File > Export > Export As WAV, and ensure the bit rate settings are as below:

Audacity WAV Encoding settings for our SD Card Files

Save all of these new files to your SD Card, and if they run as part of seperate conversations, naming them in a "conversation_StepId.wav" can be useful to make them easier to iterate in the code.

Coding

To code this was relatively easy as there is already an WAV compatible library for the AVR platform, and so all we need is to add in our logic, and the code for reading our microphone and PIR sensors.

Software Logic & Interaction Flow

The Arduino code is programmed with a state-based conversation logic:

In the code we:

  • Setup all I/O
  • Work out what conversation to start in
  • Wait for a trigger to begin a conversation (PIR Only)
  • If talking to someone, wait for a response (MIC) before responding with the next segment
  • If no-one responds after a period - give up and go to the start of the next conversation for the next person
  1. Idle State: The system waits for the PIR sensor to detect motion.
  2. Initiation: Upon detection, it plays the first audio file in a conversation sequence (e.g., "Would you like some toast?").
  3. Listening: It then activates the microphone and waits for a loud sound (a shout) as a response.
  4. Response: If a sound is detected, it plays the next audio file in the sequence. If no sound is detected within a timeout period, it gives up and resets to the idle state for the next interaction.

Future Expansion

  • IoT Integration: Using a module like the ESP8266 ESP-01 to connect the toaster to WiFi, allowing it to send tweets or notifications via services like IFTTT when toast is made.
  • Advanced Sensing: Use an optical sensor to monitor the color of actual toast and give verbal warnings.
  • Custom Personalities: Program different conversation sets and LED patterns for different "modes."

This project is a perfect exploration of Human-Machine Interaction (HMI) and adding personality to everyday objects.

Circuit Board

To create the circuit board we used here, we used a 3D Printer along with a 2.5w UV Laser.

  • Paint the copper clad board with a single layer of black matt paint
  • Design the Gerber files in a tool of your choice (Free PCB, Eagle, etc..)
  • Export your Gerber in Black and White, where Black represents the paint / copper to remove, and either vertically or horizontally flip the bottom copper layer
  • Open Inkscape and resize the document to fit your printer bed
  • Ensure you have the JTech laser tool installed
  • Import this into Inkscape and resize to the correct size
  • Convert the Image to Path using the Edge Tracing Tool
  • Use the JTech Laser tool to generate the laser GCode
  • Run on Printer

Now you should have a board which resembles the below:

PCB after lazering before any cleaning

This needs a scrub with a soft bristled brush, and we have found doing this dry first, then using a little washing up liquid works well. Clean until the copper is visibly shiny again.

NOTE - If this doesn't work you may need to tweak your laser settings to be slower / higher power.

PCB after Paint removal and cleaning

Now we can place the board into our Ferric Chloride to etch away the copper, putting your phone torch under the vat can be useful to see progress, as the light shines through the board where the etching is progressing.

NOTE - remove the board after 5-10 minutes and gently scrub the tracks again. This ensures any paint which was not fully removed now is as the acid weakens the edges of the remaining paint.

Once the etching is complete, rinse off the board, and if you're happy remove the rest of the paint using acetone.

Now we can drill the holes for our components using a small drill, 1 mm in this example (be careful not to break the bits!)

Drilling complete (well everywhere we had to anyway) Top view with additional corrective wires shown

NOTE - there were a few copper areas I failed to join on the PCB so a few added holes and wires were put in to correct this (see second image above)

We have used no solder mask or tinning solution in this project. I will just lacquer the board when finished to prevent corrosion as its just a fun project.

Now just cut the board to size and the fun really begins!

Populate the Board

Now we can add all our components to the board, and solder them in place. As we have no solder mask or tin on our board we need to ensure any flux residue is removed post soldering (acetone or warm water), so we left our board to dry overnight....

Board with all our modules added

We realised we had missed a resistor at this point, but its on the Nano itself so we added it now between D2 and D9. This gives us controllable feedback for our lights.

Now we can solder our LEDs together, and add wires to them, and to our speaker. Then solder the other ends to the relative connections on the board

The whole project complete from the electronics perspective

The Black lead is due to a soldering fail on my part, the board tracks are there for this!

The Code

At this point we just had to put the code together to make all of this work as expected, and this is included in the files at the bottom.

Rename any WAV files or pin assignments depending on your implementation.

Try it out at this point, its far easier to fix before its attached to a toaster!

The Other Physical Parts

At this point we wanted to attach ours to our toaster of choice, and add a speaker cover fitting of the project, so we 3D Printed a cover, and spray painted it (didn't have any orange plastic).

3D Printing our cover.... STL file at the end. a few coats of spray paint should save some sanding as it was a quick print...

We used an old plastic milk bottle to cut out the windows, and super glue to attach them to the speaker cover.

Then gluing some magnets on the back meant it would stick to the toaster, but could be removed from the toaster easily if needed.

Our finished cover.... Super glue drying on our windows...

Then we just attached our speaker and LED inside using a double sided foam pad on the back of the speaker, to the centre of our cover.

Some sticky foam pads allowed us to attach the board to the bottom of the toaster, giving the final toaster!

*A short clip of its favourite phrase....*

Useful Links

Visual Micro Website

AVR WAV/PCM Audio Library for SD Playback

Audacity

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x JTech Photonics Inkscape Laser Plug-In"
  - "1x Inkscape"
  - "1x FreePCB"
  - "1x Visual Micro"
  - "1x Audacity"
  - "1x Arduino IDE"
  - "1x Visual Studio 2017"
  - "1x GerbV"
author: "shassandanish1"
category: "Home Automation"
components:
  - "2x Wire, Hook Up"
  - "1x Super Glue"
  - "1x High Brightness LED, White"
  - "1x 3D Printer (generic)"
  - "1x Development Board, Class D Audio Amplifier Module"
  - "1x Audio Amplifier Board (Based on HXL1446)"
  - "1x Speaker: 0.25W, 8 ohms"
  - "1x Matt Black Spray Paint"
  - "1x Hacksaw"
  - "1x Soldering iron (generic)"
  - "1x Solder Wire, Lead Free"
  - "1x Orange 3D Printer Filament"
  - "1x SparkFun Sound Detector (with Headers)"
  - "1x Arduino Nano R3"
  - "1x PIR Motion Sensor (generic)"
  - "1x 2.5W UV Laser Module"
  - "1x Solder Flux, Soldering"
  - "1x Single Side Copper Clad Board"
description: "Meet your breakfast's new best friend: a toaster that talks, tweets, and connects to the internet."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles: []
encryptedPayload: "U2FsdGVkX193gdet09TPJEWMSGR/x5cGEUam24a+SbrmO+9ME69Ly0CkRxNw05MKQE22WbnkOk+GY3Ow92cIePAebzleQp+teq2NKi1DYaB1XoT/pRyqUt214t3caEF3ZuXQW/jL6ngbJ0lfWFWKrrZ/3V08qmcGMWh/RXL9BW9z7QXQs0jdwUXnSl0+dJAX/G4jEV6xVGNjkukwewV0ATKJaxGZNKz0JQ40CJ315QEpmu1VQWVcAxTddqN958u1pTKW6Ne2QFs1KAlELrdyow=="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/the-talking-iot-toaster-3fb0fe_cover.jpg"
lang: "en"
likes: 1
passwordHash: "0fd2eca45c59c6d8e9c821644822aa8e6085b627dd1a354b3f17b8594d8587d6"
price: 1499
seoDescription: "Build a Talking IoT Toaster with Arduino. A fun project to give your kitchen appliances a voice using IoT and sensors."
tags:
  - "home automation"
  - "food and drinks"
  - "visual micro"
title: "The Talking IoT Toaster"
tools: []
videoLinks:
  - "https://www.visualmicro.com/video/TalkieToaster_WALAT.mp4"
views: 4539