arduino – Kevin Gulling http://www.kevingulling.com Game Development, VR, and more Mon, 06 Nov 2017 23:07:25 +0000 en-US hourly 1 https://wordpress.org/?v=5.9.13 81085834 Funduino Analog Water Sensor for Arduino Test and Review https://kevingulling.com/2017/02/funduino-analog-water-sensor-arduino-test-review/ https://kevingulling.com/2017/02/funduino-analog-water-sensor-arduino-test-review/#comments Tue, 28 Feb 2017 18:39:39 +0000 https://kevingulling.com/?p=1518 Analog Water Sensor Test and Review The Funduino analog water sensor is an inexpensive, easily obtainable sensor module with many use cases. I purchased mine from the Good-Module Ebay store for just under $1 USD. You can find these modules available from other sellers on Ebay as well with similar prices. There are a lot […]

The post Funduino Analog Water Sensor for Arduino Test and Review appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
Analog Water Sensor Test and Review

The Funduino analog water sensor is an inexpensive, easily obtainable sensor module with many use cases. I purchased mine from the Good-Module Ebay store for just under $1 USD. You can find these modules available from other sellers on Ebay as well with similar prices.

Funduino H20 Sensor

There are a lot of uses for this sensor module. It can be used to detect the presence or absence of water, accurately gauge the water surface level, or you can even accurately gauge the volume of water present by using a volume measurement device such as a measuring cup in conjunction with the analog water sensor module. This makes it the Funduino analog water sensor a versatile component! Be careful not to confuse this module with a digital boolean water sensor which will only return a true or false value rather than an integer.

yt video link - water sensor

Hooking up the module to an Arduino is simple. Connect the positive to 5v, the negative to ground on the Arduino, and the analogue out to one of the 5 analog pins on the Arduino Uno. This module can also be connected to 3v, so it is virtually compatible with every type of Arduino as well as many other development boards.

Water Sensor Arduino Sketch

int h20 = 0;

void setup() {
pinMode(h20, INPUT);
Serial.begin(9600);

}

void loop() {
int i = analogRead(h20);
Serial.println(i);
delay(1000);
}

This sketch is set up to view the values (the integer i) returned by the sensor in the serial monitor. You can easily use this value to set triggers. For example in a project that I built using this sensor module, I have it set to switch off a water pump if i is less than 100. This protects my pump from operating while not fully submerged.

Some other projects you might consider this module for may be:

  1. Water leak detection
  2. Automatic plant watering
  3. Rain fall meter

If you utilize this sensor in a project that you want to show off, feel free to post a link in the comments!

The post Funduino Analog Water Sensor for Arduino Test and Review appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
https://kevingulling.com/2017/02/funduino-analog-water-sensor-arduino-test-review/feed/ 1 1518
12 Days of Arduino Day 12 – Glorious Spambot! – DIY Robot for $50 https://kevingulling.com/2016/12/12-days-of-arduino-day-12-glorious-spambot-robot-for-under-50/ https://kevingulling.com/2016/12/12-days-of-arduino-day-12-glorious-spambot-robot-for-under-50/#comments Sat, 24 Dec 2016 15:34:57 +0000 https://kevingulling.com/?p=1433 Day 12 of 12 Days of Arduino! On the 12th day of Arduino, I present our final project of the series: Glorious Spambot! I printed out some wheels , and fashioned some wheels out of bottle caps, and an axle out of a spray tube, a paperclip and a ballpoint pen. I found the wheel […]

The post 12 Days of Arduino Day 12 – Glorious Spambot! – DIY Robot for $50 appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
spambot day12

Day 12 of 12 Days of Arduino! On the 12th day of Arduino, I present our final project of the series: Glorious Spambot! I printed out some wheels , and fashioned some wheels out of bottle caps, and an axle out of a spray tube, a paperclip and a ballpoint pen. I found the wheel model on Thingiverse. There are a ton of wheels on Thingiverse that will work great, or if you don’t have a 3d printer, I’ve found that plastic bottle caps will do the trick!

Spambot

Watch Spambot on his first official voyage:




Spambot Sketch

#include

#define rxPin 0
#define txPin 1

