ACCELEROMETER BASED WHEEL CHAIR USING ARDUINO AND H BRIDGE USING RELAY

Photo of author

By Jackson Taylor

Home » Uncategorized » ACCELEROMETER BASED WHEEL CHAIR USING ARDUINO AND H BRIDGE USING RELAY

As an Amazon Associate we earn from qualifying purchases.

An accelerometer based wheelchair lets the user steer by tilting a small sensor, usually worn on the hand, wrist or head, instead of pushing a joystick. An Arduino reads the tilt, decides which way the chair should go, and switches the motors through a relay H-bridge. This article explains how the pieces fit together, how the control logic works, and what to check before you trust it with a real person.

The video below shows the project in action.

How the system works

The idea is simple. An accelerometer measures acceleration along its axes, and because gravity is always pulling down, the readings change as you tilt the sensor. Tilt it forward and the X (or Y) value moves one way. Tilt it back and it moves the other way. The Arduino compares these readings with threshold values and turns them into drive commands.

Hardware Hack

Stop Buying New Batteries for Your Tech

Electronics are expensive, but their power sources don't have to be. Discover the simple engineering trick to recondition dead batteries and bring your gadgets back to 100% capacity.

Watch the Free Video
  • Tilt forward: both motors turn forward.
  • Tilt backward: both motors turn in reverse.
  • Tilt left: the chair turns left.
  • Tilt right: the chair turns right.
  • Level position: all motors stop.

Components you need

  • Arduino board (Uno or Nano is enough for a prototype).
  • Analog or digital accelerometer module, such as an ADXL335 or MPU6050.
  • Relay modules to build the H-bridge, or a ready-made relay board.
  • Two DC gear motors, one for each drive wheel.
  • A battery that suits your motors, plus a fuse.
  • Flyback diodes (many relay modules include them) and a common ground.
  • A chassis or a small wheelchair-style frame for testing.

Use a motor and battery rated for the load you actually plan to move. A demo chassis and a real wheelchair are very different in current draw.

Why a relay H-bridge?

A DC motor changes direction when the polarity across it is reversed. An H-bridge arranges four switches so you can do this from a microcontroller. With relays, the four switches are mechanical contacts. In practice many builders use two relays per motor: one to power the motor and one to select the polarity, or a pair of changeover relays wired to give forward, reverse and stop.

See also
Best Sensors for Arduino Projects That Actually Work

If you want to see the idea before wiring hardware, our H-bridge using relay simulation walks through the circuit, and the post on H-bridge motor direction control covers the same principle in Proteus.

Relays have limits worth knowing:

  • They switch fully on or off, so you do not get smooth speed control without adding something like a PWM motor driver.
  • They click and wear out over time.
  • They switch slowly compared with transistors or MOSFETs.
  • Never switch the direction relay while the motor is running at full load. Stop the motor first and wait a moment.

Wiring overview

  1. Connect the accelerometer to the Arduino: power and ground, then the X and Y outputs to analog pins (or SDA and SCL for an I2C sensor like the MPU6050).
  2. Connect four Arduino digital pins to the relay module inputs. Check whether your module is active-low or active-high.
  3. Wire the relay contacts so the motor supply goes through them to each motor. Use thick enough wire for the motor current.
  4. Power the Arduino separately from the motors if you can, or at least make sure the motor supply does not cause resets.
  5. Join all grounds together.

Control logic

The program follows the same pattern every loop: read the sensor, compare with thresholds, set the relay pins, and repeat.

  1. Read the X and Y values from the accelerometer.
  2. If Y is above the forward threshold, switch the relays for forward on both motors.
  3. If Y is below the reverse threshold, switch them for reverse.
  4. If X is above or below its thresholds, drive one motor only, or run the motors in opposite directions, to turn.
  5. If every value is inside the neutral band, switch all relays off.

The thresholds depend on your sensor and how it is mounted, so print the raw values to the Serial Monitor and pick numbers from what you see. Leave a clear neutral zone around level, otherwise small hand movements will make the chair twitch. Averaging a few readings also helps remove jitter.

See also
How to Build a Raspbian Security Camera

Safety matters for a wheelchair

Tilt control is easy to demonstrate, but a chair that carries a person needs extra care. Treat the relay version as a learning prototype unless it has been designed and tested properly.

  • Add a clearly marked emergency stop that cuts motor power directly, not through code.
  • Make the default state “stopped” if the sensor disconnects or the Arduino resets.
  • Use a fuse or breaker on the battery line.
  • Test with the wheels lifted off the ground first, then on a flat surface with no one sitting in the chair.
  • Consider a hold-to-run switch so the chair only moves while the user is deliberately enabling it.

Ideas for improving it

  • Replace the relays with a MOSFET or dedicated motor driver to get PWM speed control and smoother starts.
  • Add an ultrasonic sensor to stop the chair before it hits an obstacle.
  • Use a low-pass filter or the MPU6050’s built-in processing for steadier readings.
  • Add a buzzer or LED to show when the chair is armed.

If you are new to accelerometers, a smaller project is a good way to get comfortable with the readings. Our accelerometer earthquake alert project and the iron box automatic turn-off system both use the same kind of sensor with simpler outputs.

FAQ

Which accelerometer is best for this project?

An ADXL335 is easy because it gives analog outputs you can read with analogRead. An MPU6050 is also popular and gives more stable data over I2C, but needs a library or a little more code.

Can I control the speed with relays?

Not smoothly. Relays are on or off, so the chair runs at one speed. For variable speed, use a PWM-capable motor driver or MOSFET H-bridge.

Sustainable Tech

Keep Toxic E-Waste Out of Landfills

Don't throw away your failing laptop, phone, or car batteries. Learn how to recondition them at home in just a few hours. It's better for the planet—and your wallet.

Learn How It Works

Can the accelerometer be worn on the head or hand?

Yes. Any part of the body that can tilt in a controlled way can work, as long as the sensor is fixed firmly and the thresholds are tuned for that movement.

See also
Best Soldering Iron for Electronics: 5 Picks by Use Case

Is this safe for a real wheelchair?

The circuit is a good prototype for learning. For real use, you need properly rated motors and drivers, an emergency stop, fail-safe behavior and careful testing.

Revive Your Dead Electronics

Got a drawer full of dead gadgets or a failing car battery? Instead of paying a premium for replacements, use this simple trick to easily recondition them right from home.

See How It Works