Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,409 members, 7,954,624 topics. Date: Saturday, 21 September 2024 at 02:19 AM |
Nairaland Forum / Science/Technology / Programming / Free Arduino Tutorials (11495 Views)
Arduino,raspberry Pi,sensors Etc / Arduino Programming Boards, Shields, And Sensors Purchases / Free Arduino Tutorials (2) (3) (4)
Free Arduino Tutorials by princejude(m): 8:07pm On Jan 10, 2015 |
What is arduino ? Arduino is an open-source electronics prototyping platform based on flexible, easy-to use hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments. Arduino can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language and the Arduino Development Environment. Arduino projects can be stand-alone, or they can communicate with software running on a computer. There are plenty of other microcontrollers available. So you may be asking, why choose the Arduino? Arduino really simplifies the process of building projects on a microcontroller making it a great platform for amateurs. You can easily start working on one with no previous electronics experience. In addition to Arduino’s simplicity, it is also inexpensive, cross-platform and open source. The Arduino is based on Atmel’s ATMEGA328 and ATMEGA168 microcontrollers. Arduino Software Software programs, called sketches, are created on a computer using the Arduino integrated development environment (IDE). The IDE enables you to write and edit code and convert this code into instructions that Arduino hardware understands. The IDE also transfers those instructions to the Arduino board (a process called uploading). Arduino Hardware The Arduino board is where the code you write is executed. The board can only control and respond to electricity, so specific components are attached to it to enable it to interact with the real world. These components can be sensors, which convert some aspect of the physical world to electricity so that the board can sense it, or actuators, which get electricity from the board and convert it into something that changes the world. Examples of sensors include switches, accelerometers, and ultrasound distance sensors. Actuators are things like lights and LEDs, speakers, motors, and displays. There have been a number of Arduino versions, all based on an 8-bit Atmel AVR reduced instruction set computer (RISC) microprocessor. The first board was based on the ATmega8 running at a clock speed of 16 MHz with 8 KB flash memory; later boards such as the Arduino NG plus and the Diecimila (Italian for 10,000) used the ATmega168 with 16 KB flash memory. The most recent Arduino versions, Duemilanove and Uno, use the ATmega328 with 32 KB flash memory and can switch automatically between USB and DC power. For projects requiring more I/O and memory, there’s the Arduino Mega1280 with 128 KB memory or the more recent Arduino Mega2560 with 256 KB memory. The boards have 14 digital pins, each of which can be set as either an input or output, and six analog inputs. In addition, six of the digital pins can be programmed to provide a pulse width modulation (PWM) analog output. A variety of communication protocols are available, including serial, serial peripheral interface bus (SPI), and I2C/ TWI. Included on each board as standard features are an in-circuit serial programming (ICSP) header and reset button. Project 1: Creating a blinking LED wave Let’s put some LEDs and resistors to work. In this project, we’ll use five LEDs to create a kind of wavelike light pattern. The Hardware Here’s what you’ll need to create this project: >> Five LEDs >> Five 560W resistors >> One breadboard >> Various connecting wires >> Arduino and USB cable We will connect the LEDs to digital pins 2 through 6 via the 560-ohm current-limiting resistors. The Sketch Now for our sketch. Enter this code into the IDE:
In void setup() the digital I/O pins are set to outputs, because we want them to send current to the LEDs on demand. We specify when to turn on each LED using the digitalWrite() function in the void loop() section of the sketch. Project 2: Repeating with for loops to be contd.... or check here: http://www.jutronix.com/tutorials/arduino-tutorial/ 1 Like |
Re: Free Arduino Tutorials by AAinEqGuinea: 5:58pm On Jan 11, 2015 |
Nice post... I use pi |
Re: Free Arduino Tutorials by princejude(m): 1:21pm On Jan 12, 2015 |
AAinEqGuinea:What pi ? |
Re: Free Arduino Tutorials by 9free(m): 3:27pm On Jan 12, 2015 |
princejude:Raspberry Pi 2 Likes |
Re: Free Arduino Tutorials by princejude(m): 3:32pm On Jan 12, 2015 |
9free: Oh! ok do you have the board? |
Re: Free Arduino Tutorials by 9free(m): 5:58pm On Jan 12, 2015 |
princejude: I currently do not have the board. But it's readily available in th market. 1 Like |
Re: Free Arduino Tutorials by AAinEqGuinea: 12:09am On Jan 13, 2015 |
princejude: Raspberry pi Have a clusters of them. but I'm sure you're aware, it doesnt matter what you use. |
Re: Free Arduino Tutorials by internetpo(m): 8:12am On Jan 15, 2015 |
between raspberry Pi and arudinuio. which is better? |
Re: Free Arduino Tutorials by Leopantro: 11:35am On Jan 15, 2015 |
AAinEqGuinea: how much do you sell your raspberry pi and where are you located? |
Re: Free Arduino Tutorials by Leopantro: 1:04pm On Jan 15, 2015 |
princejude: sorry for quoting the whole post. how much will it cost to create a unit of this, can it be made to run off batteries and can the number of LEDs be increased? |
Re: Free Arduino Tutorials by princejude(m): 4:33pm On Jan 15, 2015 |
Leopantro: The Arduino board is N5000. You can increase the number of LEDs |
Re: Free Arduino Tutorials by sisqology(m): 4:58pm On Jan 15, 2015 |
Now following, I need for a project. |
Re: Free Arduino Tutorials by LordRahl001: 3:23pm On Jan 16, 2015 |
princejude:and how much is the whole starter kit and pls where can i get it in Lagos |
Re: Free Arduino Tutorials by princejude(m): 3:56pm On Jan 16, 2015 |
LordRahl001:Yo can get a starter kit of N7000 or advance kit from N12000 to N20000. The price depends on its content. Am not in Lagos but if you want me to send it to you, you can add N2000 shipment fee |
Re: Free Arduino Tutorials by LordRahl001: 8:58am On Jan 17, 2015 |
princejude:thanks for the swift response!! will get across as soon as I can!! |
Re: Free Arduino Tutorials by AAinEqGuinea: 10:58am On Jan 17, 2015 |
Leopantro: Pis are about $35 USD each and, in many respects, worth it.. but we're I'm not here to highlight Pi (for now), Arduino time! which tend to be more agile. Thanks for posting. |
Re: Free Arduino Tutorials by princejude(m): 4:20pm On Jan 17, 2015 |
Back to tutorial... Project 2: Using for loops When designing a sketch, you’ll often repeat the same function. You could simply copy and paste the function to duplicate it in a sketch, but that’s inefficient and a waste of your Arduino’s program memory.Instead, you can use for loops. The benefit of using a for loop is that you can determine how many times the code inside the loop will repeat.To see how a for loop works, enter the following code as a new sketch:
The for loop will repeat the code within the curly brackets beneath it as long as some condition is true. Here, we have used two new integer variables, a and b, which starts with the value 2. Every time the code is executed, the a++ will add 1 to the value of a. The loop will continue in this fashion while the value of a is less than 7 (the condition). Once it is equal to or greater than 7, the Arduino moves on and continues with whatever code comes after the for loop. The number of loops that a for loop executes can also be set by counting down from a higher number to a lower number. To demonstrate this, add the following loop to the Project 2 sketch after the second for loop:
1 Like |
Re: Free Arduino Tutorials by princejude(m): 4:22pm On Jan 17, 2015 |
Pulse-Width Modulation(PWM) – Varying led Brightness Rather than just turning LEDs on and off rapidly using digitalWrite(), we can define the level of brightness of an LED by adjusting the amount of time between each LED’s on and off states using pulse-width modulation (PWM). PWM can be used to create the illusion of an LED being on at different levels of brightness by turning the LED on and off rapidly, at around 500 cycles per second. The brightness we perceive is determined by the amount of time the digital output pin is on versus the amount of time it is off—that is, every time the LED is lit or unlit. Because our eyes can’t see flickers faster than 50 cycles per second, the LED appears to have a constant brightness. The greater the duty cycle (the longer the pin is on compared to off in each cycle), the greater the perceived brightness of the LED connected to the digital output pin. The greater the duty cycle (the longer the pin is on compared to off in each cycle), the greater the perceived brightness of the LED connected to the digital output pin. Figure 3 shows various PWM duty cycles. The filled-in gray areas represent the amount of time that the light is on. As you can see, the amount of time per cycle that the light is on increases with the duty cycle. Only digital pins 3, 5, 6, 9, 10, and 11 on a regular Arduino board can be used for PWM. They are marked on the Arduino board with a tilde (~), To create a PWM signal, we use the function analogWrite(x, y), where x is the digital pin and y is a value for the duty cycle, between 0 and 255, where 0 indicates a 0 percent duty cycle and 255 indicates 100 percent duty cycle. To see figures click here because no time to upload http://www.jutronix.com/tutorials/arduino-tutorial/ |
Re: Free Arduino Tutorials by princejude(m): 4:27pm On Jan 17, 2015 |
Project 3: PWM Example Now let’s try this with our circuit from Project 2. Enter the following sketch into the IDE and upload it to the Arduino:
The LED on digital pin 3 will exhibit a “breathing effect” as the duty cycle increases and decreases. In other words, the LED will turn on, increasing in brightness until fully lit, and then reverse. Experiment with the sketch and circuit. For example, make five LEDs breathe at once, or have them do so sequentially. |
Re: Free Arduino Tutorials by princejude(m): 4:31pm On Jan 17, 2015 |
Project 4: Using a switch as digital input Our goal in this project is to create a button that turns on an LED for half a second when pressed. The Algorithm Here is our algorithm: 1. Test to see if the button has been pressed. 2. If the button has been pressed, then turn on the LED for half a second, and then turn it off. 3. If the button has not been pressed, then do nothing. 4. Repeat indefinitely. The Hardware Here’s what you’ll need to create this project: • One push button • One LED • One 560 W resistor • One 10 kW resistor • One 100 nF capacitor • Various connecting wires • One breadboard • Arduino and USB cable The Schematic First we create the circuit on the breadboard with the schematic shown in Figure 4. Notice how the 10 kW resistor is connected between GND and digital pin seven. We call this a pull-down resistor, because it pulls the voltage at the digital pin almost to zero. Furthermore, by adding a 100 nF capacitor across the 10 kW resistor, we create a simple debounce circuit to help filter out the switch bounce. When the button is pressed, the digital pin goes immediately to high. But when the button is released, digital pin seven is pulled down to GND via the 10 kW resistor, and the 100nF capacitor creates a small delay. This effectively covers up the bouncing pulses by slowing down the voltage falling to GND, thereby eliminating most of the false readings due to floating voltage and erratic button behavior. The Sketch For the sketch, enter and upload the code below:
|
Re: Free Arduino Tutorials by lordraiden(m): 10:34am On Jan 19, 2015 |
can anyone pls teach me microchip programming language |
Re: Free Arduino Tutorials by princejude(m): 7:19pm On Jan 19, 2015 |
lordraiden: Which of the microcontroller and which language ? |
Re: Free Arduino Tutorials by lordraiden(m): 7:45am On Jan 20, 2015 |
princejude:pic controllers and c programming language |
Re: Free Arduino Tutorials by princejude(m): 1:41pm On Jan 20, 2015 |
lordraiden: Check this thread https://www.nairaland.com/1214892/microcontrollers 1 Like |
Re: Free Arduino Tutorials by lordraiden(m): 2:41pm On Jan 20, 2015 |
princejude:tnx.are u a programmer modified: no need for ansa hv seen for my self cn i add u up on whatsapp |
Re: Free Arduino Tutorials by princejude(m): 7:20pm On Jan 20, 2015 |
lordraiden:Am not using whatsapp. I have uninstalled it from my phone. I don't know why. |
Re: Free Arduino Tutorials by lordraiden(m): 9:11pm On Jan 20, 2015 |
princejude:pls cn u reinstall,if u cnt actually say y u uninstalled it mayb it has no significant importance den,nw it has,cos i want to asking u some questn directly based on programming,i really need to learn it.tnx hope u do so |
Re: Free Arduino Tutorials by princejude(m): 5:56am On Jan 21, 2015 |
lordraiden:ok I will reinstall but would prefer if you ask your question here so that others will learn |
Re: Free Arduino Tutorials by lordraiden(m): 9:26am On Jan 21, 2015 |
princejude:k,tnx bt smtimez i will need quicker response dats y i was asking for ur whatsapp and d thread u shared for mi is a little bit old,cnt really comment there,plus d place is full of gurus d codes are more like chinese to mi.lol |
Re: Free Arduino Tutorials by lordraiden(m): 2:51pm On Jan 22, 2015 |
princejude:sir am still waiting for d numba pls |
Re: Free Arduino Tutorials by princejude(m): 4:55pm On Apr 24, 2015 |
Latest Arrival 30% discount: ADXL335 ACCELEROMETER ARDUINO UNO mega328 pdip ARDUINO UNO mega328 smd HC-SR04 ULTRASONIC L298N MOTOR DRIVER MQ-2 GAS SENSOR LM3940 IT-3.3V Regulator BC547 BC557 PIC18F2550-PDIP DHT11 HC-SR501 PIR MOTION SENSOR RELAY MODULE U-BLOX GPS MODULE SIM900 GSM 1uF/50V 10uF/50V 100uF/50V 22pF Flame Sensor SOIL MOISTURE SENSOR HYGROMETER TK103 CAR TRACKER CP2102 USB TO TTL 502 5K Blue trimmer Adjust Resistor BUZZER BLACK ARDUINO JUMPER WIRE 6X1 CABLE with female header FOR PICKIT3 ENC28J60/SD CARD MODULE 8p dupont 2.54mm pitch cable with female 4p dupont 2.54mm pitch cable with female 2p dupont 2.54mm pitch cable with female 28 pin IC Socket 40 pin IC Socket 2.54MM RIBBON CABLE (5meters) http://www.jutronix.com/new-arrivals/ 1 Like |
Re: Free Arduino Tutorials by AAinEqGuinea: 7:03am On Apr 25, 2015 |
Got two Arduinos, breadboard, and other micros fired up. Keep the thread alive. |
Becoming An Employable Full Stack Flutter Developer (ios And Android) / Nigerian Made Android Apps for Android Phones / Google Parent Alphabet To Cut 12,000 Jobs
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 59 |