background preloader

Arduino

Facebook Twitter

InterfacingWithSoftware. Blended Technologies » Blog Archive » Realtime Plot of Arduino Serial Data Using Python. So I got an Arduino a few weeks ago, and just made my second little project: It simply has a piezo element connected to an analog input pin.

Blended Technologies » Blog Archive » Realtime Plot of Arduino Serial Data Using Python

The Arduino polls the value every 100ms and prints it to the serial port. Here is the sketch: /* Knock Poller * ---------------- * We listen to an analog pin, sample the * signal and write it to the serial port. */ int knockSensor = 5; byte val = 0; void setup() { Serial.begin(9600); } void loop() { val = analogRead(knockSensor); Serial.println(val,DEC); delay(100); // we have to make a delay to avoid overloading the serial port } The problem was that I found it was hard to tell what was happening just by reading the values printed to the serial monitor in the Arduino IDE’s serial monitor. So I researched realtime plots/graphs/charts in Python, and sadly didn’t find too much. I repurposed it to listen to the Arduino and set it listening: You can see how my pushing on the knock sensor makes the voltage go up and down.

You can get the code here. Syncronized Serial communication with Arduino. Greetings everyone,I have been working on developing a custom serial 'protocol' for communicating data from a PC to an arduino; specifically for driving a 8x8 LED matrix from audio levels (among other things) Now I had planned to send 8 bytes at a time, 1 byte for each row or column, with values from 0 to 255...

Syncronized Serial communication with Arduino

But I have run into some problems:1) How to signal 'start' or 'end' of a packet of 8 bytes so that the display isn't refreshing with half of one frame and half of another seeing as though each byte needs to range from 0 to 255... and all useful ASCII characters fall within that range.I was thinking of possibly using multiple-byte start/end codes as well as explicitly counting the read bytes once a start byte(s) is read. Arduino Based Washer Controller. Python. Arduino and Python Talking to Arduino over a serial interface is pretty trivial in Python.

Python

On Unix-like systems you can read and write to the serial device as if it were a file, but there is also a wrapper library called pySerial that works well across all operating systems. After installing pySerial, reading data from Arduino is straightforward: >>> import serial >>> ser = serial.Serial('/dev/tty.usbserial', 9600) >>> while True: ... print ser.readline() '1 Hello world! \r\n' '2 Hello world! Writing data to Arduino is easy too (the following applies to Python 2.x): >>> import serial # if you have not already done so >>> ser = serial.Serial('/dev/tty.usbserial', 9600) >>> ser.write('5') In Python 3.x the strings are Unicode by default. >>> ser.write(b'5') # prefix b is required for Python 3.x, optional for Python 2.x. Microcontroller tutorial series: AVR and Arduino timer interrupts. Does your program seem like it’s trying to do too much at once?

Microcontroller tutorial series: AVR and Arduino timer interrupts

Are you using a lot of delay() or while() loops that are holding other things up? If so, your project is a good candidate to use timers. In this tutorial, we’ll discuss AVR and Arduino timers and how to use them to write better code. In our prior article, we covered interrupt basics and how to use external interrupts that are triggered by a pin change or similar event. Check it out if you’re looking to brush up on interrupts in general. This chapter moves on to timer interrupts and talks about their applications in Arduino projects or custom AVR circuits.

What is a timer? You’re probably familiar with the general concept of a timer: something used to measure a given time interval. The beauty of timers is that just like external interrupts, they run asynchronously, or independently from your main program. For example, say you’re building a security robot. How do timers work? Our timer resolution is one millionth of a second.

Welcome. Burn a bootloader to a blank atmega328/atmega328p with an Arduino UNO. Build your own optiLoader shield!

Burn a bootloader to a blank atmega328/atmega328p with an Arduino UNO

You cant use your Arduino UNO as programmer unless you modify it, but i didnt want to do that! Some people had luck using a Resistor and Capacitor to disable the auto reset feature but it did not work for me (Using an Arduino UNO R2) So i tried using a parallel port programmer but never got it to work. It seems easy, so if your interested go ahead and try it yourself, but be warned, could lead to frustration :) Fortunately Bill Westfield wrote optiLoader!

The readme file doesent tell you how to connect the blank chip so i asumed that you need an oscillator and a pull up resistor and... well... it worked! You need: Working Arduino (with µC and Bootloader) - optiLoader will run on that one16MHz oscillator2 x 22pF ceramic capacitor10KΩ resistor. Ready, Set, Oscillate! The Fastest Way to Change Arduino Pins « The Mind of Bill Porter. There are many ways to change an output pin.

Ready, Set, Oscillate! The Fastest Way to Change Arduino Pins « The Mind of Bill Porter

The way we know and love is the famous digitalWrite() function. (Spoiler: Want a faster digitalWrite? Download Here!) But even the Arduino Reference claims that it is not the most efficient. Studfinder: Wire Edition - CraigM. Craig Macomber, Milda Zizyte June 10, 2011 Often, humans are faced with the problem of finding that which they cannot see.

Studfinder: Wire Edition - CraigM

The five senses are limited and in particular do not extend to wavelengths outside the audible or visible spectrum. Auxillary devices employing sensing solutions are thus required to augment the senses. Such sensing capabilities are conceivably very important. In the area of electric sensing, a person might want to locate power behind a wall or want to figure out the closest source of power in a busy room. In particular, humans cannot easily locate electric fields. In fact, the robot Marvin faces the same problem humans do - just as a robot cannot see these electric fields, neither can humans. Our solution combines analog filtering with digital processing to achieve its goal. The analog circuit has three main purposes: (1) is the most complex, requiring filtering a current source.

. (2) is accomplished by the use of three LEDs, denoted “left,” “right,” and “amplitude.”