Data Logger using STM32 || ESP8266 || Thingspeak

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everyone welcome to the IOT section of controllers tech today in this video we will see how to use stm32 to log data to the things speak server using esp8266 let's first start by creating the project in cube IDE I am using nuclear 4 4 6 ar e for this project give some name and click finish here is our cube M X first I am selecting external crystal for the clock next I am selecting an ADC which will be used to read the potentiometer data changing the resolution to ten bits even if you don't enable continuous conversion it should be fine because I am going to use the pole for conversion method so continuous conversion is not required leave everything else to default now enable the UART with interrupt this is where the esp8266 will be connected let's set up the clock now I have eight megahertz crystal and I want the system to run at maximum frequency [Music] click Save to generate the project [Music] let's include the library's first I am going to use the ring buffer library and data logger library put the source and the header files in the respective folders click refresh and you can see the files here in our project let's take a look at the ring buffer dot C file here you can change the UART that you are using copy this function from here and paste it in the interrupt dot C file also we need to modify our UART Handler and comment out the original one [Music] [Music] let's take a look at the data logger dot C file now [Music] ESP in it takes the SSID and password as the parameter ESP send data sends the data to a particular filed label the parameters are self-explanatory here here you have to give the label of the field such as either 1 or 2 or 3 etc this is the one I am going to use it sends data to multiple fields at once let's first go to the things speak register yourself or log in click on channels then click new channel give some name to this channel I am going to use for fields in this channel [Music] we can modify these names also I will quickly modify others too you can see the modified names remember that field label number is the one that we need while sending data let's start include the data logger dot H I will write a function to get the ADC value this includes start a DC pole for conversion get the value and stop a DC let's define the variables that we are going to use also a buffer to stall the four values inside the main function first of all initialize the ESB with the SSID and password now in the while loop we will get the value of ADC then convert this value to the voltage [Music] and at last increment the count variable now we will store these values in the respective position in value buffer [Music] you [Music] and send these values to the sever now here we need the API key go to your channel click API key and copy write API key I have for number of fields so enter 4 here and pass the value buffer give a delay of 15 seconds minimum things feed server will not update the data if we send it within 15 seconds let's build and debug our program [Music] I am adding the variables in the live expression [Music] let's run it now [Music] [Music] [Music] you can see the first entry in the things speak now I am rotating the potentiometer so the ADC value will change [Music] you can see the new entries now also note the values of count and count times two [Music] everything is as par with the values we have in the live expression [Music] this data will keep updating every 15 seconds [Music] [Music] [Music] this is it for the video guys this program uses the 80 commands so any ESP module that supports 80 commands will work you can download the code from the link in the description be safe and have a nice day
Info
Channel: ControllersTech
Views: 31,881
Rating: undefined out of 5
Keywords: stm32, f4, f103, data, logger, esp, 8266, wifi, thingspeak, example, server, iot, uart, ring, buffer
Id: FRAlFSaYb8c
Channel Id: undefined
Length: 10min 7sec (607 seconds)
Published: Sat Jun 13 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.