Author Topic: Arduino - The Quick and Dirty Guide  (Read 18118 times)

Offline artephius

  • Survivor
  • ***
  • Posts: 149
  • Karma: 6
  • Recovering forum lurker..
Re: Arduino - The Quick and Dirty Guide
« Reply #30 on: January 14, 2016, 05:04:09 PM »
I can't speak for the ones on amazon, but I had good luck with these clones.

I chose them because having the ability to switch between 3.3/5v was really useful for my application (saved me the trouble of having to level shift to use it with a transceiver that could only handle 3.3v).

The one minor issue I had with them is the pin spacing between the two sets of female headers on one side wasn't quite right so I couldn't plug it onto a perf board with male headers without bending things a bit... That was a little annoying but not a deal breaker. I've never had a "real" arduino though so maybe this is an issue on them as well?

Offline Hurricane

  • Survivalist Mentor
  • *****
  • Posts: 573
  • Karma: 17
Re: Arduino - The Quick and Dirty Guide
« Reply #31 on: January 15, 2016, 02:41:18 PM »
 :popcorn:

Offline Smurf Hunter

  • Survival Veteran
  • ********
  • Posts: 7172
  • Karma: 334
Re: Arduino - The Quick and Dirty Guide
« Reply #32 on: February 09, 2016, 10:03:37 AM »
Let's revive this a bit, as I'm slacking on my Arduino projects.

A couple weeks back I got one of the MT8870 DTMF modules off eBay or amazon like this:


This tutorial was great, and taught me a lot about the DTMF module:
http://arduinobasics.blogspot.com.br/2015/08/mt8870-dtmf-dual-tone-multi-frequency.html

I wanted to learn how to detect the inputs of tones, and map them to keypad digits in my code.  The ultimate plan was to rig up the speaker output of a walkie talkie and have a crude command interface using the DTMF keypad over radio.

Think of a home security alarm system.  In addition to your secret code, there can be functions that are accessed numerically.  That's sort of what I was after.  As a programmer, I naively thought of this like receiving character inputs from a keyboard.

Unfortunately this is a little different, as we're sampling voltage states at a regular interval, and don't have a discrete count of input digits as you might think.

The DTMF module literally uses a 4-bit binary mask to indicate a numerical value of the received tones.  Think of 4 light bulbs.  The sequences of on/off have 16 unique combinations.

Here's the map:



Milestone #1 - display digits from the DTMF keypad on the arduino 16x2 LCD display.

Code: [Select]
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

//Global variables-----------------------------------------------------------------------------------------
byte DTMFread;            // The DTMFread variable will be used to interpret the output of the DTMF module.
const int STQ = 6;        // Attach DTMF Module STQ Pin to Arduino Digital Pin 6
const int Q4 = 7;        // Attach DTMF Module Q4  Pin to Arduino Digital Pin 7
const int Q3 = 8;        // Attach DTMF Module Q3  Pin to Arduino Digital Pin 8
const int Q2 = 9;        // Attach DTMF Module Q2  Pin to Arduino Digital Pin 9
const int Q1 = 10;        // Attach DTMF Module Q1  Pin to Arduino Digital Pin 10

void setup() {
  Serial.begin(9600);
  //Setup the INPUT pins on the Arduino
  pinMode(STQ, INPUT);
  pinMode(Q4, INPUT);
  pinMode(Q3, INPUT);
  pinMode(Q2, INPUT);
  pinMode(Q1, INPUT);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.setCursor(16, 0);
  lcd.autoscroll();
  lcd.print("H");
  delay(200);
  lcd.print("E");
  delay(200);
  lcd.print("L");
  delay(200);
  lcd.print("L");
  delay(200);
  lcd.print("O");
  delay(200);
  for(int i=0;i<11;i++) {
    lcd.print(" ");
    delay(200);
  }
  lcd.noAutoscroll();
  lcd.setCursor(16, 1);

}

