Technology – 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 Arduino Nano Voice Activated (sound sensor) LED Halloween / DJ Mask https://kevingulling.com/2017/09/arduino-nano-voice-activated-sound-sensor-led-halloween-dj-mask/ Fri, 29 Sep 2017 10:38:11 +0000 https://kevingulling.com/?p=1710 Voice Activated LED Mask Be the life of the party this Halloween with a voice (and music if it’s loud!) activated LED biohazard mask. Everybody knows that a genius conceptual Halloween costume will make you the star of the party. Sure you could be one of the millions of people to wear a caricature Trump […]

The post Arduino Nano Voice Activated (sound sensor) LED Halloween / DJ Mask appeared first on Kevin Gulling - Game Development, VR, and more.

]]>

Voice Activated LED Mask

DIY LED Mask Youtube

Be the life of the party this Halloween with a voice (and music if it’s loud!) activated LED biohazard mask. Everybody knows that a genius conceptual Halloween costume will make you the star of the party. Sure you could be one of the millions of people to wear a caricature Trump mask this year, or you can be original with this DIY project!

Materials required:

Steps:

  1. Take apart the biohazard mask filters and empty out the contents
  2. Wire LED 1 and 9v battery into one of the filters, pulling wires through the respirator air passage ways. If you make the wires the correct length, you can easily tuck them beneath the rubbery plastic liner
  3. Solder your nano and other components to the perf board (see circuit diagram below). I left the KY-038 sound module free from the board so that I could easily position it and make adjustments to the sensitivity via the on-board potentiometer.
  4. Connect the wiring from the 9v power supply and the LED.
  5. (Optional) Slap a biohazard sticker on the front, and voila!

Check out the video above to get a look at how I did it!

Here is the circuit:

(simply put your desired amount of LED’s in parallel, I used one in each filter. Using 2 or more in each filter will drain your battery a bit faster, but might make it a bit brighter)
LED Mask Circuit

Here is the Sketch code:

int LED = 3;
int mic = A0;
int brightness = 0;
int fade = 5;
int level = 30;

void setup() {
Serial.begin(9600);
pinMode(LED, OUTPUT);
pinMode(mic,INPUT);
}

void loop() {

int sound = analogRead(mic);
analogWrite(LED, brightness);
if(sound>=level && brightness < 255){
brightness = brightness + fade;
delay(5);
}
else if(sound < level && brightness > 0){
brightness = brightness - 1;
delay(10);
}

Serial.println(brightness); //Use this line to test your levels in the serial monitor

}

Did you make one? Feel free to link to your costume pics in the comments.

Did you like it? Please take a moment to subscribe to my blog and be notified every time I create something new!

The post Arduino Nano Voice Activated (sound sensor) LED Halloween / DJ Mask appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
1710
How to embed 360 pictures on your website – 1000 AE Sneak Peak https://kevingulling.com/2017/08/sneak-peak-1000-ae/ Sun, 27 Aug 2017 10:44:44 +0000 https://kevingulling.com/?p=1686 With the emergence of VR, 360 degree video and images have become a popular form of media across the web. Facebook allows users to embed these images directly simply by uploading them. But how do you post a 360 image on your website or blog? 360player.io is a great resource for developers that accomplishes just […]

The post How to embed 360 pictures on your website – 1000 AE Sneak Peak appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
With the emergence of VR, 360 degree video and images have become a popular form of media across the web. Facebook allows users to embed these images directly simply by uploading them. But how do you post a 360 image on your website or blog? 360player.io is a great resource for developers that accomplishes just that. Simply sign up for a free account, upload your 360 image/video in the proper format ( equirectangular 2:1, also for many players metadata for the associated image may be required). On Facebook you simply upload the image as you would any other image and as long as the metadata and format are correct, it is automatically converted to 360.


A 360 degree shot looking at Sol II from the satellite Lua: ARVRCADES 1000 AE for Vive/Oculus

360 image

360 image before processing

If you are wondering how you can capture these 360 degree images, there are different ways to accomplish this. You can capture real 360 pictures with the Android app Google Cardboard and Cardboard Camera available in the Play store. If you are interested in capturing a 360 shot of your project, 3d model(s) or game, there is a bit more to it. (Contact me for more info).

The post How to embed 360 pictures on your website – 1000 AE Sneak Peak appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
1686
Arduino GY-MAX471 Voltage and Current Testing Module https://kevingulling.com/2017/03/arduino-gy-max471-voltage-and-current-testing-module/ https://kevingulling.com/2017/03/arduino-gy-max471-voltage-and-current-testing-module/#comments Tue, 28 Mar 2017 15:26:18 +0000 https://kevingulling.com/?p=1543 The GY-MAX471 Voltage and Current Sensor Module I found another cheap, interesting module on ICSTATION. This one utilizes the MAX471 chip to sense the voltage and current running through the circuit. The datasheet for this module is non-existent as far as I can tell, but there is a datasheet for the MAX471, so with some […]

