Skip to the content
PCBKitNew board
2 layers20 × 10 mmEncoderBoard, the printed circuit board in 3D

Our application uses two hall sensors for measuring speed, traveled distance, burnt calories and time (not by the hall sensor). This data is shown on four 7segment displays (one part).

Size
20 × 10 mm
Copper layers
2
Thickness
1.6 mm
Parts
6
Nets
3
Pads
21
Tracks, vias
23, 0
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
7 Apr 2021
Updated
4 May 2021

Overview

EncoderBoard is an open-source printed circuit board by mkousal, from the mkousal/Digital-electronics-1-Tachometer repository on GitHub. It is a 2-layer board of 20 × 10 mm with 6 parts on 3 nets, routed with 23 tracks and 0 vias.

Its parts include 2 capacitors, 1 resistor, 1 IC and 1 connector.

README

README.md

DIGITAL ELECTRONICS 1

2021, Faculty of Electrical Engineering and Communication FEKT
image
Title: Project 2021
Topic: 3. Console for bike with hall sensor, measuring and displaying speed, traveled distance and burnt calories
Time Window:

  • Start of Project: April 7
  • End of Project: May 4

Supervisor: doc. Ing. Tomáš Frýza, Ph.D.
Vivado Teachers: doc. Ing. Tomáš Frýza, Ph.D., Ing. Stanislav Rozum

3. Console for bike with hall sensor, measuring and displaying speed, traveled distance and burnt calories

Team members

Project objectives

Our application uses two hall sensors for measuring speed, traveled distance, burnt calories and time (not by the hall sensor).
This data is shown on four 7segment displays (one part).

  • Calories counting
  • Total time
  • Total distance traveled
  • Trip distance traveled
  • Speed measuring

Modes can be selected by pressing buttons (see below).
One hall sensor is used for measuring speed and traveled distance. Another one is for calories counting.
Burnt calories will increase only by stepping the pedals, not by downhill riding!

Hardware description

Programming Board

image

  • Main programming board is Arty A7-100T. It has four Pmod connectors (16.), we have used all of them
  • Other buttons and LEDs are not used => See Main Board

Main Board

image image

  • Schematic
  • Consists of: three buttons, 7segment display, Pmod connectors, LED status and two connectors for Hall sensors
  • Board is made for direct connection to Arty A7 board. Three buttons are used to controlling the tachometer. LED at the top shows what value is now displayed at the display
  • Used seven segment display with middle double dot and dots for decimal is TDCG1050m - datasheet

Hall sensor board

image
image

  • Schematic
  • Hall sensor board only consists of hall sensor and a few passive components that are described in datasheet and connector
  • You can screw it by using M3 screw to your bicycle
  • Used sensor is MH253 - datasheet

VHDL modules description

Buttons

Button_int:
  • This block reads the input from real world buttons and translates them to commands which will be sent to the state_machine controller. When buttons up or down are pressed, the interface will enter a cooldown state when no additional button presses will be registered (to prevent jitter) after the cooldown passes, the interface will send an up or down command out
  • If the ok button is pressed, the device enters the cooldown state, after which it will wait for a longer ammount of time. If no additional ok button press is registered, the interface will send out an startstop command
  • If, however, the ok button would be pressed again, the interface will send out the reset command

Traveled distance

km_total:
  • This block counts the travel distance and sends it out to the display. Every 100 m (meters) an pulse will appear on the meters_i which will add to the total count of up to 999,9 km
  • When the trip mode is activated the block will count the trip time and send it to the display instead, the total time is being still counted in the background
  • rst signal will make the current displayed data reset to 0
  • The enable signal will be present if the trip is not paused, on pause the trip data is not counted
  • This block automaticaly wipes previous trip data when the mode is turned on

This block also contains a function which converts the traveled distance from binary integer to BCD code to be displayed on the 4 digit 7 segment display.

Main controling module