void loop() {
  if(digitalRead(STQ)==HIGH){       //When a DTMF tone is detected, STQ will read HIGH for the duration of the tone.
    DTMFread=0;
    if(digitalRead(Q1)==HIGH){      //If Q1 reads HIGH, then add 1 to the DTMFread variable
      DTMFread=DTMFread+1;
    }
    if(digitalRead(Q2)==HIGH){      //If Q2 reads HIGH, then add 2 to the DTMFread variable
      DTMFread=DTMFread+2;
    }
    if(digitalRead(Q3)==HIGH){      //If Q3 reads HIGH, then add 4 to the DTMFread variable
      DTMFread=DTMFread+4;
    }
    if(digitalRead(Q4)==HIGH){      //If Q4 reads HIGH, then add 8 to the DTMFread variable
      DTMFread=DTMFread+8;
    }
    if(DTMFread < 10) {
      lcd.print("  ");
    }
  }
  Serial.println(DTMFread);
  lcd.setCursor(16, 1);
  lcd.print(DTMFread);
}

Offline Smurf Hunter

  • Survival Veteran
  • ********
  • Posts: 7172
  • Karma: 334
Re: Arduino - The Quick and Dirty Guide
« Reply #33 on: July 07, 2016, 11:16:23 AM »
I'm hoping to dust this off and get started again.  I just received an AS9850 in the mail.  Often I order these cheap components via eBay and they are slowly shipped from China.  If you aren't in a hurry, these are a great value.



My first plan is to build a signal generator.  There are various plans, but being a little new to electronics, the quality of instructions seems to vary a lot.
Building circuits is NOT like programming software applications.  Perhaps it's like programming device drivers, but I wouldn't know.
You must understand the components you are interacting with, which pins have which function, etc.  The cheap stuff from china isn't always well marked, so lots of google image searches...

I've also seen folks build VFOs with these DDS modules:


Offline Borisgrishenko

  • Fledgling Prepper
  • *
  • Posts: 1
  • Karma: 1
  • New TSP Forum member
Re: Arduino - The Quick and Dirty Guide
« Reply #34 on: November 24, 2016, 10:02:14 PM »
Hi guys, first post here, let it be a good one!

I've been an Arduino "maker" since 2008, in 2009 I scored a contract to design, build, test and commission sensor driven audio players for the six star Emirates Eco-resort near my former hometown of Lithgow, in NSW, Australia, which has led to an adventure that shaped almost the whole second decade of my adult working life.

Over the last few years, I've worked for world class universities, some of the hottest startups, Government scientific research agencies, and was even asked by some pretty secretive types to do a few odd jobs for them... I threw it all away around two years ago, moved up North to make a medical semi-retirement in a quiet little valley.

My goal for quite a while has been to obtain a property, to secure myself against homelessness. I can rough it in the bush, despite the fact I lived in a developed town most of my life, the bush was less than an hours casual amble away, and fishing spots, gold panning areas, gemstone prospecting areas... Within hours. My favourite hobbies as a teenager were bushwalking and mountain bike riding, I used to love exploring new places, and I kept as fit as a fiddle. The onset of major, and protracted illness that haunts me even now is a telling tale...

I'm a prepper, by simple pragmatism - I lived the majority of my life in the shadow of major air burst nuclear targets, worked with some very smart nuclear physicists, and have had a morbid curiosity of the effects of nuclear strikes and EMPs upon towns and telecommunications and electrical grid infrastructure. I'm also quite well aware that climate change isn't the biggest issue we face right now, it's just one of the best to make new taxes for. Some of the problems facing humanity today are far more basic, and far more ignored... Until the last second.

So, that's me in a basic kind of way. Now - Arduinos?

Glad you asked!

I've been snooping around here the last few days, and I've noticed some basic common idea themes for Arduino or Raspberry Pi projects. I've also looked into various other sites, they've mentioned projects of some old friends of mine, the Serval Project used during Arab Spring comes to mind. There was mention that this could be an opportunity for someone with some know how to develop some ideas and plans, perhaps an eBook or two...?

