Little Red Rover Major Changes

I have not written about my Little Red Rover (LRR) for quite a while, so this will be a big update. When I get into the zone, I tend to forget about documentation.

If you have read previous posts about my Little Red Rover, you will see how much has changed. The LRR is built up from an Adafruit Mini Robot Rover Chassis Kit and started as an Arduino based remote-controlled machine. Now, I am using Adafruit"s CircuitPython, which is a derivative of MicroPython. However, Circuitpython is oriented towards education and is much easier to get started with and use. The processor is a Feather M4 Express board, which has a 120MHz SAMD51 MCU.

Here are the upgrades:

Upgraded to four wheels for better stability.
Added sensors
HTU21D-F for temperature and humidity readings
TSL2591 for detecting light level
VL53L0X for distance sensing and obstacle avoidance
Added a PowerBoost 1000C to provide 5V for the motors
Added a stack of Feather form factor boards
AdaLogger FeatherWing (RTC and SD card)
DC Motor + Stepper FeatherWing for motor control
0.54" Quad Alphanumeric Display FeatherWing
TCA9548A I2C Multiplexer
Two 2200mAH Lithium Ion batteries for power

The TCA9548A is needed because the TSL2591 and VL53L0X have the same I2C address, which can not be changed. As you will see in the pictures, I still have to do some cable management for the switches. I still have to do some cable management. I also need a special cable to go from the PowerBoost to the connection block for power to the motors. I do not have the gauge of wire I want to use to make this cable and am not happy with the small wires that are used in most USB cables.

LRR can and does log all sensor readings to the SD card at a configurable interval. There are other tasks that run at a specific interval, such as display, and heater for the SHT31-D. The software can also be easily configured to run with various combinations of sensors and displays. I am adding more sensors as I can get my hands on them.

A future upgrade will add wireless capability in the form of an
RFM69HCW 900MHz Radio FeatherWing and/or an AirLift ESP32 WiFi Co-Processor FeatherWing. I would like to add both!

That is all I have for now, but there will be more to come!

20200302_233835

20200302_233751

20200302_233814

20200302_233849

20200302_233959

20200302_233900

20200302_233941

20200302_234335

My Mesh Network: Starting Out

My goal is to create a small mesh network that consists of a Raspberry Pi 3 with an Adafruit RFM69HCW breakout board or an RFM96 Radio Bonnet and two or more Adafruit Feather M0 RFM69HCW #Arduino compatible boards. This will be important to future projects I want to do in home automation and robotics.

I want to use this network for communication between sensor packages and an MQTT gateway, as well as between a Linux computer and my robots. The RFM69 boards are much less expensive than similar boards that have WiFi, and they have much better range. My RFM69 boards all use the 900 MHz ISM band. The Raspberry Pi 3, which has both WiFi and Bluetooth, will act as a gateway for inexpensive sensor modules, as well as my robots.

My first step is to verify that the two RFM69HCW breakout boards work properly. I can do this by connecting each one to a Feather M0 board that is programmed using the Arduino IDE and using this to communicate with a Feather M0 RFM69 board. I already have my two Feather M0 RFM69 boards communicating with each other using Adafruit's fork of the RadioHead library, and should be able to use the same code with the breakout boards.

I am now working on the code that will send temperature and humidity readings from one Feather M0 RFM69 board to another identical board. This will allow me to write and test the communication code that will eventually have to run on the Raspberry Pi. Once this code is completed, I will be able to start working on the Raspberry Pi side of things and port that code to #CircuitPython.

Porting code over to the Raspberry Pi will be a major undertaking, because the code I need does not currently exist for it. I will have to either extend the current Adafruit CircuitPython RFM69 library to be fully compatible with the Arduino Radiohead library, or write my own libraries for everything from scratch. At this point, I do not know which path will require the most work, but I would really like my code to be fully compatible with the Radiohead library.

Portable Temperature and Humidity Logger

