Home Final Project Week 1 Week 2a Week 2b Week 3 Week 4 Week 5 Week 6 Week 7 Week 8 Week 9 Week 10 Week 11 Week 12 Week 13 Week 9: Programming - Input Devices
Week 9: Programming - Input Devices
9.1 Introduction
After experiencing difficulties inducing a magnetic field in Week 7, I opted to incorporate a Hall Effect sensor into my microcontroller board to further assist with final project design concepts. Previously, Anthony provided me a prefabricated Hall Effect sensor that used Texas Instruments' DRV5055 Ratiometric Linear Hall Effect sensor, which is a single axis magnetic field sensor that can be operated by 3.3 V or 5 V. The typical schematic and component diagram below are from the component’s datasheet.


9.3 Receiving an Input
I was running a little behind on work this week, because I missed the memo on fabricating your own sensor, which is obviously the moto the class, ‘Make it, don't buy it’. After using the code I wrote for this week, I recognized it was horribly inefficient due to the LED delay command. I incorporated the blinking LED function to provide visible reassurance that the microcontroller was programmed. In hindsight, I should have just removed the LED function or used a 'while' command for reading the Hall Effect sensor.

Prior to being able to receive an input from the Hall Effect sensors, I had to power to them. I failed to break out VCC legs on my board during the design phase, so to power the sensors I had to use microcontroller pins or add jumper wires. The DVR sensor only required 3.3 V, so I could have set one of the microcontroller pins I did break out to power it, but instead opted to add a jumper wire. The Allegro sensor required 5 V, so I have to solder on a jumper upstream from the board's 3.3 V voltage regulator.

The below serial plotter images are the result of changing proximity and polarity of a N42 permanent magnet. The DVR sensor appeared to perform better with little to no apparent hysteresis after changing polarity. In the future I would like to refine input of these sensor by applying a moving average filter, as demonstrated during this week's recitation.

DVR Hall Effect Sensor

Allegro Hall Effect Sensor (Own Fabrication)

Using a power supply to energize different electromagnets, I used my sensor to measure the relative strengthen of the induced magnetic field from each electromagnet. To see the results of this testing please visit my Final Project page here.


9.5 Takeaways