Make a minimum system of 51 microcontroller (stm32 and the like are also acceptable, just make the system board yourself). The minimum system includes clock circuit, reset circuit, serial port download circuit, etc., and there are sockets for display devices such as OLED or LCD1602, etc. There are enough keys to satisfy the following requirements.
Integrate the ADS1115 chip and its application circuit into the above system.
The microcontroller controls the ADS1115 to collect the voltage and display it. The measurement voltage range is 0-5V.
Set two modes. One mode has no memory function and can quickly detect and update the current voltage. Mode 2 has a memory function. The current voltage is updated after pressing the button, and the previous voltage can be stored. At least 5 sets of data can be stored and can be reviewed.
Design an additional DA conversion circuit that can set a voltage value arbitrarily within a certain range (0-5V), and then serve as a voltage source to test and verify the function of the voltmeter.
Since the clock frequency of stc89c52 is not high, it does not use high-speed mode and uses F/S mode.
Therefore, the delay function should delay more than 4.7us
VOUT=VDD*D/256
D is the data sent by stc89 to dac5571 through iic
The conversion register of ADS1115 is 16 bits, and the voltage value can be accurate to the voltage divided by 2 raised to the 15th power.
Regarding the design of a simple voltmeter, our group chose the STC89C52RC-40I chip. This chip has 44 pins and its package is PCLL.
(1) Clock circuit: An 11.0592MHz passive crystal oscillator is used to provide the clock signal, and load capacitors are connected to both ends of the passive crystal oscillator to ground.
(2) Reset circuit: When powering on, the capacitor is charged and the RST pin is high to achieve reset. When the RSTK1 button is pressed, the current flows into the ground through R15, and the high level at RST is reset.
(3) Serial port download circuit: Use CH340G chip to realize USART serial communication. When the six-pin self-locking button POWER is pressed to power on the microcontroller, it can be judged whether the power is on normally by the red LED light of LED1 turning on and off. When burning a program or communicating, you can judge whether the communication is normal or not by turning on and off LED2 and LED3.
(4) Independent buttons: Each time the power is turned on, the capacitors are charged. KEY1, KEY2, KEY3, and KEY4 are at low level and then remain at high level. When the independent button is pressed, they are at low level.
(5) Pull all the pins of P0 high to use as IO output ports; in addition, connect EA to high level to access the internal program memory; add two pin headers and connect them to VCC and GND respectively as a backup power input interface; connect some Pins are drawn out for easy control of other modules, etc.
(6) ADC: To measure the voltage, use the ADS1115 chip to collect the voltage, and connect the four input ports of AIN0-3 to the 4-pin header. In addition, the two pins SCL and SDA used for I2C communication are connected to pull-up resistors and pulled high, the ADDR pin is connected to ground to define its address, and ATERT/RDY is connected to P15 and left.
(7) LCD1602: After it can convert the voltage, it still needs to display. Use LCD1602 to complete it. Pin 3 of the interface circuit is connected to a 502 variable resistor to adjust the brightness of the backlight screen and lead out other pins, D0-7 Connect to P00-P07 to achieve parallel communication. The EN, RS, and WR pins are connected to P34 to P36, and the default is high level (P1 to P3 of the 51 microcontroller default to output high level)
(8) DAC: In addition, in order to facilitate the supply of voltage to the ADC part for testing, the DAC module extension part is designed. The chip uses DAC5571, which communicates in I2C mode. A0 is grounded to define the address. The SCL and SDA pins are connected to the same two-line microcontroller IO port as the ADC's I2C communication. The VDD pin is connected to the VCC power supply and filtered through a 100nF capacitor. Lead out VOUT, connect it to the 2-pin header output, and connect a filter capacitor at the same time.
(1) PCB rule design: power line (VCC, GND, 5V) line width is 20mil
(2) Frame design: Circuit board width 97mm, height 57mm
(3) Layout: As shown in the picture above
(4) Wiring: using automatic wiring
(5) Add silk screen: Silk screen draw the number of the pin header
It was my first time to participate in an electronic competition, and I learned a lot. What impressed me most was that no matter what chip you use, you must read the chip manual carefully, and you must stay calm if any problems arise during the test. Participating in e-sports has improved your abilities in many aspects. To design a complete DIY, you need to consider all aspects, starting from the design of the basic circuit, to PCB layout, soldering circuit board, testing circuit board, and typing code. Testing procedures and final report documentation. Although this process is not as detailed as the product design process, it is very helpful for individuals to make some gadgets by themselves in the future. In short, regardless of whether you win a prize or not, the improvement of your skills is the biggest benefit from participating in e-sports. Mutual trust and collaboration among team members are also important. When designing circuits, we need to discuss the allocation of pins together; when writing code, we need to cooperate with each other and unify variable functions; in the final summary, we need to divide the work and complete it together. A team with strong comprehensive capabilities, a team with reasonable division of labor, and a team with good communication are also the keys to our ability to successfully complete the work.
[1]DAC5571 User Manual, https://atta.szlcsc.com/upload/public/pdf/source/20131206/1457706662524.pdf
[2]ADS1115 User Manual, https://wenku.baidu.com/view/9a840b3683c4bb4cf7ecd135.html
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet