Arduino: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
Brian Wilson (talk | contribs)
mNo edit summary
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
Arduino Uno R3: This is the fancy Make: magazine version so all components are SMD. It has an ATmega328P as its main controller and an ATMega16 to talk to the USB port.
Inventory
 
* Arduino Uno R3: Make: magazine version so all components are SMD. It has an ATmega328P and an ATMega16 on the USB port.
Here's its schematic. https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
Here's its schematic. https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf
* Arduino Mini: $5 clone
* [https://wiki.wildsong.biz/index.php?title=Teensy_USB_Development_Board Teensy 3.2], also programmable in Arduino IDE


littleBits kit: from Signal 2015 I think
See also [[ESP8266]]. I have some Arduino "clone" boards that have an ESP8266 on them instead of the normal Atmega328P


Arduino Mini: $5 clone board
[[37 Sensors Kit]]


== Arduino as AVR development board ==
== Arduino as AVR development board ==
Line 19: Line 21:
It looks like Atmel Studio is Windows only? How can this be? How sad!
It looks like Atmel Studio is Windows only? How can this be? How sad!
Here are instructions to use it on Mac: http://www.thinkcreate.org/index.php/avr-studio-on-mac-os/
Here are instructions to use it on Mac: http://www.thinkcreate.org/index.php/avr-studio-on-mac-os/
There is a toolchain supported for Linux, but no IDE: http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORLINUX.aspx but I am more inclined to try Parallels with Windows 7 first.
There is a toolchain supported for Linux, but no IDE: http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORLINUX.aspx but I am more inclined to try Windows first.


Maybe I don't care, if the Arduino IDE works for me. Anyway, I am removing old crud from a W7 machine and that could take several more hours! So, later for Studio.
Maybe I don't care, if the Arduino IDE works for me.  


=== Arduino IDE ===
=== Arduino IDE ===
2018-08-26 version 1.8.6


It starts up on Mac OS/X, more than I can say for Microchip's MPLAB X! (1-2017)
It starts up on Mac OS/X, more than I can say for Microchip's MPLAB X! (1-2017)
Line 31: Line 31:
Arduino has a simple IDE that works. I did indeed write a little program using the '''Make: Getting Started With Arduino''' book while sitting at the patio table at California Flora Nursery in Fulton. What a lovely place it is.
Arduino has a simple IDE that works. I did indeed write a little program using the '''Make: Getting Started With Arduino''' book while sitting at the patio table at California Flora Nursery in Fulton. What a lovely place it is.


Now I wonder if the IDE works with a plain vanilla ATmega328P.
Now I wonder if the Arduino IDE works with a plain vanilla ATmega328P. I think I have to install the bootloader first.


=== Loading programs into Arduino ===
=== Loading programs into Arduino ===


Apparently the Arduino model is to put code into EEPROM and then use a bootloader in flash to load it? Where does it get loaded?
Apparently the Arduino model is to put code into EEPROM and then use a bootloader in flash to load it?
 
I am used to working directly with Microchip PIC controllers, programming them with a PicKit3. Using an ICSP programmer is also possible with Arduino / Atmel.
 
== Neopixels ==


I am used to working directly with Microchip PIC controllers, programming them with a PicKit3. Using an ICSP programmer is also possible with Arduino.
I have an 8x8 Nulsom WS2812 board and a custom board from Signal that has Neopixels soldered onto it, 4 x 4 array.
 
8*8*RGB = 64*3 = 192 LEDs * 20mA = 3.8A
If I light up every LED in WHITE then it's going to require at least a 4 amp 5V supply.
 
4*4*RGB = 48 LEDs * 20mA = less than 1 amp max, plus power for the Arduino of course. 2 amp 5V would be plenty.


== Shields ==
== Shields ==


=== Working with the multifunction shield ===
=== XBee shield ===
 
I got three of these from MPJA mostly because they were a good price for proto boards.
There is a 3.3 - 5 level shifter and a voltage regulator on there.
 
by Seeed Studio
v2.1 2/08/2014
 
https://www.seeedstudio.com/XBee-Shield-V2-0-p-1375.html
 
You plug Bees into it and then it adds various RF functions to the Arduino,
see this [https://en.wikipedia.org/wiki/XBee Wikipedia XBee page].
Seems like at least some of them include processors that behave like Arduinos so you don't
really need this shield or an Arduino. :-)
 
Bluetooth,
Zigbee,
RFBee (900 MHz),
LTE,
[https://www.digi.com/products/embedded-systems/digi-xbee/rf-modules/2-4-ghz-modules/xbee-wi-fi WiFi],
[https://www.digi.com/products/embedded-systems/digi-xbee/rf-modules/2-4-ghz-modules/xbee-802-15-4 802.15.4]
 
[https://www.digi.com/products/embedded-systems/digi-xbee/rf-modules/2-4-ghz-modules/xbee3-zigbee-3 XBee3 is multi-talented!]
 
UartSBee
 
=== Sparkfun Arduino Protoshield V2 ===
 
This is a (discontinued) blank board with a few components including a couple pushbuttons and a couple LEDs. It has an
area for a bluetooth bluesmirf thingie that's expensive and kind of obsolete.


I think I bought this shield from MPJA. Here's a copy of the docs: [[File:Hacktronics_multifunction_shield.pdf]]
They make a newer version.
 
=== Multifunction shield ===
 
I bought this shield from MPJA. Here's a copy of the docs: [[File:Hacktronics_multifunction_shield.pdf]]
 
Code is here: http://files.cohesivecomputing.co.uk/MultiFuncShield-Library.zip


==== Features ====
==== Features ====


* 4 digit 7 segment LED display (connected via two 74HC595 drivers.
(Test program in parentheses.)
 
* 4 digit 7 segment LED display (connected via two 74HC595 drivers. (led_display)
* DS18B20 temperature sensor interface
* DS18B20 temperature sensor interface
* LM35 temperature sensor interface
* LM35 temperature sensor interface (Temp_sensor) there is an interface but no sensor. Flat side of TO92 goes up.
* 3296 precision adjustable potentiometer, analog input port
* 3296 precision adjustable potentiometer, analog input port
* socket for infrared receiver
* socket for infrared receiver
* Three separate programmable buttons and a reset button
* Three separate programmable buttons (Buttons)
* Piezo buzzer
* Piezo buzzer (beeper)
* Socket for a wireless module or voice recognition module.
* Socket for a serial device, for example an APC220 RF module (420-450 MHz) or voice recognition module.
* Servo interface (really?)
* Servo interface (really?)
* 4 LEDs
* 4 LEDs (led_lights)
* Serial port
 
The APC 220 ($40) is described here: https://www.dfrobot.com/product-57.html
The pinouts are on the datasheet https://image.dfrobot.com/image/data/TEL0005/APC220_Datasheet.pdf and here:
1 GND
2 VCC
3 Power enable
4 UART RX (TTL)
5 UART TX (TTL)
6 MUX
7 SET
8 NC
9 NC
 
Pin block
 
(I think this is the "servo interface".) This block of pins has 4 rows with gnd and +5v and an IO pin in each row.
The IO pins are marked: ~5, ~6, ~9, A5. I believe 5 6 and 9 are PWM outputs.


http://hobbycomponents.com/shields/461-multifunction-shield-for-arduino-uno-leonardo
Buttons


http://arduinolearning.com/code/multi-function-shield-examples.php
In the '''"buttons"''' app, output is sent to the serial port. You can see
it by running 'screen /dev/cu.usbmodem1411 9600' on the Mac.
(Check "ls /dev/cu*" to find the right dev.)


http://www.cohesivecomputing.co.uk/hackatronics/arduino-multi-function-shield/part-1/
Output looks like
BUTTON_1_PRESSED
BUTTON_1_SHORT_RELEASE
BUTTON_2_PRESSED
BUTTON_2_SHORT_RELEASE
BUTTON_3_PRESSED
BUTTON_3_SHORT_RELEASE
BUTTON_2_PRESSED


http://www.sniff.org.uk/2015/04/arduino-multifunction-shield.html
* http://hobbycomponents.com/shields/461-multifunction-shield-for-arduino-uno-leonardo
* http://arduinolearning.com/code/multi-function-shield-examples.php
* http://www.cohesivecomputing.co.uk/hackatronics/arduino-multi-function-shield/part-1/
* http://www.sniff.org.uk/2015/04/arduino-multifunction-shield.html


[[Category: Electronics]]
[[Category: Electronics]]
[[Category: Embedded]]
[[Category: Embedded]]

Latest revision as of 02:22, 18 July 2024

Inventory

  • Arduino Uno R3: Make: magazine version so all components are SMD. It has an ATmega328P and an ATMega16 on the USB port.

Here's its schematic. https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf

  • Arduino Mini: $5 clone
  • Teensy 3.2, also programmable in Arduino IDE

See also ESP8266. I have some Arduino "clone" boards that have an ESP8266 on them instead of the normal Atmega328P

37 Sensors Kit

Arduino as AVR development board

I have a FutureKit Temperature Controller, which is based on an Atmel AVR controller. I'd like to be able to write code for it too, by leveraging the Arduino environment.

Writing programs for Arduino

I know I can use the official Arduino IDE but I also want to know more about [Atmel Studio http://www.atmel.com/tools/atmelstudio.aspx]. Are there advantages for me to use one or the other since I intend to develop for both the Arduino and just plain Atmel AVR controllers.

Atmel Studio

It looks like Atmel Studio is Windows only? How can this be? How sad! Here are instructions to use it on Mac: http://www.thinkcreate.org/index.php/avr-studio-on-mac-os/ There is a toolchain supported for Linux, but no IDE: http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORLINUX.aspx but I am more inclined to try Windows first.

Maybe I don't care, if the Arduino IDE works for me.

Arduino IDE

It starts up on Mac OS/X, more than I can say for Microchip's MPLAB X! (1-2017)

Arduino has a simple IDE that works. I did indeed write a little program using the Make: Getting Started With Arduino book while sitting at the patio table at California Flora Nursery in Fulton. What a lovely place it is.

Now I wonder if the Arduino IDE works with a plain vanilla ATmega328P. I think I have to install the bootloader first.

Loading programs into Arduino

Apparently the Arduino model is to put code into EEPROM and then use a bootloader in flash to load it?

I am used to working directly with Microchip PIC controllers, programming them with a PicKit3. Using an ICSP programmer is also possible with Arduino / Atmel.

Neopixels

I have an 8x8 Nulsom WS2812 board and a custom board from Signal that has Neopixels soldered onto it, 4 x 4 array.

8*8*RGB = 64*3 = 192 LEDs * 20mA = 3.8A If I light up every LED in WHITE then it's going to require at least a 4 amp 5V supply.

4*4*RGB = 48 LEDs * 20mA = less than 1 amp max, plus power for the Arduino of course. 2 amp 5V would be plenty.

Shields

XBee shield

I got three of these from MPJA mostly because they were a good price for proto boards. There is a 3.3 - 5 level shifter and a voltage regulator on there.

by Seeed Studio v2.1 2/08/2014

https://www.seeedstudio.com/XBee-Shield-V2-0-p-1375.html

You plug Bees into it and then it adds various RF functions to the Arduino, see this Wikipedia XBee page. Seems like at least some of them include processors that behave like Arduinos so you don't really need this shield or an Arduino. :-)

Bluetooth, Zigbee, RFBee (900 MHz), LTE, WiFi, 802.15.4

XBee3 is multi-talented!

UartSBee

Sparkfun Arduino Protoshield V2

This is a (discontinued) blank board with a few components including a couple pushbuttons and a couple LEDs. It has an area for a bluetooth bluesmirf thingie that's expensive and kind of obsolete.

They make a newer version.

Multifunction shield

I bought this shield from MPJA. Here's a copy of the docs: File:Hacktronics multifunction shield.pdf

Code is here: http://files.cohesivecomputing.co.uk/MultiFuncShield-Library.zip

Features

(Test program in parentheses.)

  • 4 digit 7 segment LED display (connected via two 74HC595 drivers. (led_display)
  • DS18B20 temperature sensor interface
  • LM35 temperature sensor interface (Temp_sensor) there is an interface but no sensor. Flat side of TO92 goes up.
  • 3296 precision adjustable potentiometer, analog input port
  • socket for infrared receiver
  • Three separate programmable buttons (Buttons)
  • Piezo buzzer (beeper)
  • Socket for a serial device, for example an APC220 RF module (420-450 MHz) or voice recognition module.
  • Servo interface (really?)
  • 4 LEDs (led_lights)
  • Serial port

The APC 220 ($40) is described here: https://www.dfrobot.com/product-57.html The pinouts are on the datasheet https://image.dfrobot.com/image/data/TEL0005/APC220_Datasheet.pdf and here:

1 GND
2 VCC
3 Power enable
4 UART RX (TTL)
5 UART TX (TTL)
6 MUX
7 SET
8 NC
9 NC

Pin block

(I think this is the "servo interface".) This block of pins has 4 rows with gnd and +5v and an IO pin in each row. The IO pins are marked: ~5, ~6, ~9, A5. I believe 5 6 and 9 are PWM outputs.

Buttons

In the "buttons" app, output is sent to the serial port. You can see it by running 'screen /dev/cu.usbmodem1411 9600' on the Mac. (Check "ls /dev/cu*" to find the right dev.)

Output looks like

BUTTON_1_PRESSED
BUTTON_1_SHORT_RELEASE
BUTTON_2_PRESSED
BUTTON_2_SHORT_RELEASE
BUTTON_3_PRESSED
BUTTON_3_SHORT_RELEASE
BUTTON_2_PRESSED