background preloader

Arduino-info - home

Arduino-info - home
Related:  Arduino programmingArduino

Using MQTT to connect Arduino to the Internet of Things | Chris Larson Recently I attended the AT&T Hackathon for Machine to Machine and Internet of Things. Patrick and I didn't come up with a compelling application. Instead, we spent the time creating a tutorial on how to connect an Arduino with an Ethernet or GSM shield to the Internet of Things through 2lemetry's MQTT service. Here is the tutorial as it was written. MQTT & Arduino Tutorial Chris Larson, Patrick Ester AT&T Foundry Hackathon 14 - 15 September, 2013 The following is a set of directions used to successfully connect an Arduino Uno with Ethernet shield and the Arduino Leonardo with the 3G shield to the 2lemetry MQTT web service. Hardware Arduino UNO or Arduino Leonardo, Ethernet Shield, 3G/GPRS Shield Software Arduino IDE v. 1.0.5 Libraries Pubsub from Knolleartlemetrytimer library v. 1.2 Installation of libraries on Arduino For use with an Arduino Uno and the Ethernet shield, you will need the PubSubClient library ( Create MQTT Account Create a new sketch.

Lab Guide: Arduino Hardware | Neil's Log Book In this document I distinguish between Arduino code and AVR code. In fact they are the same thing: what I call Arduino code is a C/C++ function library written using AVR code and targeting the specific hardware used in Arduino microcontrollers. The purpose of Arduino code is to hide AVR code as much as possible, ostensibly to make programs easier to read and write. You will need to read and write code in the Arduino style, and may need to use the AVR style sometimes. The AVR Hardware Specification The Seeduino is based on the ATmega1280 AVR microcontroller. [PDF, 9 MB] It’s 400+ pages, you don’t need to know the whole thing, but you can’t read or write AVR code without it. This general pattern indicates a bunch of bits being set in a register. The _BV(…) macro transforms a pin identifier into its Bit Value. You can’t always just search the document. Arduino Pins vs. AVR: Package Position Number AVR: Port and Pin Number

Exploring Arduino | Companion Site for the Book by Jeremy Blum Misc. Projects&Random Useless Stuff » Blog Archive » Playing with STC15L204 : memory layout / IAP&EEPROM Well, the STC15L204 data-sheet is not very clear on some aspects (the device is simple enough to compensate…). I almost totally forgot that this device had a 512 bytes E2PROM… And I also wanted to explore its memory to try to figure where ISP code could be located, thus I made a small program to dump the memory content , first using a code pointer (something like « ptr=(__code unsigned char *)addr; » ) and then using the IAP registers (and to get some output in the IAP section, I have put a write 0×55 at address 0×123). Here are the results (only displaying lines that does not contain only 0xFF) : On first run : > Device ready 0000 02 00 13 32 FF FF FF FF FF FF FF 02 02 5F 12 00 .... 0310 50 52 4F 4D 0D 0A 00 0D 0A 3E 20 45 4E 44 0D 0A 0320 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 0FF0 FF FF FF FF FF FF FF FF FF 00 0B 00 54 00 A4 BD > IAP/ISP/EEPROM 0120 FF FF FF 55 FF FF FF FF FF FF FF FF FF FF FF FF > END So here are my conclusions :

Using a Temp Sensor | TMP36 Temperature Sensor Connecting to a Temperature Sensor These sensors have little chips in them and while they're not that delicate, they do need to be handled properly. Be careful of static electricity when handling them and make sure the power supply is connected up correctly and is between 2.7 and 5.5V DC - so don't try to use a 9V battery! They come in a "TO-92" package which means the chip is housed in a plastic hemi-cylinder with three legs. Reading the Analog Temperature Data Unlike the FSR or photocell sensors we have looked at, the TMP36 and friends doesn't act like a resistor. Remember that you can use anywhere between 2.7V and 5.5V as the power supply. If you're using a 5V Arduino, and connecting the sensor directly into an Analog pin, you can use these formulas to turn the 10-bit analog reading into a temperature: Voltage at pin in milliVolts = (reading from ADC) * (5000/1024) This formula converts the number 0-1023 from the ADC into 0-5000mV (= 5V) Simple Thermometer Getting Better Precision

Electronics | Scargill As this is now abuzz-phrase you’ll see littering the press, I thought I’d put in my two-pence worth on this “new” subject. The “Internet of Things” is a phrase used to describe things that can be controlled or monitored (or both) over the Internet. In 1962 I was too young to be aware of what was happening outside of my own house! but at this time, a fellow called Licklider from MIT was describing what he called a “galactic network” concept in which computers all over the world would talk to each other. In 1963 my interest in electronics started with a “Philips E10” kit which started me on the path of building radio receivers, controlling lights and motors.. and I’ve been involved with electronics since then, writing articles, building machines and eventually turning my interest into a business in the 80’s and beyond. That takes care of the local connectivity while the Internet allows that remote control to extend worldwide.

Arduino for Visual Studio and Atmel Studio extension Sign in to write a review Sort by: Hi everyone, Now this is a great tool for debugging those tiny processors almost as good a the big ones. cheers and keep up the good work John I have been using Arduino IDE for ages, and it has served me well so far. Very nice product for an Arduino developer using Visual Studio.I should say: a must to have to be efficient. It really worth the moneyAlex Awesome and very first class add-on, makes developing for Arduino seem more of a professional platform and less of a hobbyists toy. Outstanding! A very good replacement for the Arduino IDE (which is basically only a text editior). It would be really necessary to make this available for Libelium Waspmote. Excellent product and SUPER support! Even though the Arduino itself is a great piece of hardware and software, one of its weak points is the IDE. I've been using the plugin with VS2008 and have now upgraded to VS2012. by Nerp | September 21 2012 Thank you! The IDE Arduino deserves Highly recommended.

My Tech Weblog | Gadget Heaven Interrupt based Pulse Counter Interrupt based Pulse Counter Arduino sketch example for interrupt based pulse counting: //Number of pulses, used to measure energy. long pulseCount = 0; //Used to measure power.unsigned long pulseTime,lastTime; //power and energydouble power, elapsedkWh; //Number of pulses per wh - found or set on the meter.int ppwh = 1; //1000 pulses/kwh = 1 pulse per wh void setup(){ Serial.begin(115200); // KWH interrupt attached to IRQ 1 = pin3 attachInterrupt(1, onPulse, FALLING);} void loop(){ // The interrupt routinevoid onPulse(){ //used to measure time between pulses. lastTime = pulseTime; pulseTime = micros(); //pulseCounter pulseCount++; //Calculate power power = (3600000000.0 / (pulseTime - lastTime))/ppwh; //Find kwh elapsed elapsedkWh = (1.0*pulseCount/(ppwh*1000)); //multiply by 1000 to pulses per wh to kwh convert wh to kwh //Print the values. Accuracy Range of 0 to 25kW (typical range for solid state pulse output meters): 1000 pulses per kWh Notes

Electrodragon Blog | Millions of Prototyping Components Online! Interrup based pulse counting with sleep mode This sketch detects pulses and prints to serial the character P. In order to reduce the power consumption the Atmega 328 is put into sleep mode in-between pulses. The interrupt pulse input (on digital input pin 2 or 3) is used to wake up the device. Unfortunately a value for power cant be calculated as the timers are off in sleep mode. Credit goes to Donal Morrissey for his clear tutorial on arduino sleep mode: Sleeping Arduino

Arduino | bitknitting I’m in the thick of the Contextual Electronics course. I’m learning a a lot about designing circuits, using kicad, picking parts, and building a PCB. The course has inspired me to make a breakout board for the RFM69 (@ 433MHz) that is controlled with an Arduino Uno instead of a Moteino. The RFM69HW breakout board will allow me to easily prototype the Base Station (early version discussed here) connected to one of the seemingly many Arduino Unos I have collected. The goal of this post is to build a schematic in kicad’s eeSchema tool that correctly identifies the circuit and components for an RFM69HW breakout board. Learning electronics is an amazing community experience. It is in this spirit I thank: plutonomore has posted a schematic and board layout (Eagle) that is a RFM69HW shield for the Arduino. ‘THANK YOU! The challenges I have run into trying to use the “off the shelf” RFM69HW / W with the Arduino Uno on a breadboard include: The schematic addresses these challenges. Ferrite Bead

OneWire in Due Hi Kcore. Thank you for your time testing. Ok, those are good news! This leaves me more confident. I Had to tweak the timings in read and write timeslots, and I was affraid that i might be just tweaking the lib for my own probes or probe cable length, etc. That proves the opposite. Regarding the original example, I have the same problem, I only get FFFFF. I've left that aside to first conclude if the actual code work with every prob. We are now 3 with working due with onewire. Unfortunately, I can't continue to test why it doesn't work with example, has i told before, I've accidentally burned my due... My suggestion now, is to transport the discovery process to the function that works and test it( and removing ds.skip() ). If more people joins this effort, maybe we can get to a final library faster. My test function was first built a very long time ago based on that example, it should work... Let us know if you move forward with this! Regards, João

When Do I Water My Plants? (Soil Hygrometer Sensor) Today's project is reading a soil hygrometer in a house plant to determine the moisture level. The sensor we are using is the Sunkee Soil Hygrometer, which has analog and digital output. It is marked VCC (5v), Gnd, D0, and A0. I dropped the sensor into a glass of water, with the water level the same level as the soil would be on the sensor. Turning on a pump when the moisture level drops below a certain point and running it for a certain amount of time would be a simple addition to this project. Here is the sketch and the output: And more photo's of the project: int soil=0; // the loop routine runs over and over again forever: void loop() { // read the input on analog pin 0: int sensorValue = analogRead(A0); sensorValue = constrain(sensorValue, 485, 1023); // print out the value you read: //Serial.println(sensorValue); //map the value to a percentage soil = map(sensorValue, 485, 1023, 100, 0); // print out the soil water percentage you calculated: Serial.print(soil); Serial.println("%");

Related: