jm_rpi-pico-v6
The Raspberry Pi Pico module is amazing. It is much faster than the Texas Instruments MSP430G2xxx family that I have been using for years, has much more memory, has two cores, a 12-bit ADC, and is available with onboard WiFi and Bluetooth. The module comes in a 40-pin wide-DIP.
I made my first board with the Pico in order to monitor the pump in my well. My well stopped working in the middle of December 2022 right after the first real snow. Because of the snow and where the well is the well company couldn’t get their truck up to the well head to fix it until the snow melted and the ground dried up. That didn’t happen until the middle of May so I went 5 months without having running water in the house. The galvanized steel pipe in the well had corroded (again) so this last time the well company used schedule 80 PVC instead of steel pipe. I don’t expect this problem to happen again but I don’t want to get caught by surprise again. That is why I made the pump monitor. I did a good job on it and have filed a patent application for it (a Provisional Application for a Patent). My pump monitor provides an early warning of many types of impending well failures and thereby reduces the constant anxiety that many well owners (like me) have that their well will stop working without warning. The EPA estimates that more than 23 million households rely on private wells for drinking water in the United States so I am probably not the only one with Well Anxiety. If I file a Non-Provisional Application and get a Patent I will post it.
In the meantime, the board I designed with the Pico has several other uses so I will post it along with software to use it.
The board has:
1. A Raspberry Pi Pico (or Pico W);
2. A 1602 LCD using its 4-bit parallel interface. I am using the standard 5V part. The inputs work with 3.3V signals but because the outputs will be 5V I only write to it.
3. A DS3231 Real Time Clock (RTC). It uses the I2C interface.
4. An NRF905 RF Module. The NRF905 is a programmable transceiver by Nordic Semiconductor which can operate in the 433 MHz, 868 MHz, and 915 MHz bands and sends and receives data packets of up to 32 bytes in length. It can go a farther distance and operate through more walls than the WiFi or Bluetooth signals of the Raspberry Pi Pico W. It uses the SPI interface and several other bits. You program the frequency and an address so you can use many different channels in the same frequency band.
5. A preamp using an MCP6002 in the DIP package. This series of opamps is also available as a single opamp (MCP6001) but as a surface mount device only. In the event of a damaging signal overload a DIP in a socket is easier to replace than a surface mount device. There is an input trimpot that can be either a 3362P (1-turn) or a 3296W (25-turn). The input can be configured with a header pin jumper to be either 0V to 3.3V DC or 3.3Vp-p AC.
6. A slide switch and three pushbuttons. I use the switch to select either the primary program or the program to set the DS3231 RTC with the three pushbuttons. The three pushbutton switches are available for the primary program as well.
7. Two LEDs controlled by the Pico.
8. There is a header that brings out a UART port. I use a CH340 serial-to-USB adapter to connect the UART to a PC running a terminal program. The header also has a pin connected to a Pico input. I use a pin jumper to ground it to select one of two NRF905 channels.
9. There is also a header to bring out the I2C bus to use for other I2C devices. I use it for a BME-280 which is a sensor for temperature, humidity, and atmospheric pressure. I2C devices are addressable through the I2C protocol so the BME-280 and DS3231 coexist on the same bus.
The board runs from nominally +9V. The range of 8V to 12V is acceptable. Cheap switching power supplies are notoriously noisy (electrically). I had one that put out an enormous amount of hash on the Mains that interfered with another project connected to the same Mains circuit. You might consider a linear power supply if you can still find one.
If you are not going to use the ADC you can leave the preamp parts unstuffed.
Software
I am posting the following software on my Web site at www.jmargolin.com/pico-projects/ . This article also contains other information such as how I got the Raspeberry Pico Pico SDK working in Windows 10. (It wasn’t easy.)
A. jm_pico-lcd-rtc
This uses the LCD, the ds3231 RTC, and the switches.
1. With SW1 closed it allows you to set the ds3231 time and date. (When SW1 is changed it is necessary to Reset the Pico with PB4.)
It starts with showing the time and date. Then you use the pushbuttons to set the time and date. PB3 advances to the next step in setting the time. PB1 increments the value. PB2 decrements the value.
2. With SW1 open it demonstrates the functions to write to the LCD with canned messages and with variables in different sizes and formats.
Hex: char (8-bits), int16, int32 All unsigned
Convert Hex to BCD: char (3 BCD), int16 (5 BCD), int32 (10 BCD), unsigned and signed.
3. There are also functions to send canned messages and variables out through the uart. You can time-stamp them using the ds3231 if you like.
B. jm_pico-adc-clock
This tests the Pico’s ADC. You can also use it to develop your own ADC code for your own projects.
1. With SW1 closed it allows you to set the ds3231 time and date. (When SW1 is changed it is necessary to Reset the Pico with PB4.)
It starts with showing the time and date. Then you use the pushbuttons to set the time and date. PB3 advances to the next step in setting the time. PB1 increments the value. PB2 decrements the value.
2. With SW1 open it runs the ADC test program.
Although the Pico ADC is rated as 12-bits, it is noisy. The noise comes from two sources:
a. The RP2040 is a mixed-signal device which means it has both analog and digital circuits on the same chip. That makes it difficult to keep digital crap out of the analog part. (The MSP430G2553 has the same problem.)
b. The RP2040 runs at 3.3V. The USB port provides nominally 5V. When you run it from your own circuitry it is easiest to also run it from a 5V source. That is why the Pico has a 3.3V voltage regulator. Unfortunately, the official Pico uses a switching regulator so it also contributes noise. There is a mode that supposedly reduces the switching noise a little at the expense of increasing the current consumption a little. But face it, the Pico is not really suitable for operating from a battery.
My software also sends the ADC values out through the uart.
The program starts by reading 256 values at a time. It reports the highest value, lowest value, difference, and average. It does this every 4 seconds. It can also do this using the average of 32 values, 16 values, 8 values, and 4 values. It can also do this reading 1 value every second. You select which test by cycling through them. PB1 increments the selection of the test, PB2 decrements the selection of the test. The results are shown on the LCD and out through the uart.
C. jm_pico-flash
Flash Memory - The Pico uses a separate Flash Memory for the program. The official Pico uses the Winbond W25Q16JV 3V 16M-Bit Serial Flash Memory with Dual/Quad SPI Interface. That is 2 MBytes = 2,097,152 bytes. You can use the Flash Memory that isn’t used for your program to store whatever you want. I sometimes use it to keep a time-stamped data log. This program shows how to do that. It logs the ADC input.
D. jm_pico-bme280
This reads the Bosch BME-280 sensor which reads temperature, humidity, and absolute atmospheric pressure. It displays it on the LCD and can also keep a time-stamped log in Flash memory which can be retrieved through the uart. It also reports which part you have, a BME-280 or a BMP-280. My Web site article includes a section on how to tell the difference between the two parts and why Barometric Pressure and Absolute Air Pressure are different when you are not at sea level and why it is important that you know that.
1. With SW1 closed it allows you to set the ds3231 time and date. (When SW1 is changed it is necessary to Reset the Pico with PB4.)
It starts with showing the time and date. Then you use the pushbuttons to set the time and date. PB3 advances to the next step in setting the time. PB1 increments the value. PB2 decrements the value.
2. With SW1 open it runs the BME-280 program.
E. jm_pico-nrf905-tx
Test the NRF905 RF Module in transmit mode. It sends 32-byte packets with test data that it also sends through the uart (in hex). Use it with the NRF905 RX Test program.
F. jm_pico-nrf905-rx
Test the NRF905 RF Module in receive mode. It receives 32-byte packets that it sends through the uart (in hex). Use it with the NRF905 TX Test program.
jm_rpi-pico-v6
*PCBWay community is a shared platform and we are not responsible for any design issues.
- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Jed Margolin
-
MyTX4 To Replace The La Crosse TX4U My TX4 Wireless Sensor Transmitter replaces the La Crosse TX4U wireless sensor which is no longer ma...
-
Audio Tone Burst Generator The Audio Tone Burst Generator produces a periodic burst of tone at a User-selected audio frequency ...
-
jm_rpi-pico-v6 The Raspberry Pi Pico module is amazing. It is much faster than the Texas Instruments MSP430G2xxx fa...
-
Woof Meter The Woof Meter is for testing subwoofer speakers to measure their Thiele-Small (TS) parameters. Thes...
-
Precision Low Frequency Signal Generator The Precision Low Frequency Signal Generator produces a User-selected signal from 10Hz to 90Hz with ...
-
GPS Clock and Armageddon Alarm A GPS Module using the U-blox NEO6MV2 is used to receive the GPS timing signals to show the exact ti...
-
PB1 - Prototyping Board with Ground Plane and Power Supplies This board is for prototyping circuits using wire wrap. It has a good ground plane and power supplie...
-
Flame Switch This board simulates the electrical characteristic of a flame for troubleshooting residential gas fu...
-
PB2 - Prototyping Board for MSP430G2xxx This board is for prototyping circuits with the Texas Instruments MSP430G2xxx microcontroller. It ca...
-
GP1 - Board for demonstrating how to use an MSP430G2xxx This board is for demonstrating how to use the Texas Instruments MSP430G2xxx microcontroller. The bo...
-
VGA Adapter for Atari Hard Drivin’/Race Drivin’ Cockpit This VGA Adapter for Atari Hard Drivin’/Race Drivin’ Cockpit also provides for delaying horizontal a...
-
Phone Selector/Adapter 2-line to 1-line This converts an RJ11 line with two phone pairs on it to two single line RJ11 jacks. It provides two...
-
Triangle Wave Generator With Adjustable Symmetry This is a simple circuit using only one IC, a TL084 quad opamp. The integrator integrates the output...
-
Voltage Controlled Audio Oscillator with LM13700s This is a voltage controlled audio oscillator using two LM13700s. At 1 KHz ARTA software (http://www...
-
Oscillator - Xtal or RC This is an oscillator that can be stuffed to be either a crystal oscillator (with a 74HC04) or an RC...
-
Sine Wave Generator Using a Johnson Counter This is a 1KHz audio oscillator using a Johnson Counter. ARTA software (http://www.artalabs.hr/) rep...
-
VGA Adapter For Tektronix TDS 360 Oscilloscope The Tektronix TDS 360 is a two-channel digital oscilloscope from the middle 1990s. The sampling rate...
-
Atari BattleZone Engine Sound Generator Atari’s BattleZone game is considered the first real 3D video game. I did the 3D graphics algorithms...
-
Ultimate 64 (U64) 64c Userport Side Mount Install Kit - COREi64 Original Design
60 0 0 -
Ultimate 64 (U64) 64c Internal Userport Install Kit - COREi64 Original Design
47 0 0 -
-
-
Air conditioning on/off control via telegram and esp32
140 0 0 -
-
Hive Helper - Home Assistant epaper display
428 2 1 -
26 pin 1.25mm to 1.00mm Floppy FFC ribbon adapter
129 0 1 -
-