Tuesday, December 30, 2014

Programming the Leixen VV-898 with CHIRP

Previously I posted about manually programming the new Leixen VV-898 from Radioddity, and tonight had the opportunity to program the radio using CHIRP and the programming cable Radioddity just sent me. I downloaded CHIRP, plugged in the cable, and downloaded the settings from my radio. I made a couple of changes, and uploaded the changes back to the radio. What follows are the steps I took, and a video of my setup. Enjoy!


  • Install the CHIRP software 
  • If you get a message that the software may not have installed properly, just override and click the button to tell it that it did.
  • Plug in usb cable into the computer, wait for prolific driver to install (can take a few minutes). then plug the other end into the radio (microphone jack)
  • Now run the chirp program (it will be on your programs menu)
  • Click "Radio" on the menu, and choose "Download from radio"
  • You will be asked for the port number, vendor (Leixen), and the model (VV-898). click ok.
  • A "cloning from radio" progress bar pops up.
  • When it's done, the radio will play a  tune, and a spreadsheet of your settings will show.
  • Make changes per your repeater requirements. 
  • Click radio on the menu, and upload your changes back to the radio.
Official CHIRP Documentation - http://chirp.danplanet.com/projects/chirp/wiki/Beginners_Guide

Video:

D Shell connectors, DB-9's and other Nonsense

30 + years in IT, and I remember many tech's and computer folks talking about DB-9 serial connectors. I needed a d connector for a joystick to Arduino project, and found to my amazement we've been calling them wrong for years (ok, so I kinda remember the correct terminology, but the wrong ones were so commonly used). The Joystick uses a DA-15, the Serial a DE-9, and the printer used a DB-25. D stood for the shape of the shell, the second letter (A, B, C, or D) stood for the size, and the numeral, the number of pins or sockets. VGA is a DE-15HD, or High Density.

http://en.wikipedia.org/wiki/D-subminiature


I don't even want to get into the "RJ-45" Connector naming issue, but I guess I will. Ethernet does not use a RJ-45 connector. Ethernet uses a 8P8C connector. a RJ-45 is a mechanically-keyed variation of the 8P8C body with an extra tab that prevents it from mating with other connectors, used in telecom applications.

http://en.wikipedia.org/wiki/Registered_jack#RJ45

Hope this sheds some light on issues you never knew were an issue, LOL

Thursday, December 18, 2014

Packt5Dollar $5 Dollar Tech Book / Video Sale

Merry Christmas! Take advantage of Packt5Dollar‬ this Holiday! Electronics and Programming books -

The $5 eBook Bonanza is here!

Treat yourself to the eBook or Video of your choice for just $5 and get as many as you like until January 6th 2015. To get you started, we've put together the Top 20 Titles of 2014 for you to pick up here. But don’t forget, you can get ANY eBook or Video for $5 in this offer.

http://bit.ly/1x20UiM

Founded in 2004 in Birmingham, UK, Packt’s mission is to help the world put software to work in new ways, through the delivery of effective learning and information services to IT professionals.

Working towards that vision, we have published over 2000 books and videos so far, providing IT professionals with the actionable knowledge they need to get the job done –whether that’s specific learning on an emerging technology or optimizing key skills in more established tools.

As part of our mission, we have also awarded over $1,000,000 through our Open Source Project Royalty scheme, helping numerous projects become household names along the way.

Wednesday, December 17, 2014

Remote Reprogramming your Arduino

Need to make changes to a Arduino that's remote? Monitor, Control, even reprogram remotely using your web browser on any platform from phone, tablet, or pc.

Connect the $30 CoPiino "HAT" to a Raspberry Pi, install the BlueberryC software, and you can remotely control and reprogram the onboard Arduino compatible. Full shield compatibility with existing Arduino shields.





Tuesday, December 9, 2014

SainSmart Support Forum Back Online!


The SainSmart support forum is back online! SainSmart is one of my favorite sources for Arduino's, Raspberry Pi's, and related sensors and modules. I've posted some of my favorite projects there, and will be posting more soon. Come and learn more about the products they sell, programming, electrical connections, and more. Post your favorite SainSmart based projects. Welcome to the SainSmart Community! http://www.sainsmart.com/vanilla/

Tuesday, November 18, 2014

Emulating An Arduino Sketch in a Spreadsheet

Many times I'll mock up my Arduino formulas in a spreadsheet before I start building a sketch. One of the more complicated Arduino commands to emulate is the MAP command.

The Arduino code:

height = map(adc, 171, 512, 12, 0);

In Excel becomes:

= (adc-in_min)*(out_max-out_min) / (in_max-in_min) + out_min

The following emulates a voltage divider that converts a fluid level of a container to gallons. It uses a reverse map as decreasing resistance of the sensor means increasing depth.