state_machine:
  • This is the main utility block of the device. It recives commands from the button interface and switches the outputs accordingly. Inputs up_i and down_i will cycle through the 4 modes of the device and light up their status LED
  • While in a mode the data stream from its block will be sent to be displayed on the segment display via the data_o, with added decimal point or double dot if needed
  • While in a mode the reset and ok commands also aply for the selected block only. The trip mode is special, because it does not generate data on its own, when activated, it will send a mode change command to all blocks which will now store and display data in an additional variable as well as keeping the total count going
  • The status LED of trip will remain on as we cycle through the other modes until it is paused by the startstop button or turned off via the reset. At this point all trip data will be reset from all blocks and the normal total data will be displayed

Time mode

total_time:
  • This block acts as a stopwatch. When startstop is applied, it will start or pause the counting
  • Reset will reset the total time
  • When the trip mode is enabled, the stopwatch will automatically start counting the trip time and will reset before every trip is started

This block also contains a function which converts the total time from binary integer to BCD code to be displayed on the 4 digit 7 segment display.

SENSOR

sensor:
  • This block is used to calculate actual speed and triggering pulse every 100 meters for counting travelled distance
  • Uses input from hall sensor mounted at the front wheel. Output one trigger signal every counted 100 meters and calculate actual real speed and set it to display output

7 Segment Driver Module

  • This block consists of 4 smaller modules:
    1. CLOCK
    2. UP_DOWN_COUNTER
    3. DRIVER_4X7SEG
    4. DECODER_7SEG
CLOCK:
  • Generates 100MHz clock
  • This periodic signal is used in module UP_DOWN_COUNTER, which reacts on rising edge of the signal
  • Originally uses 4ms for each segment
UP_DOWN_COUNTER:
  • According settings (g_CNT_WIDTH), counts as the edge of the clock signal rises
DRIVER_4X7SEG:
  • Main module, drives four 7segment displays. It is determinated by CLOCK and UP_DOWN_COUNTER
  • Process MUX uses above modules to set data_outputs to each 7segment display
  • Input is a 16bit unsigned (b"xxxx xxxx xxxx xxxx")
DECODER_7SEG:

This module is used for displaying data on 7segment display. If have more displays, MUX has to be used
Both, common cathode and common anode can be used as well

Calories Mode

calories:
  • This block calculates burned calories by measuring the time between each pedals rotations
  • Rotation is captured by hall probe attached to pedal
  • The 100 MHz clock is used for counting time. Every 0.5s a number is increased, which recalculates the calories formula
  • When signal from hall probe is not generating for 2s, the number that was increasing is stopped. The amount of burned calories is sent to display

Testbenches and simulations

Button_int:
  • Shows states of button_int block
  • In order to save time and make the inner working of this device more clear, all simulated data has been sped up
    image
km_total:
  • Screenshot demos how the counting works
  • In order to save time and make the inner working of this device more clear, all simulated data has been sped up image
state_machine:
  • Screenshot below represents testbench of main unit
  • In order to save time and make the inner working of this device more clear, all simulated data has been sped up image
total_time:
  • Funcionality of total time counting is shown by this signals
  • In order to save time and make the inner working of this device more clear, all simulated data has been sped up image
sensor:
  • First waveform shows how the speed calculation works. Calculated speed is written to the s_disp_o, which is 16bit word and is here until the new value is calculated image
  • Second waveform shows pulsing at the s_trigger_o every 50 sensor's tick, which is equal to the 100 meters in real distance image
CLOCK:
  • Generates 100 MHz clock signal image
UP_DOWN_COUNTER:
  • As internal values set, counts with edge of the clock
  • 0-31 states: image
  • 0-31 states: image
  • 0-4 states = This is used in our application
  • Four 7segment displays are controlled by this states image
DRIVER_4X7SEG:
  • These screenshots show how the multiplexer works
  • s_data is the main 16bit data input
  • s_hex is the 4bit data output, which is used in DECODER_7SEG. This module decodes the 4bit data value and diplays it on a specific 7segment display
  • s_dig_o shows which one of four displays is being used. b"0001" means display on very right side
  • s_seg_o represents common cathode bits image image
  • This screenshot shows a real situation, when input data will be refreshed every one second (tachometer)
  • If data is not changed for a while, displays will use last data. This prevents from wrong/unwanted values image
