Building an Arduino based capacitive touch kitchen timer – Part 2

This part of the Arduino based capacitive touch kitchen timer series discusses the hardware aspects of the project. In the last part, we took a look at the project idea itself, the goals, and skimmed over the theoretical principles behind capacitive sensing. So, it was now time to design a simple circuit and a PCB, which proved to be quite a bit more difficult than expected…

Designing the main circuit for this project

As mentioned in the last part, I decided to use only the MCU of an Arduino Uno in this project. This ensures that the finished device can be as small as possible, while it still gives me the convenience to use simple tools, such as the Arduino IDE, to write the firmware for this project.

Aside from that, the circuit also contains the previously mentioned resistors and traces that will connect the Arduino to the metal contacts of the capacitive touch sensor in the finished project. Keep in mind that I’ve never worked with this type of circuit before, and I generally also don’t take capacitance or any advanced topics into account when designing a circuit, as I’m simply not a professional by any means. Anyway, I gave it my best, and I hope the following circuit will be up for the task at hand:

Figure 1: The display part of the schematic

Note that fig. 2 only shows the display section of the circuit. The MAX7219 seven-segment display driver does the heavy lifting here. Initially, I planned to use two separate controllers and let them interface one display respectively. However, I found that employing the MAX7219 leads to an overall smaller circuit as this method means that I’d only need to add a single IC. The downside to this approach is that the software will have to be slightly more complicated and that the MAX7219 is relatively expensive. Anyway, this also means that I only had to connect three I/O lines of the Arduino to control both seven-segment displays, which is a huge benefit as well. Overall, I think this solution will work just fine in this project. Note that the pinouts of the seven-segment displays in EAGLE didn’t match the real ones I’m using. That means that the connections between the controller IC and the displays might not be correct in your case. Please double check them if you’d like to build this project at home!

How to use only the MCU of an Arduino in a DIY project

Figure 1 only showed a small part of the circuit. Here’s the second part of the schematic that shows how the ATMega328PU fits in:

Figure 2: The ‘Arduino’ part of the circuit

Note that the three lines that go off the top of figure 2 connect to the three lines that come in from the bottom of figure 1. Anyway, the main attraction in figure 2 is the MCU, which is an ATMega328PU (i.e. the same MCU used in an Arduino Uno). Running an Arduino MCU without the Arduino board itself only requires you to add a few external components. The bottom left corner of fig. 2 contains an external 16 MHz crystal that serves as the input clock for the MCU. This setup also requires two 22 picofarad ceramic capacitors. Some ATMega328PU chips actually don’t even require this external crystal because the IC might have an internal 8 MHz oscillator. However, that’s not the case for every manufacturer. Some ICs, especially the cheaper ones, might omit this internal oscillator, so I like to be on the safe side and add an external one just in case. The external oscillator ‘overrides’ the internal clock in either case. Besides that, note how the reset pin is constantly pulled high via a 10K pull-up resistor. Pulling the reset pin of the MCU low resets the microcontroller, and you could add a reset button here to allow users to reset the device if it hangs up, for example. In my case, however, there will be no physical buttons that the users can access. Therefore, I omitted the button.

Other than the MCU, figure 2 also shows the headers that I’ll use to connect the Arduino to the metal plates of the capacitive sensor. Note how each sensor output also incorporates a 36 megaohm resistor. And, lust but not least, there’s an additional pinheader for connecting a buzzer that alerts the user when the timer reaches zero. I, however, forgot about this header when ordering the PCBs, so I’ll have to add the buzzer manually in the end.

In a later revision of this project, I also added capacitors close to the power pins of both ICs to prevent brown-out issues (See part five of this series for more details).

Designing the power supply for this project

So far, I’ve covered the logic portion of the circuit. The finished device, however, also requires power. The easiest way to supply the circuit would be to add a simple USB cord to it and make the users plug it into a USB power supply. That approach would be convenient for me, but it would greatly limit the effective range of the timer, which is not a desirable property for a kitchen timer.

Therefore, I came up with the following incredibly simple and not optimized power supply that allows me to run the finished project off a common 9V battery:

Figure 3: The PSU section of the circuit

The main goal for the PSU was simplicity and to keep the board as small as possible. I might replace this circuit with a more efficient one later if I find out that the battery life is too poor in the finished device, but for now I’m happy with the simple 7805 based PSU. There’s nothing surprising in fig. 3, and you can buy all required components for very little money in a convenient kit on eBay (or similar online shops).

A quick look at the PCB designs

When designing the PCBs, I thought that it made sense to separate the logic part of the circuit and the PSU portion and give each of them a custom PCB. I hope to achieve better results with this approach, and this, furthermore, allows me to build the finished project in layers like a building. My plan is to put the PSU board and a 9V battery on the bottom of the finished device, and then place the logic part above that towards the top of the finished device. I’ll, however, discuss the layout of the project in more detail in a later part of the series. Anyway, here’s the PCB design for the logic section:

Figure 4: The logic PCB

As you can see, I prominently placed the seven-segment displays in the center of the board, and then put all other components around them. I managed to keep the design single-sided until I noticed that I forgot to add a header for the external buzzer. I tried to keep the traces that connect the Arduino to the external capacitive sensor strips as short as possible. However, that didn’t work out quite as well as I had initially hoped, and we’ll see how this turns out in the end.

Figure 5: The PSU board

Figure 5 shows the PCB for the power-supply section. Note that this design is, in theory, also single-sided. However, I decided to add a top plane just for heat dissipation as the 7805 can become quite warm over time. Putting the PSU part of the circuit on a separate board also means that I can easily switch it out for a more efficient one later.

As an aside: I originally tried to manufacture the PCBs at home. That idea, however, didn’t work out for some reason (I think the acid was too weak already), so I decided to order the PCBs online instead. You can use the following links to quickly order the PCBs:

Please keep in mind that the project is still work in progress at this point in time. Therefore, I can’t guarantee that the designs work as intended, but I’ll update this article once the designs turn out to be working as expected!
Everything works as expected now! I updated the schematics and descriptions accordingly.

Figure 6: The finished PCBs and two assembled boards

I’ll include a full BOM in the last part of this series!

Summary

This part of the series discussed the electronics of the capacitive touch kitchen timer project. I explained how to control the seven-segment displays with a single controller IC, how to use the MCU of an Arduino on a custom PCB, and how I designed a very simple 7805 based power-supply for this project.

Sources

Arduino to breadboard – arduino.cc
A simple 7805 based power supply – electronicshub.org

Table of contents

Part 1: Project Idea and the theory behind capacitive sensing
Part 2: The circuit and a custom PCB (You are here)
Part 3: The software
Part 4: The case design and an upcoming revision
Part 5: The finished product, lessons learned

4 thoughts on “Building an Arduino based capacitive touch kitchen timer – Part 2

Leave your two cents, comment here!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.