diff options
author | thing1 <thing1@seacrossedlovers.xyz> | 2025-05-01 12:07:41 +0000 |
---|---|---|
committer | thing1 <thing1@seacrossedlovers.xyz> | 2025-05-01 12:07:41 +0000 |
commit | 10d3793dd58f5c85e9a1be331afc3a08922c0f38 (patch) | |
tree | bdee1f883b6d03abbba8a79260422267c2fa1f15 | |
parent | 32b9a010a24570a131cc5c9521b8e76102e9cd38 (diff) |
woowwwwwwwwwwwwwwwwww
-rw-r--r-- | comp/work/55/rle.py | 28 | ||||
-rw-r--r-- | comp/work/56/starter | 25 | ||||
-rw-r--r-- | electronics/cw2/diagrams/amde.png | bin | 0 -> 22908 bytes | |||
-rw-r--r-- | electronics/cw2/diagrams/blockdiagram.png | bin | 85624 -> 114376 bytes | |||
-rw-r--r-- | electronics/cw2/diagrams/pics/feh_017477_000001_final.jpg | bin | 0 -> 841356 bytes | |||
-rw-r--r-- | electronics/cw2/diagrams/pics/final.jpg | bin | 0 -> 4435368 bytes | |||
-rw-r--r-- | electronics/cw2/diagrams/volboost2.png | bin | 0 -> 54331 bytes | |||
-rw-r--r-- | electronics/cw2/timetable.org | 8 | ||||
-rw-r--r-- | electronics/cw2/writeup.tex | 87 | ||||
-rw-r--r-- | electronics/notes/wireless.ms | 35 | ||||
-rw-r--r-- | electronics/work/ppq2019.ms | 87 |
11 files changed, 231 insertions, 39 deletions
diff --git a/comp/work/55/rle.py b/comp/work/55/rle.py index c2c43da..a8c88ea 100644 --- a/comp/work/55/rle.py +++ b/comp/work/55/rle.py @@ -1,30 +1,12 @@ def rle(s): - en = "" - c = s[0] - cc = 0 + en, c, cc = "", s[0], 0 for i in s: if i == c: cc += 1 else: - en += (c if (cc == 1) else str(cc) + c) - c = i - cc = 1 - en += (c if (cc == 1) else str(cc) + c) + en += (c if (cc == 1) else c + str(cc)) + c, cc = i, 1 + en += (c if (cc == 1) else c + str(cc)) return en -def rld(s): - de = "" - cc = "" - c = '' - for i in s: - if i.isdigit(): cc += i - else: - c = i - if not cc.isdigit(): cc = "1" - de += c * int(cc) - cc = "" - - return de - - -print(rld(rle("abbbcccd"))) +print(rle("abbbcccd")) diff --git a/comp/work/56/starter b/comp/work/56/starter new file mode 100644 index 0000000..7915931 --- /dev/null +++ b/comp/work/56/starter @@ -0,0 +1,25 @@ +--------------------------- +insert into Sales +values ( + 4072, + 48, + "29/9/2024" +) + +2 marks +--------------------------- + +--------------------------- +update Product +set quantity = quantity - 3 +where ProductID = 1 +--------------------------- + +--------------------------- +SOMETHING +--------------------------- + +--------------------------- +slow + +--------------------------- diff --git a/electronics/cw2/diagrams/amde.png b/electronics/cw2/diagrams/amde.png Binary files differnew file mode 100644 index 0000000..a4e878c --- /dev/null +++ b/electronics/cw2/diagrams/amde.png diff --git a/electronics/cw2/diagrams/blockdiagram.png b/electronics/cw2/diagrams/blockdiagram.png Binary files differindex 6bcef5b..491783a 100644 --- a/electronics/cw2/diagrams/blockdiagram.png +++ b/electronics/cw2/diagrams/blockdiagram.png diff --git a/electronics/cw2/diagrams/pics/feh_017477_000001_final.jpg b/electronics/cw2/diagrams/pics/feh_017477_000001_final.jpg Binary files differnew file mode 100644 index 0000000..d8b98ba --- /dev/null +++ b/electronics/cw2/diagrams/pics/feh_017477_000001_final.jpg diff --git a/electronics/cw2/diagrams/pics/final.jpg b/electronics/cw2/diagrams/pics/final.jpg Binary files differnew file mode 100644 index 0000000..59e41cd --- /dev/null +++ b/electronics/cw2/diagrams/pics/final.jpg diff --git a/electronics/cw2/diagrams/volboost2.png b/electronics/cw2/diagrams/volboost2.png Binary files differnew file mode 100644 index 0000000..dab67a3 --- /dev/null +++ b/electronics/cw2/diagrams/volboost2.png diff --git a/electronics/cw2/timetable.org b/electronics/cw2/timetable.org index e8e1872..e3b1d87 100644 --- a/electronics/cw2/timetable.org +++ b/electronics/cw2/timetable.org @@ -1,8 +1,2 @@ * things left to do: -- alternative sub systems (complete on friday) -- realisation (start on friday) done -- evaluation (weekend) -- more words on the testing section (next week) -- better system anaylis (next week) -- hand in (next friday) - + add photo diff --git a/electronics/cw2/writeup.tex b/electronics/cw2/writeup.tex index 6e69089..8204cc4 100644 --- a/electronics/cw2/writeup.tex +++ b/electronics/cw2/writeup.tex @@ -35,7 +35,7 @@ showspaces=false, showstringspaces=false, showtabs=false, - tabsize=8 + tabsize=8, } \lstset{style=mystyle} @@ -182,20 +182,29 @@ This system will convert the AM wave to a unmodulated regular wave, it will also To test this I will put in a modulated sine wave into it and confirm that I receive the original wave as an output. Yet again I will use and oslioscope to test the two traces against each other. Because I would expect this to produce a very different output wave from the input, I will not make a diagram for this, however I would expect the output to look like this. - \begin{center} \includegraphics[width=\textwidth]{diagrams/AM-demod.png} \end{center} -\subsubsection{The volume boost amplifier} % perhaps show an alternative for here + +This could have been replaced with an active system to achieve the same output, The active system may have had less bouncing on the output wave. The alternative would have looked like this. + +\begin{center} + \includegraphics[width=0.5\textwidth]{diagrams/amde.png} +\end{center} + +I choose not to use this as my system already had many op amps, and I didn't want to use them exclusivly. + + + +\subsubsection{The volume boost amplifier} This is just another op amp, but with different resistor values. Here is its circuit diagram: \begin{center} \includegraphics[width=0.5\textwidth]{diagrams/volume boost amplifier.png} \end{center} -Like the previous amplifier it can be tested by putting into a wave into it and checking it was multiplied by the correct gain. - +Like the previous amplifier it can be tested by putting into a wave into it and checking it was multiplied by the correct gain; I will use the following table to check if it is operating correctly. \begin{center} \begin{tabular}{ |c|c| } \hline @@ -209,6 +218,14 @@ Like the previous amplifier it can be tested by putting into a wave into it and \end{tabular} \end{center} +This could have been replaced with the following alternative: + +\begin{center} + \includegraphics[width=0.5\textwidth]{diagrams/volboost2.png} +\end{center} + +This would have performed some smoothing on the audio and thus produced a less noisy output, it would also have added volume control capabilitys to the system. I however choose against using this, as i did not have access to the kind of op amp requred to build it. + \subsubsection{The audio normalisation filter} This is a filter that will only show the peaks of the output from the previous systems, this will allow the micro controller to properly poll the input for the next subsystem. Here is its circuit diagram: @@ -241,6 +258,8 @@ This system will massively boost the current of the input, which will make it au To test this system, I can measure the current in and the current out, and see how the compare. +As an alternative to this section, I could have used it without the feedback op amp, however I choose to use the version I did to avoid the signal crossover that you get when using without the op amp. The output signal would be flat when the input signal is crossing into the negative zone, this would make my audio sound choppy as it will have sections cut out of it. + \subsection{Full block diagram} % put a full block diagram here \begin{center} @@ -473,6 +492,31 @@ Below is a repeat of my circuit diagram, to compare against later. \end{center} \subsection{Circuit realisation} % show the actual thing, describe colour coding, etc. etc. +Here is my final finished project built on my board. + +\begin{center} + \includegraphics[width=\textwidth]{diagrams/pics/final.jpg} +\end{center} + +I attached the large inductor to the yellow wire on the bread board. + +I had live (+15v) to the red wire. + +I had ground (0v) to the green wire. + +I had negative (-15v) to the black wire. + +In this photo, I am using a resisotr to represent the speaker for testing purposes. + +I decided to use a ribon cable to attach my bar graph to avoid the need to route them inbetween the micro controller and casing. + +My colour coding had anything that went to a power rail in red, and anything that connected components in white. (I relised this makes my circuit hard to follow at too late a stage to fix it). + +\subsection{Connecting the sub systems} +While testing my project I found I had multiple loading effects. I had one cause by the large inductor and capacitor, and another caused bt the demodulation system. To fix these I used large resistor values on the following systems to avoid the need to use a volatge follower. + +There however was alot more work that was needed to connect the micro controller, as this required 5v to power it. I first tried using just a potential divider to power it, however this caused a loading effect to the power input. To fix this I placed the output of the potential divider into a voltage follower, and then into the power rail of the micro controller, and this made the system work as intended. + \subsection{Circuit results} % prove the whole thing works from start to finish To test my system I put a number of different frequencies through the system, and I confirmed that the output frequency matched the input. The frequencies are passed into an antenna inside the room I was testing, and then is picked up by the receiver, and passes through the entire system. The outputs are measured from the output of the push pull power amp. @@ -517,12 +561,31 @@ Here is the scope trace of the input at 3.3Khz. \includegraphics[width=\textwidth]{diagrams/pics/finaloutput.jpg} As the trace shows, it is negative, a DC offset has been applied. I originally believed, that my amplifiers were causing the signal to be negative as they are inverting, however I have an even amount of them so it wasn't them. I then realised that it had to be a DC offset. I fixed it but putting a capacitor before the input, however I removed this as it was distorting the input signal. It doesn't have any effect on the output as the speaker still moves in the same way. - -\subsection{User Manual} % did it work, how well, compare to original goal \section{Evaluation} -Here is a repeat of my design objectives to compare against: +\subsection{User Manual} +\begin{center} + To use my project one needs to do the following. + + Power the device using a 15v power supply or battery. + + Ensure the antena is in a reasonable location, preferably somewhere high up. + + Listen to the output. + + Look at the bar graph to see an intensity of the sound. +\end{center} +As my project does not receive user input in any way, it is quite simple to use. +\subsection{Safety Guide} +\begin{center} + To use this product safely they must avoid touching the battery/power supply, as the push pull power amp can cause large current draws, which if touched could cause a nasty electric shock. This should not be an issue however as the device would be placed in an enclosure when used. + + One should also be careful with the large inductor that is used as an antena, this is heavy, and thus it should be treated with caution. +\end{center} + \begin{center} +Here is a repeat of my design objectives to compare against: + \begin{tabular}{ |c| } \hline objective \\ @@ -567,11 +630,17 @@ This shows that I have achieved all of my design goals. \subsection{What went well?} My system worked as intended, it did play the input signal, through the speakers, atfer passing through all the subsystems and the speaker. For this I believe I made a good project. -\subsection{What didn't go well?} +\subsection{What didn't go well, what would I improve next time?} My colour coding for my system was not ideal, I believe it was too generic and would have benififted from using multiple colours for each sub system. I would have prefered to use a less noisy alternative to the push pull power amp, as my system outputed a large amount of static. I would have prefered to use FM rather than AM, as this would reduce the noise; making the device better. + +The micro controller + bar graph often resulted in a flickering output, which was still perfectly usable, however ideally would be moreconstant, this could have been fixed by using a faster micro controller with a faster ADC. + +\subsection{Safety while building and designing the system} +Because my system was made with the high current push pull power amp, I needed to be careful from the heat they gave off. They gave of heat when a constant input wave was used for too long, mostlikely because the transistors used were disipating too much current. To keep my self save while building i decided to change how the system was layed out on my board. I made it so the top and bottem halfs of the board had 1 transistor each, which gave me enough room to put things between them, without touching them. This is apposed to the style of design, where you have both on the same half of the board, which makes them very close. Also to avoid damaging compontets in this situation, I added heat sinks to each of them to make it take longer for heat to become a damaging factor, allowing for small constant pulses of constant waves. } \end{document} + diff --git a/electronics/notes/wireless.ms b/electronics/notes/wireless.ms new file mode 100644 index 0000000..3e2f996 --- /dev/null +++ b/electronics/notes/wireless.ms @@ -0,0 +1,35 @@ +.TL +Wireless coms +.AU +Lucas Standen +.AI +QMC +.2C + +.EQ +delim @@ +.EN +.EQ +delim @# +.EN + +.NH 1 +Recap +.LP +Digital coms comunicating using a PISO to a SIPO + +Anolog coms comunicate using AM and FM + +You need to think about noise, SNR and attenuation + +.NH 1 +Wireless +.NH 2 +Types +.LP +There are many types of signal, for example radio, wifi, bluetooth, tv + +They all work with EM radiation. + +We can visualize waves over time and comapare amplited to make a graph. + diff --git a/electronics/work/ppq2019.ms b/electronics/work/ppq2019.ms new file mode 100644 index 0000000..26ba112 --- /dev/null +++ b/electronics/work/ppq2019.ms @@ -0,0 +1,87 @@ +.TL +Electronics ppq 2019 1 +.AU +Lucas Standen +.AI +QMC + +.2C + +.LP +1)a) +.PS +line "" "A + B"; +.PE +1)b) +.TS +center allbox tab(@); +L | L | L | L | L | L | L +- - - - - - - +N | N | N | N | N | N | N . +C @ B @ A @ X @ Y @ Z @ Q +0 @ 0 @ 0 @ 1 @ 1 @ 0 @ 1 +0 @ 0 @ 1 @ 1 @ 0 @ 0 @ 0 +0 @ 1 @ 0 @ 0 @ 1 @ 0 @ 1 +0 @ 1 @ 1 @ 0 @ 0 @ 0 @ 0 +1 @ 0 @ 0 @ 1 @ 1 @ 1 @ 1 +1 @ 0 @ 1 @ 1 @ 0 @ 1 @ 1 +1 @ 1 @ 0 @ 0 @ 1 @ 0 @ 1 +1 @ 1 @ 1 @ 0 @ 0 @ 0 @ 0 +.TE +.LP +2)a) +.PS +"A+B" +.PE + +.PS +"" "(" +move 0.05; +line 0.1 "" "A"; +"" "." +move 0.05; +line 0.1 "" "B"; +"" "." +move 0.05; +line 0.1 "" "C"; +move 0.05; +"" ")" + +move 0.1; +"" "+" +move 0.1; +"" "(" +move 0.05; +line 0.1 "" "A"; +"" "." +move 0.05; +"" "B"; +move 0.05; +"" "." +move 0.05; +line 0.1 "" "C"; +move 0.05; +"" ")" + +move 0.1; +"" "+" +move 0.1; + +"" "(" +move 0.05; +"" "A"; +move 0.05; +"" "." +move 0.05; +line 0.1 "" "B"; +"" "." +move 0.05; +"" "C"; +move 0.05; +move 0.05; +"" ")" + + +.PE + + |