mirror of
https://github.com/peter-tanner/peter-tanner.github.io.git
synced 2024-11-30 12:00:18 +08:00
Compare commits
4 Commits
702ec9edd2
...
73e27d957c
Author | SHA1 | Date | |
---|---|---|---|
73e27d957c | |||
7660d758cc | |||
3de64623b1 | |||
383346d359 |
|
@ -8,9 +8,9 @@ toc: true
|
||||||
# image: assets/img/2024-08-19-ELEC4406ELEC2311-not/preview.png
|
# image: assets/img/2024-08-19-ELEC4406ELEC2311-not/preview.png
|
||||||
---
|
---
|
||||||
|
|
||||||
# Notes for ELEC4406
|
Some useful notes/code for the class tests 1 and 2, the lab test and exam.
|
||||||
|
|
||||||
## lab-test tips
|
## Lab test tips
|
||||||
|
|
||||||
The lab test has a very high time pressure (kind of like comms if you have/are doing it).
|
The lab test has a very high time pressure (kind of like comms if you have/are doing it).
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ The lab test has a very high time pressure (kind of like comms if you have/are d
|
||||||
- **NOTE: Check for your current year**. As of 2024, you may use your personal computer in the test and you don't need to use the lab computers (subject to same restrictions). You may not use anything other than Altera Quartus, Modelsim and Adobe Acrobat. You _cannot_ use vscode.
|
- **NOTE: Check for your current year**. As of 2024, you may use your personal computer in the test and you don't need to use the lab computers (subject to same restrictions). You may not use anything other than Altera Quartus, Modelsim and Adobe Acrobat. You _cannot_ use vscode.
|
||||||
- Make a few project files and the directory structure before the test, DO NOT put modelsim project in the same directory as code.
|
- Make a few project files and the directory structure before the test, DO NOT put modelsim project in the same directory as code.
|
||||||
|
|
||||||
```
|
```text
|
||||||
[SID]
|
[SID]
|
||||||
-> SYNTH
|
-> SYNTH
|
||||||
-> Part1
|
-> Part1
|
||||||
|
@ -260,6 +260,8 @@ Look at Expr evaluation value to decide if change should be rejected (not inputs
|
||||||
|
|
||||||
Make table like this for delta time (required for followthrough marks):
|
Make table like this for delta time (required for followthrough marks):
|
||||||
|
|
||||||
|
NOTE: In 2024's papers, this table template was already included in the question sheet so you don't need to memorise the columns.
|
||||||
|
|
||||||
| Time | Event | Processes triggered | Transactions enqueued | Causes event? |
|
| Time | Event | Processes triggered | Transactions enqueued | Causes event? |
|
||||||
| ----- | ----- | ------------------- | --------------------- | ------------- |
|
| ----- | ----- | ------------------- | --------------------- | ------------- |
|
||||||
| 5 ns | E->1 | U1 | 10ns:E->0 | Y |
|
| 5 ns | E->1 | U1 | 10ns:E->0 | Y |
|
||||||
|
@ -275,13 +277,13 @@ Make table like this for delta time (required for followthrough marks):
|
||||||
|
|
||||||
## Test 2
|
## Test 2
|
||||||
|
|
||||||
### TEST 2 CAN HAVE ANY CONTENT FROM TEST 1!
|
### TEST 2 CAN HAVE ANY CONTENT FROM TEST 1
|
||||||
|
|
||||||
Do not forget how to do delta delay, timing diagrams, VHDL -> diagram or diagram -> VHDL.
|
Do not forget how to do delta delay, timing diagrams, VHDL -> diagram or diagram -> VHDL.
|
||||||
|
|
||||||
### Test vectors ⚠
|
### Test vectors ⚠
|
||||||
|
|
||||||
**Can be expressed using X for don't care**, do not need to enumerate every combination.
|
**Can be expressed using X for don't care** in tests/exams, do not need to enumerate every combination.
|
||||||
|
|
||||||
Example: "`11X0X`"
|
Example: "`11X0X`"
|
||||||
|
|
||||||
|
@ -295,6 +297,10 @@ Re-remember these identities again for XOR method
|
||||||
| De Morgan's law | $\overline{AB}=\overline A+\overline B$ | $\overline{A+B}=\overline A\cdot\overline B$ |
|
| De Morgan's law | $\overline{AB}=\overline A+\overline B$ | $\overline{A+B}=\overline A\cdot\overline B$ |
|
||||||
| Idempotency | $AA=A$ | $A+A=A$ |
|
| Idempotency | $AA=A$ | $A+A=A$ |
|
||||||
|
|
||||||
|
### Path sensitization
|
||||||
|
|
||||||
|
Make sure to do the workshop question which has a branch after the fault! Understand how to identify the three paths (two single and one multiple).
|
||||||
|
|
||||||
## Timing
|
## Timing
|
||||||
|
|
||||||
$$
|
$$
|
||||||
|
@ -305,6 +311,33 @@ $$
|
||||||
\end{align*}
|
\end{align*}
|
||||||
$$
|
$$
|
||||||
|
|
||||||
|
## Exam study
|
||||||
|
|
||||||
|
### Extra papers
|
||||||
|
|
||||||
|
Past exam papers are not provided, but from my 2024 experience the workshops and past tests are more than adequate for the exam questions.
|
||||||
|
|
||||||
|
If you need more questions, search "**ENGT2301**" on OneSearch. You will find a 2005 paper (note the 2005 deferred has the same questions). There's some obsolete questions involving JK flip-flops, but there's some useful ones on timing, state machines and path sensitization.
|
||||||
|
|
||||||
|
### **2024 EXAM OUTLINE IMPORTANT**
|
||||||
|
|
||||||
|
This was quoted from the final lecture.
|
||||||
|
|
||||||
|
- 5 questions x 20 marks
|
||||||
|
- **1** Testing 25 marks
|
||||||
|
- No _XOR method_ (XOR can be used still for validation)
|
||||||
|
- Path sensitization
|
||||||
|
- **2** Read VHDL (???)
|
||||||
|
- **3** VHDL -> Draw circuit
|
||||||
|
- **4** Circuit -> VHDL
|
||||||
|
- **5** Timing question (practical 5)
|
||||||
|
- 10 marks allocated to general questions
|
||||||
|
- NOTE: In the 2024 examination, calculators were allowed which was useful for the timing questions.
|
||||||
|
|
||||||
|
### Implementation technologies
|
||||||
|
|
||||||
|
- No practice questions, but may have worded questions
|
||||||
|
|
||||||
## Issues with saving file/modifying files not updating the simulation
|
## Issues with saving file/modifying files not updating the simulation
|
||||||
|
|
||||||
The optimizer is once again causing issues.
|
The optimizer is once again causing issues.
|
||||||
|
@ -353,51 +386,6 @@ Alternatively, add `+acc` to `voptargs` if you are using the TCL command line:
|
||||||
vsim $TESTBENCH_ID -voptargs=+acc; add wave *
|
vsim $TESTBENCH_ID -voptargs=+acc; add wave *
|
||||||
```
|
```
|
||||||
|
|
||||||
## Dark mode in intel quartus
|
## Dark mode in Intel/Altera Quartus
|
||||||
|
|
||||||
Run this script I made on windows. [🔗Link](https://github.com/peter-tanner/Intel-Quartus-Dark-Mode-Windows)
|
Run this script I made on Windows. [🔗Link](https://github.com/peter-tanner/Intel-Quartus-Dark-Mode-Windows)
|
||||||
|
|
||||||
## Exam study
|
|
||||||
|
|
||||||
### **2024 EXAM OUTLINE IMPORTANT**
|
|
||||||
- 5 questions x 20 marks
|
|
||||||
- **1** Testing 25 marks
|
|
||||||
- No _XOR method_ (XOR can be used still for validation)
|
|
||||||
- Path sensitization
|
|
||||||
- **2** Read VHDL (??? so probably a delta time question)
|
|
||||||
- **3** VHDL -> Draw circuit
|
|
||||||
- **4** Circuit -> VHDL
|
|
||||||
- **5** Timing question (practical 5)
|
|
||||||
- 10 marks allocated to general questions
|
|
||||||
|
|
||||||
### Implementation technologies
|
|
||||||
|
|
||||||
- No practice questions, but may have worded questions
|
|
||||||
|
|
||||||
Partitioning
|
|
||||||
|
|
||||||
|
|
||||||
> Yeah, you can implement, you know, in any any function,
|
|
||||||
> uh, partition is important to understand why we do partitioning.
|
|
||||||
> I'm not gonna ask you this, OK, because, uh, you
|
|
||||||
> know, some of you may have forgotten this.
|
|
||||||
> Uh, we're going at a bit a bit higher level,
|
|
||||||
> Uh, but it's good to to to to know what
|
|
||||||
> is behind, uh, below the the surface.
|
|
||||||
|
|
||||||
> Uh uh, So there won't be any problems per SE.
|
|
||||||
> It's more, uh, an overview of of of the FPG.
|
|
||||||
> Uh, so I want to ask you to implement, but
|
|
||||||
> I may ask you questions.
|
|
||||||
> You know why, uh, why do we you know, why
|
|
||||||
> would we need a large look up table or whatever?
|
|
||||||
> Any questions?
|
|
||||||
> All right.
|
|
||||||
|
|
||||||
|
|
||||||
PAL > CPLD > FPGA > standard cell > custom design
|
|
||||||
|
|
||||||
### LECTURES TO WATCH
|
|
||||||
|
|
||||||
- [(low-med priority, has a video which might be asked in final) Digital System Design - ELEC2311_SEM-2_2024 / ELEC2311 - 17 Sep 2024, 10:00 - Lecture - Tue 17, Sept](https://echo360.net.au/lesson/G_d242de04-466c-4e5c-90c5-8559bf05817a_f680b162-bea0-4466-ba23-9c4e4e8608f4_2024-09-17T09:58:00.000_2024-09-17T11:52:00.000/classroom)
|
|
||||||
- [(low priority, already tested to success) Digital System Design - ELEC2311_SEM-2_2024 / ELEC2311 - 18 Sep 2024, 09:00 - Lecture - Wed 18, Sept](https://echo360.net.au/lesson/G_cd2b8e85-7208-4aef-bd38-9ec27622ec31_f680b162-bea0-4466-ba23-9c4e4e8608f4_2024-09-18T08:58:00.000_2024-09-18T09:52:00.000/classroom)
|
|
||||||
|
|
|
@ -9,7 +9,17 @@ tags: [rf, electronics, fpga, ebaz4205, max2769, zynq7010, gps, devlog] # system
|
||||||
|
|
||||||
## 🚧🚧 THIS PAGE IS NOT FINISHED 🚧🚧
|
## 🚧🚧 THIS PAGE IS NOT FINISHED 🚧🚧
|
||||||
|
|
||||||
## Notes:
|
## Updates
|
||||||
|
|
||||||
|
### 2024-11-15: First PCB design
|
||||||
|
|
||||||
|
The openGNSS PCB is done! The tab extending down on the left side of the board is to provide a mounting point for the board to mount to the ebaz4205 board if the top mounting points cannot be used, since IREC regulations do not allow use of connectors as mechanical mounting.
|
||||||
|
|
||||||
|
![Top PCB](/assets/img/2024-10-02-Dev-log-GPS-receiver/top.png)
|
||||||
|
|
||||||
|
![bottom PCB](/assets/img/2024-10-02-Dev-log-GPS-receiver/bottom.png)
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
https://github.com/iliasam/STM32F4_SDR_GPS?tab=readme-ov-file
|
https://github.com/iliasam/STM32F4_SDR_GPS?tab=readme-ov-file
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,144 @@
|
||||||
|
---
|
||||||
|
title: SC03-C2H5OH Electrochemical Ethanol/Alcohol Sensor notes
|
||||||
|
author: peter
|
||||||
|
date: 2024-10-20 15:05:45 +0800
|
||||||
|
categories: [Electronics] # 0-2 categories. Blogging | Electronics | Programming | Mechanical | SelfHosting
|
||||||
|
tags: [electrochemical,sensor,electronics,beers,alcohol] # 0-\infty. systems | embedded | rf | microwave | electronics | solidworks | automation | tip
|
||||||
|
# image: assets/img/2024-10-20-SC03C2H5OH-Electroch/preview.png
|
||||||
|
---
|
||||||
|
|
||||||
|
Most alcohol sensor modules use the MQ3 alcohol sensor (or similar), which operate using a metal oxide semiconductor which changes in resistivity when alcohol is exposed to it. These tend to be terrible. The SC03-C2H5OH is the cheapest electrochemical alcohol sensor I could find online, it uses an electrochemical cell which should be better.
|
||||||
|
|
||||||
|
I was able to purchase it in quantities of one on [Aliexpress](https://www.aliexpress.com/item/1005005789802562.html) for around $20 AUD. The package arrived with the sensor and a male-male ribbon cable to connect it to a 2.0 mm picoblade connector (see below for specifications).
|
||||||
|
|
||||||
|
## Better datasheet
|
||||||
|
|
||||||
|
If you email the company listed on the Aliexpress page you will get a datasheet, but it is quite unreadable. It appears this datasheet has been copy and pasted from other similar gas sensors since the commands used to communicate are the same. The datasheet is missing some commands present on other gas sensors (like putting the sensor into polling mode).
|
||||||
|
|
||||||
|
### Product Description
|
||||||
|
|
||||||
|
SC03-C2H5OH electrochemical ethanol module is a general-purpose, miniaturized
|
||||||
|
module. Using the electrochemical principle to detect C2H5OH existing in the air
|
||||||
|
has good selectivity and stability. SC03-C2H5OH is a general- purpose gas module
|
||||||
|
designed and manufactured by combining mature electrochemical detection
|
||||||
|
technology with sophisticated circuit design. It has digital output and analog
|
||||||
|
voltage output, and is suitable for various application circuit schemes.
|
||||||
|
|
||||||
|
### Module Features
|
||||||
|
|
||||||
|
- High sensitivity, high resolution, low power consumption, long service life
|
||||||
|
- Provide UART data output mode
|
||||||
|
- High stability, excellent anti-interference ability, temperature compensation, excellent linear output
|
||||||
|
|
||||||
|
### Main Application
|
||||||
|
|
||||||
|
Alcohol detectors, etc.
|
||||||
|
|
||||||
|
### Specifications
|
||||||
|
|
||||||
|
| Parameter | Value |
|
||||||
|
| ----------------------- | ---------------------------------------------- |
|
||||||
|
| Product Model | SC03-C2H5OH |
|
||||||
|
| Detection gas | Ethanol (alcohol) |
|
||||||
|
| Interfering gases | Carbon monoxide and other gases |
|
||||||
|
| Output data | UART output (3V TTL level) |
|
||||||
|
| Working voltage | 3.7 V - 5.5 V |
|
||||||
|
| Warm-up time | ≤ 5 seconds |
|
||||||
|
| Response time | ≤ 5 seconds |
|
||||||
|
| Recovery time | ≤ 10 seconds |
|
||||||
|
| Range | 0 - 500 mg/100mL (blood alcohol concentration) |
|
||||||
|
| Resolution | ≤ 0.1 mg/100mL (blood alcohol concentration) |
|
||||||
|
| Recovery time(T10) | < 5s |
|
||||||
|
| Working temperature | -20℃ - 50℃ |
|
||||||
|
| Working humidity | 15% RH - 90% RH (non-condensing) |
|
||||||
|
| Storage temperature | 0 - 25℃ |
|
||||||
|
| Service life | 5 years (0℃ - 35℃ in air) |
|
||||||
|
| Module size (L x W x H) | 18.2 mm x 15.2 mm x 6.5 mm |
|
||||||
|
|
||||||
|
### Module dimensions
|
||||||
|
|
||||||
|
TODO:
|
||||||
|
|
||||||
|
### Pin description
|
||||||
|
|
||||||
|
![pinout](/assets/img/2024-10-20-SC03C2H5OH-Electroch/pinout_top.png)
|
||||||
|
|
||||||
|
Header ("Micro JST" (Molex Picoblade) 7 pin, 1.25 mm pitch. [🔗 Example listing](https://www.aliexpress.com/item/1005004032675657.html)):
|
||||||
|
|
||||||
|
| Pin | Function | Direction | Maximum rating |
|
||||||
|
| --- | -------- | --------- | -------------- |
|
||||||
|
| 1 | NC | | |
|
||||||
|
| 2 | NC | | |
|
||||||
|
| 3 | GND | I | |
|
||||||
|
| 4 | VIN | I | 3.7 V - 5.5 V |
|
||||||
|
| 5 | UART_RXD | I | 0 - 3.3 V |
|
||||||
|
| 6 | UART_TXD | O | 0 - 3.3 V |
|
||||||
|
| 7 | NC | | |
|
||||||
|
|
||||||
|
### Protocol
|
||||||
|
|
||||||
|
#### UART settings
|
||||||
|
|
||||||
|
| Baud rate | Data bits | Stop bit | Parity bit |
|
||||||
|
| --------- | --------- | -------- | ---------- |
|
||||||
|
| 9600 baud | 8 | 1 | None |
|
||||||
|
|
||||||
|
#### Checksum calculation
|
||||||
|
|
||||||
|
```c
|
||||||
|
unsigned char get_checksum(unsigned char array[], unsigned char array_size)
|
||||||
|
{
|
||||||
|
unsigned char checksum = 0;
|
||||||
|
for (unsigned char i = 1; i < array_size - 2; i++)
|
||||||
|
checksum += array[i];
|
||||||
|
checksum = (~checksum) + 1;
|
||||||
|
return checksum;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Important notes
|
||||||
|
|
||||||
|
1. Electrolyte leakage may cause damage; do not disassemble the sensor.
|
||||||
|
2. Avoid exposing the sensor to organic solvents (including silicone rubber, adhesives), coatings, pharmaceuticals, oils, or high-concentration gases.
|
||||||
|
3. Electrochemical sensors should not be fully encapsulated in resin or placed in oxygen-free environments, as this will damage the sensor and affect its performance.
|
||||||
|
4. Do not use electrochemical sensors in environments with corrosive gases for extended periods, as these gases can damage the sensors.
|
||||||
|
5. Gas zero-point measurements must be conducted in a clean atmosphere.
|
||||||
|
6. When testing or using the sensor, avoid direct vertical air intake from the front.
|
||||||
|
7. Do not block or contaminate the air inlet surface of the sensor.
|
||||||
|
8. Do not open or damage the waterproof and breathable membrane on the sensor.
|
||||||
|
9. The sensor must not be subjected to excessive shock or vibration.
|
||||||
|
10. Do not use the sensor if the casing is damaged or deformed.
|
||||||
|
11. After prolonged exposure to high-concentration gases, the sensor will recover slowly to its original state.
|
||||||
|
12. During storage, the anode and cathode should remain short-circuited.
|
||||||
|
13. Do not encapsulate the sensor using hot melt adhesive or sealant that cures at temperatures above 80 °C.
|
||||||
|
14. Avoid storing or using the sensor in high-concentration alkaline gas for extended periods.
|
||||||
|
|
||||||
|
## Reverse engineering
|
||||||
|
|
||||||
|
This configuration appears to be copy-pasted between a lot of these gas sensors on Alibaba/Aliexpress. The commands/output data format are also the same between most of these sensors. The PCB layouts are also very similar, but sometimes differ for some reason. For example, the picoblade connector is sometimes omitted, and others use 2.54 mm headers instead of the 2.00 mm headers on this sensor.
|
||||||
|
|
||||||
|
### Linear regulator
|
||||||
|
|
||||||
|
MICRONE(Nanjing Micro One Elec) type regulator, marking on the top of the regulator `S2UD`
|
||||||
|
|
||||||
|
Similar to [this one.](https://www.lcsc.com/product-detail/Voltage-Regulators-Linear-Low-Drop-Out-LDO-Regulators_MICRONE-Nanjing-Micro-One-Elec-ME6211C33M5G-N_C82942.html)
|
||||||
|
|
||||||
|
### Microcontroller
|
||||||
|
|
||||||
|
`CX32L003F8` (STM32 clone)
|
||||||
|
|
||||||
|
Used to digitize signal and format it for UART.
|
||||||
|
|
||||||
|
It may be programmed over SWD interface through the 2.00 mm headers.
|
||||||
|
|
||||||
|
### Operational ampplifier
|
||||||
|
|
||||||
|
`GS8552`
|
||||||
|
|
||||||
|
???
|
||||||
|
|
||||||
|
### Headers
|
||||||
|
|
||||||
|
2.00 mm headers
|
||||||
|
|
||||||
|
Header ("Micro JST" (Molex Picoblade) 7 pin, 1.25 mm pitch. [🔗 Example listing](https://www.aliexpress.com/item/1005004032675657.html)):
|
|
@ -52,6 +52,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
- ENGT4301 Digital Communications and Networking
|
- ENGT4301 Digital Communications and Networking
|
||||||
- ELEC3302 Communications Systems
|
- ELEC3302 Communications Systems
|
||||||
- Note that ELEC5501 Advanced Communications is a different unit.
|
- Note that ELEC5501 Advanced Communications is a different unit.
|
||||||
|
- To be honest, you select (relevant) questions from these for class test study as well.
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Listing of examination papers on OneSearch</summary>
|
<summary>Listing of examination papers on OneSearch</summary>
|
||||||
|
@ -71,6 +72,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
- This formula sheet will attempt to condense all processes/formulas you may need in this unit.
|
- This formula sheet will attempt to condense all processes/formulas you may need in this unit.
|
||||||
- **You do not get given a formula sheet**, so you are entirely dependent on your own notes (except for some exceptions, such as the $\text{erf}(x)$ table). So bring good notes.
|
- **You do not get given a formula sheet**, so you are entirely dependent on your own notes (except for some exceptions, such as the $\text{erf}(x)$ table). So bring good notes.
|
||||||
- Doing this unit after signal processing is a good idea.
|
- Doing this unit after signal processing is a good idea.
|
||||||
|
- Try to practice questions from the exam papers on OneSearch mentioned above before class test, since you don't get past questions for the tests.
|
||||||
|
|
||||||
|
### Final exam 2024
|
||||||
|
|
||||||
|
As quoted from the lectures:
|
||||||
|
|
||||||
|
- No short questions
|
||||||
|
- 10 calculation questions
|
||||||
|
- From exam front page: Any printed or written material (e.g. dictionaries, textbooks, statutes, cases, legislation, annotations, lecture notes, tutorials with solutions, notes) except UWA Library books. Photocopied or printed eBook of a textbook is permitted.
|
||||||
|
- So yes you can still bring as many papers as you want to the final, unlike in signals and systems/signal processing where the final only allowed two pages.
|
||||||
|
|
||||||
## Printable notes begins on next page (in PDF)
|
## Printable notes begins on next page (in PDF)
|
||||||
|
|
||||||
|
|
BIN
assets/img/2024-10-02-Dev-log-GPS-receiver/bottom.png
Normal file
BIN
assets/img/2024-10-02-Dev-log-GPS-receiver/bottom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 290 KiB |
BIN
assets/img/2024-10-02-Dev-log-GPS-receiver/top.png
Normal file
BIN
assets/img/2024-10-02-Dev-log-GPS-receiver/top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 341 KiB |
BIN
assets/img/2024-10-20-SC03C2H5OH-Electroch/pinout_top.png
Normal file
BIN
assets/img/2024-10-20-SC03C2H5OH-Electroch/pinout_top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 696 KiB |
9
assets/lib/2024-10-20-SC03C2H5OH-Electroch/checksum.c
Normal file
9
assets/lib/2024-10-20-SC03C2H5OH-Electroch/checksum.c
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
unsigned char get_checksum(unsigned char array[], unsigned char array_size)
|
||||||
|
{
|
||||||
|
unsigned char checksum = 0;
|
||||||
|
for (unsigned char i = 1; i < array_size - 2; i++)
|
||||||
|
checksum += array[i];
|
||||||
|
checksum = (~checksum) + 1;
|
||||||
|
return checksum;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user