Spring 2017 Prosthetic Arm: Sleep ISR Test with Analog Sensor

The Robot Company | CEO Professor Gary Hill

Blog Post created by Project Manager | Bianca Esquivel

Project Test Executed by Mission, Systems, and Test Engineer | Phuong Tran and Electronics and Control Engineer | Mikael Movsisyan

Preliminary Information

Test Objective

Purpose: The experiment is conducted to satisfy the L1.4 Requirement Safety – The operating temperature of the prosthetic arm shall not exceed 50oC for safety reasons and L2.4.1 Requirement – A temperature sensor shall shut down the MCU using an Interrupt Service Routine when the internal temperature of the arm exceeds 50oC.
Aim: Obtain Arduino code for sleep ISR to power down MCU. Modify code to receive input from an analog sensor (simulating a temperature sensor) and when the input value exceeds a threshold, initiate ISR to curb down current supply to the MCU.

Materials

Arduino UNO

Photoresistor

1k, 220 ohm Resistor

Multimeter

MG996R

Test Set Up

Procedure

  1. Set up a light-dependent voltage divider circuit with a photoresistor and the 1k resistor.
  2. Connect analog pin 0 of MCU to read the voltage drop across the photoresistor. Use this analog reading in place of using a temperature sensor, for ease of use.
  3. Connect Interrupt 0 (pin 2) to RX (pin 0) with a 220 ohm resistor.
  4. Obtain code for power down sleep ISR from Arduino Playground website.
  5. Connect servo to MCU.
  6. Modify code such that when the analog reading exceeds a threshold value, the sleep ISR will kick in.
  7. Modify code to sweep servo from 0 to 180 degrees.
  8. Measure the current drawn from the battery before and after the sleep routine.

Sleep ISR Circuit

Arduino Code

Results

The current readings from a 9V battery show that before sleep the MCU draws 0.376A and after sleep only 40mA. The servo PWM pin voltage drops from around 0.255V to 0V, as the servo turns off.

Battery Current

Sleep Current

PWM Transistion

     

Conclusion

The sleep ISR significantly reduces current drawn from power source i.e. battery. This test confirms, that in the event of overheating, the LM34 temperature sensor reading will exceed the required threshold of 50oC thereby, powering the MCU down. The reduced current draw will cool down the PCB and the attached electronic components (e.g. servo).

Link to Code:
https://drive.google.com/open?id=0B6kkqAMmUffrSnEwSjlTWTBCODQ