A collection of all my Arduino Projects
Important Links -
- https://iotbytes.wordpress.com/
- https://learn.sparkfun.com/tutorials/tags/internet-of-things?page=all
- https://blog.adafruit.com/category/iot/
- https://nurdspace.nl/ESP8266
- https://github.com/esp8266/Arduino
- https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/introduction
- http://randomnerdtutorials.com/getting-started-with-esp8266-wifi-transceiver-review/
- https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/overview
- http://iot-playground.com/component/tags/tag/11-esp8266
- https://www.hackster.io/search?q=ESP8266
- http://hackaday.com/2015/03/18/how-to-directly-program-an-inexpensive-esp8266-wifi-module/
Simple Blink LED's (https://github.com/tangowhisky37/ArduinoProjects/tree/master/Blink_LEDs)
- This program simply blinks LED's (Blink_LEDs/Blink3LEDs)
- Connections for this circuit include :
- Connect the Digital pins on the Arduino to the LED.
- On the MEGA 2560, D0 is Rx0 and D1 is Tx0. You will need to use D2 onwards.
- A sample connection would include - D2 to Anode (Longer leg), 50 Ohm Resistor in line with Anode.
- Cathode (Shorter leg) connects to the ground rail on the Breadboard.
- You can use a Male to Male cable to connect the Arduino Ground, to the Ground rail on the Breadboard.
- Connect up as many LED's you want to connect. Use different colors.
- Hardware required includes :
- Arduino MEGA 2560 R3 (You can choose your own version of the Arduino)
- Coloured LED's
- Breadboard for building the circuit
- Dupont Male to Male wires
- 50 Ohm Resistors
- Software required includes :
- Arduino Development IDE
- Links to read up on with regards to programming the Arduino from the Raspberry Pi
Blink LED's while reading data from Analog Sensors (https://github.com/tangowhisky37/ArduinoProjects/tree/master/Blink_LEDs)
- This program simply blinks LED's and displays data from Analog Sensors on the Serial Monitor
- Connections for this circuit include :
- Connect the Digital pins on the Arduino to the LED.
- On the MEGA 2560, D0 is Rx0 and D1 is Tx0. You will need to use D2 onwards.
- A sample connection would include - D2 to Anode (Longer leg), 50 Ohm Resistor in line with Anode.
- Cathode (Shorter leg) connects to the ground rail on the Breadboard.
- You can use a Male to Male cable to connect the Arduino Ground, to the Ground rail on the Breadboard.
- Connect up as many LED's you want to connect. Use different colors.
- Connect up the Analog sensors you might have. In this case I've used the following sensors -
- Soil Moisture Sensor, Alcohol Sensor and LDR Sensor. Follow the connection diagrams for your sensors.
- Please connect up the relevant Analog sensors to the available Analog ports and change code accordingly.
- Hardware required includes :
- Arduino MEGA 2560 R3 (You can choose your own version of the Arduino)
- Coloured LED's
- Breadboard for building the circuit
- Dupont Male to Male wires
- 50 Ohm Resistors
- Analog Alcohol Sensor
- Analog LDR or Light Dependant Resistor Sensor (LDR)
- Analog Soil Moisture Sensor
- Software required includes :
- Arduino Development IDE
- Links to read up on with regards to programming the Arduino from the Raspberry Pi
Display Simple Web Page (https://github.com/tangowhisky37/ArduinoProjects/tree/master/Ethernet/DummyWebPagev0.11)
- This program uses the Ethernet Addon based on Enc28j60 and displays a web page over ethernet
- I configured my Raspberry Pi as a DHCP server using ISC DHCP and provided the Arduino MEGA 2560 R3 a lease over ethernet.
- Connections for this circuit include :
- Connections between the Enc28j60 and Arduino MEGA 2560 R3 are as follows :
- Enc2860 Ground connected to Ground on the Arduino MEGA 2560 R3
- Enc2860 3.3 connected to 3.3v on the Arduino MEGA 2560 R3
- Enc2860 SO connected to D50 (Pin 50) on the Arduino MEGA 2560 R3
- Enc2860 SI connected to D51 (Pin 51) on the Arduino MEGA 2560 R3
- Enc2860 SCK connected to D52 (Pin 52) on the Arduino MEGA 2560 R3
- Enc2860 CS connected to D53 (Pin 53) on the Arduino MEGA 2560 R3
- Connections between the Enc28j60 and Arduino MEGA 2560 R3 are as follows :
- Diagram -
- Hardware required includes :
- Arduino MEGA 2560 R3 (You can choose your own version of the Arduino)
- Addon board based on Enc28j60 (http://www.ebay.com/bhp/enc28j60-module)
- Breadboard for building the circuit
- Dupont Male to Male wires
- Dupont Female to Male wires
- Software required includes :
- Arduino Development IDE
- Ethernet Library to be downloaded from https://github.com/jcw/ethercard/
- Links to read up on with regards to programming the Arduino from the Raspberry Pi
- Articles to read :
Obtain DHCP lease with DNS and accept Web Requests (https://github.com/tangowhisky37/ArduinoProjects/tree/master/Ethernet/EthernetDemoUsingDhcpDnsv0.11)
- This program uses the Ethernet Addon based on enc28j60 and obtains a DHCP lease over ethernet.
- I configured my Raspberry Pi as a DHCP server using ISC DHCP and provided the Arduino MEGA 2560 R3 a lease over ethernet.
- Connections for this circuit include :
- Connections between the Enc28j60 and Arduino MEGA 2560 R3 are as follows :
- Enc2860 Ground connected to Ground on the Arduino MEGA 2560 R3
- Enc2860 3.3 connected to 3.3v on the Arduino MEGA 2560 R3
- Enc2860 SO connected to D50 (Pin 50) on the Arduino MEGA 2560 R3
- Enc2860 SI connected to D51 (Pin 51) on the Arduino MEGA 2560 R3
- Enc2860 SCK connected to D52 (Pin 52) on the Arduino MEGA 2560 R3
- Enc2860 CS connected to D53 (Pin 53) on the Arduino MEGA 2560 R3
- Connections between the Enc28j60 and Arduino MEGA 2560 R3 are as follows :
- Diagram -
- Hardware required includes :
- Arduino MEGA 2560 R3 (You can choose your own version of the Arduino)
- Addon board based on Enc28j60 (http://www.ebay.com/bhp/enc28j60-module)
- Breadboard for building the circuit
- Dupont Male to Male wires
- Dupont Female to Male wires
- Software required includes :
- Arduino Development IDE
- Ethernet Library to be downloaded from https://github.com/jcw/ethercard/
- Links to read up on with regards to programming the Arduino from the Raspberry Pi
- Articles to read :
Obtain data from sensors and display on Web Page (https://github.com/tangowhisky37/ArduinoProjects/tree/master/Ethernet/WebPageWithSensorData)
- This program uses the Ethernet Addon based on enc28j60, obtains data from on-board sensors and displays values over a web page
- I configured my Raspberry Pi as a DHCP server using ISC DHCP and provided the Arduino MEGA 2560 R3 a lease over ethernet.
- Connections for this circuit include :
- Connections between the Enc28j60 and Arduino MEGA 2560 R3 are as follows :
- Enc2860 Ground connected to Ground on the Arduino MEGA 2560 R3
- Enc2860 3.3v connected to 3.3v on the Arduino MEGA 2560 R3
- Enc2860 SO connected to D50 (Pin 50) on the Arduino MEGA 2560 R3
- Enc2860 SI connected to D51 (Pin 51) on the Arduino MEGA 2560 R3
- Enc2860 SCK connected to D52 (Pin 52) on the Arduino MEGA 2560 R3
- Enc2860 CS connected to D53 (Pin 53) on the Arduino MEGA 2560 R3
- Connect the Digital pins on the Arduino to the LED.
- On the MEGA 2560, D0 is Rx0 and D1 is Tx0. You will need to use D2 onwards.
- A sample connection would include - D2 to Anode (Longer leg), 50 Ohm Resistor in line with Anode.
- Cathode (Shorter leg) connects to the ground rail on the Breadboard.
- You can use a Male to Male cable to connect the Arduino Ground, to the Ground rail on the Breadboard.
- Connect up as many LED's you want to connect. Use different colors.
- Connect up the Analog sensors you might have. In this case I've used the following sensors -
- Soil Moisture Sensor, Alcohol Sensor and LDR Sensor. Follow the connection diagrams for your sensors.
- Please connect up the relevant Analog sensors to the available Analog ports and change code accordingly.
- Connections between the Enc28j60 and Arduino MEGA 2560 R3 are as follows :
- Diagram -
- Hardware required includes :
- Arduino MEGA 2560 R3 (You can choose your own version of the Arduino)
- Addon board based on Enc28j60 (http://www.ebay.com/bhp/enc28j60-module)
- Breadboard for building the circuit
- 50 Ohm Resistors
- Dupont Male to Male wires
- Dupont Female to Male wires
- Analog Alcohol Sensor
- Analog LDR or Light Dependant Resistor Sensor (LDR)
- Analog Soil Moisture Sensor
- Software required includes :
- Arduino Development IDE
- Ethernet Library to be downloaded from https://github.com/jcw/ethercard/
- Links to read up on with regards to programming the Arduino from the Raspberry Pi
- Articles to read :
Blink lights on the NodeMCU ESP8266 board (https://github.com/tangowhisky37/ArduinoProjects/tree/master/Nodemcu_Geekcreit/BlinkLights/Blink_v0_11)
- The NodeMCU board is one among the many ESP8266 boards out there but with a bit of a difference.
- This board is affordable, connects to a USB port of your machine, is breadboard friendly and most importantly works with the Arduino IDE.
- This is the Hello world of embedded electronics. You usually use this when you get started with any new board.
- This simple tutorial includes connecting the NodeMCU board to your machine, setting up the Arduino IDE interface and flashing the board.
- The sketch involved causes the light on the NodeMCU board to blink.
- Connections for this circuit include -
- Connecting the NodeMCU board to the USB port of your development machine
- Software required includes -
- Arduino IDE
- ESP8266 libraries packes into the Arduino IDE which include the packages for NodeMCU board
- Here are some of the links you might want to refer to with regards to configuring the Arduino IDE for ESP8266 development :
- https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide
- https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon
- Hardware required includes :
- 1 x NodeMCU board
- Links for purchase :
- http://www.banggood.com/Geekcreit-Doit-NodeMcu-Lua-ESP8266-ESP-12E-WIFI-Development-Board-p-985891.html
- http://www.nodemcu.com
NodeMCU - Identify MAC Addres, Connect to a wireless network and blinks lights(Source code at https://github.com/tangowhisky37/ArduinoProjects/tree/master/Nodemcu_Geekcreit/ObtainMACAddress/Get_MAC_Address_v0.11)
- The NodeMCU board is one among the many ESP8266 boards out there but with a bit of a difference.
- This board is affordable, connects to a USB port of your machine, is breadboard friendly and most importantly works with the Arduino IDE.
- When working with NodeMCU boards one of the initial challenges is configuring your wireless router to allow the NodeMCU board to speak to it.
- Most routers (including mine at home) use whitelisting or a MAC address list to allow a set of endpoints to connect to it. This is more for purposes of security than anything else.
- If this is the case with you as well, you will need to know the MAC address of the NodeMCU board to be able to configure the Wireless AP (Access Point) to allow your NodeMCU board to connect to it.
- Usually this is something you would only do once when you get started with any new NodeMCU board. This simple tutorial includes connecting the NodeMCU board to your machine, setting up the Arduino IDE interface and flashing the board with the code provided.
- Once you've flashed the board, open up the Serial monitor window in your Arduino IDE. Hit the re-set button on the NodeMCU to get the board to reboot.
- With the board booting up you should now see the MAC address for your new NodeMCU board on the Arduino IDE serial monitor.
- Now's the opportunity to add the MAC address for the new NodeMCU board onto the whitelist of your wireless router. Once you've done that go back to your NodeMCU.
- Reset the board using the re-set button on the NodeMCU with the Arduino Serial Monitor open. You should now see the NodeMCU obtaining a DHCP lease from your wireless router.
- The sketch involved causes the light on the NodeMCU board to blink.
- Connections for this circuit include -
- Connecting the NodeMCU board to the USB port of your development machine
- Software required includes -
- Arduino IDE
- ESP8266 libraries packes into the Arduino IDE which include the packages for NodeMCU board
- Here are some of the links you might want to refer to with regards to configuring the Arduino IDE for ESP8266 development :
- Hardware required includes :
- 1 x NodeMCU board
- Links for purchase :
- http://www.banggood.com/Geekcreit-Doit-NodeMcu-Lua-ESP8266-ESP-12E-WIFI-Development-Board-p-985891.html
- http://www.nodemcu.com
IoT (Internet Of Things) Web Server using the NodeMCU ESP8266 board (https://github.com/tangowhisky37/ArduinoProjects/tree/master/Nodemcu_Geekcreit/Web_Server)
- The NodeMCU board is one among the many ESP8266 boards out there but with a bit of a difference.
- This board is affordable, connects to a USB port of your machine, is breadboard friendly and most importantly works with the Arduino IDE.
- This program is a copy of the Web Server program that comes with the NodeMCU tutorials part of the examples in your Arduino IDE for NodeMCU.
- To get this program working you will need the credentials for a local wireless network so that you can connect to it.
- You can hook up all sorts of sensors (Digital or Analog) to your NodeMCU board and have it present values through the web page.
- Connections for this circuit include -
- Connecting the NodeMCU board to the USB port of your development machine
- Software required includes -
- Arduino IDE
- ESP8266 libraries packes into the Arduino IDE which include the packages for NodeMCU board
- Here are some of the links you might want to refer to with regards to configuring the Arduino IDE for ESP8266 development :
- Hardware required includes :
- 1 x NodeMCU board
- Links for purchase :
IoT (Internet Of Things) Soil Moisture Sensor that Tweets using NodeMCU with ESP8266 v1 (https://github.com/tangowhisky37/ArduinoProjects/tree/master/Nodemcu_Geekcreit/ThingSpeakDataUpload/ThinkgSpeakDataUpload_v014)
- The NodeMCU board is one among the many ESP8266 boards out there but with a bit of a difference.
- This board is highly affordable (costs around 8-10 AUD), connects to a USB port of your machine, is breadboard friendly and most importantly works with the Arduino IDE.
- As part of this program you will connect to the local wireless network, read values from the Soil moisture sensor and tweet the values.
- The code also uses the Thingspeak Arduino library to upload data points to ThingSpeak and view graphically the data being logged.
- To get this program working you will need the credentials for a local wireless network so that you can connect to it.
- You will need to setup an account at www.thingspeak.com, create a channel and setup it up so that you can write to the channel using your NodeMCU.
- You will then need to head off and setup a Twitter account at www.twitter.com and configure the thingtweet application.
- The thingtweeet application (https://thingspeak.com/apps/thingtweets) requires that you register your Twitter account with Thingspeak. Here's a summary of the steps involved. Please refer to the details at the Thingspeak website. -
- Sign in to https://thingspeak.com/login, select Apps from the menu, and then click on ThingTweet.
- Under the ThingTweet App, select “Link new Twitter account”.
- This will redirect you to Twitter to see if you want the app to have the ability to access your account.
- You can Allow or Deny the process. Once you have confirmed the right Twitter account, Twitter will send you back to ThingSpeak.
- The app generates a ThingTweet API Key for you to use. If you send an HTTP POST with your ThingTweet API Key, then the message will be relayed to Twitter.
- All of the parameters from the Twitter API (statuses/update) are possible including geolocation.
- Over the coming weeks (or months..as and when i can find time) I will update the code such that it only tweets when certain conditions are met.
- Currently the code tweets every 5 minutes
- Connections for this circuit include -
- Connecting the NodeMCU board to the USB port of your development machine
- Software required includes -
- Arduino IDE
- ESP8266 libraries packes into the Arduino IDE which include the packages for NodeMCU board
- Thingspeak IoT libraries which can be installed using the Arduino IDE
- Here are some of the links you might want to refer to with regards to configuring the Arduino IDE for ESP8266 development :
- https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide
- https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon
- Read up on NodeMCU at http://www.nodemcu.com
- Twitter account
- Thingspeak account
- Configuration of Thingtweet application so that it is integrated with your Twitter account and can publish to it
- Diagram -
- View the Fritzing diagram here : https://github.com/tangowhisky37/ArduinoProjects/blob/master/Nodemcu_Geekcreit/ThingSpeakDataUpload/Fritzing/SoilMoistoreSensor_v0.2_bb.png
- v0.1 of the Fritzing uses a Wemos Pro instead of a NodeMCU since i couldn't find the right template to use. Please refer to v0.2
- Hardware required includes :
- 1 x NodeMCU board
- Links for purchase :
- NodeMCU - http://www.banggood.com/Geekcreit-Doit-NodeMcu-Lua-ESP8266-ESP-12E-WIFI-Development-Board-p-985891.html
- Soil Moisture Sensor : https://www.sparkfun.com/products/13322
- NPN 2N2222A : https://www.adafruit.com/product/756
- 1 x 100 Ohm Resistor
- 1 x 1K Ohm Resistor
- Dupont Male to Male breadboard wires
- Dupont Femal to Male breadboard wires
IoT (Internet Of Things) Soil Moisture Sensor that Tweets & Emails using NodeMCU with ESP8266 v2 (https://github.com/tangowhisky37/ArduinoProjects/tree/master/Nodemcu_Geekcreit/ThingSpeakDataUpload/ThinkgSpeakDataUpload_v018)
- Changes compared to v1 are -
- Alerts sent over email (gmail)
- Use of a Single Channel Optoisolator Relay (Shunyu SH-05VDC)
- The NodeMCU board is one among the many ESP8266 boards out there but with a bit of a difference.
- This board is highly affordable (costs around 8-10 AUD), connects to a USB port of your machine, is breadboard friendly and most importantly works with the Arduino IDE.
- As part of this program you will connect to the local wireless network, read values from the Soil moisture sensor, tweet the values and also send yourself alerts over email.
- This version of the Soil Moisture Sensor program uses the Thingspeak Arduino library to upload data points to ThingSpeak and view graphically the data being logged.
- Email alerts are based on an assessment of how low the moisture in the soil is. This is a configurable value and while I've set this to 100 you can change this to any other value that works for your setup at home.
- To get this program working you will need the credentials for a local wireless network so that you can connect to it.
- You will need to setup an account at www.thingspeak.com, create a channel and setup it up so that you can write to the channel using your NodeMCU.
- You will then need to head off and setup a Twitter account at www.twitter.com and configure the thingtweet application.
- The thingtweeet application (https://thingspeak.com/apps/thingtweets) requires that you register your Twitter account with Thingspeak. Here's a summary of the steps involved. Please refer to the details at the Thingspeak website. -
- Sign in to https://thingspeak.com/login, select Apps from the menu, and then click on ThingTweet.
- Under the ThingTweet App, select “Link new Twitter account”.
- This will redirect you to Twitter to see if you want the app to have the ability to access your account.
- You can Allow or Deny the process. Once you have confirmed the right Twitter account, Twitter will send you back to ThingSpeak.
- The app generates a ThingTweet API Key for you to use. If you send an HTTP POST with your ThingTweet API Key, then the message will be relayed to Twitter.
- All of the parameters from the Twitter API (statuses/update) are possible including geolocation.
- A set of template Gmail SMTP libraries are provided in the same folder as the Arduino code. Download those libraries.
- Once you've synced the changes into your local git repo let's start by editing the gsender.h file.
- The gsender.h file should be modified to include your email address, your password.
- The email address and password however need to be provided in Base64 format.
- To convert your gmail (email) address and password into Base64 format you might consider using - https://www.base64encode.org/
- For details on configuring your Gmail account to allow use by external applications please refer to - https://www.instructables.com/id/ESP8266-GMail-Sender/
- Over the coming weeks (or months..as and when i can find time) I will update the code such that it only tweets when certain conditions are met.
- Currently the code tweets every 15 minutes. You can go in and make changes to suit your setup at home.
- Connections for this circuit include -
- Connecting the NodeMCU board to the USB port of your development machine
- Relay Input (https://github.com/tangowhisky37/ArduinoProjects/blob/master/Nodemcu_Geekcreit/ThingSpeakDataUpload/ThinkgSpeakDataUpload_v018/Optoisolated_relay_module_Shunyu_SH05VDC_Input_terminals.jpg) -
- Vcc to 3v3 (esp8266)
- Gnd to Gnd (esp8266)
- Int to D2 (esp8266)
- Relay Out (https://github.com/tangowhisky37/ArduinoProjects/blob/master/Nodemcu_Geekcreit/ThingSpeakDataUpload/ThinkgSpeakDataUpload_v018/Optoisolated_relay_module_Shunyu_SH05VDC_Output_terminals.jpg) -
- 3V3 to NO (esp8266) [The input voltage from the esp routes through the relay NO and Common to go into +ve of the sensor]
- Common (mid) to Soil Moisture Sensor +ve
- In reference to the image above, extreme left is NO,Common in the middle, NC on the right
- Soil Moisture Sensor -
- Signal to AD0 [This allows measurement of the soil moisture by the arduino code]
- Negative to Gnd
- Software required includes -
- Arduino IDE
- ESP8266 libraries packes into the Arduino IDE which include the packages for NodeMCU board
- Thingspeak IoT libraries which can be installed using the Arduino IDE
- Here are some of the links you might want to refer to with regards to configuring the Arduino IDE for ESP8266 development :
- https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide
- https://learn.sparkfun.com/tutorials/esp8266-thing-hookup-guide/installing-the-esp8266-arduino-addon
- Read up on NodeMCU at http://www.nodemcu.com
- Twitter account
- Thingspeak account
- Gmail account including libraries (template provided)
- Configuration of Thingtweet application so that it is integrated with your Twitter account and can publish to it
- Configuration of gmail privacy settings to allow for use by third party applications
- Diagram -
- View the Fritzing diagram here : https://github.com/tangowhisky37/ArduinoProjects/blob/master/Nodemcu_Geekcreit/ThingSpeakDataUpload/Fritzing/SoilMoistoreSensor_v0.2_bb.png
- v0.1 of the Fritzing uses a Wemos Pro instead of a NodeMCU since i couldn't find the right template to use. Please refer to v0.2
- Hardware required includes :
- 1 x NodeMCU board
- Links for purchase :
- NodeMCU - http://www.banggood.com/Geekcreit-Doit-NodeMcu-Lua-ESP8266-ESP-12E-WIFI-Development-Board-p-985891.html
- Soil Moisture Sensor : https://www.sparkfun.com/products/13322
- Single Channel Relay with Optoisolator : https://tronixlabs.com.au/relay/module/relay-module-board-single-channel-with-optoisolator-australia/
- Dupont Male to Male breadboard wires
- Dupont Female to Male breadboard wires
- Dupont Female to Female breadboard wires
!!!Happy Hacking!!!