146 A&C: Components for PiR2D (146)
This is a Work-In-Progress
Introduction
A new board, the WeatherHat Pro (shown above on the left), has been designed by BC-Robotics (Source 18). It is their SKU: RAS-186 at a cost of CAD$39.95 (fully assembled). It was originally designed to meet the needs of a domestic weather station. The WeatherHat Pro incorporates many features (listed below) needed by the PiR2D (Source 02) which is an upgrade of the PiR2A. Above right is the WeatherHat, which is the precursor to the WeatherHat Pro. Their components and pinouts are almost identical. Either is mounted on a recent Raspberry Pi. Either also accepts many devices that do NOT make use of the I2C bus. Note the black "1-wire" cable of the DS18B20 temperature sensor. The GPIO pins that are physically # 1 and # 2 are on the top left corner of the the board's 40 GPIO pins. (Physical pin # 2 is closest to the corner.) The PiR2D can make use of another I2C device, the MCP23017, which connects to 8 more Digital Input lines and 8 more Digital Output Lines. This device would free up 5 of the GPIO pins that were used for Digital Input and Digital Output on the PiR2A. It permits the PiR2D to use additional Digital Input/Output lines without using any of the GPIO pins. Use of the MCP23017 pins adds a little more software complexity.
Other existing components are being considered for inclusion in the PiR2D. They are described in Source 01. Source 01 also describes a Raspberry-Pi "breadboard HAT" (the 3.14-2 by TwinIndustries) on which a Pi camera (and other components) can easily be mounted. These two HATs greatly facilitate the building of the PiR2D.
As a quick review, the PiR2D provides greatly increased functionality but with less circuitry and less encumberance of the GPIO pins. This is because the PiR2D can make use of the following prebuilt boards:
- the WeatherHat Pro (which accepts the few sensors and actuators on the PiB2A plus two I2C Grove connectors.)
- the 3.14-2 unpopulated breadboard which permits mounting of devices such as a Raspberry Pi camera, display and a single 8 pin small IC chip.
- the small Pi-Zero sized Adafruit 4132 Bonnet which provides 16 additional DIO pins, Arduino-like devices, I2C but no ADC converter. For some reason, pin GPIO26 is conspicuously not brought out.
- the INA219 which reports the USB voltage and current via the I2C
- the MCP23017 which uses the I2C to provide 16 more Digital IO (8 bits in and 8 bits out)
The PiR2D makes extensive use of devices on the I2C bus which reduces its internal circuity and reduces the software needed to access the sensors and control the actuators. Furthermore, WaveShare provides SKU 15391 incorporating the MCP23017 on a board complete with connectors/pins for US $3.99.
Features of the WeatherHat Pro
-
- 4 channel AS1015 (0-3v3) A-D Converter (which uses 1 analog input) (See Source 19)
3 extra analog inputs
eg thermistor, soil moisture sensor or CDS photo cell -
- DS18B20 Temperature Sensor (via 1-wire)
-
- spot for a servo motor plugin
-
- 3 RJ11 connectors for the (optional) Weather Sensors.
labeled: Wind, Rain, Analog. -
- pins for a 5v0 external fan
-
- pins for an UART
-
- pins to be fed by an external regulated 5V0 power supply
-
- 40 pin GPIO for Raspberry-Pi connection
compatible with all recent Raspberry-Pi models -
- onboard BME280 Temp/Press/Humidity sensor (pre-mounted only on the WeatherHat Pro)
-
- I2C broken out
GPIO Pins vs Board Pin Names
GPIO # Device PiR2D3 Signal
------ ------ ------ ------
GPIO14 UART na Tx
GPIO15 UART na Rx
GPIO10 SPI Y MOSI
GPIO09 SPI Y MISO
GPIO11 SPI Y SCLK
GPIO08 SPI Y SP10
GPIO07 SPI Y SP11
GPIO02 I2C1 Y SDA
GPIO03 I2C1 Y SCL
GPIO04 1-Wire na DAT (Note 1 immediately below)
GPIO18 Servo na Sig
GPIO23 Rain na RJ11 pin 3
GPIO17 Wind na RJ11 pin 3
Note 1: For sensing the DS18B20, this has a 4.7k pull up attached to 3.3V. Designated "R7".
Signals on the 3 RJ11 Connectors
Name GPIO/A# RJ11 pin
---- ------- --------
Rain GPIO23 3
Rain Gnd 4
Wind A0 2
Wind GPIO17 3
Wind Gnd 4
Wind Gnd 5
Analog Gnd 1
Analog A1 2
Analog Gnd 3
Analog A2 4
Analog Gnd 5
Analog A3 6
The RJ11 pins are numbered 1 to 6 Left to Right as viewed from the front of the top of the RJ11.
The 4 analog input lines (A0, A1, A2, A3) are read on port 48 of I2C bus 1.
The PiR2D3 Area Controller
In the photo above, we see the PiR2D3 mounted on the WeatherHat Pro which is connected to a Raspberry Pi Model 4 using a 90 degree GPIO connector. (Without the 90 degree GPIO connector, the WeatherHat Pro is very close to the Pi Model 4 and both boards run very hot.) The three "traffic light" LEDS of the PiR2D3 are very visible at the center right. The yellow "remote Heat" wire can be seen at the top right. The three empty RJ11 connectors of the WeatherHat Pro are visible although they appear very dark. Refer to the photo named "PiR2D3 fully wired" a little farther down in this article for a better view of it.
As of 2020 H Aug 18, Source 5 provides the most detailed description of the functionality of the PiR2D Controller. It provides a very recent list of the sensors and actuators that are planned to be included in this next version of the PiR2A controller. Version PiR2C of the PiR2A Controller (Source 6) included the IN3231 which is a triple current measuring device that measures the voltage and the current used by 3 circuits. Recently the new WeatherHat PRO was discovered to have 4 Analog-to-Digital converters and much more functionality. So work on the PiR2C has been discontinued in favor of the PiR2D (Source 8) which might be composed of 2 different Raspberry Pi HATs. One is a powerful breadboard, SKU 3.14-2, shown below (Sources 3 and 4). The 3.14-2 allows some circuitry to be added to the board along with a Raspberry Pi Camera. This 3.14-2 camera HAT board (described in Source 03) might be augmented by the WeatherHat Pro to produce a powerful PiR2D controller for the Raspberry Pi computer. [Update: the announcement of the Raspberry Pi-400 has changed the direction of the PiR2. It is not possible to add the Raspberry Pi camera to the Pi-400. This prompts the author to include a Linux camera to the PiR2 instead. This makes the 3.14-2 less attractive and the WeatherHat Pro more desirable.] Via a GROVE I2C connector, an INA219 will be used to measure the current (and voltage) that will charge a tablet (or iPhone) via a USB connector. Another I2C cable will be used to monitor the temperature of a fridge or freezer.
The PiR2D3 for the WeatherHat Pro
The most recent PiR2D3 wiring is shown (apologies for the "text" drawing) below. The idea is to create a board with 1 row of pins pointing downward to be plugged into a row of female pins on the WeatherHat Pro.
WeatherHat Pro wiring to create PiR2D3
5V0
DigIn-|-PB(NO)-3V3 3V3
DigOut---1K0--| |
| |----1K0-------- MOSI (10
| |----1K0---------GND
|
HEAT(remote)-|----------------------------MISO (09)
|
100R(remote)
|
|---------|
|
3v3 |
| |
(No "Button") |-CDS0----| |-260R---<RedLED--------------SCLK (11)
| | |
| | |-260R---<YelLED--------------SP10 (08)
(Yes "Button") |-CDS1--| | |-260R---<GrnLED--------------SP11 (07)
| | |
| | |---------------------------- GND
( GrnLED was | | I GND
formerly WhtLED) | | 2
| | C
| |-----------------------------|
| |
| GND---10kR-|-A1
|
| nc A2
|
|-------------------------------|
|
From PiR2DrawK12.odg |
For ePC Article 146 GND---10kR-|-A3
By D@CC
Date 2021AJan30
/WeatherHat_Pro_PiR2D3B.txt
Note that the wiring diagram (shown above left) is not meant to be mounted on a Raspberry Pi directly. Therefore the GPIO Names and signals implied by the pair of 2x20 of pins on the Proto Board (the wired PiR2D3 shown above right) are not true. Instead, one should refer to the signal names on the above diagram (shown above left) which match the signal names and pinouts on the WeatherHat Pro (which the PiR2D3 was designed to be connected to). The names of the 5 actual GPIO pins used by software appear along the right of the wiring diagram (shown above left).
To make the PiR2D3, the wiring diagram (shown above) will be applied to the BC Robotics Proto Board (shown below). Note the "traffic light" 3-LED array. The RedLED means "Stop" and the GreenLED means "Go". The YellowLED also means "Heat" is being applied to the ambTemp thermometer. The light-sensor to the left of the RedLED can be covered by a finger to mean a "No" response. Likewise, the light-sensor to the left of the GreenLED can be covered by a finger to mean a "Yes" response. It is intended that the "PushButton" will eventually be replaced by touching both light-sensors simultaneously instead. In the future, during "Start-Up" of the PiR2D3, the "traffic light" LEDs can indicate the initialization process by blinking the 3 LEDs first blinking Red, then blinking Yellow, then finally blinking the Green LED on each time a main log record is written, to show that the PiR2D3 is operating. In the future, the PiR2D3 can continually blink the Yellow LED whenever it is requesting a Yes/No response.
The 100 ohm "Heat" resistor is now located external to the board. The intention is that a wire will be connected to the "Heat" resistor which will be positioned very close to the external ambTemp sensor (for example being wired to the TMP102 sensor). The return path from the "Heat" resistor can use the "Gnd" terminal on the TMP102. The Yellow LED can still be lit when heat is being applied to the "Heat" resistor. The intention is for the YelLED to be controlled by the SP10 line making it's "Heat" meaning dependant upon the PiR2 software. Therefore in the future the Yellow LED can have a meaning independant of (but also including) "Heat".
The communication between the PiR2D3 and the WeatherHat Pro is via a single row of 12 female connectors which are soldered to the "connector" pins labelled SPI and ANALOG on top of the WeatherHat Pro. One pin must be removed where there is no pin-hole between the two "connectors". Note that the 5v is not communicated to the PiR2D3 board. The PiR2D3 has a single row of 12 male connectors which are soldered to the bottom of it. The last pin that communicates with the PiR2D3 is A3. It should be noted that the A1, A2 and A3 signals are also available on the RJ11 connector labelled ANALOG. The only GPIO pins controlled directly by the PiR2D3 software are GPIO07 through GPIO11. A TMP102 remote temperature sensor has not yet been attached to the WeatherHat Pro via a Grove connector. A 100 ohm "Heat" resistor can be optionally used to simulate a "heater" if it is very close to the TMP102 IC. This "heater" demonstrates that the PiR2D3 can function as a closed loop control system to simulate a thermostat. When the PiR2D3 functions with the WeatherHat Pro, no cables are plugged into the 3 RJ11 connectors on the WeatherHat Pro. Of course, the ambient temperature, humidity and barometric pressure are read from the WeatherHat Pro. The Analog sensors, the temperature, humidity, pressure sensors and the TMP102 remote temperature sensor all make use of the SDA and SCL lines on I2C bus 1.
PiR2D3 Python Test Program
The Python program used to test the PiR2D3 can be seen in Source 20. The program blinks the RedLED twice, then blinks the YelLED once and the GrnLED once. Then it continuously loops to:
-read ambLight0
-read ambLight1
-read ambTemp
-read ambHum
-read ambPress
-read PushButton
if depressed
-turn RedLED on
-turn Heat on
else
-turn RedLED off
-turn Heat Off
#end of loop
Output of the Test Program
with fluorescent lighting, the Test program will continuously display
valA0= 20256
valA1= 19904
valA3= 21048
valV0: 3.28199999 v
valV1: 2.488 v
valV3: 2.489428 v
ambLight0= 387.669 lux
ambLight1= 388.617 lux
case Temp: 24.364 C at Wed Jan 27 17:48:36 2021
Humidity: 20.02665 %
Pressure: 101.20003 kPa
Wind Dir: Not Connected ( 999 )
Examine the PushButton
Turn off the RedLED and Heat
.
By touching (covering) a photocell with a finger, the ambLight0 will drop to 6.2 lux.
When the flourescent lights are turned off the ambLight0 will drop to 0.6 lux.
If the pushbutton is depressed, while it is depressed, the RedLED will turn on and stay on and
3.3v will be applied to the Heat signal line.
I discovered that the photocells and/or resistors are not matched, so I "adjusted" one of the
values read so that the lux measurements would become almost identical.
Reading A1, A2, A3 on the WeatherHat Pro
The CDS0 and CDS1 (CDS photocells as shown above) are sensors of ambLight each using a cheap CDS sensor. As the amount of light increases; the resistance of the sensor decreases and vice versa. Resistance is roughly 5K to 10K Ohms in the light and up to 200K Ohms in the dark. BC-Robotics says "To use the photocell you will need a single 10K ohm resistor. The resistor is connected between your analog pin and ground while the photocell is connected between the analog pin and your power. The photocell is symmetrical so there is no need to worry about hooking it up backwards!"
NOTE: the analog readings of A1, A2 and A3 from the WeatherHat Pro are surprising. A1 returns a value of 0 when reading 0.0v . A1 produces 26368 when reading 3.3v. A1 returns 4240 when left open. I questioned BC-Robotics who replied:
ADCs do not, by nature, output a voltage reading. They output a range of integers relative
to the voltage on the line and the bit depth of the ADC. Depending on how you use the onboard
gain, these numbers can shift, but at the end of the day they are just a range of numbers.
Whether it is 0 - 3.30000000000 or 0-4096 or 4240-26368 they still mean the same thing.
The difference is that the 0-3.3 (voltage) is a reduction of resolution, slower to execute,
and a larger memory footprint, takes extra calculations to generate, and is generally more
annoying to work with.
Typically, you would only use a decimal to display to the end user, so that is why we work
with the integer range and never reference the voltage in the code. If we needed to convert
it to something human readable, we would do that at the very end using a similar method as
you have shown [below].
The webmaster's work-around solution is as follows:
The Analog reading of A1 is erroneously 26368 when it should be 3v3. The Analog reading of A1 is correctly 0 when it should be 0v. So, in the User's Python code, the reading of A1 can be corrected as follows:
chan1 = AnalogIn(ads, ADS.P1)
valA1 = chan1.value
print("valA1=", valA1, " v", " Erroneous")
trueA1= 3.3 * valA1 / 26368 #Correction
print("trueA1=", trueA1, " v") #Correction
# which prints the following when 3v3 is applied to A1
# valA1=26368 v Erroneous
# trueA1=3.3 v
lux from CDS voltage
I [the WebMaster] have an iPhone app that measures the amount of light in lux. I connected 3v3 to a CDS to a 10k resistor to ground. I used an ADC converter (ti ADS1015 on the WeatherHat Pro) to measure the voltage, A1, between the CDS and the 10k resistor. I discovered that the following formula can be used to calculate the number of lux present on a surface:
surface light (lux) = 10**(A1) where A1 is measured in volts.
For example: if A1 is 2.5v then the surface light is 10**(2.5) which is 275 lux.
The Python code to do this is:
print("ambLight=", 10**(trueA1), "lux")
Clearly this is only an approximation. The surface light on a CDS can also be read as a binary value (digLight). For more information about ambLight and digLight, see PiR2Null (Source 19).
BC-Robotics Pi Proto Board
The PiR2D2 can be mounted on the above proto board and mounted on the WeatherHat Pro.
Twin Industries 3.14-2 (R-Pi Prototyping Board)
(To enlarge .....Click it)
3.14-2
Features of the 3.14-2
- Protoboards for use with Raspberry Pi Model 4, Model 3, Model B, Model B, Model A+, and Model B+
-
All 40 header signals clearly labeled for easy access to power, ground, and GP I/O signals
-
Gold-plated-through holes.
-
Power and ground signals connected
-
Locations for capacitors
-
Mounting holes to attach headers, standoffs, and camera unit
-
Footprints for SMT or through hole EEPROMs (for future HAT development)
-
Board dimensions = 113mm x 69mm
The 40 GPIO pins on the Raspberry Pi Models 3 and 4
As of 2020, more and more powerful small electronic devices (sensors and actuators) are being invented that make use of the I2C bus. These new devices can easily be used on the Rasperry Pi. But there is a limited number of ID codes (only 112/buss) for these I2C devices. To date, each I2C device has a very small range (e.g. 3) of alternate ID codes. The result is that the 2 I2C busses on the Raspberry Pi can only accept a total of 8 of each device. To date, this has not been a problem. In the future, additional I2C busses will probably be desirable on the Raspberry Pi. Fortunately, more I2C busses can be created in the Raspberry Pi, through Bios reconfigurations. This is because the many subprocessors on the Raspberry Pi can make use of software reconfigurations of their BIOS software. Some of these alternate configurations are shown in the above image on the right. Source 9 provides more information about additional future I2C bus locations on the GPIO pins.
The INA219 to measure the Voltage / Current sent to a USB
One of the features of the PiR2 area controller is to be aware of the status of a USB charging port for an iPad, iPhone, tablet etc. The INA219 is designed to do this job. The folks at SwitchDoc Labs have equipped it with an I2C Grove adapter to provide a measurement of the supply voltage and current in digital format.
(To enlarge .....Click it)
/a/139/INA219_1_360x.jpg
MCP23017
Many suppliers offer the MCP23017 mounted on a board as seen below. It is not widely known that each of the 16 data pins can be defined to be either digital input or digital output. So the MCP23017 can provide 16 Digital Inputs or 16 Digital Outputs or any combination of them.
Mouser SKU: MCP23017-ESP CAD $ 1.90 IC
Waveshare SKU: 15391 MCP23017 US $ 3.99 Board
store.ncd.io SKU: PR2-9 MCP23017 US $54.95 w Screw Terminals
ICStation SKU: 13017 MCP23017 I2C US $ 4.35 wo Screw Terminals (photo:bottom-right)
Mouser SKU: Prj:25df06786a MCP23017 I2C CAD $33.78 w/o board
Mouser SKU: 485-4132 MCP23017 (Adafruit) I2C CAD $14.93 w cable connector (shown below)
Mouser SKU: 651-1725737 10 screw term.strip CAD $11.85 w Screw Terminals
Recommendation: 1 x 13017 CAD $ 6.00 + 2 x 651-1725737 ($CAD $11.85) = CAD $ 30.00
Note that the Adafruit 4132 from Mouser is the only board that provides a Ground Pin to pair up with each of the 16 data pins. In some cases this may greatly facilitate the job of running a pair of wires to each sensor or actuator. Circuitry is plainly visible to optionally use a 5V or 3v3 voltage source. The Adafruit MCP23017 board is the only board that includes 40 pins to connect to the Raspberry Pi GPIO pins. This configuration is normally called a HAT but Adafruit calls it a "Bonnet". This probably means that the 4132 can be used to provide the 16 DIO points either remote from the Pi or local to the Pi. When provided local to the Pi, no other board is needed between the MCP23017 and the Pi. An effort has been made to also "break out" the most useful (Notes 1 & 2 below) of the 40 GPIO pins onto plated-through holes on the 4132 board. Further inspection may show that the PiR2A can be built by soldering some LEDs directly to the 4132 !! This bears further investigation !! For this reason, the 4132 may become a very interesting board indeed !! Especially when used with the Wio Terminal with its Grove connectors. The 2 images below show the front and back views of the 4132. The GPIO pin lists shown below account for all the GPIO pins except GPIO 26. (I carefully examined the physical IC top layer on the wiring diagram and the schematic. This is a design/manufacturing error. (This error has been confirmed.) I don't believe that GP26 was reserved for special usage on the Adafruit GPIO Expander board !
Note 1: Most Useful GPIOxx Pins: Tx,Rx,4,17,18,27,22,23,24,25,MOS,MIS,CLK,CE0,CE1,5,6,12,13,16,19,20,21,5V,3v3,GND,SDA,SCL
Note 2: Sorted Letters , Digits: CE0,CE1,CLK,GND,MIS,MOS,Rx,SCL,SDA,Tx,3v3,4,5,5v,6,12,13,16,17,18,19,20,21,22,23,24,25,27
Note 3: GPIO pin 8 7 11 9 10 15 3 2 14
Note 4: missing 26
Note 5: GPIO02 is in the top left corner of the board (when viewed from the front).
The photo on the right (above) shows the back side of the Adafruit 4132 Bonnet. Note that the back side can accomodate 2 I2C female Grove connectors in addition to the 40 GPIO pins of the Raspberry Pi. This photo also shows the 2 connectors that can be used to connect the 16 additional DIO lines of the Adafruit 4132 Bonnet.
The article in Source 10 shows how to add 8 Digital In and 8 Digital Out ports to the Raspberry Pi using the MCP23017 IC (shown below left). It connects to the Raspberry Pi using the I2C bus, therefore NO GPIO pins are necessary for each Digital In and each Digital Out line. Its device ID has 8 alternates which are more than enough. The Raspberry Pi article (in Source 10) provides a full description of its usage including matching ultra-simple Python code. This article shows how to control 3 LEDS and how to read a PushButton as seen in the photo on the right below. The PiR2D only requires 1 DI and 4 DO lines (in addition to the A1 and A2 analog inputs leading to another board), so there is plenty of room for expansion. The 4132 makes use of the MCP23017 chip. If the MCP23017 were socketed, it could easily be replaced if an over-voltage input burnt it out. :(
Testing The MCP23017
Source 11 is a Data Sheet for the MCP23017. A functional block diagram of the MCP23017 itself appears below.
Remote Digital I/O using an MCP23017
Waveshare offers an MCP23017 with an I2C connector and 16 pins of Digital IO. Their SKU is 15391 (shown above) costing only US $3.99 for a remarkably inexpensive device that delivers 16 Digital IO (plus VCC and GND) pins to a remote location via a 4 conductor I2C cable. The 20 pins should be wired to ("screw?") terminals of some type at the remote location. When I figure out how to attach remote wires to the pins, it will become my favorite way to wire up the PiR2 in the field. One end of the 15391 has a PH2.0 I2C connector (that includes the 2 unused interupt signals), but the 4 non-interrupt I2C wires can be soldered to the other end of the board. The I2C wires on the other end of the I2C cable can be terminated in a Grove connector to mate with the PiR2 controller.
Many MCP23017 boards provide a IC socket for the MCP23017, permitting it to replaced at a cost of $1.99. The MCP23017 doesn't have an IC socket, but the replacement cost of the whole 15391 (if is destroyed by overvoltage) is only $3.99 . The ID code of the 15391 can be selected by solder jumpers on the board. Furthermore it has an on-board voltage translator that converts 5V to 3.3V. (NOTE The webmaster doesn't see any voltage translator on the schematic, perhaps it is internal to the MCP23017.) The 15391 comes with a manual (Source 12) providing examples for Raspberry Pi use etc. [Ed Note When translated into English, "weld" should have become "solder".]
Grove Pi Base Hat for Raspberry Pi Zero
Seeed Studio offers a small Base Hat, sku 103030276, at a price of $8.90 (shown above). It is currently "Out Of Stock", but this will change. They describe it as follows:
The Grove Base Hat for Raspberry Pi Zero provides Digital/Analog/I2C/PWM/UART ports. With the help of the build-in MCU, there is also a 12-bit 6 channel ADC. This ADC capability is the major deficiency of the Raspberry Pi compared to the Arduino computer. Of course, the I2C provided by the Raspberry Pi is a deficiency of the Arduino. Currently, more than 60 Groves will help you extend functionalities with Raspberry Pi.
They should also mention the following impressive features:
Detailed Features of the 103030276
- 8 grove male connectors
- 4 Digital IO bits: GPIO05, GPIO06, GPIO16, GPIO17 via Grove connectors
- 1 PWM
- 6 12 bit ADC (Analog to Digital Converters) to read analog signals
- 1 I2C bus (pronounced "I-squared-C")
- 1 UART
- 1 GPIO/SWD (See the SWD note below)
- 3 usable GPIO male pins are present: GPIO09, GPIO10, GPIO11 (3 more Digital IO bits)
- compatible with all Pi with 40 pin GPIO (including the Pi Model 4)
- built-in MCU
- male GPIO connector (permitting remote use via a 40 wire female/female ribbon cable)
- does not use the ATMEGA chip so it runs faster
- completely assembled (ready to use)
- mounts directly onto a Pi-Zero
- mounting screws included
- 3v3 logic is used although a source of 5v0 is available on board
(To enlarge .....Click it)
Grove Pi Base Hat for Raspberry Pi SWD
The SWD port (the equivalent port shown above is for the "Grove Base Hat for Raspberry Pi") is used to burn the firmware to this hat. It only uses GPIO09, GPIO10 and GPIO11 (from the RPi) during the initial burn. The respective pins of the MCU are not available to the user. But the 3 RPi GPIO pins are fully available. More information about this device is available at Source 14.
Grove Male Connector Pin-Outs
The pin-outs of the Male end of a Grove cable (viewed as its wires enter the connector) are shown below:
Normally, the I2C master has a female Grove connector (Note: It has male pins protuding within it). Components such as the TMP102 are I2C slaves that should also have a similar female connector (shown on the right above). The female D90 Grove connector (SKU 110990037 ) shown on the far right costs US$0.15 from Seeed when bought in quantities of 10. (The female connector with option D90 allows the cable to enter parallel to the board, not perpendicular to it. Normally Grove cables enter perpendiclar to the board. Connectors for plated-through holes have option DIP. Connectors for Surface-Mount boards have option SMT or SMD) Therefore the Grove cable used to connect a master-slave pair of I2C devices must have Male Grove connectors on each end. The longest male-male Grove cable is 40cm long (SKU:110990064 US$3.90 for a pack of 5). Some suppliers use a Qwiic connector which resembles but is not compatible with Grove connectors. Many I2C components can be connected on the same I2C bus by using a cable with multiple male Grove connectors (or by using a board with multiple female Grove connectors all wired in parallel). The latter is called a Grove - I2C Hub. A Grove - I2C Hub with 4 I2C female connectors costs US$2.90 from Seeed. An equivalent Grove - I2C Hub with 6 female connectors costs US$1.50.
As of 2021AJan 28, I plan to use Grove connectors for the PiR2 controllers. More information about the Grove components is available in Source 13. At Source 21, Seeed Studios (US) offers a full range of components equipped with Grove connectors. Seeed products can also be ordered from Mouser Electronics (Canada). Seeed Studios also provide software for its I2C components. Software is provided for both Arduino (preferred) and Raspberry computers.
Grove ADC converter
Source 22 describes the Grove-I2C_ADC, SKU 103020013 US$12.90 (shown above) which is an ADC converter that converts one analog voltage to an I2C signal. It has 2 male Grove connectors: J1 for the I2C bus and J2 for the analog sensor. The I2C address of the ADC converter can be defined on-board. Seeed uses the same Grove connector for non-I2C purposes, such as J2 above. So beware . . . . a 4-pin female Grove socket might NOT be I2C compatible.
Grove-UART-WiFi-V2
(To enlarge .....Click it)
15391.jpg
Seeed also offers (as shown above) a mini-wifi board with a Grove Connector (Source 15). The SKU is 113020011 and it costs US$13.90 . Some "first users" have had difficulties getting it to work, but eventually this will permit a single remote sensor to be polled via Wifi, say from a Raspberry Pi computer. This seems almost "state-of-the-art", but will certainly be interesting to watch.
Grove - 315MHz Simple RF Link Kit
(To enlarge .....Click it)
315mhzRF.jpg
Seeed also offers the Low-Cost RF board set (shown above) with a Grove Sensor Connector in the transmitter (Source 16). The SKU is 113020001 and it costs only US$6.90 .
This kit is used for one way wireless communication at a frequency of 315MHz and includes a transmitter module and a receiver module. The transmitter module requires a small battery and has a range of 40 meters indoors and 100 meters outdoors. It uses AMP (Amplitude Shift Keying) Modulation and the VirtualWire communications library (Source 17). Where can I find the answers to the following?
Questions
- What battery is needed?
- How long will the battery last?
- Give an example of a Grove sensor that it can use?
- What type of address (if any) is used to differentiate between sensors?
- How often can it interrogate the sensor?
- Can a Raspberry Pi control it (or just an Arduino)?
- What is the Receiver Interface in the computer?
- What is AMP Modulation?
- What is a valid URL for the missing documentation at:
http://www.summitek.com.tw/ST_SPEC/ST-RX04-ASK.pdf
Messages of up to VW_MAX_PAYLOAD (27) bytes can be sent.
Each message is transmitted as:
- 36 bit training preamble consisting of 0-1 bit pairs
- 12 bit start symbol 0xb38
- 1 byte of message length byte count (4 to 30), count includes byte count and FCS bytes
- n message bytes, maximum n is VW_MAX_PAYLOAD (27)
- 2 bytes FCS, sent low byte-hi byte
The documentation seems to be weak. But the product is very interesting.
Small 8 ohm 1 watt Speaker (SKU: AUD-012) $0.95
BC-Robotics offers a tiny 20mm (size of a dime) 8 ohm 1 watt audio speaker (shown below):
(To enlarge .....Click it)
audio speaker 8ohm 1watt
PiR2_Pico
In early 2021, the Raspberry Foundation announced a new micro-controller called the Pi Pico at the extreme low cost of US$4.00 . Much more information about the Pi Pico can be found in Source 23 which is Article 151 written by this webmaster. The Pi Pico has permitted the creation of a new alternative cheaper platform for the PiR2 controller: the PiR2_Pico. The absence of any Analog Input Port on the Raspberry is now being addressed by the Pi Pico. The reader is advised to review the initial design for a PiR2_Pico that appears in Article 151 (Source 23). A novice programmer/technician can easily build the PiR2_Pico because it only requires a small amount of soldering. The hardware needed to convert the Pi Pico into the PiR2_Pico is extremely minor (under CAD$4.00), including only:
- 3 resistors: 100 ohm, 330 ohm, 10K ohm
- 1 CDS photo cell
- 2 6-pin female connector strips
- 1 Red LED
Believe it or not, the following sensors and actuators will ALL be provided by the PiR2_Pico:
- ambTemp0
- ambLight (or adcIn2)
- ...pushButton1 (derived from ambLight)
- grnLED (on-board)
- redLED
- pushButton0 (on-board)
- digIn0
- digOut0
- 12 bit adcIn0 and adcIn1
- heatOut
- picoSN
Amazingly, the only port on the Raspberry Pi that will be needed to support the PiR2_Pico is a single low-speed USB port sharing one of the Raspberry Pi's USB ports. Note that the ambLight CDS can also serve as a second pushButton, if touched momentarily by a finger. The current design of the PiR2_Pico permits multiple PiR2_Pico controllers to be attached to a single Raspberry Pi. More than one PiR2_Pico can share the same USB port on the Raspberry Pi. Each of the additional PiR2_Pico controllers can support up to 8 Digital IO ports; up to 3 of the 8 Digital IO ports can be configured to read analogIn (e.g. adcIn0 etc) signals instead.
The very first version (the prototype) of the PiR2_Pico will only read one value: the analog voltage on A0 as adcIn0.
Web Sources
Web Source S146:01: PiR2C Components PDF article by D@CC on 2020 H Aug 11
Web Source S146:02: Pi: PiR2A Area Controller Prototype (139) article by D@CC on 2020 E May 03
Web Source S146:03: 3.14-2 TwinIndustries DataSheet article by TwinIndustries on 2020 E May 03
Web Source S146:04: 3.14-2 Product Info (Search for 3.14-2) article by TwinIndustries on 2020 E May 03
Web Source S146:05: Pi: PiR2 CONTROLLER FUNCTIONALITY V8 PDF referenced in article 128 by D@CC on 2020 E May 03
Web Source S146:06: PiR2C Schematic by D@CC on 2020 E May 03
Web Source S146:07: Pi: Raspberry Pi Model 4B 8 GB Computer (140) Article by D@CC on 2020 E May 03
Web Source S146:08: PiR2D Wiring Notes article by D@CC on 2020 H Aug 17
Web Source S146:09: GPIO pins for multiple I2C busses (130) Article by D@CC on 2020 H Aug 18
Web Source S146:10: 8 DI 8 DO GPIO pins via an I2C bus Raspberry Article saved on 2020 H Aug 18
Web Source S146:11: Data Sheet for the MCP23017 PDF
Web Source S146:12: link to a PDF Data Sheet for the 15391 by WaveShare on 2018 I Sep 29
Web Source S146:13: Grove Components for PiR2D ver F by David KC Cole on 2021AJan 11
Web Source S146:14: Grove Base Hat for Pi Zero by Seeed on 2021B Feb 03
Web Source S146:15: Grove WiFi by Seeed on 2021B Feb 03
Web Source S146:16: Grove Cheap RF Link by Seeed on 2021B Feb 03
Web Source S146:17: VirtualWire Documentation by Mike McCauley of on 2021AJan 12
Web Source S146:18: BC-Robotics BC-Robotics 2021AJan 18
Web Source S146:19: ti ADS1015 DataSheet by Texas Instruments 2018AJan
Web Source S146:20: PiR2D3 Test Program by D@CC 2021AJan 27
Web Source S146:21: Grove Components by Seeed Studios (US) as of 2021AJan 28
Web Source S146:22: Grove I2C ADC by Seeed Studios (US) as of 2021AJan 28
Web Source S146:23: Pi: New Raspberry Pi Products c2021 (151) by David Cole as of 2021BFeb 02
Web Source S146:24: Pi: PiR2Null Area Controller Article 153 by David KC Cole as of 2021BFeb 10
Web Source S146:25: Very small speaker by BC-Robotics as of 2021BFeb 13
Created: 2020 H Aug 12
Updated: 2024 F Jun 30
/146.html