jhJ2fQ2

#8th LCSC Electronics Contest# Renesas RA-Smart Cat Water Fountain

 
Overview

Project Function Introduction:
1. Automatic timekeeping via WIFI upon power-on. (Video uploaded)
2. An alarm sounds every hour, activating the water pump to change the water and controlling the activation time based on temperature (whether it exceeds 30 degrees Celsius), 30 seconds, 60 seconds. (The alarm starts at 0 minutes past the hour; this is already configured and therefore not recorded.) 3. The water pump automatically starts for a period of time upon detecting a cat passing by. (Video uploaded) 4. Customizable RGB lighting. (Video uploaded) 5. Detects water in the tank; if water is low, a buzzer sounds and the RGB lights turn off. (Video uploaded) 6. Detects battery voltage; if the battery is low, a buzzer sounds intermittently and the RGB lights turn off. (Similar effect to low water, but the alarm sound is different; waiting for the battery to run out of power is difficult, so this is not recorded.) 7. Can be powered by battery or via TYPE-C (which can also charge the battery). (Image uploaded) 8. Onboard serial port debugging interface; SWD debugging is also possible. (Image uploaded) 9. WiFi control for water pump activation.
10. Touch button can be added to activate the water pump.
(4 videos uploaded)
 
As we all know, cats don't like to drink from their own bowls, so I wanted to make a smart water fountain for my cat. A search on Taobao revealed that smart cat water fountains are generally overpriced, so I decided to make one myself.
 
I found a cheap water fountain modification on Pinduoduo, which was very cheap, around ten yuan. Now I have a water tank and a USB water pump. I'll take this opportunity to get free components and build a more powerful smart water fountain.
 
Project Structure
 
, Physical Appearance ,                                                     Circuit Board Image
 
        , Temperature and Humidity Sensor, OLED Module,
 
                                                   Smart Water Dispenser Front,
 
                               Smart Water Dispenser Side (Charging Interface),
 
Hardware Circuit
: 1. MCU Core Circuit
: R7FA2E1A72DFL Chip Features:

48MHz Arm® Cortex®-M23,
64kB Flash and 16kB SRAM,
4kB Data Flash, providing data storage capabilities similar to EEPROM,
1.6V - 5.5V Wide Operating Voltage Range,
Enhanced Capacitive Touch Sensor Unit (CTSU)
, 12-bit ADC, LPACMP, Temperature Sensor
, 32-bit General Purpose PWM Timer, 16-bit General Purpose PWM Timer, Low-Power Asynchronous General Purpose Timer,
Real-Time
Clock, SCI (UART, Simple SPI, Simple I2C),
Independent SPI Interface/I2C Multi-Master Interface,
Security Features,
Encryption Function

 
. 2. WIFI Circuit (Can be replaced with Bluetooth).
When purchasing the ESP8266, it's best to buy one with AT firmware. If not, you'll need to download it yourself.
 
3. Liquid level detection sensor, human body sensor, temperature and humidity sensor, OLED module.
Liquid level sensor and
human body sensor
have fast response speed, low static power consumption, high sensitivity, small size, and are easy to install. The lens and pin headers are already installed and soldered. With a power supply, no debugging is required. Features: 1. The high-level output time is adjustable from 2.5 seconds to 1 hour. The factory-set output time is 2.5 seconds. If needed, a surface-mount resistor can be changed. 2. Lockout time: 2 seconds, not adjustable. 3. Factory-defined as retrievable and cannot be changed. 4. The module's supply voltage is 3.3V to 15V, and the maximum voltage is 2.8V to 18V. 5. The module's output timing is: after power-on, it outputs a high level for 2 seconds, then changes to a low level to enter standby mode. If the delay time is changed, the time for the module to output a high level after power-on will increase accordingly. This can be understood as the startup time to enter normal working state after power-on will increase. 6. After installing the photosensitive element, it will not work during the day but will work at night. Without the photosensitive element, it will work all day (the default is that no photosensitive element is installed). 7. This module is very sensitive. Pay attention to the installation location and try to avoid heat sources and radiation sources (air outlet/sun). 8. The sensitivity of this module is adjustable. A surface-mount resistor
temperature and humidity sensor needs to be replaced (note the pin order).
1. Humidity measurement range: 0~100%RH
2. Humidity measurement accuracy: ±3%RH
3. Temperature measurement range: -40~125℃
4. Temperature measurement accuracy: ±0.3℃  
5. Operating voltage: 2.4~5.5VDC (wide voltage)
6. I2C interface output
to 0.96-inch OLED module (note the pin order)
 1. High resolution: 128*64 2. Ultra-wide viewing angle: greater than 160° 3. Ultra-low power consumption: 0.06W during normal display 4. Wide power supply range: DC 3.3V-5V 5. Industrial grade: operating temperature range -30°C~70°C 6. Small size: 27mm*27mm*2mm 7. Communication method: IIC 8. Brightness and contrast can be controlled by program commands 9. Service life of no less than 16,000 hours 10. Internal driver chip for OLED screen: SSD1306
 
