Difference between revisions of "Frequency meter"

From ShawnReevesWiki
Jump to navigationJump to search
Line 1: Line 1:
[[File:Photo-gate-timer-2014-03-11.jpg|512px|thumb|right|A photo-gate timer featuring an LCD display, showing 3 of 5 possible gates at left. In a working lab, the LEDs and photo-transistors would have to be attached to the board via long wires so they could be placed usefully.]]
 
 
===Specifications===
 
===Specifications===
 
*Connect 1 Hall effect switch to watch a magnet passing once per cycle.
 
*Connect 1 Hall effect switch to watch a magnet passing once per cycle.
Line 8: Line 7:
  
 
===Circuit===
 
===Circuit===
[[File:PICAXE-Photo-gate-timer-i2c-LCD-2014.png|512px|thumb|right|Circuit diagram for a photo-gate timer featuring an LCD display.]]
+
[[File:Frequency-meter-PICAXE-08M2.png|512px|thumb|right|Circuit diagram for a frequency meter featuring an LCD display.]]
 
For a detailed diagram, see [[File:Frequency meter-PICAXE-08M2.pdf]].
 
For a detailed diagram, see [[File:Frequency meter-PICAXE-08M2.pdf]].
  
 
===Components===
 
===Components===
 
*Breadboard (~$5)
 
*Breadboard (~$5)
*Micro-controller. I use a PICAXE 20M2 (software timing) or a 20X2 (dedicated hardware timing for better accuracy); both have plenty of inputs and outputs for multiple gates and any type of display. ($4-$6)
+
*Micro-controller. I use a PICAXE 08M2. ($3)
**Resonator circuit if necessary. Not available for PICAXE 20M2. (~$1)
+
**Resonator circuit if necessary. Not available for PICAXE 08M2. (~$1)
 
*Display
 
*Display
**LCD Display, serial capable. I use Newhaven's NHD-C0216CiZ-FSW-FBW-3V3 LCD with I2C ($10)
+
**LCD Display, serial capable. I use Electronic Assembly's DOGM081 with SPI. ($10)
***Two 1µF capacitors to aid voltage booster circuit.
 
***Two 5kΩ resistors to pull up serial clock and data lines while idle.
 
***One 50kΩ resistor to pull up reset.
 
 
**Alternatively, a TTL-to-USB or TTL-to-serial circuit for sharing data with computer ($18)
 
**Alternatively, a TTL-to-USB or TTL-to-serial circuit for sharing data with computer ($18)
 
*Hook-up wires ($2)
 
*Hook-up wires ($2)
Line 25: Line 21:
 
**9V or a quartet of AAA with a 5V voltage regulator, capacitor(s), resistor(s), or
 
**9V or a quartet of AAA with a 5V voltage regulator, capacitor(s), resistor(s), or
 
**120V AC to 5V DC adapter, or
 
**120V AC to 5V DC adapter, or
**Three alkaline AAA or AA batteries.
+
**Three alkaline AAA or AA batteries, or
 +
**Four NiMH rechargeable batteries.
  
 
===Program===
 
===Program===
 
For an explicit example, see [[Frequency meter with a PICAXE 08M2]].
 
For an explicit example, see [[Frequency meter with a PICAXE 08M2]].
 
#Initiate the display
 
#Initiate the display
#Set an interrupt on the pin attached to the first gate. Will interrupt the program wherever execution is and go to Interrupt.
+
#Set an interrupt on the pin attached to the switch. Will interrupt the program wherever execution is and go to Interrupt.
 
#Loop.
 
#Loop.
 
##Increment time counter.
 
##Increment time counter.
 +
##Display frequency.
 
##Go back to Loop.
 
##Go back to Loop.
 
#Interrupt
 
#Interrupt
 +
##Convert count to Hz.
 +
##Reset counter.
  
 
===Datasheets===
 
===Datasheets===
 +
;Electronic Assembly ED DOGM081-A:8-character LCD dot matrix display, with SPI serial control. http://www.lcd-module.com/eng/pdf/doma/dog-me.pdf
 +
:Read various forums for discussions on using SPI between the micro-controller and this display. For example, one on how CSB must be used: http://forums.parallax.com/showthread.php/134847-EA-DOGM-162-Display
 +
;Diodes Incorporated Hall effect switch:http://diodes.com/datasheets/AH180.pdf
  
 
===See also===
 
===See also===

Revision as of 14:16, 15 March 2014

Specifications

  • Connect 1 Hall effect switch to watch a magnet passing once per cycle.
  • Include a display with at least 4 characters.
  • Include a power switch to save the battery, and/or a reset switch.
  • Use a breadboard so it can be built by students, or modified.
  • Allow timing of periods up to at least 10s, accurate to 0.01s.

Circuit

Circuit diagram for a frequency meter featuring an LCD display.

For a detailed diagram, see File:Frequency meter-PICAXE-08M2.pdf.

Components

  • Breadboard (~$5)
  • Micro-controller. I use a PICAXE 08M2. ($3)
    • Resonator circuit if necessary. Not available for PICAXE 08M2. (~$1)
  • Display
    • LCD Display, serial capable. I use Electronic Assembly's DOGM081 with SPI. ($10)
    • Alternatively, a TTL-to-USB or TTL-to-serial circuit for sharing data with computer ($18)
  • Hook-up wires ($2)
  • Power supply
    • 9V or a quartet of AAA with a 5V voltage regulator, capacitor(s), resistor(s), or
    • 120V AC to 5V DC adapter, or
    • Three alkaline AAA or AA batteries, or
    • Four NiMH rechargeable batteries.

Program

For an explicit example, see Frequency meter with a PICAXE 08M2.

  1. Initiate the display
  2. Set an interrupt on the pin attached to the switch. Will interrupt the program wherever execution is and go to Interrupt.
  3. Loop.
    1. Increment time counter.
    2. Display frequency.
    3. Go back to Loop.
  4. Interrupt
    1. Convert count to Hz.
    2. Reset counter.

Datasheets

Electronic Assembly ED DOGM081-A
8-character LCD dot matrix display, with SPI serial control. http://www.lcd-module.com/eng/pdf/doma/dog-me.pdf
Read various forums for discussions on using SPI between the micro-controller and this display. For example, one on how CSB must be used: http://forums.parallax.com/showthread.php/134847-EA-DOGM-162-Display
Diodes Incorporated Hall effect switch
http://diodes.com/datasheets/AH180.pdf

See also

See more discussion and other circuits at Circuits for teaching physics.