Timer With Arduino and Rotary Encoder

6,363

8

2

Introduction: Timer With Arduino and Rotary Encoder

About: Concerned about projects and constructions in the field of electronics. New and old projects.

The timer is a tool often used in both industrial and household activities.

This assembly is cheap and easy to make.

It is also very versatile, being able to load a program chosen according to needs. There are several programs written by me, for Arduino Nano.

The duration of the timer can be entered on the display (1602) from the rotary encoder. By pressing the button on the rotary encoder the timer is triggered.
The load will be powered during the time delay via the contacts of a relay.

I personally used the timer for UV exposure in the process of PCB, but also at home where a kitchen robot operated to knead bread dough.

Supplies

All components can be found on AliExpress at low prices.

PCB is designed and manufactured by me (KiCad project). The method of PCB production will be the subject of a future Instructables.

Step 1: Schematic Diagram

The circuit is built around an Arduino Nano. The display that sets the time and reads the remaining time is of type 1602.

Through Q1, BZ1 is activated, which emits a beep at the end of the delay time.

The setting of the delay time is made from Rotary Encoder (mechanical type).

Also from here is made "Start time".

The relay K1 (12V) is activated by Q2. The relay contacts K1 are available at connector J1.

The schematic is supplied (+12V) to the J2 connector.

Step 2: List of Components and Tools

This is the list of components given by the KiCad program:

A1 Arduino_Nano Module:Arduino_Nano_WithMountingHoles

BZ1 Buzzer 5V Buzzer_Beeper:Buzzer_12x9.5RM7.6

C1 470nF Capacitor_THT:C_Rect_L7.0mm_W2.0mm_P5.00mm

C2, C3 100nF Capacitor_THT:C_Rect_L7.0mm_W2.0mm_P5.00mm

D1 LED Red LED_THT:LED_D5.0mm

D2 1N4001 Diode_THT:D_DO-41_SOD81_P10.16mm_Horizontal

DS1 WC1602A Display:WC1602A

J1 Conn_01x05 Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Horizontal

J2 +12V Connector_BarrelJack:BarrelJack_Horizontal

K1 Rel 12V Relay_THT:Rel 12V

Q1, Q2 BC547 Package_TO_SOT_THT:TO-92_Inline

R1, R3 15K Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal

R2 1K/0,5W Resistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P12.70mm_Horizontal

R4 220 Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P10.16mm_Horizontal

RV1 5K Potentiometer_THT:Potentiometer_Piher_PT-10-V10_Vertical

SW1 Rotary_Encoder Rotary_Encoder:RotaryEncoder_Alps_EC11E-Switch_Vertical_H20mm

SW2 Memory Button_Switch_THT:SW_CuK_JS202011CQN_DPDT_Straight

To this are added:

-PCB designed in KiCad.

-Digital multimeter (any type).

-Fludor and soldering tools.

-Screws M3 l = 25mm, nuts and spacers for LCD1602 mounting.

-Knob for rotary encoder.

-The desire to do it.

Step 3: PCB

The PCB project is made in the KiCad program and can be found at:

https://github.com/StoicaT/Timer-with-Arduino-and-...

Here you will find all the details necessary for the factory order (Gerber files, etc.).

Starting from this documentation, you can also make your own PCBs on double-plated material, 1.6 mm thick. No metallic holes, with side-by-side passages with non-insulated connector.

Cover all routes with tin.

We check with the digital multimeter the PCB routes to detect interruptions or short circuits between the routes (first photo in Step 4).

Step 4: Module Assembly

The following photos briefly show how to plant electronic components.

The last 3 photos show the completed front-back set (final).

Start up the module:

-Visually check the correct placement of components and tin soldering (the components are planted in such a way that the assembly can be mounted on the front panel of a device).

-Power the mounting on the J2 with 12V .

-Measure (according to the schematic diagram) the voltages on the board (digital multimeter).

-Adjust the optimal contrast on the LCD1602 from RV1.

-Upload the program on Arduino Nano board as shown below.

-Check the proper functioning by giving a timer and seeing that it is executed correctly.

Step 5: Software.

The program can be found at:

https://github.com/StoicaT/Timer-with-Arduino-and-...

https://github.com/StoicaT/Timer-with-Arduino-and-...

There are 2 program variants. The github repository explains what each one does and how the timer is programmed in each case.

We will download the desired version and upload it to the Arduino Nano board.

And that's it!

Arduino Contest 2020

Participated in the
Arduino Contest 2020

Be the First to Share

    Recommendations

    • CNC and 3D Printing Contest

      CNC and 3D Printing Contest
    • Lamps Challenge

      Lamps Challenge
    • Puzzles Challenge

      Puzzles Challenge

    2 Comments

    0
    vldtch
    vldtch

    Question 5 weeks ago on Step 1

    Hello, I reproduced the timer (with Hours Min Sec) but I see that the press of a button does not move the cursor when setting time, if I press and rotate - then it moves (but easy to overshoot). again, to start the timer, need to press and rotate. Do u think it is possible to correct it with code? How come it works for u? do u suspect the hardware mistake on my part?

    0
    TedySto
    TedySto

    Answer 4 weeks ago

    Hello!
    First time I asked myself if there is an error in the software on github. To clarify, I downloaded the sketch from there and uploaded it to the Arduino Nano, which is equipped a timer identical to the one in the Main Photo. It works correctly. Then I compared the PCB published on github with the physical copy that I have in hand. They are identical.
    So I can only think is a hardware problem on your object. Maybe Rotary Encoder is not the same(or broken). If the PCB is made by you, there may be short-circuited or broken paths. If you used a breadboard, maybe there are problems making the connections. Pay attention to how A0, A1, A2, from the Arduino Nano are connected. In the end it will be OK! Success!