Use Hard Disk Motor to CONTROL ALMOST ANYTHING!

by Kimanzi254 in Circuits > Microcontrollers

927 Views, 6 Favorites, 0 Comments

Use Hard Disk Motor to CONTROL ALMOST ANYTHING!

IMG-20221118-WA0007.jpg

According to statista.com, more than 50 million metric tons of electronic waste - commonly referred to as e-waste is generated every year globally. Only 20% of this formally recycled. With the Age of Industrial 4.0 upon us this will only get worse unless something is done.

When e-waste is not properly disposed or recycled, the toxic chemicals or metals contained on them can leach into the soil and lead to contamination of water sources/supplies. This especially is of major concern in my home country, Kenya, where only 10% of e-waste generated end up being managed properly. The existence of recycling centers such a WEEE, E-WIK and the emergence of others there is a glimmer of hope that one day at least 90% of the generated e-waste is properly recycled but until then lets individually do our own bit.

Okay, lets get to the fun part!

In this instructable am reusing a no longer working hard drive and pairing it with Arduino plus some complementary parts to basically create a rotary encoder wannabe that has a smooth feel unlike the incremental movement of the latter.


Supplies

  1. Arduino Mega (Any version should work)
  2. Broken Hard drive
  3. LM324
  4. 3 x 1KOhm Resistor
  5. 3 x 56KOhm Resistor
  6. Jumper wires
  7. Multimeter
  8. Soldering iron
  9. Soldering wire
  10. Breadboard

Circuit / Hardware Implementation

HarddiskEncoder.PNG
IMG-20221118-WA0007.jpg
1668783430098.jpg
1668783430165.jpg

The hardware is connected as per the circuit. The interrupt pins of the Arduino boards are almost the same with UNO/NANO/PRO MINI being pin 2 and pin 3 while the MEGA being 2,3,18,19,20,21.

LM324 is a single supply quad operational amplifier. In has four operational amplifiers, in this case we are only using three of them. Resistors 56K and 1K do set the gain. They help with setting the sensitivity of the spindle motor as you spin it.

The hard disk drive should be carefully opened to expose the internals. The spindle motor should have at least 4 connection pads. My case it has four connection indicating it is a motor connected in the Star configuration. This is where the multimeter comes in handy. Measure the resistance between each of the connecting pads and record them. By doing this we are basically looking for the neutral point. The resistance between the neutral and each of the the three pads in my case is 2.0 Ohm while between the three pads is 3.8 Ohm. Solder the connection pads while keeping tabs with which is neutral wire.

Connect the motor connection to LM324 as per the circuit and later on connect the LM324 to the Arduino. You can power LM324 straight from the Arduino. Double, Triple check you connection before powering anything!



Arduino IDE/ Software Implementation

testino.PNG

Arduino IDE is used for software implementation. Make sure all the defined pins are connected correctly. The baud rate should be set to 9600. In case of any hardware changes in terms of pin connection to the Arduino make sure it is also made on the code. Incase you want to use digital pin 3 as the external interrupt pin, make sure you change:

  1. isr0 to isr1
  2. attachInterrupt( 0, isr0, RISING) to attachInterrupt(1, isr1, RISING)

Upload the code and give it a try!

Adjust the delay and see what happens.

Downloads

How It Works

Spinning the spindle motor generates three sine wave which are out of phase with each other. The amplitude(in the range of millivolts) is usually very low that the Arduino cannot easily detect them. The LM324 acts as a comparator which compares the voltage of the neutral point to the three individual connections of the motor. If one individual connection has a higher voltage than the neutral point, it pulls that comparator HIGH. If the neutral point has a higher voltage than that individual connection it pulls the comparator LOW. With the use of an interrupt(if the pin is HIGH) the Arduino is able to know which comparator pulled HIGH next and with that we are able to know the direction of motion of the motor.

HIGH(5V)

LOW(0V)

BONUS: Application!

HarddiskFM.PNG
1668783430212.jpg
Screenshot_20221118-195745.jpg

Lets put it into use. TEA5767 FM module is an additional hardware needed in this case. The FM module is an I2C device, only two wires are connected to the Arduino minus the power supply wires. Be sure to identify the I2C pins on your Arduino. Remember to include pullup resistors on the I2C pins, I forgot to include them on the schematic. Double check your connections, hook up an amplifier input to the Left and Right output of the FM module, upload the code and have fun tuning in to different FM stations with the help of the hard disk motor.



HAPPY BUILDING!