-
1Register for a free web hosting service
You don't actually need a free web hosting service if you are willing to pay for one. I personally used 000webhost.com, but you can use any web hosting service that provides PHP and MySQL.
-
2Set up a database on your web site
This example is valid for 000webhost.com, but the procedure should be very similar for any free webhost.
- Login to the web host admin page.
- Click on the icon "Manage database".
- Click on the button "New database".
- Enter a database name, for example "data" with a username and password for management of this database.
- You will be shown a list of your databases with the full name, for example id1234567_data. Remember this name, it will be needed later.
- Beside id1234567_data, click on Manage->PhpMyAdmin to manage the database.
- Click on the tab "SQL". Paste in the following text (after changing id1234567 to the correct user id) and click "Go".
-- Create a table "Info" which contains columns "Time" and "Voltage" in database "data" -- Remember to change id1234567 to the correct user id SET time_zone = "+00:00"; CREATE TABLE id1234567_data.Info ( Time datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, Voltage text COLLATE utf8_unicode_ci NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ALTER TABLE id1234567_data.Info ADD PRIMARY KEY (Time), ADD KEY Time (Time);
If you have any problems, click on the tab "Structure" and enter the above options using the graphical interface.
-
3Upload files to your website
This example is valid for 000webhost.com, but the procedure should be very similar for any free webhost.
- Login to the web host admin page.
- Click on the icon "File Manager".
- Click on the button "Upload files now".
- Click on the upload button (up arrow) to upload index.html and newdata.php
- Right-click on the file .htaccess, select "Edit" and add the following text to the end of the .htaccess file (it allows the PHP in index.html to be executed automatically)
<Files index.html> AddType application/x-httpd-php .html Files>
-
4Test your website
Use a web browser to visit yourWebsiteName.000webhostapp.com
You should see the message "0 results".
Use a web browser to visit yourWebsiteName.000webhostapp.com/newdata.php?voltage=12.3
You should see a blank page.
Use a web browser to once more visit yourWebsiteName.000webhostapp.com
You should one line of data with a timestamp and a voltage "12.3".
-
5Loading software to Arduino
Using a serial adaptor, connect a PC to the GND, RX and TX pins of the Arduino.
Use the Arduino IDE to edit the INO file. At the top of the file, set the web address for the website where the data should be stored.
Use the Arduino IDE to send the INO file to the Arduino.
-
6Hardware assembly
Warning: The SIM800L module can tolerate a maximum of 4.5 volts as a power supply. Before connecting the power supply, adjust the voltage to 4.1 volts (assuming you are using an adjustable power supply).
Warning: The SIM800L module needs a lot of current (2 Amps) while registering to a GSM network. If the LED on the SIM800L flashes approx 8 times and then seems to reset, you have a power supply problem.
You can use a simple PCB or just loose cables to join the components. Refer to the diagram in wiring.png.
- Battery + to Power Supply IN+ and to one end of resistor divider.
- Battery - to Power Supply IN-.
- Power Supply OUT- to Arduino GND and to SIM800L GND and to other end of resistor divider.
- Power Supply OUT+ to Arduino Vcc and to SIM800L Vcc.
- Arduino D2 to SIM800L RESET.
- Arduino D3 to SIM800L TX (not actually used, so this is optional).
- Arduino D4 to SIM800L RX.
- Arduino A3 to resistor divider.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
I am having a real tough time with steps 2 and 3. When I follow the steps I do not have an index or newdata file. I only have htaccess. Do I need to create a website with a template first?
Thank you,
Anthony
Are you sure? yes | no