Sunday, July 24, 2016

Countdown timer for a PhotoBox

One day a colleague from our Laser department (YES we have Lasers!) stood next to my desk and started to ask some suspicious questions about 7-Segment displays and how to control them with an Arduino.

In general its not a problem, I like to share my knowledge about electronics and programming etc., but I hate it to answer questions without knowing the circumstances. So I asked him what the target of the project would be and he said he wanted to program a countdown timer and that he also has not really the time to do it. He also told ne that the project is not for him, its for Murat (Also a guy from the Laser department).

Later that day I went to Murat and asked him about the details of the project and what the main goal would be. He told me that he want to build a PhotoBox for his sisters wedding. I told him that if it is for his sisters wedding it should not only be some 7-Segment displays. He would need something which looks much fancier with more animation and special effects than a 7-Segment display is able to provide, and I showed him my work that I have done with the 3208 lattice clock and that something similar could be done for a countdown display.

He said he would like to have something that does the following:

  • Push a button
  • Countdown starts
  • End of the countdown a Relay is triggered
On that evening I went home and started to dig out my spare 3208 Lattice Clock module and a relay board. I soldered some connectors for power supply, relay output and programming to the board, and started to play with it. After some hours I came up with the following animation:

In the video itself it is not very clear, but the sequence is as follows:
  • Press RESET or reconnect the power to start
  • Dim up the first number in the middle of the screen
  • Shift the number out to the left while the new number comes from the right
  • When the 0 is reached then dim it out
  • Actuate the relay output for one second
  • Wait in idle until RESET or re-power
The complete code including the control for the HT1632C is in one single Arduino sketch with less than 300 lines of code. I apologize for the German comments in the code But it was quick and dirty written. The code can be found in my GitHub repository

So far my work was done for this project. Murat also sent me some pictures of the finished project where he put it all together into a nice box with a tablet as picture preview.
Sadly Instagram changed their logo recently.

HotKey 3

Building and Programming a prototype

Wiring up the Keypad to the Arduino Leonardo

To wire up the Keypad to the Arduino Leonardo I've soldered some thin copper wire to the connector of the PCB and connected it to an external proto board as you can see in the picture below.

After that was done I wired up a simple adapter board for the Arduino Leonardo.

The schematic for this board is quite simple. It just consists of a 10Pin connector for the keypad, an RGB LED and two connectors for the LC-Diaplay and the Serial debug connection.

Creating the Program / Sketch

After the Keypad was wired up to the Leonardo I had to figure out a way to find get the key presses properly into the Arduino. THANKFULLY there was already a library on the Arduino page which does exactly THAT. I've played around a little bit with it and it seem to work properly.

I've created some test sketches and uploaded them into my GitHub repository.

Now I will need to find a way to replace the original PCB of the Keypad.

Tuesday, March 29, 2016

HotKey 2

The day after the proof of concept

I'm using my Hotkey device now since some days and it is pretty practical for the daily workflow. So I've decided to make a more clean or professional version of the HotKey device.

The surprise

I've ordered one of these external USB number pads for notebooks just to have a look inside if there would be enough space to replace the electronics and maybe reuse the keypad matrix. 

JACKPOT! After I have opened it I figured out that there is plenty of space for my upcoming PCB design and also the Keypad Matrix is not glued to the PCB its connected by a flat flex connector, so that it could be reused completely.

Some reverse engineering 

A closer look to the area above the connector of the keypad shows us that the designer of the PCB was so kind to add some labelled test points for me.

This gave me the ability to quickly figure out which button triggers which row and column.

Ordered by key:
7C1 R28C2 R29C3 R2"-"C2 R1
4C1 R35C2 R36C3 R3"+"C4 R3
1C1 R42C2 R43C3 R4
C4 R4
0C1 R500C2 R5.C4 R5

Ordered by column and row:
C1 R1NUMC2 R1-C3 R1*C4 R1/C5 R1
C1 R27C2 R28C3 R29C4 R2BCKSPCC5 R2
C1 R34C2 R35C3 R36C4 R3+C5 R3
C1 R41C2 R42C3 R43C4 R4ENTERC5 R4TAB
C1 R50C2 R500C3 R5C4 R5.C5 R5

Then it was quite easy to also figure out the pin out of the connector:


What's Next?

The next step would be to wire up the keypad matrix to the Arduino Leonardo and figure out a proper algorithm to read the key presses from the matrix.

Friday, March 25, 2016


The idea and the proof of concept

I use EAGLE, LTspice and a lot of other programs which gain a lot of more power an usability if the commands of the Hotkeys are known. But the main problem is that these program have all different Hotkeys/Commands which will vary from [CTRL]+C over the command "copy" to [F6] for copy something.

Even though I know most of the Hotkeys for each program I have often the problem to mistake them when I quickly switch between the different programs. So I thought about that problem and how I could get rid of it. I saw an Arduino sitting on one of my shelfs collecting some dust and I came to my mind that this litte device can "fake" the behaviour of mouse and keyboard on a computer.

I used this feature of the Leonardo before as it can be seen in one of my previous articles. So I've decided to give it a chance to solve my problem.

The proof of concept

I wired up a "shield" with some buttons for my Arduino Leonardo to test the concept and how I would like it.

I Know it looks ugly but it has worked quite well. Below I prepared the schematic for this shield to get a quick overview over the wiring.

The Shield has nine buttons for the Hotkeys and two to select the current configuration. I also added a RGB LED and a 16x2 LC-Display through the I2C connection to show additional information on the currently active configuration. It also got a connector for the serial output for debugging purposes.

All buttons are biased trough the internal pull up resistors of the MCU so that they switch to ground when they are pushed. This saved me 11 Resistors of wiring effort for the board.

I've added the corresponding Arduino sketch to my github repository. You will need a library for the I2C connection of a LC-Display or just comment the line with the definition of LCD_I2C_ACTIVE out.

#define LCD_I2C_ACTIVE // Uncomment to activate the LCD Output

After some tests...

... I decided that I should follow the idea with a HotKey pad to increase the usability of my favourite programs. So stay tuned for the upcoming articles if you want further information about the HotKey pad.