Electronic Design

Overview:

There were in total 5 circuit modules:

  1. LEAF detection system
  2. Hammer detection system
  3. House LEDs and buttons system
  4. Water level handle system
  5. Energy meter display system

The hammer detection circuit and LEAF detection circuit both relied on an IR beam break detection, but of different kinds. While the hammer circuit was designed to detect edges, the LEAF circuit was designed to detect constant DC signals.

The house LED and button system used a set of 6 SPST-momentary switches for the buttons and a single shift register to control the LEDs.

The water level handle system used a rotary potentiometer to detect the level of turning. For the display, a set of LEDs connected in parallel to each other, and controlled by an NPN MOSFET were used. The LEDs had decreasing values of current-limiting resistors in series with each of them in order to achieve a gradient in the light emitted. PWM signals were sent to the MOSFET from the TIVA microcontroller, corresponding to the potentiometer reading.

The energy meter display system used a simple circuit with two shift registers coupled together to control the 16 display LEDs.

Detailed Design Description:

Tiva Port Assignments

LEAF Detection System

Circuit Description:

  • A QRB1134 reflective object sensor is used as the primary sensing device and is positioned above the black rectangle of the (inserted) LEAF. Underneath the LEAF there is another IR LED emitter (which is why there are two emitter circuits above).
    • When the LEAF is not inserted, this IR LED shines directly onto the 1134, and the receiver circuit is designed so as to detect this as a high signal.
    • When the LEAF is inserted incorrectly, i.e. with the white part facing the 1134, the IR LED beam is broken but the circuit is designed so that the reflection off the white surface is sufficient for the signal to be detected as a high.
    • When the LEAF is correctly inserted the IR LED beam is again broken but this time as the reflective surface is black, the 1134 will detect a smaller analog signal, and the circuit is designed so as to consider this a low signal. Hence correct insertion of the LEAF is detected
  • The QRB1134 is used in a transresistive circuit with a 2.5 V reference voltage. This signal is then passed through a stage of amplification with a low pass filter to reduce the noise, and finally through an inverting Schmitt Trigger with modest upper and lower thresholds.

Calculations

Hammer Detection System

Circuit Description:

  • A photo-transistor is used as a receiver, in conjunction with an IR LED that acts as the transmitter/emitter. The transistor and LED are placed on opposite sides of the hammer target and hence when the hammer is hammered down the beam is broken and this is detected. There is software debouncing present to account for errant micro-bounces of the hammer.
  • The photo-transistor is used in a transresistive circuit with a 2 V reference voltage. A 2 V reference is used so as to boost the current through the photo-transistor (over a 2.5 V reference voltage) and hence detect the relatively far-away LED signal (A lower reference voltage could potentially be used as well but too low a reference will later limit the amplification possible due to the lower limit of GND).
  • This signal is then passed through a DC blocker (essentially a high pass filter) in order to get rid of DC ambient signals such as that from the sun or lighting in the room. As we only need to detect a change in the hammer state (hammer DOWN or hammer UP) i.e. only need to detect edges, this does not affect the working of the system. However, it implies that we cannot measure using this circuit a constant DC voltage, which has implications for the software implementation. We will need to assume an initial state of the hammer at the start of the game (in our case we assumed hammer UP), and cannot actually detect it. Then for the first edge detected, it can be deduced that the hammer has been hammered down, for the second edge detected that it has been raised up again and so on. However, is the assumption is for some reason violated, then the software would incorrectly assume the state of the hammer and the system would not work correctly.
  • The signal from the DC blocker is then passed through a stage of amplification with a low pass filter to reduce the noise. The amplification is done with respect to the 2 V reference voltage, as the output from the DC blocker is impulses above and below 2 V when a rising and falling edge is detected respectively and we would like to maintain this symmetry in our signal.
  • Finally, the signal is conditioned using an inverting Schmitt Trigger with very high upper and lower thresholds, in order to ensure that random IR changes in the environment do not get registered.

Calculations

House LED and Button System

Circuit Description:

  • A set of 6 SPST-momentary switches are used as the buttons for the house system. An arbitrary current limiting resistor of 2.2k is used.
  • A single shift register is used to control the 6 house LEDs. The sizing of the current limiting resistors for the LEDs is similar to the hammer LEDs described above and is so omitted here.

Water Level Handle System

Circuit Description:

  • A simple rotary potentiometer (0-500 ohms) was connected co-axially to the external water handle. The central prong of the potentiometer was read in order to determine the level at which the handle currently was.
  • For the display, a set of LEDs connected in parallel to each other, and controlled by an NPN MOSFET were used, as shown above. The LEDs had decreasing values of current-limiting resistors in series with each of them in order to achieve a gradient in the light emitted. The resistor values were chosen based on empirical calibration for a good viewing experience.
  • PWM signals were sent to the MOSFET from the TIVA microcontroller, corresponding to the potentiometer reading; thus the display reflected the handle value.

Energy Meter Display System

Circuit Description:

  • Two shift registers were cascaded to control the 16 display LEDs.
  • The calculations for the current limiting resistors are similar to the hammer LED display calculations and are hence omitted here.

Other Miscellaneous Circuit Schematics