Can one Mega board run analog steering input and mpu6050 balance info to an oDrive motor-controller?

This is my first project, using Arduino Mega and oDrive 3.6 56v to power two bosch BLDC hub-motors in a self-balance platform.

All the other projects I’ve seen use an RC module to ‘steer’ directly connected to the oDrive board. I want to use Segway’s hall-sensor steering, which outputs an analogue voltage, ranging from 1.96 to 3.1 volts, it uses 2.5v as ‘centre/straight-ahead’, lower voltages steer Left, higher voltage steer Right.

Can I connect that hall-output to the Mega’s Analog pins, to convert it to a digital output for sending to the oDrive board? And can this operate while the Mega is also handling forward/back lean-angle data from an MPU6050 which sends data to the oDrive to control how much forward/reverse acceleration is required. Will I need to run two Arduinos, one for each task?

Sure - you would just set the voltage(s) to an analog input on the arduino and convert them into a variable that correlates to an output for the motor(s)

You’ll probably want to start by getting the MPU to work/give good readings; try this code https://github.com/jrowberg/i2cdevlib/b … 0_DMP6.ino and then get the Mega to also control the motors, then combine the code into one larger ‘sketch’ :smiley: