The code for the hall effect current sensor has been posted on github. It is a micropython file for executing on a raspberry pi pico w.
The main idea of the code is that a timer executes every 1 millisecond. Each time the timer executes, it will take an ADC measurement.
There is a simple wireless webserver, so you put the sensor wherever you want, and then ask it to take some measurements, and then download them.
To ask it to take the measurements, you can use a browser and set the URL to ?GO_ADC?
Then, you can get the measurements (256 samples, spaced at 1 millisecond) with ?ADC_VAL?
Then, you can copy and paste into your favorite plotting tool.
I also added a triggering function so that, when activated, it will start taking data if the ADC reading is above or below a threshold (you can ask for the values with ?TRIGGER_HIGH_SET? and ?TRIGGER_LOW_SET?, and set them, for example, with ?TRIGGER_HIGH_SET=25000TRIGGER_HIGH_SET?
The code also supports serving up webpages, pictures, etc. For example, I created "favicon.ico" (which is just a .png file called favicon.ico that is stored on the raspberry pi pico.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.