background preloader

Arduino hacks

Arduino hacks

ShiftOut Learning Examples | Foundations | Hacking | Links Started by Carlyn Maw and Tom Igoe Nov, 06 Shifting Out & the 595 chip At sometime or another you may run out of pins on your Arduino board and need to extend it with shift registers. How this all works is through something called "synchronous serial communication," i.e. you can pulse one pin up and down thereby communicating a data byte to the register bit by bit. The "serial output" part of this component comes from its extra pin which can pass the serial information received from the microcontroller out again unchanged. "3 states" refers to the fact that you can set the output pins as either high, low or "high impedance." Here is a table explaining the pin-outs adapted from the Phillip's datasheet. Example 1: One Shift Register The first step is to extend your Arduino with one shift register. The Circuit 1. Make the following connections: GND (pin 8) to ground, Vcc (pin 16) to 5V OE (pin 13) to ground MR (pin 10) to 5V 2. 3. Circuit Diagram

The World Famous Index of Arduino & Freeduino Knowledge Arduino to Twitter over USB - There are many reasons to want a project with the ability to provide status feedback. One useful method for providing feedback is by posting updates to Twitter. This enables one (or many people) to monitor a system from anywhere. It is even possible to, then, receive SMS updates to your phone. A simple Google search shows that there is plenty of documentation available for using an Arduino with an ethernet shield. For this tutorial, I will be using the Python programming language to help my device post to Twitter. Functional Overview The basic software flow of this project (sans configuration) is shown in Figure1. Figure1: Functional Flow Diagram Observe that the Arduino prints status updates to the serial port. Twitter APIBefore your project can integrate with Twitter, you must register your application and get an API key. Consumer KeyConsumer SecretAccess TokenAccess Token Secret This information will be used in the Python code, later. Serial.println("This is your status message");

Ressources pour l'interactivité | Arduino / I2C Arduino est distribué avec la logithèque Wire qui permet une communication I2C et Two Wire. La logithèque Wire utilise un adressage à 7 bits pour l'écriture et la lecture. Pour convertir une adresse I2C à 8 bist en adresse I2C à 7 bits, les bits doivent être décalés vers la droite ( >> 1 ). Par exemple, le capteur TPA81 à l'adresse I2C 8 bits de 0xD0 (B11010000) par défaut. Rp=1.8k 5.1 Écriture // Set register and write data Wire.beginTransmission(ADDRESS); Wire.send(REGISTRE); Wire.send(DATA); [...] 5.2 Lecture // Set register Wire.beginTransmission(ADDRESS); Wire.write(REGISTRE); Wire.endTransmission(); // Request data Wire.requestFrom(ADDRESS, NUMBER_OF_BYTES); // Wait for register's datawhile(Wire.available() < NUMBER_OF_BYTES) { ; // Do nothing } int i2c_data =;

rh_count Relative Humidity Measurement using the Humirel HS1101 Sensor Arduino, BasicX BX24 and PICAXE-18X copyright, Peter H. Anderson, Baltimore, MD, Nov, '07 (Nov, '07). Introduction This discussion focuses on a relatively simple technique for measuring relative humidity using a sensor. It is desireable to measure temperature as people are usually interested in both the relative humidity and temperature. Advantages of this technique for measuring relative humidity are that it is inexpensive and as the input to the processor is a pulse train as opposed to an analog voltage, the RH measurement circuitry may be located several hundred feet from the processor. I offer a small assembled package, consisting of a HS-1101 sensor, TS555 (SGThompson), 49.9K and 562K one percent resistors for the 555 circuitry, and a separate 10K NTC thermistor for measuring temperature. In the above I have illustrated the powering of the humidity board using a processor output. Arduino. BasicX BX24

Arduino BitBang Sources Tuto qu'on a suivi Pourquoi ? Si vous achetez un atmel, qui ne coute qu'environ 3€, vous pouvez le programmer aussi bien qu'un arduino, et c'est plus facile a integrer dans un montage Seul problème: le programmeur coute une fortune, pas besoin de depenser d'argent si vous avez déja un arduino! Materiel Necessaire: Arduino 1 Atmel, peu importe lequel (atmega8, atmega 16, atmega 32 ou atmega 168) Des "pins" secables (4) Quelques cables et si possibles une plaquette d'essai Comment ? On va utiliser la puce qui se trouve sur l'arduino pour communiquer en usb entre le pc et l'atmel. Partie Materielle Pins sur l'arduino Il faut souder les 4 pins secables sur l'arduino, attention de ne pas faire cramer la puce! Branchement de l'atmel on va recuperer l'alimentation du port icsp de l'arduino, et le reste des 4 pins que l'on vient de souder. On a maintenant une prise icsp qui peut programmer n'importe quel atmel! Du côté de l'atmel, justement nous avons deux choix qui s'offre a nous: Conclusion

Modifier la fréquence d'un PWM Un signal PWM est défini par son rapport cyclique (le temps au niveau haut par rapport à la période totale) mais aussi par sa fréquence. C’est cette fréquence qui nous intéresse aujourd’hui : il faut l’adapter à l’usage qu’on va faire, de quelques centaines de Hertz à plusieurs kHz. Pour un usage courant en électronique ludique, 500 ou 1000 Hz sont suffisant pour modifier l’intensité d’une led, notamment pour obtenir des couleurs variées sur un éclairage RGB, ou pour commander un dispositif externe en faisant varier une tension. Mais ces fréquences sont audibles et si un résonateur est connecté au signal PWM, vous devriez être rapidement gêné. Ce problème est notamment important avec le robot à chenilles RP5 qu’utilise le club pour ses ateliers. Un PWM à modifier Dans les montages à base de micro-contrôleur type AVR, on bénéficie de compteurs internes au circuit intégré permettant de réaliser un signal PWM. En résumé : Un PWM sur Arduino Lecture de la datasheet Schéma de l’Arduino Modification

Tutorial: Arduino timing methods with millis() - Birds on the Wire Welcome back fellow arduidans! In this article we introduce the millis(); function and put it to use to create various timing examples. Please ensure you are running version 13 or upwards of the Arduino IDE . Millis? Nothing to do with lip-syncers… hopefully you recognised milli as being the numerical prefix for one-thousandths; that is multiplying a unit of measure by 0.001 (or ten to the power of negative 3). Interestingly our Arduino systems will count the number of milliseconds (thousands of a second) from the start of a sketch running until the count reaches the maximum number capable of being stored in the variable type unsigned long (a 32-bit [four byte] integer – that ranges from zero to (2^32)-1. (2^32)-1, or 4294967295 milliseconds converts to 49.71027-odd days. Where start is an unsigned long variable. Example 37.1 The sketch stores the current millis count in start , then waits one second, then stores the value of millis again in finished. Example 37.2 ( image licence )

Hack the Arduino Robot: the results are impressive! (And you can vote them) Hack the Arduino Robot: the results are impressive! (And you can vote them) dcuartielles — March 12th, 2014 During the last months we’ve been involved with RS components in launching the “Hack the Arduino Robot” competition. I was part of the committee and I am pleased to say that I am not disappointed. I think everyone should look at the videos just to see that robots can be so much more than whatever it is we conceptualized them for. Now it’s time to express your vote too: the likes of the videos on the playlist will be counted until 23rd of March 2014.