DECODER_7SEG:
  • Decodes 4bit signal to 7bit (7 segments (+ decimal dot and colon)) image
calories:
  • The simulation is in ratio 1s = 10ms
  • In wave form is display calories counting in both modes and amount of burned calories is sending to display image

TOP module description and simulations

  • TOP module represents the whole project
  • Final test schema can be seen below: image
  • After having main board and hall sensor board done, software can be written into Arty A7 board. Generated bitstream is available here.
    image

Video

Video presentation is available here.

References

Used materials:

Used programs and its links:


©2021, VUT FEKT, Brno, Czech Republic
Kousal Martin, Ledvina Matej, Kříčka Tomáš, Košík Samuel
For Educational Purposes Only!

Parts

6
QtyValueFootprintReferences
1100pCapacitor_SMD:C_0402_1005MetricC2
110kResistor_SMD:R_0402_1005MetricR1
110nCapacitor_SMD:C_0402_1005MetricC1
1Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_HorizontalJ1
1MH253Package_TO_SOT_SMD:SOT-23U1

The 5 most common of 6 parts.

Questions

How big is the EncoderBoard PCB?

It measures 20 × 10 mm and has 2 copper layers, 1.6 mm thick.

What parts does the EncoderBoard use?

6 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the EncoderBoard KiCad files?

From the mkousal/Digital-electronics-1-Tachometer repository on GitHub, at the commit this page was made from: the board is hw/encoder/encoderBoard/encoderBoard.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the EncoderBoard design in my own project?

Its repository states no licence, so its author keeps all rights: ask mkousal before reusing the design.

More from mkousal/Digital-electronics-1-Tachometer

1
  • 2 layers91.4 × 50 mmTachometer, the printed circuit board in 3D

    Tachometer

    mkousal/Digital-electronics-1-Tachometer

    Our application uses two hall sensors for measuring speed, traveled distance, burnt calories and time (not by the hall sensor). This data is shown on four 7segment displays (one part).

    55 parts

Similar boards

  • 2 layers18.5 × 11.1 mmSwitch, the printed circuit board in 3D

    Switch

    byrantech/laptop

    anyon_e, a highly integrated, high end, open source laptop. Attempt the impossible.

    6 parts4.3kMIT
  • 2 layers14.6 × 33 mmBrain board SD Card 1, the printed circuit board in 3D

    Brain board SD Card 1

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    6 parts1.2k
  • 2 layers9 × 9 mmDpoint, the printed circuit board in 3D

    Dpoint

    Jcparkyn/dpoint

    Open-source digital stylus using camera tracking and inertial measurements

    6 parts1.1kMIT
  • 2 layers51.5 × 16.6 mmMicroswitchXY Endstop, the printed circuit board in 3D

    MicroswitchXY Endstop

    VoronDesign/Voron-Hardware

    Cool Hardware designed by the Voron Design group

    6 parts1.1kGPL-3.0
  • 2 layers21.9 × 76.7 mmAmiga External, the printed circuit board in 3D

    Amiga External

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    6 parts1kGPL-3.0
  • 2 layers88.9 × 50.8 mmBusinesscard, the printed circuit board in 3D

    Businesscard

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    6 parts915
  • 2 layers20.3 × 15.2 mmL0 RGB led, the printed circuit board in 3D

    L0 RGB led

    Luos-io/luos_engine

    Open-source and real-time orchestrator for cyber-physical-systems, to easily design, test and deploy embedded applications and digital twins.

    6 parts546MIT
  • 2 layers9 × 3.6 mmOpticalEncoder, the printed circuit board in 3D

    OpticalEncoder

    adamb314/ServoProject

    Getting the most out of your hobby servo

    6 parts545