11. Input devices¶
1. Group assignment¶
Group work had done with Antti and Mona in Fablab Oulu Protopaja, using DHT11 of Temperature and humidity sensor. The report is here.
We learned about how the sensor is sending the data and analog value of input is varied by the capacitance on the sensor by the experiments.
2. Individual assignment¶
2.1 Main board creation by ESP32¶
This week is focusing on the main computing board for further electronics weeks and my final project. My final project needs Bluetooth connectivity and many GPIO controlling 4 pieces stepper motor. And for further study, this main board needs more GPIOs for sensing and controlling other devices. Thus, I chose ESP32-WROOM-32E which has powerful 32bit dual core computing processor with WiFi/Bluetooth radio, SD card interface and 26 GPIO pins.
(c) https://randomnerdtutorials.com/esp32-pinout-reference-gpios/
Design specification¶
ESP32 as the main board for my final project, the requirements are here,
- Modular concept. Motor controller, power controller and other devices are seperated PCBs, each can be connected with 1 cable (8pin) and 5V/GND power also provided.
- Power indicate LED and extra LED for debugging are on the board.
- Mini USB connector for flashing ROM and 5V power for programming.
Design reference is used Barduino of Fablab Barcelona. The modification is additional requirements of above and connector interfaces layout.
Circuit diagram¶
Used KiCAD as I learned in previous week6 Electronics desgin to draw the circuit diagram. The interface for other board/device is used 8 pin’s pin header. And USB flashing FTDI function is also implemented.
PCB layout design¶
PCB design is followed the reference of Barduino, but one point that has limitation of routing the lines by the track width of 16 mils (0.406mm) which taught as design rule in previous week.
Need more small track width, I added 0.300mm track width. Also I confirmed that LPKF support this track width for milling.
Then 0.300mm track can route these lines.
PCB layout is done. Some of the unconnected signs are shown but these are ground related, no impact for functionality.
Milling the board¶
PCB fabrication, milling the board is made by LPKF automated milling machine used in week6 Electronics design.
Concerned part in above PCB design, made a smaller track width of 0.300mm are well milling, no problem.
Milling done beautifully.
Component soldering, assembly¶
One mistake on USB-mini connector mounting position. It should be located on the edge of board, otherwise USB cable of plastic part hits to the board and cannot insert…
Made a cut by CNC machine SRM-20 which is used in week4 Elecronics production with very simple rectangle shape cut data with board edge milling bit.
Other component implementations are okay, made my board.
Coding with Arduino IDE¶
To connect with Arduino IDE, need to download the library of ESP32 from Board manager in Arduino IDE.
And then select Tools -> Board -> ESP Arduino -> ESP32 Dev kit
Arduino IDE can flash the ESP32 board.
2.2 Acoustic distance sensor¶
As Input device, this time used an distance sensor by ultrasonic acoustic sonar as an input sensor.
The configulation is connecting the sensor of Trigger #22 pin and Echo #21 pin on the ESP32 board. And #23 pin is connected to ESP32 board internal LED for debug purpose.
For coding, used Arduino IDE with library of HCSR04 module of this.
Modified pin assign and put some delay for stable operation. And the trigger when distance became less than 10cm, put the LED ON. And the measurement value is displayed on serial monitor.
And here is the experiment result,
Reflections¶
Lesson & learnt, further improvements are,
1. PCB layout: 5V Power tracks are located at board edge in this time design. This makes short circuit easily when I hold the board, switch on/off on the board when flashing… as the result, short circuit happened serveral times and broke the schottky diode on the input power line of USB. After replaced the shottky diode then recovered but as contamination action, I put the masking tape on the edge of board over the power lines. For next design, better to locate the power line into inside of board, or make more gap with ground plane.
2. Circuit diagram: Because of FTDI serial is using GPIO #1 and #2, these pins should be removed from connector to use other purpose. During the test of above distance sensor input, first used #1 pin but when the cable is inserted to #1 connector, Arduino IDE code flashing cannot be done, always error for the board connection.