The intent of this work is to unique speed control(PWM) the individual motors (bi-directional) based on the ultrasonic sensor readings using Arduino Nano. In addition, We wanted to have an MPU-6050 IMU and an RC receiver.
I have challenge of connecting all the below components in one Arduino Nano board. Any Suggestion/solution to accommodate the below components in one Arduino Nano are welcome.
If we could not fit below components in one Arduino Nano what is the other feasible and low cost approach to achieve this Solution. As we have the space constraint, we could not accommodate the Controller board which is bigger than Arduino Nano.
I have also attached the rough Circuit diagram for your reference
Existing Components:
5 Numbers of Ultrasonic sensor (HC-SR04)
4 Numbers of Motors (bi-Directional, Need unique speed on every motor)
10 pins for Ultrasonic Sensors
12 pins for 4 motors with speed control
2 pins for MPU-6050 IMU (I2C/TWI/Wire)
1 pin for RC Receiver
25 pins total.
The Nano only has 19 digital I/O pins so you will need some kind of I/O Expansion. You can share the I2C pins with a "port expander" to get 8 of the 12 motor pins:
10 pins for Ultrasonic Sensors
4 PWM pins for speed control on 4 motors
2 pins for MPU-6050 IMU (I2C/TWI/Wire) and Port Expander for the 8 motor direction controls.
1 pin for RC Receiver
17 pins total.