4. Water pump circuit
: When P111 outputs a high level, the water pump turns on (LED2 lights up):
R_IOPORT_PinWrite(&g_ioport_ctrl, WaterPump, BSP_IO_LEVEL_HIGH);//Turn on the water pump
R_IOPORT_PinWrite(&g_ioport_ctrl, WaterPump, BSP_IO_LEVEL_LOW); // Turn off the water pump
 
. 5. Buzzer, RBG circuit
: When P104 outputs a high level, the buzzer sounds:


R_IOPORT_PinWrite(&g_ioport_ctrl, Buzzer, BSP_IO_LEVEL_HIGH); // Turn on the buzzer
R_IOPORT_PinWrite(&g_ioport_ctrl, Buzzer, BSP_IO_LEVEL_LOW); // Turn off the buzzer


 
 WS2812b core display code:


setPixelColor(i, green, red, blue); // Which WS2812B color value (transmitted via SPI)


 
6. Serial port debugging circuit
is directly connected to the RA MCU by default. Connecting a jumper can be used for programming and debugging ESP8266
 
 
. 7. Battery power detection:
The upper and lower voltage limits of the 18650 lithium battery are 4.2V and 2.75V, respectively.
The nominal voltage of a single 18650 lithium battery is typically 3.6V or 3.7V.
The minimum discharge termination voltage for 18650 lithium batteries is generally 2.75V. Lowering this voltage can easily lead to a significant decrease in battery capacity or even render the battery unusable. Most lithium batteries should not be discharged below 3.2V, otherwise over-discharge will damage the battery.
In the program, we set an alarm and shut down the water pump and RGB when the battery voltage is below 3.6V.
 
8. Power Circuit (Lithium Battery Charge/Discharge Protection, Boost, LDO)
(It is best to solder the power module and debug the 5V output before soldering other modules)
Maximum charging current: 1000mA Charging cutoff voltage: 4.2V Battery over-discharge protection voltage: 2.4V
Maximum output current: 2A (Recommended to use within 1A)
Output voltage: 4~12V      
Type-C power input, red light is constantly on, indicating charging. Blue light is on when fully charged. When there is power at the input terminal, current is obtained from the power input terminal; if no power is connected, current is obtained from the battery. When the battery voltage is below 2.4V, the output is automatically shut off. When connecting the battery for the first time, there may be no voltage output. Powering on the power input terminal is required to activate the protection circuit. When using a mobile phone charger, it must output at least 1A; otherwise, charging may not be possible. For
 
software code
copying projects, please note the need to change the WiFi account and password .
See the attached files for project details.
 
ESP8266 initialization and related code are in:
ESP8266.c and ESP8266.h.
 
OLED initialization and related code are in:
oled.c, oled.h, and oledfont.h.
 
SHT30 initialization and related code are in:
sht3x.c and sht3x.h.
 
WS2812B initialization and related code are in:
ws2812b.c and ws2812b.h. 
 
The main program is written in hal_entry.c.

 

 
 
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2026-03-27 00:19:40

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号