石榴姐

[Solicitation Order] Tathagata IP Camera-Remote Bait Boat

 
Overview

Tathagata IP Camera-Remote Bait Boat

Background of the project

Today is an era of rapid technological development, and people change their mobile phones much more frequently. Should I trade my old mobile phone for a kitchen knife? It is better to use it as an IP camera, and it can also expand many rich ways to play. For example, the protagonist introduced in this project - the remote control boat, uses an old mobile phone to achieve real-time audio and video transmission, boat control, and voice dialogue!

Project Introduction

Hardware part: Main control Air103 (convenient for everyone to make and use the development board), motor driver RZ7886
Embedded part: based on Hezhou LuatOS
Hull part: This is a PDD purchase, you can use it yourself, you can try to design your own shell, etc.
APP: Tathagata IP Camera, Portal: Click here to download .    You can also go to   Xiaomi App Store   /  Baidu Mobile Assistant to download.

☆The embedded source code, schematic diagram, and PCB are completely open source. The main control provides a serial port control protocol. Users can expand the rich gameplay by themselves and expand various control methods such as lora and 2.4g radio frequency.

Schematic design instructions

The schematic design part of this project is relatively simple and mainly consists of the following parts: 2S->5V step-down, Air103 development board, RZ7886 motor driver, Type-C interface, CH340 serial port conversion chip, shipboard LED driver, power ADC detection, etc. Made up of several parts.
Bait boat schematic diagram.png

PCB design instructions

In the PCB part, please note that the power supply and motor drive parts must be bolded.
Bait boat PCB.png

3D preview

Bait boat 3D.png

Software description (core part)

Serial port data processing:

module(..., package.seeall)
--Introduce necessary library files (written in Lua), internal libraries do not require require
local sys = require "sys"

--Configure and use the corresponding serial port ID
local DATA_UART_ID = 1 -- select a different uarId based on the actual device

--initialization
local result1 = uart.setup(DATA_UART_ID, --serial port id
115200, --Baud rate
8, --data bits
1--Stop bit
)
-- Receiving data will trigger a callback, where "receive" is a fixed value
uart.on(DATA_UART_ID, "receive", function(id, len) local s = ""
repeat
-- If it is air302, len is not trustworthy, pass 1024
-- s = uart.read(id, 1024)
s = uart.read(id, len) if #s > 0 then
-- #s is to take the length of the string
-- If binary/hexadecimal data is transmitted, some characters are not visible, which does not mean that they were not received.
-- For information about sending and receiving hex values, please refer to https://doc.openluat.com/article/583
log.info("DATA_UART", "receive", id, #s, s) --if s:toHex() == "010601220001E9FC" then
-- log.info("start config mode")
-- isInConfigMode = true
-- intoConfigMode()
--elseif s:toHex() == "010601220000283C" then
-- log.info("end config mode")
-- isInConfigMode = false
-- intoRunMode()
--else
-- uart.write(DATA_UART_ID, "command error")
-- log.info("command error")
--end
local data, result, errinfo = json.decode(s) if result and type(data) == "table" then
--motorControl putFoodControl lightControl
local action = data.action if action == "motorControl" then
local a1 = tonumber(data.a1) local a2 = tonumber(data.a2)
local b1 = tonumber(data.b1)
local b2 = tonumber(data.b2)
if a1 == nil or a2 == nil or b1 == nil or b2 == nil then
log.error("Incomplete data") return
else
driveMotor(a1, a2, b1, b2) end
elseif action == "putFoodControl" then
putFood() elseif action == "lightControl" then
local lightState = data.lightState if lightState then
ledOn() else
ledOff() end
elseif action == "getId" then
local unique_id = mcu.unique_id() local unique_data, unique_len = string.toHex(unique_id, " ")
--Data conversion
log.info("unique_id:", unique_data) log.info("unique_id-length:", unique_len)
local unique_data_result = {
deviceId = unique_data
}
unique_data_result = json.encode(unique_data_result)
uart.write(DATA_UART_ID, unique_data_result)
else
log.error("control action error") end
else
log.error("data is not json") end
end
until s == ""
end)
-- Not all devices support the sent event
uart.on(DATA_UART_ID, "sent", function(id) log.info("BLE_UART", "sent", id)
end)
motor driven:
好神奇,电机驱动的代码放这里就没法提交工程,会触发拦截,还是放在附件中吧

The embedded source code and firmware are included in the attachment.

Physical display instructions


1. The empty board returned
WeChat picture_20220711233359.jpg
WeChat picture_20220711233406.jpg

2. What it looks like after welding
WeChat picture_20220711233410.jpg
WeChat picture_20220711233414.jpg

3. Shipment test
WeChat picture_20220711233418.jpg
WeChat picture_20220730103228.jpg
WeChat picture_20220730103219.jpg

Precautions

Be careful not to connect the battery backwards! ! !


Demo video


参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2024-11-24 20:10:40

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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号