int motor = 3;
int fan = 5;
int incomingByte[2];
boolean motorBool = false;
boolean fanBool = false;

SoftwareSerial bluetooth(rxPin, txPin);

void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode (motor, OUTPUT);
pinMode (fan, OUTPUT);
bluetooth.begin(9600);

analogWrite (motor, 0);
analogWrite (fan, 0);
}

void loop() {
if(bluetooth.available()>0){
while(bluetooth.peek() == 'A'){
//bluetooth.println(bluetooth.peek());
bluetooth.read();
incomingByte[0] = bluetooth.parseInt();
bluetooth.println(incomingByte[0], DEC);
if(incomingByte[0] == 1){
motorBool = true;
bluetooth.print("motor:");
bluetooth.println(motorBool, DEC);
}
else if(incomingByte[0] == 0){
motorBool = false;

}
else if(incomingByte[0] == 2){
fanBool = true;
bluetooth.print("fan:");
bluetooth.println(fanBool, DEC);
}
else if(incomingByte[0] == 3){
fanBool = false;

}
}

while(bluetooth.available()>0){
bluetooth.read();
}
}

if(motorBool == true){
analogWrite (motor, 255);
//bluetooth.print("motor:");
// bluetooth.println(motorBool, DEC);
}
else{
analogWrite (motor, 0);
//bluetooth.print("motor:");
//bluetooth.println(motorBool, DEC);
}
if(fanBool == true){
analogWrite (fan, 255);
//bluetooth.print("fan:");
//bluetooth.println(fanBool, DEC);
}
else{
analogWrite (fan, 0);
//bluetooth.print("fan:");
//bluetooth.println(fanBool, DEC);
}
delay(1000);
}

The code hasn’t changed much from yesterday’s I just commented out some of the debugging stuff.

