Stepper Motor + Water Level Sensor – Dario N (Week 8)

Goal of the Project:

With this project, I wanted to explore a new and rare sensor as a trigger/switch for a stepper motor. In this case, I used a ‘Water Level Sensor’ to tell the Motor when to turn on and off depending on how deep the sensor was into the water. I wanted to challenge myself into going to use new tools and hardware.

List of Components:

  • x1 Arduino Uno
  • x1 Breadboard
  • x1 Water Level Sensor
  • x1 Unipolar Stepper Motor
  • x1 Stepper Motor H Bridge
  • Jumper Wires

Assembly Process:

To create this project, first, I checked that the water level sensor was reading the analog data as soon as a submerge it into the water. I simply connected the jumper wires to the 5V, the ground and to the analog read. Then, I connected the stepper motor to H-Bridge and into the Arduino to pins 8-11.

How it works:

The Arduino is constantly reading the input data from the Water Level Sensor. 0 means that the sensor is out of the water; as soon as it gets submerged the data start bumping up to approximately 400. I used this value to tell the stepper motor when to turn on.  It is also possible to modify the direction of rotation depending on the range of values from the sensor. There are infinite possibilities! I imagine using this scheme in applications such as in boats, aquatic designs. I quite like the idea of using the water as a trigger. What if the sensor is a trigger to create a musical instrument were the water is the medium?

Problems:

I had some issues with the coding part. The water sensor was giving me values every second when It was by itself. But as soon I connected the motor, it started reading every turn which is not ideal. I couldn’t solve this issue with coding. I had to increase the speed of the motor, so the reading happened quicker.

Arduino Code (File):

https://www.dropbox.com/s/vlz4gihrfu8y3ro/Stepper_Dario.ino?dl=0

Circuit Diagrams:

Resources:

http://engyfun.blogspot.com/2015/02/here-is-source-code-for-our-28byj48.html

https://github.com/joycemolly/stepper-motor-and-h-bridge/blob/master/sketch_mar13a.ino

Leave a Reply

Your email address will not be published. Required fields are marked *