9. input devices#
1.Group work#
Click here for details. week09
2.individual work#
Click here for information on base production.
01. Connecting modules#
- Grove - Multichannel Gas Sensor v2 - Besides CO, NO2, C2H5CH, VOC - MEMS gas sensor
- https://www.seeedstudio.com/Grove-Multichannel-Gas-Sensor-v2-p-4569.html
Grove - Multichannel Gas Sensor V2 provides stable and reliable gases detecting function under the circumstances of any other four sorts of gases. It can detect a variety of gases, besides Carbon monoxide (CO), Nitrogen dioxide (NO2), Ethyl alcohol(C2H5CH), Volatile Organic Compounds (VOC), and etc.
02.Board Fabrication#
Obtaining mill data using Fusion 360 for electronics#
Trace#
-
Select the layer to trace.
-
Select the target.
-
Export it. The export method is described in the outline below.
Outline#
-
Create a layer.
- Layer name: MilOutline
-
Select the layer to transfer.
- Target layer name: 20BoardOutLine
-
Select “line” in the selection to limit the selectable objects.
-
Select all target lines and transfer them to “layer” using “convert to polygon”.
-
Select only the “layer” and export it. Proceed with the export method as shown in the image below.
- OUTPUTS> Image>Browse…>naming >save > ok
Note
Don’t forget to check “monochrome” when exporting.
Hole#
Note
The holes currently visible are virtual images projected when reflecting the 3D modeling in “eagle”. In reality, the hole information does not yet exist on the “board”. Therefore, it is necessary to create a new layer for holes and export it.
-
Select the “board outline” layer.
-
Select the circle at the hole location.
-
Check the diameter with “DDD”.
-
Currently, due to the grid, you cannot create a hole circle at the specified location. Change the “Size” of the Grit setting to 1ml.
-
DESIGN > PLACE > Hole (NPTH)
-
Change the ULP’s drill-aid to 0.
- a search > b select target > enter drill-aid > OK > OK
-
Select the “hole” layer created in step 5 and export it. The export method is the same as the method described in the outline.
Creating G-code data using modsproject#
The procedure to open the G-code creation program for mil 2D PCB is as follows. - programs > open program > G-code >mil 2D PCB
-
A. read png
- a: import png files
- b: invert. mods creates G-code to excavate the white part. If the area you want to excavate is represented in black, you must invert it.
-
B. set PCB defaults
- c: isolate trace.
-
C. mil raster 2D
- d: calculate. Clicking this starts the calculation, and a 3D G-code check screen opens in a new tab. At the same time, the G-code file is downloaded.
- d: calculate. Clicking this starts the calculation, and a 3D G-code check screen opens in a new tab. At the same time, the G-code file is downloaded.
G-code information that can be confirmed in 3D opened as a new tab
Trace#
- Import the trace png file
- Select isolate trace 0.7 in set PCB defaults
- Select isolate trace (1/64) in set PCB defaults
Outline#
- Import the outline png file
- Select mill outline(1/32) and set tool diameter 0.7mm in mill raster 2D
- Select calculate in mill raster2D. Then the G-code data will be downloaded.
Hole#
- Import the hole png file
- Select invert.
- Select mill outline(1/32) and set tool diameter 0.7mm in mill raster 2D
- Select calculate in mill raster2D. Then the G-code data will be downloaded.
Milling#
A detailed workflow for PCB Milling can be found on the Group assignment page.
CNC machine used this time#
Sainsmart Genmitsu PROVerXL4030
https://jp.sainsmart.com/products/genmitsu-cnc-proverxl-4030
Difference in drill diameter#
- Small diameter
- Easy to break
- In the first place, there is almost no need to cut the surface (it is meaningless). Since it is enough to insulate, the drill diameter has almost no effect on the processing time.
- Preparation
- Check the size of the board. This time, a 48mm x 48mm board is fine.
- Download the software
- This time I used Gsender https://sienci.com/gsender
- Turn on the power
- Fix the board with double-sided tape
- Attach the drill
- Two types of drills were used this time
- V
- End mill
- Use two wrenches to tighten the bolt.
- Two types of drills were used this time
- Check the size of the board. This time, a 48mm x 48mm board is fine.
Warning
The Z-axis has a limited range of motion. If you insert the bit too much when attaching it, the bit may touch the limit of the range of motion before touching the board when setting the Z-axis 0 point, and you may not be able to lower the bit to the 0 point. Attach it with the bit sticking out to some extent (for example, about 15mm).
- Align the X and Y axes to the 0 axis on the Gsender software
- A: Selecting A in the image moves the tip to the lower left corner.
- B: You can change the movement distance per movement with Rapid, Normal, and Precise. Select Precise when precise movement is required.
- Align the Z axis to the 0 axis
- Pinch the paper and lower the Z axis little by little. Move it to a location where the paper no longer moves, lowered by about +1 operation, and set it to the 0 axis.
- Load and execute G-code data
- The speed can be adjusted with Feed (red frame). Be careful as the drill may break if it is too fast.
- This time, execute in the order of trace > hole > outline.
- The speed can be adjusted with Feed (red frame). Be careful as the drill may break if it is too fast.
Note
When the outline is cut, the board is separated from the whole. If you perform additional excavation in the separated state, the board may move and you may not be able to excavate properly. Cut the outline last.
Warning
- Do not leave the CNC excavation unattended. It may cause troubles due to drill breakage or fire due to friction.
- The drill may break depending on the speed and deterioration state. Wear safety glasses for safety reasons.
Stuffed#
- This time, use the following parts.
- 2X7 SMD PinSocket x2 (For Xiao)
- 2X4 SMD PinHeader (For I2C)
- 1X6 Angled PinSocket (For Serial)
- LED1208
- RESISTER 1208 1K x2
- RESISTER 1208 10K x2
- SWITCH_TACT
- I confirmed that it can be placed without problems as shown in the image.
Solder
03. Insert library#
You can import the library by following the steps below.
sketch > include library > add Zip Library
The imported library is here
https://github.com/Seeed-Studio/Seeed_Multichannel_Gas_Sensor/archive/master.zip
- Differences between the connection terminals of the microcomputer and the terminals of the module
- Create a conversion connector
Gas Sensor v2#
PCB I created#
The wiring considering the I/O positional relationship is as shown in the figure below.
In order to achieve this, I made my own conversion connector.
For more information on PCB production, please see the Week08 documentation.
04. Programming#
Coding is done using Arduino.
The program code this time is as follows. This code is a partial modification of the sample code included in the Multichannel_gas_sensor_V2.0.ino library.
You can download the library from here.
https://github.com/Seeed-Studio/Seeed_Multichannel_Gas_Sensor/archive/master.zip
/*
Multichannel_gas_sensor_V2.0.ino
Description: A terminal for Seeed Grove Multichannel gas sensor V2.0.
2019 Copyright (c) Seeed Technology Inc. All right reserved.
Author: Hongtai Liu(lht856@foxmail.com)
2019-9-29
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.1 USA
*/
#include <Multichannel_Gas_GMXXX.h>
// if you use the software I2C to drive the sensor, you can uncommnet the define SOFTWAREWIRE which in Multichannel_Gas_GMXXX.h.
#ifdef SOFTWAREWIRE
#include <SoftwareWire.h>
SoftwareWire myWire(3, 2);
GAS_GMXXX<SoftwareWire> gas;
#else
#include <Wire.h>
GAS_GMXXX<TwoWire> gas;
#endif
static uint8_t recv_cmd[8] = {};
void setup() {
Serial.begin(9600);
// If you have changed the I2C address of gas sensor, you must to be specify the address of I2C.
//The default addrss is 0x08;
gas.begin(Wire, 0x08); // use the hardware I2C
//gas.begin(MyWire, 0x08); // use the software I2C
//gas.setAddress(0x64); change thee I2C address
}
void loop() {
uint8_t len = 0;
uint8_t addr = 0;
uint8_t i;
uint32_t val = 0;
Serial.print("Variable_1:");Serial.print(gas.getGM102B()); Serial.print(",");
Serial.print("Variable_2:");Serial.print(gas.getGM302B()); Serial.print(",");
delay(2000);
}
05. How do physical properties relate to measurement results?#
Grove - Multichannel Gas Sensor v2 can monitor multiple gases: It can detect carbon monoxide (CO), nitrogen dioxide (NO2), ethyl alcohol (C2H5CH), volatile organic compounds (VOC), etc.
This time, we tested whether the Gas Sensor would react when the flux bottle was opened.
Basically, flux is composed of base resin, organic acid glycol ether, solvents such as alcohol, surfactants, zinc chloride, ammonium chloride, and purified water (alcohol, etc.).
As a result, the two sensors reacted simultaneously to the odorous components of the flux. It is a very interesting phenomenon that GM302B reacted more noticeably than GM102B among the four gas sensors.
Checking the data sheet, it can be seen that GM102B (Variable_1) is designed to react to carbon dioxide, and GM302B (Variable_2) is designed to react to ethanol.
GM102B:https://www.winsen-sensor.com/d/files/manual/gm-102b.pdf?campaignid
GM302B:https://www.winsen-sensor.com/d/files/manual/gm-302b.pdf?campaignid
From this, it was determined that it reacted strongly to the ethanol component of the flux.
In addition, according to the data sheet, GM502B is designed to react to ethanol, formaldehyde, toluene, etc., and GM702B is designed to react to carbon monoxide (CO), nitrogen dioxide (NO2), and hydrogen.
GM502B:https://www.winsen-sensor.com/d/files/manual/gm-502b.pdf
GM702B:https://www.winsen-sensor.com/d/files/manual/gm-702b.pdf
The following is information extracted from a translated version of the Chinese datasheet.
GM-102B / GM-302B#
GM-502B#
GM-702B#
06. Reflection#
- I learned that the Grove - Multichannel Gas Sensor v2 sensor can detect multiple gases such as CO, NO₂, ethanol, and VOCs. In particular, I understood the characteristic that each element of the sensor (GM102B, GM302B, etc.) reacts specifically to a specific gas.
- In connecting the microcomputer and the gas sensor, since the terminals were not compatible, I solved the physical connection problem by designing and manufacturing my own conversion connector.
- I learned how to program to acquire sensor data on the Arduino IDE and how to utilize the library provided by Seeed Studio. In addition, I was able to put into practice that it is possible to operate according to the purpose by making necessary modifications based on the sample code of the library.
- I experimented with how the sensor reacts when the flux is opened, and considered the relationship between the chemical components of the substance and the reactivity of the sensor. In the experiment, GM302B reacted more strongly than GM102B, so I estimated that it has high sensitivity to ethanol contained in the flux, and this was supported by the data sheet.
- Through the experience of reading data sheets in English and Chinese, I was able to understand the detection target and technical specifications of the sensor.