Sometimes resetting a device isn’t as easy as expected. After some research i figured out, that opening a serial connection with a special baud rate would to the job for our Arduino Micro (and similiar like Leonardo):
port='/dev/ttyACM0'#adjust this in case your device differs
ser=serial.Serial()#open serial connection
ser.port=port#setting the port accordingly
#in case your usual baudrate isn't 9600 reset will not work, therefore we will open a resetable connection
#thanks to mattvenn.net for suggesting to add this step!
ser.baudrate=1200# set the reset baudrate
#don't forget to sleep some reset time
Run the script as root. It might need required to change your port according to your serial controller status.
Soldering, Soldering, Soldering 🙂 Everything else had been following the amazingly well written guides of the LSM9DS0 made by sparkfun. Nine degrees of freedom at a rate of “a few per second”(currently 9Hz) since I’ve followed just the basic setup without fancy interrupt usage.
One thing thats really important to mention is the different signal voltage level of the SDA and SCL pins between the Micro(5V) and the IMU Breakout Board(3.3V) – which in case you connect them together without bi-directional level shifting, as you might expect since i2c is designed for exactly that, would lead to blue chip burn.
So wiring on the bread board (and not removing the wires used by the arduino motor shield v2, so do not get too confused by that):
and applying the library to the arduino IDE, leads to a working live example with 2 outputs per second:So the next step is to increase the rate by improving the setup wiring, parse that data into ROS Hydro by a SensorMsg/Imu publisher, kalman and combining these with other odom sources like my currently used (and sadly poor) or even an GPS source to a exact and really usable Odometry by the robot_pose_ekf package for later Simultaneous Localization and Mapping (SLAM) – a real autonomous mapping and navigation. Sounds easy right?
I’ve experimented with the [amazon &title=BMP180&text=BMP180]. Since its a 3,3V breakout board which is I²C capable I had concerns since the Micro usually uses 5V on its Pins. But without a reason: the I²C on the[amazon &title=BMP180&text=BMP180] needs to get a voltage of 5V and the arduino micro also provides 3.3.
So wiring all together:
BMP180 and Arduino Micro
BMP180 and Arduino Micro
Breakout Board -> [amazon &title=Arduino Micro&text=Arduino Micro] DA -> SDA (Digital 2) CL -> SCL (Digital 3) + -> 3.3 (do NOT plug this to 5V!) – -> GND
Sparkfun offers very good tutorials and source code. The library you’ll need to run this board can be found here
Getting this into your Arduino IDE leads to:
Since its an I²C device it should be stackable with any other I²C device in case they do not have the same BUS-address.
Notice: Undefined index: pagination in /var/www/html/wp-content/plugins/list-category-posts/include/lcp-widget.php on line 32