The post Arduino GY-MAX471 Voltage and Current Testing Module appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
The GY-MAX471 Voltage and Current Sensor Module


I found another cheap, interesting module on ICSTATION. This one utilizes the MAX471 chip to sense the voltage and current running through the circuit. The datasheet for this module is non-existent as far as I can tell, but there is a datasheet for the MAX471, so with some guess work I hooked it up to my UNO.

This is all the info about the module itself that I could find:

1.Size:19.5*20.3mm
2.Test Voltage range:DC 3-25V (Arduino work on 5V) or DC3-16.5V (work on 3.3V)
3.Test Current range:DC 0-3A
4.Chip: MAX471

There are similar modules that also utilize the MAX471 with a little bit more documentation available (this video for example), but this one has a couple major differences from other similar modules. The header pins are arranged in different order, and there are a couple more terminals.

I was getting a constant reading of 0 from the OUT pin, which I am assuming is the current reading. This was likely due to the fact that I was not drawing enough amperage with the LED to trigger a result. It could also be that something is not working correctly, I would have to test it out with something that draws more a few hundred mA or more to be sure. If I ever get around to that I’ll be sure to update this article and post the results.

In the video below you can see the GY-MAX471 in action:

youtube link

arduino sketch screenshot

GY-MAX471 Voltage/Current test sketch

The sketch for voltage test only:

#define vtpin A0
#define Arduino_Voltage 5.0

void setup() {
pinMode(vtpin, INPUT);

Serial.begin(9600);

}

void loop() {
int v = analogRead(vtpin);
double voltage = v * (Arduino_Voltage / 1023.0) * 5;

Serial.print(voltage);
Serial.println('v');

delay(3000);
}

The sketch for voltage and current test:


#define vtpin A0
#define atpin A5
#define Arduino_Voltage 5.0

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

}

void loop() {
int v = analogRead(vtpin);
int a = analogRead(atpin);

double voltage = v * (Arduino_Voltage / 1023.0) * 5;
double current = a * (Arduino_Voltage / 1023.0);

Serial.print(voltage);
Serial.println('v');
Serial.print(current);
Serial.println('A');

delay(3000);
}

The sketch for voltage current and watts:


#define vtpin A0
#define atpin A5
#define Arduino_Voltage 5.0

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

}

void loop() {
int v = analogRead(vtpin);
int a = analogRead(atpin);

double voltage = v * (Arduino_Voltage / 1023.0) * 5;
double current = a * (Arduino_Voltage / 1023.0);
double watts = current * voltage;

Serial.print(voltage);
Serial.println('v');
Serial.print(current);
Serial.println('A');
Serial.print(watts);
Serial.println('W');

delay(3000);
}

In summary, this is a pretty handy module. But do beware, in the MAX471 datasheet from the company maxis, they warn that they have discontinued production of the max471 chip, so don’t base any new designs off of it. So if you are using this in single project that doesn’t have to be reproduced many times, this is great option for testing the voltage and current, but if you are looking to prototype something that will eventually go into production, it’s probably best to look elsewhere for a way to handle this. I personally think it’s going to work great for my robotics project where I will run a shutdown sequence if the circuit is under-powered due to a low battery charge.

The post Arduino GY-MAX471 Voltage and Current Testing Module appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
https://kevingulling.com/2017/03/arduino-gy-max471-voltage-and-current-testing-module/feed/ 9 1543
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
RCWL-0516 Microwave Radar Motion Sensor for Arduino Test and Review https://kevingulling.com/2017/01/rcwl-0516-microwave-radar-motion-sensor-for-arduino-test-and-review/ https://kevingulling.com/2017/01/rcwl-0516-microwave-radar-motion-sensor-for-arduino-test-and-review/#comments Thu, 26 Jan 2017 15:33:31 +0000 https://kevingulling.com/?p=1486 RCWL-0516 Sensor Test & Review The RCWL-0516 microwave radar motion sensor module is a low cost sensor that has been newly added to ICSTATION inventory. There is quite a lack of information on the module online, at least not that I could find, so I’m compiling what I could find and posting it all here […]

The post RCWL-0516 Microwave Radar Motion Sensor for Arduino Test and Review appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
RCWL-0516 Sensor Test & Review

rcwl-0516

The RCWL-0516 microwave radar motion sensor module is a low cost sensor that has been newly added to ICSTATION inventory. There is quite a lack of information on the module online, at least not that I could find, so I’m compiling what I could find and posting it all here in this article.

Distance Test

video of rcwl-0516

RCWL-O516 Arduino Circuit

rcwl-0516 arduino

RCWL-0516 Arduino Uno Circuit