I built a small portable temperature and humidity sensor using an Adafruit Feather M0 Express, a FeatherWing 128x32 OLED. an SHT31-D Temperature & Humidity Sensor Breakout, a JST 2-pin Extension Cable with On/Off Switch, and a Lithium Ion Polymer Battery - 3.7v 500mAh. I am going to add a FeatherWing - RTC + SD Add-on, so the sensor can time stamp and log temperature readings. I also see the possibility of adding an Ultimate GPS FeatherWing so the location of the reading can also be logged.[

I want to eventually build this into a small case to make it easier to take with me. The OLED FeatherWing also has three buttons that can be used to control various functions. I would use Button A to show the current reading on the display so the display is only on when it is needed. This would save on battery usage.

I have this running all the time in my room so I can always know how hot and humid it is here. 20180819_123401.jpg 20180819_122237.jpg

Little Red Rover Upgrades

Here is my test setup for the new electronics that will eventually run my Little Red Rover. The battery on the left powers all the electronics, including the Feather M0 Express (the MCU) and DC Motor Controller FeatherWing stacked at the top of the large breadboard. The battery on the right goes through a PowerBoost 1000C to provide 5V for the motors. The left and right VL53L0X distance sensors are on the small breadboard, connected to a TCA9548A I2C Multiplexer which is connected to the MCU using I2C. There is also an SHT31-D Temperature and Humidity sensor next to the MCU on the large breadboard. Both batteries are 3.7V @ 2500mAH Lithium Polymer packs.

20180311_173447.jpg

Unfortunately, I can not load all the libraries I need all at once on the MCU because it only has 32Kb of RAM. I will have to wait until I can get a Feather HUZZAH ESP32, which has 520Kb of RAM so I can load everything I need. There are currently five different libraries I need for my Little Red Rover, and may be another one if I decide to put a pan/tilt on the front with a camera. That will require an 8-Channel PWM or Servo FeatherWing and associated library.
Little_Red_Rover.jpg
I have modified the DC Motor Controller library so it plays nice with other libraries and will use a shared I2C bus. With enough RAM and a different MCU, I should be able to use whatever libraries I need for my rover,

Getting Up and Running with Elixir and Phoenix

There is a little work to be done to get up and running with the latest versions of Elixir and Phoenix on a Raspberry Pi 2 or 3, but it is not too bad if done right. I had to do a bit of information collecting from a few different sources to make it happen, and have collected the procedure I used here. This procedure assumes you are running either Raspian or Ubuntu 16.04. In my case, I am running Ubuntu MATE 16.04, so that is what this post will assume.

You can download Ubuntu MATE 16.04 for the Raspberry Pi 2 and 3 here

Add the repository for elixir and erlang.

sudo echo "deb http://packages.erlang-solutions.com/debian jessie contrib" | sudo tee /etc/apt/sources.list.d/erlang-solutions.list

sudo wget http://packages.erlang-solutions.com/debian/erlang_solutions.asc

sudoapt-key add erlang_solutions.asc`

Update the repository information.

sudo apt-get update

Install Elixir, inotify, PostGreSQL, and some other prerequisites.

sudo apt-get install elixir erlang-dev erlang-parsetools inotify-tools postgresql

Now, you have the latest and greatest versions of Elixir and Erlang installed! You will also need a few other things to make this all work.

inotify enables Elixir’s live load feature, so any changes you make to Phoenix code for the web will take effect immediately.

erlang-dev and erlang-parsetools are required.

PostGreSQL is the database Phoenix uses by default, and it is better than MySQL.

If you have not set a password for root, you will need to do that now.

sudo passwd root
<enter a good password>

su -
<enter your root password>

su – postgres
psql

ALTER USER postgres with encrypted password 'postgres';

\q
exit

This will set a password for the ‘postgres’ use in the PostGreSQL database software. This is the default password used my the Phoenix database package, ecto. If you want to set a different password for the database ‘postgres’ account, change the password you use in the ALTER USER command above and in your <project name>/config/dev.exs file.

Now, it is time to install Phoenix! Login to the account you will be running Phoenix from – this should NOT be the root (superuser) account!

mix archive.install https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez

Now, you have everything you need to get up and running with Elixir and Phoenix in the least amount of time!

You can create a new project my doing mix phoenix.new <project name>

Little Red Rover Upgrades

I am finally getting ready to upgrade my Little Red Rover

LRR-Final.jpg

The first upgrade will be to remove the front caster and add two front motors/wheels. This will stabilize the rover and allow me to add more weight to the front.

Following that, I will test communication between a Raspberry Pi 3 and an Adafruit Feather M0 RFM69HCW Packet Radio - 868 or 915 MHz set for 915 MHz. Communication will be via the ROS (Robot Operating System) serial protocol. The Feather M0 board will be programmed to accept and send specific ROS messages. I will have two HC-SR04 Ultrasonic distance sensors connected via a level shifter to convert the 3.3V signals of the Feather M0 board to/from the 5V signals of the sensors.

I will also have a DC Motor + Stepper FeatherWing to control the four motors, and an 8-Channel PWM or Servo FeatherWing to control up to eight servos stacked on top of the Feather M0 board. Both of these FeatherWings are controlled using I2C. It would also be possible to control these FeatherWings directly from the Raspberry Pi 3, or to add the Raspberry Pi HATs directly to it. However, I have chosen to use the Feather M0 board because many sensors are just easier to deal with using an Arduino, and there are many more libraries available.

The really interesting part of all this will be accessing the RFM69HCW transceiver radio on the Feather M0 board from the Raspberry Pi 3 board. This radio will allow creating multi-point packet networks with full encryption. I will also be testing smart sensors using this Feather M0 board, which would theoretically allow my Little Red Rover to communicate with any of these over distances of up to 500 meters (about 1640 feet).

This is my current plan, assuming for now that everything works the way I need it to work.