This is an update on where my project is at.
My initial intent was to rebuild a line follower that I did back like 8 years ago; but using the MiniZed. The board is very well suited for this application - the PL (FPGA) can do all the grunt work of reading dual wheel encoders, running a control loop to feed a PWM signal back to the motors. Since the board offers a whole host of other goodies like the MuRata bluetooth & Wifi module, then a web interface could be added. We could use the microphone and the accelerometer for all sorts of useful things like to fire a warning if the tilt increases too much.
My old line follower:
Due to time constrains and the learning curve, I am reducing my scope to just one of the control systems. I am working on just the portion of the line follower which will read the analog feedback for the line detector. I built a simple sensor array with LEDs and LDRs (photo-resistors). The ADC chosen is the ADS1115 breakout board from Adafruit. This runs over the I2C bus and has an address of 0x4A when the ADDR pin is tied to the SDA which I have done.
Here is my pile of components and a shroud I 3D printed to isolate the light by each sensor; with each LDR paired with an LED to provide a controlled light source. Yes - that is not actually my ADC chip; it is a different I2C chip I had handy when I started but before the other parts came in...
The premise of the sensor array is a simple voltage divider. The LDR (light sensor) is just a variable resistor whose resistance decreases with the amount of light. By paring this with another fixed value resistor (10K in my case) we create a voltage divider circuit. The LDR is on the top of the divider; which causes the voltage to increase proportional to a light level increase. So more light = higher voltage. Less light = Lower voltage.
According to Lab 9, the correct I2C port that I would use is axi_iic_0. We also have axi_iic_1 (PMOD1), axi_iic_2 (PMOD2), and the Zync's own native I2C as options; although we never enabled the Zync I2C hardware in Vivado.
Here is the analog signals of my sensor array as I pass my finger above the sensors.
The idea is pretty simple here - Find the sensor with the strongest response and that's where the line is. You can even compare to its neighbors since there is some overlap; and get a more precise location; when using something like electrical tape on white paper.
I've spent the last few days trying to get up to speed on using the regular I2C. The Pmod headers use a slightly different setup with what appears to be differential pairs. I tried scoping the lines during the last SW lesson but couldn't get any response from them - none of the PMOD pins read anything. I am working to find some example code for the axi_iic_0 port which comes out the SDA/SCL pins on the Arduino style header and there doesn't seem to be much out there.
Any help out there?
So my first question for the community is - Does my hardware look correct from this screenshot? This was made as per the lessons, but it seems like i'm missing some physical connections.
Any example code I've found so far is either for PMOD headers and/or other boards like the PicoZed or ZedBoard.
Here is a quick video update:
More updates to come!