We only use 3 of the 5 header pins in this project.

  • 3V3
  • GND – [connects to ground]
  • OUT [connects to digital input]
  • VIN – [connects to 5v]
  • CDS

The 0516 is a flexible module that can easily be used in conjunction with many MCU’s and even without a microcontroller at all. It can handle anywhere from 4v-28v in, which it then converts and outputs 3.3v to the 3V3 pin. This pin can be utilized for a multitude of tasks, such as an LED to indicate power, or even to supply power to a mini 3v based MCU.

Change the resistor value to decrease sensitivity. I have a 220Ω resistor in the circuit which shouldn’t impede the sensitivity too drastically, I’ll play around with some other values and update with my findings.

RCWL-O516 Arduino Sketch

Click to enlarge


int ip = 8;
int val = 0;
int led = 13;

void setup() {
Serial.begin(9600);
pinMode (ip, INPUT);
pinMode (led, OUTPUT);
}

void loop() {
val = digitalRead(ip);
Serial.println(val, DEC);
if(val >0)
{
digitalWrite(led, HIGH);
}
else
{
digitalWrite(led, LOW);
}
delay(1000);

}

To make the reaction time faster you can reduce the delay time from 1000 to something like 100. This will also allow the sensor to pick up smaller movements. Conversely you can increase the delay to help keep small movements from triggering (this is a simple but not perfect way of accomplishing this effect), and make the circuit conserve more power.




Disclaimer: I could not find an official datasheet on this module, so I’ve had to make some guesses here. I’m not responsible for any damage this could cause to your Arduino or sensor module! If you choose to try this yourself, don’t blame me when you spontaneously combust!

For even more info check out the git by Joe on it here which is still in the works (as of jan 2107) but it looks like he’s keeping it up to date with new findings: https://github.com/jdesbonnet/RCWL-0516/

The post RCWL-0516 Microwave Radar Motion Sensor for Arduino Test and Review appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
https://kevingulling.com/2017/01/rcwl-0516-microwave-radar-motion-sensor-for-arduino-test-and-review/feed/ 4 1486
Arduino + SPO2 Pulse Oximeter + Unity3D – Teardown Tuesday https://kevingulling.com/2017/01/arduino-spo2-pulse-oximeter-unity3d/ https://kevingulling.com/2017/01/arduino-spo2-pulse-oximeter-unity3d/#comments Tue, 17 Jan 2017 23:30:15 +0000 https://kevingulling.com/?p=1460 Arduino + SPO2 Pulse Oximeter + Unity3D After a recent hospital visit, I was given a disposable spo2 sensor to monitor my oxygen saturation and pulse which is standard practice these days. Rather than let the nurse toss my sensor afterwards, I decided to take it home and tinker with it. It would be pretty […]

The post Arduino + SPO2 Pulse Oximeter + Unity3D – Teardown Tuesday appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
Arduino + SPO2 Pulse Oximeter + Unity3D

After a recent hospital visit, I was given a disposable spo2 sensor to monitor my oxygen saturation and pulse which is standard practice these days. Rather than let the nurse toss my sensor afterwards, I decided to take it home and tinker with it. It would be pretty neat to have my own spo2 monitor at home, never know when it could come in handy! I am especially interested in the applications that it can be applied to in the gaming world, such as fitness gaming, so I created a Unity asset that can handle the readings and graph the results, much like an ECG.

diy pulse oximeter

A couple of you have asked for more details about the project so here’s everything I have so far (work in progress).

I couldn’t find much on the exact sensors that Masimo uses in their resposable SP02 sensors, so disclaimer: I’m just sort of winging it here, there is definitely more info needed to perfect this project… That being said, without wasting any more time, here is the project:



Project materials:
-Arduino Uno R3
-Masimo Universal Resposable SPO2 Pulse Oximeter
-Breadboard
-10k resistor
-220 resistor
-330 resistor

SPO2 sketch:


The circuit:

breadboard schematic

This handy tool I made in Unity reads the data we send to the serial com and graphs it for us in a manner that emulates an ECG.

spo2 grapher unity3d

Download Unity3D SPO2 grapher for Windows

You’ll notice that I commented out a few lines in the sketch. Enable these lines if you would rather plot your graph using an online tool such as FooPlot rather than the realtime Unity3d made monitor.

If you have any information to contribute for the advancement of this project, leave a comment or contact me and I’ll be sure to keep this article up-to-date with new findings! If you have any questions go ahead and leave those in the comments as well and I’ll do my best to answer any.

The post Arduino + SPO2 Pulse Oximeter + Unity3D – Teardown Tuesday appeared first on Kevin Gulling - Game Development, VR, and more.

]]>
https://kevingulling.com/2017/01/arduino-spo2-pulse-oximeter-unity3d/feed/ 5 1460
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