Sunday, November 16, 2014

Installing & Programming the VV-898 2m / 70cm Ham Radio

Ricky and I installed my new Leixen VV-898 2m/70cm 10 watt dual band Ham Radio in my truck today. It's $135 delivered, from http://www.radioddity.com. Ricky pulled out the ashtray and installed the radio in the exposed cavity. I then wired the power to the power leads from the old cigarette lighter (radio is about 10 watts, lighter can handle 150 watts), and we ran the antenna cable under the seats and out the back window (temporary, there's a rubber plug in the floor behind the seat).

UPDATE: I've programmed two of our "local" repeaters, one on the SCHeart system (Murrel's Inlet, SC), and one on the PALS system (Greelyville, SC). Both are about 35 miles from me (Andrews, SC) in opposite directions. I'm getting great signal reports, and both TX and RX is clean and clear.

Programming the radio to talk to our local repeater was a bit of a challenge (Software programming further down). Complete details were not in one place. I've collected the bits, and assembled them in an orderly and easy to follow collection.

In order to program the radio, you need to put it into Frequency mode (defaults to Channel mode). Press B on the Mic, and verify the channel + and - buttons actually change the frequency, and not the channel number.

Now enter the frequency of your repeater output using the numeric buttons on the Mic. I could not enter 146.805 (kept going to 146.800), so I knew the step was off.

Press M (which puts you in Menu mode), and CHA+ till you get to Menu 41. Press M again to enter Menu 41, and CHA+ until step says 5KHz. Press M again to back out to Menu.

Now enter the frequency of your repeater with the Mic keypad.

Press M to enter Menu mode, then:

Press CHA + or - to Menu 34, Press M to enter, and CHA- or + to pick your offset (600 KHz for us), then M again to exit.

Press CHA + or - to Menu 35, then M to enter. Set the offset type to -RPT (or whatever your repeater uses) with the CHA+ or -, then M to exit out.

Press CHA + or - to Menu 10, press M to enter, and CHA + or - to select CTC, then M to exit.

Press CHA + or - to Menu 11, press M to enter, and CHA + or - to select CTC Code (85.4 in our case), then M to exit.

Press CHA + or - to Menu 5, press M to enter, and CHA + or - to select Channel 1 (or whatever channel you want to save to), then M to exit.

Wait 3 or 4 seconds for the timeout to exit Menu, and press B to exit Frequency Mode. Now you should be able to use the CHA + or - to select saved channels.

Find out more - http://www.radioddity.com/us/lx-898-mobile-radio-60db-4w-10w-dtmf-vehicle-mobile-dual-band-transceiver-136-174-400-470mhz.html








If you have a Kenwood programming cable, a USB -> TTL adapter, or want to make one, you can download the CHIRP programming software, and build a cable adapter like the following:


Wednesday, November 12, 2014

The MQTT Connection

MQTT stands for MQ Telemetry Transport. It is a publish/subscribe, extremely simple and lightweight messaging protocol, designed for constrained devices and low-bandwidth, high-latency or unreliable networks. The design principles are to minimise network bandwidth and device resource requirements whilst also attempting to ensure reliability and some degree of assurance of delivery. These principles also turn out to make the protocol ideal of the emerging “machine-to-machine” (M2M) or “Internet of Things” world of connected devices, and for mobile applications where bandwidth and battery power are at a premium.

The MQTT protocol is based on the principle of publishing messages and subscribing to topics, or "pub/sub". Multiple clients connect to a broker and subscribe to topics that they are interested in. Clients also connect to the broker and publish messages to topics. Many clients may subscribe to the same topics and do with the information as they please. The broker and MQTT act as a simple, common interface for everything to connect to. This means that you if you have clients that dump subscribed messages to a database, to Twitter, Cosm or even a simple text file, then it becomes very simple to add new sensors or other data input to a database, Twitter or so on.

