Smartphone control system solution

In the era of mobile Internet, smart phones are the main application platform. In the home environment, the smartphone can be used as a control terminal to control every smart home appliance in the home. This paper starts with a specific application example, and describes in detail the whole process of Android smartphone controlling DC motor through Wi-Fi, which has high reference value.

1 system structure and overall design

The structural block diagram of this system is shown in Figure 1. The system is divided into five parts: wireless router, smart phone, CC3000 Wi-Fi module, MSP430 single-chip circuit and DC motor drive circuit. First, the smartphone connects Wi-Fi to the wireless router; then opens the SmartConfig app in the smartphone and configures the CC3000 Wi-Fi module so that the CC3000 can connect to the wireless router; then open the motor control APP, build the smartphone and CC3000 Wi-Fi module connection. Among them, the CC3000 Wi-Fi module and the MSP430 microcontroller communicate via the SPI bus. Finally, the motor can be wirelessly controlled via the motor control APP in the smartphone.

Figure 1: System block diagram

2 hardware design

2.1 CC3000 Wi-Fi Module

The wireless communication part of the system uses TI's Simple Link CC3000 Wi-Fi, a self-contained wireless solution that greatly simplifies the implementation of Internet connectivity. It also provides simplified Wi-Fi connectivity for microcontroller-based (MCU)-based systems, and works with MSP430 and TIva C-Series MCU LaunchPad evaluation kits for a variety of MCU-based home automation, health fitness, and machine-to-machine ( M2M) Application Quick Start Development. The Simple Link CC3000 Wi-Fi solution is provided in modules, as shown in Figure 2.

Figure 2: CC3000 Wi-Fi Module

It reduces product development time, reduces manufacturing costs, saves board space, simplifies certification, and reduces the need for RF expertise. Connectivity to low-memory microcontrollers is achieved by fully integrating software on the CC3000.

The main features of Simple Link CC3000 Wi-Fi are:

1 The wireless network processor uses the IEEE 802.11b/g (2.4 GHz) standard to embed the IPv4 TCP/IP protocol stack.

2 has good RF performance, transmit power is +20 dBm, 11Mbps (CCK); receiving sensitivity is -89 dBm, 11 Mbps (CCK).

3 Easily matched with low memory capacity, low cost and low power microcontroller systems.

4 Built-in antenna reference design certified by FCC, IC, CE and TELEC.

5 integrated crystal and power management module.

6 small packages measuring 16.3 mm & TImes; 13.5 mm & TImes; 2 mm.

7 working temperature is -20 ~ 70 °C.

8 intelligent configuration technology: You can configure Simple Link CC3000 Wi-Fi with a smartphone, tablet or PC.

9 Verified Wi-Fi Interoperability: Based on TI's seventh generation of proven Wi-Fi solutions.

10 Provides a complete platform for the solution, including user manuals, migration guides, API guides, sample applications, and support communities.

The CC3000 specifications are listed in Table 1.

Table 1: CC3000 Specifications

2.2 MSP430 microcontroller

The MSP430 MCU is an ultra-low-power type 16-bit MCU produced by TI. It uses the RISC core structure and supports C language programming. At the same time, this series of microcontrollers integrates a large number of peripheral modules (such as LCD drivers, watchdogs, A/D converters, hardware multipliers, analog comparators, etc.) into the chip, which is especially suitable for designing system-on-chip. It is connected to the CC3000 Wi-Fi module through the SPI bus. The specific connection is shown in Figure 3. The MSP430 MCU can be used to configure the connection parameters of the CC3000 Wi-Fi module through the SPI bus, and can also communicate with other Wi-Fi devices.

Figure 3: CC3000 Wi-Fi Module and MSP430

2.3 DC motor drive circuit

The L298N is used to drive the DC motor. It is a high-voltage, high-current motor driver chip produced by ST. The main features of the chip are: high operating voltage, maximum operating voltage up to 46 V; large output current, instantaneous peak current up to 3 A, continuous operating current of 2 A; high voltage and high current with two H-bridges Bridge driver, which can be used to drive inductive loads such as DC motors and stepper motors, relays, coils, etc.; standard TTL logic level signal control; with two enable control terminals, allowing or not being affected by input signals The device is disabled; there is a logic power input that allows the internal logic circuit to operate at low voltage; an external sense resistor can be used to feed back the change to the control circuit.

Figure 4: DC motor drive circuit

The DC motor drive circuit is shown in Figure 4. The speed of the DC motor is adjusted by the PWM waveform of the P3.0 output of the single-chip microcomputer, and the rotation direction of the DC motor is controlled by the difference between the high and low levels of the P3.1 and P3.2 pins.

3 software design

3.1 MSP430 microcontroller programming

MSP430 MCU mainly completes two functions: one is to communicate with CC3000; the other is to control DC motor, the former is the difficulty of this program design.

The main program flow chart of the single chip microcomputer is shown in Figure 5. Use the CC3000 as a server and wait for the smartphone to connect. The MCU first initializes the I/O port and configures some registers. Then it determines whether the CC3000 needs to be Smart Config. If it is not needed, it determines whether it is connected to a wireless router. After the CC3000 is connected to the router, it will get an IP address. Then CC3000 sends the broadcast and initializes CC3000 to Server mode, waiting for Clie nt connection. When the smartphone receives the broadcast and connects to the CC3000, it can control the DC motor through the smartphone.

Figure 5: MCU main program flow chart

3.2 Android application design

The APP is divided into two parts: SmartConfig and Motor Control. The SmartConfig program of this system directly uses the APP program provided by TI's official website, and no programming is required here. When the CC3000 is used for the first time or when changing to a network environment, you need to perform SmartConfig on the instrument, and write the current network information into the CC3000. When it is used again, the instrument will automatically connect to the network.

The motor control program interface is shown in Figure 6. The program mainly implements the connection of the CC3000 Wi-Fi module to the smartphone and controls the forward, reverse, stop and speed of the motor. The three Button components in the interface are used to control the forward, reverse, and stop of the motor. By sliding the SeekBar component, you can adjust the speed of the motor and display the speed above the component. The bottom Spinner component is used to display the connected device and will be displayed here when connected to the CC3000.

Figure 6: Motor Control Program Interface

Conclusion

This paper adopts MSP430 MCU as the core of the control terminal, communicates with CC3000 Wi-Fi module through SPI bus, enables the smart phone and MSP430 MCU to indirectly perform data interaction, so as to achieve the purpose of remote control of MCU and its peripheral devices. After testing, the smartphone and CC3000 can be connected stably, and the motor control APP can be used to control the forward, reverse, stop and adjust the speed of the DC motor. The system has achieved the expected design goals and has high practical value.

Internet of Things Conference

Connectors overmolding

Overmolding the Connectors offers significant opportunities for cable improvements with higher pull strength and waterproof issue for those parts, which without these characteristic by conventional types.Such as jst jwpf connector. Just be free to contact us if you need any wire-harness solutions or partner for your products. Our professional and experienced team would support you by satisfied skill and service.


Molded Connectors,Molded Waterproof Connector,Molded Straight Wire Connector,Jst Jwpf Connector

ETOP WIREHARNESS LIMITED , https://www.wireharnessetop.com