The mission of GloriousSpambot.org is simple, to create one or many useful, fully functional, open-source designs utilizing recycled and used parts and affordable components such as a Spam can, and to spread the word about it! Most robots on the market are for entertainment purposes, I want to see future iterations of Spambot that can

  • Detect Smoke/Fight Fires
  • Vacuum/Sweep/Dust
  • Monitor Pets/Children
  • Home Security
  • Elderly Care
  • Home Automation
  • Companion, Helper and Friend!
  • That might seem like quite a leap from the current iteration of Spambot, but you all saw what Spambot was 5 days ago: a pile of scraps! The possibilities are endless. By next month, the plan is to have Spambot doing tasks on the PC including making friends on social networks, and playing video games!

    That wraps up my 12 Days of Arduino series but the project will continue at www.GloriousSpamBot.org Make sure you check it out and like/subscribe for updates also follow on Twitter @GloriousSpamBot

    If you want to help out with the project, Tweet a message to @GloriousSpamBot and you will get a reply. For now it will be me, but in the near future Spambot will be in the beginning stages of automation including communicating with humans!

    Edit: it’s only been a little while since the announcement of Spambot, and already quite the following from around the world, over 1500 followers @GloriousSpamBot! Awesome! Thanks for the support everyone πŸ˜€ You can also help by clicking over to Youtube in the video above and liking/subscribing! Also thanks to @Nick Gammon for the link to the alternative TIP120 datasheet and @Due_Unto for the expert advice, @JohnLincoln for the link to transistor heatsink mounting kit

    Also to help out make sure you use this link to order components from ICStation. All proceeds will go directly back into development!


    Happy Holidays!

    The post 12 Days of Arduino Day 12 – Glorious Spambot! – DIY Robot for $50 appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]> https://kevingulling.com/2016/12/12-days-of-arduino-day-12-glorious-spambot-robot-for-under-50/feed/ 1 1433 12 Days of Arduino Day 11 – Robot Drive and Controls https://kevingulling.com/2016/12/1409/ Fri, 23 Dec 2016 20:21:39 +0000 https://kevingulling.com/?p=1409 Welcome back to Day 11 of 12 Days of Arduino! Today I backtrack a bit and tie up some “loose ends” with the design. The HC-06 that I am using states that it needs 3.3v on the rx, not 5v as I had it set up yesterday. We’ll want to comply with this to avoid […]

    The post 12 Days of Arduino Day 11 – Robot Drive and Controls appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    arduino header

    Welcome back to Day 11 of 12 Days of Arduino! Today I backtrack a bit and tie up some “loose ends” with the design.
    The HC-06 that I am using states that it needs 3.3v on the rx, not 5v as I had it set up yesterday. We’ll want to comply with this to avoid damaging any components. A simple way to go about this is to create a voltage divider using a couple resistors. I use this handy tool that does all the math for you to figure out what resistance resistors are necessary to get our voltage down to 3.3v: Voltage Divider Calculator. I ended up going with a 1k and a 2k resistor to obtain close to 3.3v.

    spambot

    Pro Tip: You won’t find this in most tutorials or datasheets, the heatsink tab of the TIP120 is directly connected to the Collector.

    Because of the heat sink I had connected to both the Tip120’s, when the circuit would close it would also close the circuit to the transistor that was also connected to the heatsink. So unfortunately I had to remove the cool looking heat sink which honestly was probably complete overkill in the first place, more aesthetic than functional, so it’s probably for the best! That being said.

    Parts:
    -Arduino Uno R3
    -Motor
    -Fan
    -Jumper Wires
    -Breadboard
    -Spam Can
    -2x TIP120 transistors
    -HC-05 or HC-06
    3d printed core
    -1k resistor
    -2k resistor



    Bluetooth Robot Controller Sketch


    Creative Commons License
    All code on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

    #include

    #define rxPin 0
    #define txPin 1

    int motor = 3;
    int fan = 5;
    int incomingByte[2];
    boolean motorBool = false;
    boolean fanBool = false;

    SoftwareSerial bluetooth(rxPin, txPin);

    void setup() {
    pinMode(rxPin, INPUT);
    pinMode(txPin, OUTPUT);
    pinMode (motor, OUTPUT);
    pinMode (fan, OUTPUT);
    bluetooth.begin(9600);

    analogWrite (motor, 0);
    analogWrite (fan, 0);
    }

    void loop() {
    if(bluetooth.available()>0){
    while(bluetooth.peek() == 'A'){
    //bluetooth.println(bluetooth.peek());
    bluetooth.read();
    incomingByte[0] = bluetooth.parseInt();
    bluetooth.println(incomingByte[0], DEC);
    if(incomingByte[0] == 1){
    motorBool = true;
    bluetooth.print("motor:");
    bluetooth.println(motorBool, DEC);
    }
    else if(incomingByte[0] == 0){
    motorBool = false;

    }
    else if(incomingByte[0] == 2){
    fanBool = true;
    bluetooth.print("fan:");
    bluetooth.println(fanBool, DEC);
    }
    else if(incomingByte[0] == 3){
    fanBool = false;

    }
    }

    while(bluetooth.available()>0){
    bluetooth.read();
    }
    }

    if(motorBool == true){
    analogWrite (motor, 255);
    bluetooth.print("motor:");
    bluetooth.println(motorBool, DEC);
    }
    else{
    analogWrite (motor, 0);
    bluetooth.print("motor:");
    bluetooth.println(motorBool, DEC);
    }
    if(fanBool == true){
    analogWrite (fan, 255);
    bluetooth.print("fan:");
    bluetooth.println(fanBool, DEC);
    }
    else{
    analogWrite (fan, 0);
    bluetooth.print("fan:");
    bluetooth.println(fanBool, DEC);
    }
    delay(1000);
    }

    I didn’t have time today to get as much done as I would like, so tomorrow will be a big day! That or I may have to extend it to day 13… Tomorrow I’ll put everything together and we will take Spambot for a stroll!

    Support future projects by shopping at ICStation:


    Day 12 β†’

    The post 12 Days of Arduino Day 11 – Robot Drive and Controls appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    1409
    12 Days of Arduino Day 10 – Robot Bluetooth Connection https://kevingulling.com/2016/12/12-days-of-arduino-day-10-robot-bluetooth-connection/ Thu, 22 Dec 2016 19:46:57 +0000 https://kevingulling.com/?p=1387 Welcome back to 12 Days of Arduino Day 10. Today we finish the core and connect to a remote computer via bluetooth. Everything has been pretty simple up until this point, so if you are a beginner you might want to watch some tutorials on YouTube and read up on the HC-05 and HC-06 before-hand. […]

    The post 12 Days of Arduino Day 10 – Robot Bluetooth Connection appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    12 days of arduino day 10

    Welcome back to 12 Days of Arduino Day 10. Today we finish the core and connect to a remote computer via bluetooth. Everything has been pretty simple up until this point, so if you are a beginner you might want to watch some tutorials on YouTube and read up on the HC-05 and HC-06 before-hand.



    Parts:
    -Arduino Uno R3
    -Motor
    -Fan
    -Jumper Wires
    -Breadboard
    -Spam Can
    -2x TIP120 transistors
    -HC-05 or HC-06

    Bluetooth Sketch

    Bluetooth Sketch

    #include <SoftwareSerial.h>

    #define rxPin 0
    #define txPin 1

    int motor = 3;
    int fan = 5;
    int incomingByte = 0;

    SoftwareSerial bluetooth(rxPin, txPin);

    void setup() {
    pinMode(rxPin, INPUT);
    pinMode(txPin, OUTPUT);
    pinMode (motor, OUTPUT);
    pinMode (fan, OUTPUT);
    bluetooth.begin(9600);
    }

    void loop() {
    // put your main code here, to run repeatedly:
    if(bluetooth.available()>0){
    bluetooth.print("I received: ");
    bluetooth.println(incomingByte, DEC);
    }
    analogWrite (motor, 255);
    digitalWrite (fan, HIGH);
    delay(1000);
    }

    Pro Tip: If you have issues uploading your sketch, unplug the Bluetooth module from the rx/tx pins.

    Support future projects by visiting our affiliate ICStation for electronics components:


    The post 12 Days of Arduino Day 10 – Robot Bluetooth Connection appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    1387
    12 Days of Arduino Day 9 – Robot Core / Cooling System https://kevingulling.com/2016/12/12-days-arduino-day-9-robot-core-coolant-system/ Wed, 21 Dec 2016 20:31:04 +0000 https://kevingulling.com/?p=1375 Day 9 of 12 Days of Arduino! So I couldn’t wait to get our components hooked up to the core, aka the spam can so I jumped ahead of schedule a bit so we can see the robot start to take shape! Don’t worry though, there’s more to this surprise! Make sure you catch Day […]

    The post 12 Days of Arduino Day 9 – Robot Core / Cooling System appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    day9 arduino r3 robot core

    Day 9 of 12 Days of Arduino! So I couldn’t wait to get our components hooked up to the core, aka the spam can so I jumped ahead of schedule a bit so we can see the robot start to take shape! Don’t worry though, there’s more to this surprise! Make sure you catch Day 10-12, and if you’ve missed it, go back and check out the “Keyduino“.



    Parts:
    -Arduino Uno R3
    -Motor
    -Fan
    -Jumper Wires
    -Breadboard
    -Spam Can
    -2x TIP120 transistors

    2 Motors Sketch

    One motor for the driver and one for the cooling

    int motor = 3;
    int fan = 5;

    void setup () {
    pinMode (motor, OUTPUT);
    pinMode (fan, OUTPUT);
    }
    void loop () {
    analogWrite (motor, 255);
    digitalWrite (fan, HIGH);
    }

    This old fan that I scrapped off a GPU from the turn of the millennium has seen better days. It was not responding to anything less than 12v therefor I simply gave it a digitalWrite to HIGH, so I’ll likely be swapping this out in the future, and switching back to pulse width modulation. I’m not sure if there is any difference in digitalWrite() with a value of HIGH and analogWrite() with a value of 255, maybe someone can shout that out to me @KevinGulling and I’ll make an update here.

    I know a lot of you have been following along and that’s great! Show your support by giving a like or retweet, it’s highly appreciated πŸ‘πŸ» Thanks! Hope you are looking forward to tomorrow, things are starting to get fun aren’t they?

    Check out ICStation for low price electronics kits:


    The post 12 Days of Arduino Day 9 – Robot Core / Cooling System appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    1375
    12 Days of Arduino Day 8 – Simple Motor Controller https://kevingulling.com/2016/12/12-days-of-arduino/ Tue, 20 Dec 2016 21:24:19 +0000 https://kevingulling.com/?p=1356 Day 8 of 12 Days of Arduino! Today I’m starting a new project, utilizing a 6v geared motor I found on Ebay. It does 30 RPM’s after the reduction, so it should have plenty of torque for most small-scale projects! This particular motor does not have reversible polarity, so it only spins in one direction, […]

    The post 12 Days of Arduino Day 8 – Simple Motor Controller appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    day8

    Day 8 of 12 Days of Arduino! Today I’m starting a new project, utilizing a 6v geared motor I found on Ebay. It does 30 RPM’s after the reduction, so it should have plenty of torque for most small-scale projects! This particular motor does not have reversible polarity, so it only spins in one direction, but for this simple project that will due perfectly! My goal here was to create the simplest motor controller possible and my original goal was to try and find a motor that I could run directly off the Arduino Uno io pins, which is a recommended 40mA maximum load. After testing the current on the motor I purchased I found that I was drawing 70mA, which was low enough not to fry anything, but probably not going to hold up over time. But that’s fine because a Tip120 is great in this scenario!

    6v motor

    6v Geared Motor

    Project requires
    –Arduino Uno
    -Jumper wires
    Tip120 Transistor



    Using the analogWrite() method we can give the motor a value ranging from 1-255.

    sketch8

    Sketch – Simple Motor

    int motor = 3;

    void setup () {
    pinMode (motor, OUTPUT);
    }
    void loop () {
    analogWrite (motor, 255);
    }

    Tomorrow we will add a component to our circuit to control our motors output values. Edit: Changed my mind, instead I build the structure and coolant system for our new project, we will wait another day for the controls.

    Check out ICStation for a good deal Arduino Uno R3’s and a huge selection of motors:


    The post 12 Days of Arduino Day 8 – Simple Motor Controller appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    1356
    12 Days of Arduino – Day 1 – Arduino Morse Code Keyer https://kevingulling.com/2016/12/arduino-morse-code-keyer/ https://kevingulling.com/2016/12/arduino-morse-code-keyer/#comments Tue, 13 Dec 2016 18:25:01 +0000 https://kevingulling.com/?p=1214 Hi friends, this December I’ve decided to do a special on development with Arduino microcontrollers, specifically the Arduino Uno R3 in this series. Arduino is to makers as HobbyLobby is to crafters. The best part is that Arduino is open-source! This isn’t so much a tutorial (if you are looking for tutorials check out @educ8s.tv […]

    The post 12 Days of Arduino – Day 1 – Arduino Morse Code Keyer appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    morse-code-keyer header

    Hi friends, this December I’ve decided to do a special on development with Arduino microcontrollers, specifically the Arduino Uno R3 in this series. Arduino is to makers as HobbyLobby is to crafters. The best part is that Arduino is open-source!

    This isn’t so much a tutorial (if you are looking for tutorials check out @educ8s.tv on YouTube, a fantastic channel for tutorials on different sensors and modules) but rather a demonstration of various applications (both practical and impractical) for different sensors, modules and other components. That being said I will be showing you the circuitry as well as the sketches, so if you want to build any of these you can. Also I will go over some great ways to reuse materials and salvage components off old electronics. I read somewhere that an estimated 87.5% of all electrical components that could be recycled or reused in some matter, are thrown out and buried in landfills, so get out there and salvage some of these parts and save yourself a few bucks while you do it!

    Arduino Morse Code Keyer:



    Project requires
    Arduino Uno
    Active buzzer
    button touch switch
    -LED
    -220 ohm resistor
    -10k ohm resistor
    -jumper wires

    morse code keyer sketch

    Morse Code Keyer Sketch

    This project is pretty simple and straight forward, but if you have any questions feel free to leave them in the comments.

    Sponsored by ICSTATION

    Day 2 β†’

    The post 12 Days of Arduino – Day 1 – Arduino Morse Code Keyer appeared first on Kevin Gulling - Game Development, VR, and more.

    ]]>
    https://kevingulling.com/2016/12/arduino-morse-code-keyer/feed/ 2 1214