The Arduino makes a handy MQTT client, and Mosquitto (yes, with two T's) on the Raspberry Pi makes a handy MQTT broker (server).

An example Arduino project

What can you build?

Arduino Networking

As much fun as it is connecting sensors to an Arduino, and displaying data on a LCD, lighting LED's, or other local actions, the real power is when you connect to a network. Whether it's a local network and you are communicating between them or collecting data in a central database (Raspberry Pi), or connecting to the internet and contributing local weather data to a server, or broadcasting data with email or Twitter, even pulling down information like emails, tweets, or scraping other websites for data for local display, there's a lot of fun to be had.

One book that explains how this all works, and gives you easy to replicate (and understand) projects is "Arduino Networking" by my friend Marco Schwartz. This book delves into the abilities of network connectivity, explaining how and why it works, and leaves your mind swirling with new applications, and the ability to execute them. It's a must have on any maker's shelf!

Communicate with Marco at his Forum "Open Home Automation" on G+

Thursday, October 30, 2014

Making the Raspberry Pi Talk 5v

Coming from the Arduino world, most everything I do is 5v logic. It's been a switch for me now that I'm integrating my Raspberry Pi's into my Arduino solutions (they really are complementary). We have been following a great guy by the name of Jean-Damien, who has a simple solution to this problem:

When I received my Raspberry Pi the first thing I wanted to try was to use it to communicate with the electronic world.
Looking at the excellent raspberrypi.org official forum I’ve found posts explaining that the Debian image was already configured to redirect the linux system console to the broadcom chipset UART interface. Giving a try by connecting directly a scope to the GPIO pins confirmed it.
As you probably know, the broadcom chip is running at +3.3v so the GPIO pins cannot handle more than that. As “still classic” TTL are running at +5v we need to do some level shifting operation before interfacing devices to the GPIO pins. Note that if you intend to work only with 3.3v devices, this shifting isn’t required.
Read more at http://blog.sunyday.net/?p=36#more-36

Tuesday, October 28, 2014

Printing with the Arduino

http://blog.sunyday.net/
So you built this cool Arduino based test gear that does quality control tests on a piece of hardware. It's time to ship to the customer, and you need to send them a sheet of paper with the test results. How do we get the Arduino to print to a printer?

Years ago, serial printers were quite common. I remember installing a lot of Okidata Line Printers connected to Unix Servers using serial cables. Those printers use a type of serial called RS-232. The signals range from +10v to -10v, which allowed long distance cabling. But how would that work with the 5v signaling the Arduino can handle?

There's a chip called the MAX232. It's a RS-232 to TTL Serial converter. TTL serial is the type of serial the Arduino speaks. With a inexpensive converter board, you can create statements like Serial.println("This is printed text"); and This is printed text shows up on the printer.

All you need now is a serial printer. You can comb the catacombs of discarded computer equipment, or head over to ebay and see what they have!

Mini Thermal Receipt Printer Starter Pack

https://www.adafruit.com/products/600

The Raspberry Pi Laptop, more than just a laptop!

More than just a cool laptop, it's a learning tool you build and expand yourself!
Pi-Top provides a platform to expand your knowledge in hardware creation. The kit takes you through each of its components and their functionality, so that you can use Pi-Top as a tool for your own projects in the future.
Pi-Top focuses on teaching people how to create real hardware. Online and integrated lesson plans teach you how to understand electronics, create Printed Circuit Boards, and 3D print objects.

Learn more at
https://www.indiegogo.com/projects/pi-top-a-raspberry-pi-laptop-you-build-yourself/x/4943498

For more delicious Raspberry Pi goodness, see http://www.sainsmart.com/raspberry-pi.html


Sunday, October 26, 2014

A Calibrated Solid State Radiation Detector

I've been playing with radiation detectors. The common solution is a Geiger - Müller tube, but those solutions tend to be expensive, and contain high voltage connections. PIN Diodes can be used, and are very inexpensive, but are uncalibrated.

A nice in between is a calibrated (3.4 cpm/µSv/h) solid state sensor from Teviso, the RD2007. There are three such sensors in this family, but the RD2007 is a very affordable solution, applicable to civilians and citizen scientists alike.

It has three connections, 5v, Gnd, and data out. The output line ticks high when radioactivity is sensed. Connect this to an interrupt on the arduino, and you can easily display accurate radioactivity readings.

For more information on building Radiation Detectors, see http://opengeiger.de/index_en.html

Schematic:



Code:


#define MAXCNT 10
#define CalFactor 3.4
volatile int counter = 0;
unsigned long oldTime = 0;
float rate = 0.0;
int speaker = 5;

void setup()
{
 pinMode(speaker, OUTPUT);
Serial.begin(9600);
 int i = (int)(rate*10.0);
 Serial.println(i,3);
 attachInterrupt(0, count, RISING);
}
void loop() {
 unsigned long time;
 unsigned long dt;

 time = millis();
 if (counter >= MAXCNT) {
 dt = time-oldTime;
 oldTime = time;
 counter = 0;
 rate = (float)MAXCNT*60.0*1000.0/(float)dt/CalFactor;
 int i = (int)(rate*10.0);
 Serial.println(i,3);
 }
}
void count()
{
 counter++;
 digitalWrite(speaker, HIGH);
 delayMicroseconds(50000);
 digitalWrite(speaker, LOW);
}

Friday, October 24, 2014

Does the Windows FTDI Update "Brick" your Arduino?

The story going around is Microsoft has destroyed FTDI USB to Serial Interface chips in the marketplace with the recent update. Many people are up in arms over this "clearly illegal act".

But is it illegal, and how much harm has it done? Microsoft obtains the FTDI Drivers from FTDI. The FTDI drivers provided by FTDI are certified to work with their chips. There are devices on the market that use counterfeit FTDI chips, that this update will not work with. In fact, the update turns the chip "off".

Is that illegal? Not that I can tell. Microsoft themselves disable Windows functionality if it determines it's not a genuine copy. Fortunately, there is a utility that you can run to turn the chip back on.

How does this Affect Arduino Users? If you are using recent Arduino boards, not at all, as they no longer use FTDI chips (and came with legitimate FTDI chips when they did use them). If you are using arduino clones, like Sainsmart and others, there may be a non-FTDI (even though it says FTDI) chip on board. The following video explains how to fix your "bricked" non-ftdi interface. No damage has been done, and you can get your equipment working again.
 

FTDI responds to the outrage:

We appreciate your feedback, comments and suggestions.

As you are probably aware, the semiconductor industry is increasingly blighted by the issue of counterfeit chips and all semiconductor vendors are taking measures to protect their IP and the investment they make in developing innovative new technology. FTDI will continue to follow an active approach to deterring the counterfeiting of our devices, in order to ensure that our customers receive genuine FTDI product. Though our intentions were honourable, we acknowledge that our recent driver update has caused concern amongst our genuine customer base.  I assure you, we value our customers highly and do not in any way wish to cause distress to them. 

The recently release driver release has now been removed from Windows Update so that on-the-fly updating cannot occur. The driver is in the process of being updated and will be released next week. This will still uphold our stance against devices that are not genuine, but do so in a non-invasive way that means that there is no risk of end user’s hardware being directly affected.    

As previously stated, we recommend to all our customers to guarantee genuine FTDI products please purchase either from FTDI directly or from one of our authorised distributors.  http://www.ftdichip.com/FTSalesNetwork.htm

If you are concerned that you might have a non-genuine device, our support team would be happy to help out.

Yours Sincerely

Fred Dart - CEO

Monday, October 6, 2014

Fingerprint Scanning with the Arduino

A secure way to enable access to projects is through the use of fingerprint scanning. This tutorial uses the 5v TTL unit from Sparkfun. The scanner does not come with a cable, so make sure you also order the JST SH cable. The wires from the JST SH cable are too fine to plug into the Arduino directly, so we are using a solderless breadboard to make the connections with jumper wires.

Fingerprint Scanner -> Arduino
Pin 1 - TX    (black)             D4 - RX                    
Pin 2 - RX    (white)             D5 - TX
Pin 3 - Gnd   (white)            GND
Pin 4 - VCC  (white)            +5v

No resistor is necessary for 5v use, regardless of what the sample sketch's suggest.

The sketch uses SoftSerial, so the pins on the Arduino can be changed in the sketch.

You will need to download the examples and libraries, then upload the Enroll sketch to make the unit recognize your finger print. Follow the instructions in the serial monitor, then upload the IDfinger sketch. Now when you scan your finger, the serial monitor will show "Verified" (with the appropriate ID number) or "Finger not found" if it's not recognized. All you need to do is to enable a relay if a correct fingerprint is detected, and possibly write a entry line to a SD card with time and date stamp for a entry log.




Thursday, October 2, 2014

Protect Your Outdoor Arduino Sensors

Outdoor Arduino projects, especially temperature, humidity, and barometric pressure, need access to outdoor environmental conditions, but protection from sunlight and rain. This is done with a louvered box called a Stevenson Screen or Cotton Region Shelter.
"A Stevenson screen or instrument shelter is an enclosure to shield meteorological instruments against precipitation and direct heat radiation from outside sources, while still allowing air to circulate freely around them. It forms part of a standard weather station. The Stevenson screen holds instruments that may include thermometers (ordinary, maximum/minimum), a hygrometer, a psychrometer, a dew-cell, a barometer and a thermograph. Stevenson screens may also be known as a cotton region shelter, an instrument shelter, a thermometer shelter, a thermoscreen or a thermometer screen. Its purpose is to provide a standardised environment ..." - http://en.wikipedia.org/wiki/Stevenson_screen
This is perfect for our outdoor Weather Station
Temperature, Humidity, Barometric Pressure, Dew Point, Wind Chill, and Heat Index Project 

Here's a DIY project so you can build your own outdoor Arduino Sensor Shelter!

http://www.instructables.com/id/Stevenson-Screen-weather-station/#step0


Wednesday, October 1, 2014

What's your favorite type of sensor?

Arduino's are great devices because they let us sense our environment around us. There are a great number of sensors available that can work with the arduino. Digital sensors allow us to sense whether something is on, or off, like a door switch. Analog sensors allow us to sense how much of something exists, like how much light, or pressure. Some sensors give us actual data streams, like a gps sensor, instead of simple on/off, or a varying voltage.

What are your favorite types of sensors?
What do you like to sense?
Give us feedback if we missed yours, or post links to the project you have personally made!


What is your favorite sensor?











pollcode.com free polls

Poll doesn't work? See
What is your favorite sensor?

Saturday, September 27, 2014

Arduino Seismic / Vibration Sensor

Want to sense Earthquakes? Maybe equipment vibration? We have put together a quick and inexpensive project that will sense vibration. We use a Vibration sensor from Sparkfun, a SainSmart UNO, and a I2C LCD.

We have created a bar graph that moves back and forth based on vibration intensity, and a "Earthquake" message that displays when the level exceeds a threshold.

I2C library and LCD tutorial

See Code and Video below:


Code:

//sensitivity variables
int minimum = 200;
int maximum= 1023;
int maxdelay = 400;

#include <Wire.h>
#include <LCD.h>
#include <LiquidCrystal_I2C.h>
#define I2C_ADDR 0x27 // change to your address found with I2C scanner
#define BACKLIGHT_PIN 3
#define En_pin 2
#define Rw_pin 1
#define Rs_pin 0
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7
LiquidCrystal_I2C lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

// Custom Character
byte seismic[8] = {
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
B11111,
};

//defines the pin connections
int sensePin= 2;


void setup()
{
Serial.begin(9600);

lcd.begin (16,2); // or (20,4)
// Switch on the backlight
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(HIGH);

lcd.createChar(0, seismic);
lcd.begin(16, 2);

}

void loop()
{
int reading= analogRead(sensePin);
Serial.println(reading);
reading = constrain(reading, minimum, maximum);
Serial.println(reading);
reading = map(reading, minimum, maximum, 0, 15);
Serial.println(reading);
lcd.clear();

for (int i=0; i <= reading; i++){
lcd.write(byte(0));

}

if (8<=reading){
lcd.setCursor(0, 1);
lcd.print("Earthquake");
delay(500);
}

delay(maxdelay);
lcd.clear();

}






Saturday, September 20, 2014

Arduino Himalayan Salt Candle

Himalayan Salt Lights are really cool looking translucent salt "Rocks". With a lightbulb inside, not only are they a soothing warm light, but they are supposed to give off Negative Ions that leave you refreshed. I have added a Arduino and  SSR to give my light a flickering candle look, which makes it a very interesting conversation piece.

Video, code, and parts list below!


Parts:

Arduino UNO
Solid State Relay (SSR)
Himalayan Salt Light

Code:


int lightPin = 9;   
int randNumber;

void setup()  { 
  randomSeed(analogRead(0));
  pinMode(lightPin, OUTPUT);  

void loop()  { 
    randNumber = random(50, 254);
    analogWrite(lightPin, randNumber);   
    delay(randNumber*3);     
  } 


Tuesday, September 16, 2014

De-Soldering Can Be A Pain!

I typically hate de-soldering. Removing old parts, or re-working a new design can be tricky, as you can over heat a part, damage the board, etc. Well, I've been using a inexpensive manual vacuum tool for months now, and it works GREAT! Cleans the holes out well, and the parts drop right out. The Soldapullt DS-017 is the perfect companion to my Sparkfun variable temperature soldering station.


Tuesday, September 2, 2014

The Under $5 Arduino

Next time you build a permanent project, don't waste a $15-$30 Arduino board. You can get the same functionality of the Arduino UNO for less than $5 at http://goo.gl/ZhOrrh

No usb or power onboard (requires 5v). Program it with an existing UNO or a FTDI Cable.

Will post a programming tutorial as soon as these arrive!

Friday, August 22, 2014

Pan & Tilt, Arduino Style

I've been wanting to play with an Arduino controlled Pan & Tilt Mechanism for quite some time. Today I ordered a kit that will be a prototype for a solar array on a bigger scale. I'll be using this Pan & Tilt Mechanism. The kit includes brackets, two miniature servos and all the nuts and bolts. I'll mount a small solar panel from a garden light on here, and keep you posted as to my progress.

Update: Received kit 8/25/14
Check your hardware package before starting assembly! Mine was missing a small self tapping screw for holding the servo to the wheel. Jameco sending replacement hardware.
Update: Received replacement hardware 8/29/14. Jameco Rocks!

Thursday, August 21, 2014

Albert Piganti Updates Arduino Basic Connections

Albert Piganti, known as Pighixxx, is well known for his beautiful artwork depicting various microcontrollers like the Arduino and Raspberry Pi, and the various accessories and connections that can be made with them. He is updating his original designs, and you can find them at http://forum.arduino.cc/index.php?topic=154549.msg1850477#msg1850477
and
http://forum.arduino.cc/index.php?topic=154549.msg1850479#msg1850479

Friday, August 15, 2014

4 Channel 16 Bit ADC Arduino / Raspberry Pi

The Arduino UNO has five 10 bit Analog to Digital Converter pins (0-1023), but I needed higher resolution. I'm working with a I2C connected 16 bit 4 channel ADC from Adafruit called the ADS1115. 16 bits of resolution allows me to measure signed integers with values ranging from negative 32768 through positive 32767 (-5v to +5v). Although I'm running this single ended (measuring 4 separate inputs in respect to ground), it can also run in a 2 channel differential mode. This would measure the voltage difference between AIN0 and AIN1, and between AIN2 and AIN3. I'm multiplying the value being reported by the ADC by .000188 (188uV / bit) to get the voltage being supplied to the input.

Click for a cool ADS1115 project, reading a current shunt!



The Raspberry Pi has no ADC, and can only read digital inputs, so this would be a nice addition, as the Pi does have a I2C interface. I'll post an article on the code for doing this soon. Here is the code for the Arduino. Complete tutorial, connections, and library available at https://learn.adafruit.com/adafruit-4-channel-adc-breakouts

Raspberry Pi code and examples - https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code

Arduino Code:

#include <Wire.h>
#include <Adafruit_ADS1015.h>

Adafruit_ADS1115 ads1115;

void setup(void)
{
  Serial.begin(9600);
  Serial.println("Hello!");

  Serial.println("Getting single-ended readings from AIN0..3");
  Serial.println("ADC Range: +/- 6.144V (1 bit =  188uV)");
  ads1115.begin();
  //ads1115.setGain(GAIN_TWOTHIRDS);
}

void loop(void)
{
  int16_t adc0, adc1, adc2, adc3;
  float volt0, volt1, volt2, volt3;

  adc0 = ads1115.readADC_SingleEnded(0);
  adc1 = ads1115.readADC_SingleEnded(1);
  adc2 = ads1115.readADC_SingleEnded(2);
  adc3 = ads1115.readADC_SingleEnded(3);
  volt0 = adc0*0.000188;
  volt1 = adc1*0.000188;
  volt2 = adc2*0.000188;
  volt3 = adc3*0.000188;
  Serial.print("AIN0: ");
  Serial.print(adc0);
  Serial.print(" ");
  Serial.print(volt0, 4);
  Serial.println(" vdc");
  Serial.print("AIN1: ");
  Serial.print(adc1);
  Serial.print(" ");
  Serial.print(volt1, 4);
  Serial.println(" vdc");
  Serial.print("AIN2: ");
  Serial.print(adc2);
  Serial.print(" ");
  Serial.print(volt2, 4);
  Serial.println(" vdc");
  Serial.print("AIN3: ");
  Serial.print(adc3);
  Serial.print(" ");
  Serial.print(volt3, 4);
  Serial.println(" vdc");
  Serial.println(" ");

  delay(1000);
}

Wednesday, August 6, 2014

Dual RFID Readers

I have an application that needs two RFID readers. Because these RFID readers are SPI devices, they can be connected to the same two data pins (MISO & MOSI), and clock pin (SCK), and only two pins (SDA & RST)  have to be unique. This makes a total of 7 data pins, plus 3.3v and Gnd. I'm taking the 5 sets of serial numbers, and adding them together, and making each reader accept a different set of numbers. Run the serial monitor, scan your badge or keyfob, and then enter the total code into your sketch to make it active. You could have two security doors, and one badge will get you through one, but a different badge can get you through both. Get the code and library here!



Friday, July 25, 2014

Constant Current, or Constant Voltage?

I needed a Constant Current power supply for my bench. Now I don't know if you have priced bench power supplies lately, but they can be several hundred dollars. Not any more! Would you believe a 40v 3a adjustable voltage or current supply for about $20?
http://goo.gl/WYD7m3
I grabbed a used 24vac HVAC transformer, soldered a bridge rectifier on top, and fed the input on this board. I put a 300ma 1w LED on the output, and I'm controlling the brightness by controlling the current, even down to 2ma (dim), all the way up to 300ma (blindingly bright). I could go higher, up to 3000ma, but that will let the magic smoke out.


Wednesday, July 23, 2014

Put the Physical into Physical Computing!

The whole point of microcontrollers and physical computing is doing something with the data sensed. If you sense a temperature, if you sense motion, you act on it. However, There's a bunch of science involved when you want to make things move, making sure you have enough power to move said object. The best explanation of the science of making things move is "Making Things Move DIY Mechanisms for Inventors, Hobbyists, and Artists" by Dustyn Roberts.
I've written about this book before, and I own it in paperback and kindle version, because it's that important to Arduino and Raspberry Pi owners. If you want action, you need this book. It simplifies the "magic" of making your microcontroller make things move, in some cases, very large objects.

Sunday, July 6, 2014

Creating the Super Simple Library

Functions allow you to remove repetitive routines from your main code, and call them when needed. There are times when you would like to move commonly used functions out of your Arduino sketch entirely, and into a library you can call from your sketch. This helps clean up your sketch visually, and allows you to reuse code without having to recreate it each time. Below is a simple sketch that takes a value in Celsius, and converts it to Fahrenheit. I'll show you how to convert that into a called function, then I'll repost it by calling an external library that does the same thing. This is kept simple, in order to show the process. There is much more you can do with libraries, but this is the bare minimum to get it to work.

Original sketch without a function:

float celsius = 20;
float tempF = 0;

void setup()
{
  Serial.begin(9600);
  tempF = (1.8 * celsius) + 32;
  Serial.print(tempF);
}

void loop()
{
  
}



Original sketch with a function:

float celsius = 20;
float tempF = 0;

void setup()
{
  Serial.begin(9600);
  tempF = tempConvert(celsius);
  Serial.print(tempF);
}

void loop()
{
  
}


float tempConvert(float celsius)
{
  float fahrenheit = 0;
  fahrenheit = (1.8 * celsius) + 32;
  return fahrenheit; 

}

Now let's remove the function tempConvert, and put it in a seperately called library, ( a pair of .h & .cpp files).

Sketch calling libary:

float celsius = 20;
float tempF = 0;

#include <tempConvert.h>

void setup()
{
  Serial.begin(9600);
  tempF = tempConvert(celsius);
  Serial.print(tempF);
}

void loop()
{
  
}

put the following two files in a folder called tempConvert, inside the libraries folder.

tempConvert.cpp

// tempConvert.cpp

#include "Arduino.h"   
// use: Wprogram.h for Arduino versions prior to 1.0

#include "tempConvert.h"

float tempConvert(float celsius)
{
  float fahrenheit = 0;
  fahrenheit = (1.8 * celsius) + 32;
  return fahrenheit; 
}

tempConvert.h

/*
 * tempConvert.h
 * Library header file for tempConvert library
 */
#include "Arduino.h"

float tempConvert(float celsius);  // function prototype

For more on creating libraries, see http://arduino.cc/en/Hacking/LibraryTutorial


Sunday, June 29, 2014

Arduino, or a Raspberry Pi, What's better?

Well that question is like asking what's better, a hammer, or a saw? It all depends on what you are trying to accomplish. If you are trying to read analog and digital inputs, make a decision, and control a device, the Arduino is the clear winner. If you need to run a linux operating system, with web and database services, full screen displays, and keyboard and mouse input, then the Raspberry Pi is more appropriate. There are many projects that are best served with a combination of the two. For instance, we use a network of Arduino's as sensors, feeding a database running on a Pi, and other Arduino's are picking up jobs from the database to be executed. This could not be done by an Arduino or a Raspberry Pi alone. So don't limit yourself to making choices, take both home, thay are small!

SainSmart Arduino Uno - $17
Raspberry Pi - $37 (needs a SD Card)




Wednesday, June 25, 2014

Setting up Arduino to work via Windows Embedded and RDP

by Mike Maynard

So here is my situation.  I had the brilliant idea to set up virtual machines for my boys to use, and let them access them via an HP Thin Client, and Windows Remote Desktop.  Great idea right?  I thought so..... right up to the point where I wanted to introduce them to the Arduino.....

The Thin clients are running Windows Embedded Standard (WES) an embedded version of XP.  They then connect to their Win 8.1 pro virtual machines using remote desktop.  Its actually set up so when they log into the the thin client (TC) the remote desktop session (RDP) auto launches and connects them to their virtual machine.

The directions that follow make the following assumptions:

  • You already know how to setup and use an Arduino on a standard computer
  • You are somewhat familiar with driver installations
  • You understand the basics of making a Remote Desktop Connection and how to set its options prior to the connection.


The first problem is, WES does not have driver support for the Arduino.  After much digging I stumbled upon this article - http://www.maxvalente.com/2013/03/installing-arduino-on-windows-embedded/ - which was instrumental in making this work.

I only needed 2 files from his list

  • usbser.sys
  • mdmcpq.inf
I originally tried copies out of a Windows 7 install, but I am not sure they will work.  Not having a handy XP install, I turned to google.  I found the needed files, and downloaded them along with the standard Arduino fileset from www.arduino.cc  (download the zip and not the exe, since we only need the drivers at this point).  Extract the Arduino zip someplace handy, and add the 2 above files to the drivers directory.

Plug in your arduino and let the driver install process start.  Choose the driver folder location inside the arduino directory, and voila - you should have a functional Arduino COM port!  (note: on both of my installs, I had placed a copy of usbser.sys into c:\windows\system32\drivers\ first.  I am not sure if this is necessary or not.  Also on one TC, it asked me to locate that file on my windows xp install disk, I just pointed it to the one in the above mentioned drivers directory and it worked fine)


Now on to the second problem!

Now that we have a working COM port for the Arduino on the TC - we need to pass it through to the RDP session.  I have several hours of banging my head against the wall here, and its really a simple solution, courtesy of this post here:  http://www.thinstuff.com/faq/index.php?action=artikel&id=27

Long and short, upon making your RDP connection, click the options dropdown.  then choose the Local Resources tab, followed by the 'more' button.  Then check the Ports checkbox, and click OK.  Then you can make your connection like normal (or save the connection for simple use later)

Once you connect to your remote session, your Arduino Com port should be passed through to the remote session, using the same Com port  #.

Voila!! - you now have an arduino plugged into a Windows Thin Client, and passed through to the Remote Desktop Session of another machine.


Friday, June 20, 2014

Arduino Bar Code Reader

Use Bar Coded ID Badges in your time card or security application? Want to teach your Arduino to read Bar Codes? Get a PS/2 style card reader, and connect it to The Arduino PS/2 Keyboard Smart Interface, and you have Bar Code Badge ID's flowing into your Arduino security application!


Thursday, June 19, 2014

A Better Arduino IDE?

Everyone pretty much agrees that although the Arduino IDE is simple to use, for professional programming it's just not up to par with mainstream code editors.

I've used Notepad++ for several years as my editing environment of choice, for html, css, php, etc.

Would it be possible to use Notepad++ for Arduino Sketch editing? Well as it is, yes, but there's no syntax highlighting, extension recognition, or easy way to upload sketches to the Arduino (a macro that executes "C:\Program Files\Arduino\arduino.exe" $(FULL_CURRENT_PATH)).

All that and more can be done, with a few tweaks of the environment, and a plugin.

Follow the instructions at

http://sriramiyer.net/blog/2014/02/12/using-notepad-plus-plus-instead-of-the-arduino-ide/

then  download the plugin at http://sourceforge.net/projects/narduinoplugin/ and follow the instructions in the README file.








Tuesday, June 3, 2014

Logic Gates (with pulleys)

Computers are built with Logic Gates. A logic gate looks at a input that is either on or off, and makes a decision, producing a output that is either on or off. Different types of logic gates have different outputs. The following video describes the various types, and the associated "truth tables".

 
Pulley Logic Gates from Alex Gorischek on Vimeo.

Thursday, May 29, 2014

Free Circuit Design and Simulation?

What happens when a bunch of makers and hackers decide that they need multiplatform schematic capture, spice simulation and PCB layout and don't like the idea of having to pay lots of money to buy a huge software suite and then spend weeks learning how to use it? EasyEDA Happens!


Cool Schematic Capture

Draw schematics quickly using the available libraries. Share your work, or import from LTSpice , Altium Designer and Eagle files.

Schematic capture image


Clever Spice Simulation

Verify analog, digital and mixed signal circuits with spice subcircuits and models. Get the results quickly from our cloud based servers!

Spice simulation image


Powerful PCB Layout

Export your PCB files to Gerber files, or order your PCBs from EasyEDA directly. Hardware design never come out so easy!

PCB layout image

Friday, May 23, 2014

Getting Kids Interested in Electronics

When I was a kid, my parents got me the 300-In-1 Electronic Project Lab from Radio Shack. Elenco now makes similar units. Although this really kickstarted my interest in electronics (and a 30+ year career), the springs would get bent out of shape, and if you blew a component, it was not so easy to replace. Now with Snap Circuits, younger children can enjoy the excitement of connecting electronics and seeing and hearing the results, with a much more durable product.

Friday, May 9, 2014

What is 123D Circuits?

With 123D Circuits you can design in a familiar breadboard view and the app will guide you to make professional printed circuit boards with built in layout tools. When you’re done just click to have your boards professionally manufactured and shipped for free worldwide.

What’s also cool is how you can easily, simultaneously work on the same circuit with your friends. And at any point you can compile and emulate your Arduino code inside a live, editable circuit!

http://www.123dapp.com/circuits

Tuesday, May 6, 2014

Win a free Baofeng GT-3 Dual Band Ham Radio!

Win a free Baofeng GT-3!

Just join the forum at http://www.radioddity.com/forum/ and you'll be entered into a drawing for a free Baofeng GT-3 dual band HT! A new radio given away each month to a member of the pool that joined that month. Get in for May!
Related Posts Plugin for WordPress, Blogger...