CE 351 Spring 2023
Lab 4 Various Things
Interfacing various displays with various sensors.
This lab uses a thermistor,
humidity sensor, and temperature module to measure variables as well as
an arduino uno and a bunch of wires. The lab also requires a 4-digit
seven-segment display and a liquid crystal display.
Methods: The LCD was first
wired per the given schematic and the example code was modified to
modulus the seconds since run by 6 to prevent a 6 from appearing on the
screen. This removes the need for an if statement and should run
slightly faster. The code block can be seen in Figure 1.
Figure 1. Code to display hello world and count to 5 before resetting to 0.
A video of the functioning ciruit can be seen Youtube Video Here.
I was forced to upload all of my videos as youtube shorts. I didn't
realize this would cause an embedding issue until I started writing
this. I'll figure out the embedding for next submission.
The circuit was then programmed to scroll by offsetting the cursor each iteration as seen here.
The thermistor was then connected and programmed to display the temperature on the LCD as seen in Figure 2.
Figure 2. Thermistor readout to LCD.
DHT11 temperature and humidity sensor was then wired into the circuit
to replace the thermistor and can be seen in the test video here.
IR sensor then was wired to the circuit to read the signals from the
remote. The signals had to be tested to fill in the switch cases to map
the buttons to the right outputs. My remote was pretty broken
outputting 0xFFFFFFF for almost all buttons and would often happen on
the few buttons that did work. I eventually got a few buttons working
which can be seen here.
the ATMEGA328P was used without the arduino PCB shield that is typical.
I also had issues getting the programming to work with it often giving
desync errors. The demo blink can be seen in the video here.
programming the controller for the interupt it started to not allow me
to program it through the rtx pins causing me to try plugging the chip
back into the uno casing. This turned out to be a mistake that lead to
the 16th pin to snap off. I tried to solder it but the chip refused to
work after this. I am going to try and demo it in the morning and
upload a video here.
The code for the interupt can be seen below in Figure 4.
Figure 4. Interupt Code.
code is pretty simple combining the interupt with the humidity and 7
Segment Display code. Basically it collects data and resets the seven
segment display number constantly and then only update the seven
segment display once the interupt is called. I wanted to put the whole
data collection in the interupt using global volatile variables but the
DHT11 sampling failed too frequently for this method to be viable.
Instead the failed connections can be dismissed because it is being
called 3-4 times per interupt and as such only updates on a succesful
call. Finally, my messy wiring for the circuit can be seen below in
I was having issues with the wires not making propper connections a lot of the time and messing with the circuit.
Figure 5. Super messy SSD and Humidity wiring.