-
Adding breadboard modules
12/13/2020 at 23:06 • 0 comments2020-12-13
I had several non-pi boards on a bread board. Connected them to the Pi with coloured wires.
- 3V3 Brown
- 5V Red
- SDA Orange
- 5V Yellow
- SCL Green
- GND Blue
Opening a console to run from the command line,
i2cdetect -y 1
detected devices at hex addresses 20 (MCP23017 sixteen-bit PIO), 48 ( ADS1115 ADC), 57 (DS3232 Real-Time Clock) and 68 (MPU6050 accelerometer/gyro).
2020-12-14
Example Python code from https://www.abelectronics.co.uk/kb/article/1094/i2c-part-4---programming-i-c-with-python now talking to the MCP23017 i/o board, blinking a light and reading inputs.
DS3231 real-time clock now successfully integrated into the OS.
-
Adding an LCD
12/13/2020 at 19:31 • 0 comments2020-12-12
Bought this from The Pi Shop for £46. Includes a touch-screen digitiser.
Installed the software, rebooted, and it got stuck at the square splash screen.
The LCD backlight is on, so it is getting power on the right pins.Recovered by editing the config.txt file display-control entries after the [all] line.
This doesn't solve the installation problem, but I will leave that for later. -
Adding an e-ink display
12/13/2020 at 19:25 • 0 comments2020-12-12
Bought this from the Pi Shop for £25.
https://thepihut.com/products/inky-phat
This might be useful in battery-powered equipment, to show data like when a battery was last fitted, and how much estimated battery life is left. This will remain on the screen even after a battery has died. There are situations where a dead battery can result in a dead user!
The box has a link to http://pimoroni.com/inkyphat, which links to installation instructions at https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-inky-phat
The software can be installed by the command line
curl https://get.pimoroni.com/inkyphat | bash
This collects the script from the web url and pipes it to the bash command.
It is a very long script, and several times reported:
"Some packages could not be installed, review the output for details!"I ran the demos anyway, seemed to work fine.
Total installation time very short, mostly installation script working.
Key points:
- The display is almost as big as the PCB, so take care how you push it onto the header.
- The demo font is awful, this is not a bug
-
Adding a camera
12/13/2020 at 17:18 • 0 comments2020-12-12
Bought this from the Pi Shop in town, for £25.
This might be useful for remotely monitoring events, either in real time.
It is rated 1080 lines at 30 fps, and 720 at 60 fps, which should be plenty.The PiCamera box has a link to https://www.okdo.com/gettingstarted/, which links to the product page at https://www.okdo.com/p/official-raspberry-pi-camera-v2-1/, which links to how to use it https://www.raspberrypi.org/documentation/usage/camera/.
Key points:
- It is notoriously static-sensitive, so precautions are essential.
- Plug it in the right socket - next to the Ethernet socket.
- Pug it in the right way round - contacts toward the HDMI socket.
Instructions advise updating and upgrading the software first, using the command line:
sudo apt-get update && sudo apt-get upgrade
This took about 22 minutes.
After that, I rebooted and was able to run the commands to demonstrate it was working.
Total installation time is a few minutes, discounting the software update. I made the mistake of plugging it into the LCD port. Thankfully this hasn't damaged the camera.
-
Initial steps
11/03/2020 at 01:52 • 0 comments2020-10-27 Ordered modules to play with:
- AZDelivery ADS1115 ADC Analog to Digital Converter 16bit 4-Channel Module (pack of 3)
- AZDelivery I2C 0.96-inch OLED Display SSD1306 128x64 Pixels IIC 3.3V 5V White Character Display
- AZDelivery MCP23017 16-bit Bidirectional I/O Port Expander I2C Serial Interface Module 2.7V - 5.5V (pack of 5)
- AZDelivery GY-521 MPU-6050 3 Axis Gyroscope and Accelerometer 6DOF Sensor Module 16 Bit ADC I2C(pack of 3)
- AZDelivery TXS0108E Logic Level Converter 8 Channel SPI 8 Way 3.3V 5V I2C IIC 8-Bit Bi-Directional Converter Module
- XLX MINI MCP4725 Module I2C DAC Breakout Development Board 2.7V to 5.5V Supply with EEPROM (pack of 5)
That should be enough to get on with. The level shifter is for interfacing to 5V devices.
2020-10-27 Setting up R-Pi with fresh installation of Raspbian on Micro-SD card.
Had some issues with this. Installed Raspbian and Kodi from the NOOBS card. After updating itself, Raspbian fails to boot, producing repetitive 4-flash sequence on green LED, indicating it cannot find the loader program. I used the Windows Raspbian disk-image creator, which produced an SD card that booted reliably.
Second issue is that my display (Dell) goes blank every few seconds. Google results suggest this is due to inadequate earthing of the monitor. It looks fine to me. Other results suggest changing the HDMI drive boost settings of the Pi.
I guessed that the USB PSU could not supply enough current, and thus the Pi failed while re-writing the card. I have replaced it with a bigger PSU. Swapped displays - my LG 2753EV does not blank.
2020-11-02 Set Locale Country and Keyboard to GB.
In Settings-->Configuration-->Interfaces tab, enable I2C and SPI.Run Thonny IDE interface for Python. Ran the example program LED.py and this seemed to work.
Opening a console to run from the command line,
i2cdetect -y 1
returns a scan of devices like so:
0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --
All seems ready to proceed. I2C devices cannot be plugged in while the Pi is running, so they must be connected to a bit of breadboard and connected first.
Looked around for existing software for the devices I bought. No point reinventing wheels! The manufacturers provide documentation and sometimes Pi Python code examples.
2020-11-03
Quick check of expected addresses, in case of conflicts. None apparent.
Addresses from https://learn.adafruit.com/i2c-addresses/the-list010 0xxx = 2x = MCP23017 011 110x = 3C = SSD1306 100 10xx = 48 = ADS1115 110 0xxx = 60 = MCP4725 110 100x = 68 = MPU6050
2020-11-12
Googled for further information, there is plenty at Adafruit:
https://learn.adafruit.com/search?q=MCP23017
https://learn.adafruit.com/search?q=ADS1x15
https://learn.adafruit.com/search?q=SSD1306
https://learn.adafruit.com/search?q=MCP4725
https://learn.adafruit.com/search?q=MPU-6050At this point there is not much I can add to this project that is not already on the web.