In a self-service car wash project, the stability and real-time nature of water and electricity control are critical - the user must turn on the power immediately after scanning the QR code to pay, and automatically cut off the power when the time is up, and the status of the equipment must be monitored. This 50A smart circuit breaker from Thingboot just meets the needs. The following is a step-by-step explanation of how to connect it.
1. Why choose this hardware? (Selection ideas)
First, we have to confirm whether this "hard guy" can withstand the environment of a car wash shop. Although ordinary relays or contactors are cheap, they are easy to stick and have no data feedback.
In Thingboot’s product line,Intelligent high-power circuit breaker [Metering digital display version] (Model: UNI-DLQ-M-50A-PD)Almost tailor-made for this kind of scenario:
High power carrying:supportMAX 50Acurrent, resistive loads up to10000W. There is no pressure when the car washing machine, water pump, and foam machine are all turned on..
Guide rail installation: It is a standard rail installation and can be installed directly into your existing electrical box to replace the old leakage switch. No additional cabinets are required..
With metering function: This is very important. It can report voltage, current, and power in real time. You can use this data to determine whether the device is faulty or whether the user is using it normally..
Friendly interface: it supportsHTTPandMQTTprotocol. This means that you don’t need to do any complicated microcontroller development, you can control it by sending a request directly with your backend server (Java/PHP/Python/Go).
2. Hardware wiring and networking (physical connection)
Before writing code, you must first connect the electricity. This circuit breaker from Thingboot is directly connected to the 220V main line, but here is amust pay attentionThe pit:
Wiring scheme
Incoming line end: Connect to the mains input (live wire L/neutral wire N).
Outgoing terminal: Connect the power cord of the car washing machine equipment.
Notice: This device isWiFi networkingdoes not require a gateway, but it requiresZero live wire power supply. Many electricians are used to only connecting live wires to circuit breakers, but in order to supply power to the chips inside,Must be connected to neutral line, otherwise the device will not power on and cannot connect to the Internet..
3. Practical integration development (core logic)
This is the part you care about most. Thingboot’s open interface is very standard and usesHTTP APIorMQTTWay. We use the most commonHTTP APIFor example, the steps are as follows:
1. Preparation
After getting the device, first connect the device to the WiFi of the car wash shop through the network configuration mode. Then get three key credentials from Thingboot’s backend:
AppID(your app ID)
AppSecret(your app key)
Device ID(ID of this circuit breaker, such as 1234567)
2. Signature calculation (security verification)
To prevent someone from maliciously taking control of your car wash, all requests need to be signed. The official signature rules are slightly encapsulated, and the logic is as follows:Sign = md5( md5(AppSecret) + ts )Let me explain it in spoken language: first perform MD5 encryption on your key, then splice it with the current timestamp, and then perform MD5 on the spliced string as a whole..
3. Issue the "power on/power on" command
When the user successfully scans the QR code to pay, your backend needs to send an instruction to Thingboot's server.
Request address:
https://api.thingboot.com/{yourAppID}/device/control/Request method:
POSTRequest Body (JSON format) :
Code logic example (pseudocode): The user pays successfully -> Query the device ID corresponding to the parking space -> Call the above interface -> The device clicks shut, and the car wash machine is powered on.
4. Issue the "power off/stop" command
scene: The user clicks the "End" button, or the billing time expires, or power leakage is detected.
instruction
5. Data monitoring and "anti-running orders" mechanism (advanced gameplay)
take advantage of itMetering function, you can build a very intelligent risk control system.Instead of sending requests all the time asking the device "How much current is going on right now?"Set up a Webhook for data reporting(Or proactively inquire).
For example, you can design the logic like this:
instruction:Start
{"power": 1}power ups.Detection: Read the real-time power of the device after 10 seconds.judge: If the power is < 50W, it means that the car washing machine has not started (for example, the user did not pick up the water gun after scanning the code). At this time, you can automatically cut off the power and issue a refund to avoid idling of the equipment or the user forgetting to turn it off.
4. Advanced Optimization: Solving Network Delay
The electrical box in a car wash is usually in the corner, and the WiFi signal may not be good. Here's a little one:
If it is a single store: Directly using the WiFi version is enough, simple and cheap.
If it is a chain store:consider4G versioncircuit breaker. Because WiFi relies on the router, if the router crashes or the broadband is in arrears, the car wash machine will be out of control; the 4G version is independent of the store network and has higher stability..
5. Summary
Connecting Thingboot's 50A smart circuit breaker to the self-service car wash project is actually doing"Business logic"and"hardware instructions"translation work.
Connect the wires: Remember to connect the neutral line to ensure the device is online.
Adjust the interface: After getting the two layers of MD5 encryption signature, you can send it
power=1andpower=0.Business closed loop:useMeasurement dataTo determine whether the device is actually started, it can effectively reduce after-sales disputes.
This solution can help you save complex circuit design and directly turn high-voltage control into an HTTP request as simple as calling the Alipay interface. The development cycle is very short, and it is very suitable for the rapid implementation of unmanned car wash scenarios.