Two of the most basic themes I see mentioned are energy management, and sentry and defence. I'd like to address both:

* in a self sufficient off grid situation with little to no outside help, managing ones energy is crucial to survival. At this point, my budget dictates my lack of obtaining outside help as it were. In a SHTF situation, it'll be impossible to cruise down to the 7-11 for a 20L jerrycan of petrol for your three phase generator. So, being able to observe, measure, and control the energy used by a BOL or a homestead is key. For my worth, a simplified but structured home automation system is the idea here, a Raspberry Pi with a small router (the Wifi Pineapple Alfa AP-121 I believe it is, is a good choice here) playing the "server" with Arduino "clients" swinging off the control system, these would most likely be ESP8266 boards. Total ongoing power draw would be in the area of the sniff of an oily rag.

* for sentry and defence, again, a similar architecture could be used, however, rather than controlling relays or measuring current meters and thermoprobes, one could utilise IR tripwires, radio modules based on LoRAWAN (Google "The Things Network") and if you'd like to go as so far, there is a "Project Sentry" that allows you to target and track a hostile element. I'd advise paintballs, or a tranq dart, use of lethal force could be pretty damning, especially if the system misfired and took you, a loved one, or say like a Census official out. I saw the videos of an American fellow who adapted what I believe was a Glock to fire from a UAV platform. It was all FUD and paranoia here at home in Oz, I was even called in to give a professional opinion to the Government suit types. Let's just say I'd be making *defensive* devices, and about as passive as one could get. LEDs, HID lamps, loud noises, so on, could be deterrents. Don't kill anyone!

I'm going to stress once more - I do NOT under any circumstances condone placing an offensive lethal weapon on an automated system!

So, at this point, what's the diff?

I've got my loose ends all over the place here. There has been mention of finding broken bits of the usual "95% still works fine!" type electrical and electronic salvage, which are great for subassemblies that'd cost a mint elsewhere. I believe TexasGirl spoke of using her system to control a solar hot water system? I'm all over both of those ideas, and yet... I've lacked the final "push" for a long time, for two reasons: my health would just fail me at the worst moments, and the odd knick knacks you need to tie all the important bits together were just outside my limited budget, and patience to suffer China Cheap, China Fast shipping.

Basically, I kept shooting myself in the foot.

Now, it's likely I'm moving 700km back South to the Hunter Valley, leaving behind the Richmond Valley I am now proud to call my Home, in this last two weeks, finally breaking my bad habit of calling Lithgow Home. This is a medical necessity, but I've thought so many times, if only I could get an easy going contract in, and some steady milestones based payments, I'd be golden...

I can give a far more detailed breakdown of my onhand parts, even go so far as to make a Google spreadsheet for such. The concentrated solar hot water, to be electrical, heat for water and industrial process and absorption cooling and refrigeration project is the best advanced right now, but to be honest, the conventional 12VDC "junkbox" photovoltaic system is probably in a better position to be completed quite expediently. I'd presume perhaps $150 - $200 in parts and $200 in refurbished solar panels would get that one going, and complete with very cool management features, such as graphing, profiling, and if you really wish, access to maritime shortwave weatherfax broadcasts (or Internet weather scraping - WeatherUnderground springs to mind, although in a grid down situation, the Internet is likely toast).

A very cool bonus is a 12VDC brushed motor controller supervisory package I was making to run a cheap Chinese scooter motor I scavenged off the dump to assist me with running my hand powered camping washing machine, although the applications are limitless, you can even make linear actuators for them... It's pretty much at the point where an overheat alarm will shut the controller down, after using a PWM fan to keep it cool. Firmware is 40% written, I need some last few "nice parts" although I'm going to impose upon adopted family members. That supervisory package is generic to ANY motor controller, and motor too, if you'd wish to utilise thermoprobes on the motor. There are far, far more features planned.

If any of this sounds useful, let me know! Cheers!