Difference between revisions of "ArduinoInABox"

From Land Boards Wiki
Jump to navigation Jump to search
 
(56 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[file:ArdionoInABox_P18146_720px.jpg]]
+
[[File:tindie-mediums.png|link=https://www.tindie.com/products/26877/]]
 +
 
 +
<video type="youtube">qjMhJRPKGPQ</video>
 +
 
 +
[[file:ArduinoInABox-P18170_720px.jpg]]
  
 
== Features ==
 
== Features ==
Line 8: Line 12:
 
** On-board DC/DC buck regulator allows 7-23V input
 
** On-board DC/DC buck regulator allows 7-23V input
 
** Direct 7-9V input (USE VRAW jumper)
 
** Direct 7-9V input (USE VRAW jumper)
** 3.3V of 5V Arduino support
+
** 3.3V or 5V Arduino support
 +
** Measured 12 mA with 9V input and 3.3V Arduino Pro Mini
 
* I/O Boards
 
* I/O Boards
 
** DB-25
 
** DB-25
Line 16: Line 21:
  
 
* Inexpensive and widely available
 
* Inexpensive and widely available
* [https://www.arduino.cc/en/uploads/Main/Arduino-Pro-Mini-schematic.pdf Arduino Pro Mini sCHEMATIC]
+
* [https://www.arduino.cc/en/uploads/Main/Arduino-Pro-Mini-schematic.pdf Arduino Pro Mini Schematic]
 
* I/O - 14 digital input/output pins (of which 6 can be used as PWM outputs)
 
* I/O - 14 digital input/output pins (of which 6 can be used as PWM outputs)
 
** Serial: 0 (RX) and 1 (TX).
 
** Serial: 0 (RX) and 1 (TX).
Line 50: Line 55:
 
* Can leave attached to main board until installing in box
 
* Can leave attached to main board until installing in box
  
=== Input power ===
+
=== Input Power Options ===
  
* Wide input voltage range
 
** 5-23V (for 3.3V Arduino Pro Mini)
 
** 7-23V (for 5V Arduino Pro Mini)
 
 
* 2.1mm DC Power Connector Jack
 
* 2.1mm DC Power Connector Jack
* RF filter into Switching regulator board
 
* 2nd RF filter into HID card
 
 
* [[Mini360_Buck_Converter|Mini360]] Switching Mode Power Supply
 
* [[Mini360_Buck_Converter|Mini360]] Switching Mode Power Supply
** About $1
+
** Wide input voltage range
 +
*** 5-23V (for 3.3V Arduino Pro Mini)
 +
*** 7-23V (for 5V Arduino Pro Mini)
 +
*** About $1
 
* Jumper to use raw input and not populate the Mini360
 
* Jumper to use raw input and not populate the Mini360
 
** Uses the inputs jack as RAW power into the Arduino Pro Mini
 
** Uses the inputs jack as RAW power into the Arduino Pro Mini
 
** 3.35-12 V (3.3V model) or 5-12 V (5V model)
 
** 3.35-12 V (3.3V model) or 5-12 V (5V model)
 +
 +
==== RF Filters ====
 +
 +
* RF filter into Switching regulator board
 +
* 2nd RF filter into HID card
  
 
== Connectors ==
 
== Connectors ==
 +
 +
[[file:ArduinoInABox_CAD_X1.png]]
  
 
=== J1 - OLED ===
 
=== J1 - OLED ===
Line 75: Line 85:
 
# GND
 
# GND
  
=== J2 - HID (on HID card) ===
+
=== J2, J4 - On Base and HID card(s) ===
  
 
[[file:ARB_J2.PNG]]
 
[[file:ARB_J2.PNG]]
  
=== J3 - On base board ===
+
* Can detach HID to mount in box
 +
* Pinout
  
[[file:ARB_J3.PNG]]
+
# GND
 +
# ENCODER A
 +
# ENCODER B
 +
# ENCODER SWITCH
 +
# I2C_SCL
 +
# I2C_SDA
 +
# VCC
 +
# GND
  
 
=== J4, J7, J8 - BNC/SMA input headers ===
 
=== J4, J7, J8 - BNC/SMA input headers ===
Line 88: Line 106:
  
 
=== J5 - Arduino Pins ===
 
=== J5 - Arduino Pins ===
 +
 +
* 2x13 header
  
 
[[file:ARB_J5.PNG]]
 
[[file:ARB_J5.PNG]]
Line 93: Line 113:
 
=== J6 - Voltage Adjustment ===
 
=== J6 - Voltage Adjustment ===
  
* Adjust voltage for 3.3V or 5V with jumper before installing jumper
+
* Adjust voltage for 3.3V or 5V to match Pro Mini voltage before installing jumper
  
 
=== J9 - Use Raw Power ===
 
=== J9 - Use Raw Power ===
  
 
[[file:AIB_J9.PNG]]
 
[[file:AIB_J9.PNG]]
 +
 +
# DC_FILT (top pin)
 +
# VRAW (bottom pin)
 +
 +
=== FTDI (on Arduino Pro Mini) ===
 +
 +
* Used to download program to Arduino Pro Mini
  
 
== Human Interface (HID) ==
 
== Human Interface (HID) ==
  
* Detachable board
 
 
* OLED
 
* OLED
 
* Rotary Switch with Pushbutton
 
* Rotary Switch with Pushbutton
 +
* Detachable board
 +
** Can be mounted to Front Panel of enclosure
 +
 +
[[file:HID_Connect.PNG]]
  
 
=== OLED ===
 
=== OLED ===
Line 123: Line 153:
 
== I/O Boards ==
 
== I/O Boards ==
  
* Arduino pins brought to 2x13 header
+
* Base board has 3 optional BNC (P1-P3) or edge launch SMA (P4-P6) connectors
 +
** Brought to headers (J4, J7, J8)
 +
* Easy to application specific custom I/O cards
 +
** All Arduino pins brought to J5 - 2x13 pin header
 
** I/O pins are on 0.1" grid for easier prototyping
 
** I/O pins are on 0.1" grid for easier prototyping
 
** P2-P13, A0-A3
 
** P2-P13, A0-A3
** A4/A5 or SDA/SCL
+
** A4/A5 or SDA/SCL (connects to OLED)
* Easily designed
+
* Location of mounting holes
* 3 BNC or SMA connectors
 
** Brought to headers
 
** [[DB25-02|DB25 pass-through]]
 
  
 
[[file:DB-25_Mechs_DBdMtg.png]]
 
[[file:DB-25_Mechs_DBdMtg.png]]
Line 136: Line 166:
 
=== DB-25 Example ===
 
=== DB-25 Example ===
  
* [[DB25-02]]
+
** [[DB25-02|DB25 pass-through]]
 
* Standard DB-25 female
 
* Standard DB-25 female
 
** Does not have 26 pin of the 2x13 header in the box
 
** Does not have 26 pin of the 2x13 header in the box
** OK, extra powers/grounds at the ends
+
*** OK, extra powers/grounds at the ends
 
** Connect with 1:1 cables to 2x10/2x3 Dupont receptacles
 
** Connect with 1:1 cables to 2x10/2x3 Dupont receptacles
  
Line 155: Line 185:
  
 
* Board is designed to fit into Aluminum Project Box Enclosure DIY 100*76*35mm - [https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2334524.m570.l1313&_nkw=100*76*35mm+aluminum&_sacat=0&LH_TitleDesc=0&_odkw=100*76*35mm+Aluminum+PCB+Instrument+Box+Enclosure+Electronic+Project+Case+Set&_id=174408274566 ebay search]
 
* Board is designed to fit into Aluminum Project Box Enclosure DIY 100*76*35mm - [https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2334524.m570.l1313&_nkw=100*76*35mm+aluminum&_sacat=0&LH_TitleDesc=0&_odkw=100*76*35mm+Aluminum+PCB+Instrument+Box+Enclosure+Electronic+Project+Case+Set&_id=174408274566 ebay search]
 
* [[VFO-003]] - Similar in a box
 
 
[[file:VFO-003_P1871_720px.jpg]]
 
  
 
[[file:ArduinoInABox_Mechs.png]]
 
[[file:ArduinoInABox_Mechs.png]]
Line 166: Line 192:
 
[[file:VFO-003_RearPanel_Holes.PNG]]
 
[[file:VFO-003_RearPanel_Holes.PNG]]
  
== Software ==
+
== Schematic ==
 
 
=== GitHub Repository ===
 
 
 
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/VFO-003 GitHub Repository] - VFO-003
 
* [https://github.com/land-boards/lb-Arduino-Code/tree/VFO-003_MVP/LBCards/VFO-003 Minimal Viable Product build] - GitHub repo
 
  
=== Memory Usage ===
+
* [http://land-boards.com/ArduinoInABox/ARDUINO_IN_A_BOX_REV1_Schematic.pdf ArduinoInABox Rev 2 Schematic]
  
* [https://github.com/land-boards/lb-Arduino-Code/tree/VFO-003_MVP/LBCards/VFO-003 Minimal Viable Product Build] - GitHub repo branch
+
== Test ==
* Arduino bootloader 2048 of Flash
 
* Display code: 10260 of Flash and 1033 of SRAM using u8g2
 
* Alternate display code: 6198 of Flash and 446 of SRAM using u8x8
 
* Si5351 code: 12076 of Flash and 378 of SRAM
 
 
 
==== Total Memory usage with u8g2 Library ====
 
  
 +
* Test code - [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ArduinoInABox/OLED_Test OLED/Rotary Switch Test]
 +
* If there is no display on OLED, verify OLED appears at expected I2C address with [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ArduinoInABox/I2C_Scan I2C scan] at I2C address 0x3C
 +
** Expect results
 
<pre>
 
<pre>
Sketch uses 25970 bytes (84%) of program storage space. Maximum is 30720 bytes. Global variables use 1503 bytes (73%) of dynamic memory, leaving 545 bytes for local variables. Maximum is 2048 bytes.
+
Scanning...
 +
I2C device found at address 0x3C  !
 +
done
 
</pre>
 
</pre>
 
+
* May require a different constructor
==== Total Memory usage with u8x8 Library ====
+
** I used
 
 
* ~4K less than the u2g2 library
 
 
 
 
<pre>
 
<pre>
Sketch uses 22064 bytes (71% of program storage space. Maximum is 30720 bytes. Global variables use 925 bytes (45%) of dynamic memory, leaving 1142 bytes for local variables. Maximum is 2048 bytes.
+
U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE);
 +
</pre>
 +
** Your mileage may vary
  
</pre>
+
== Software ==
  
==== Minimal u8g2 code ====
+
=== GitHub Repository ===
  
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/u8g2Test Minimal u8g2Test code]
+
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ArduinoInABox GitHub Repository]
* [https://github.com/olikraus/u8g2/wiki/u8g2setupcpp olikraus u8g2 Library]
+
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ArduinoInABox/OLED_Test OLED/Rotary Switch Test] - Good starting point
 +
** Uses [https://www.best-microcontroller-projects.com/rotary-encoder.html Rotary Encoder Tutorial] - best code is at the ends under "Code For Improved Table Decode"
 +
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ArduinoInABox/BounceLEDs BounceLEDs] - Bounce an LED across pins D5-D13 and A0-A3
 +
** A0 = D14
 +
** A1 = D15
 +
** A2 = D16
 +
** A3 = D17
 +
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ArduinoInABox/AiBMenu Menu Demo Code] - Select between menu options
  
<pre>
+
<video type="youtube">qjMhJRPKGPQ</video>
Sketch uses 10260 bytes (33%) of program storage space. Maximum is 30720 bytes. Global variables use 1033 bytes (50%) of dynamic memory, leaving 1015 bytes for local variables. Maximum is 2048 bytes.
 
</pre>
 
  
* Code
+
=== Total Memory usage with u8x8 Library and Rotary Encoder Code ===
  
 +
* [https://github.com/land-boards/lb-Arduino-Code/tree/master/LBCards/ArduinoInABox/OLED_Test OLED/Rotary Switch Test]
 +
* Arduino bootloader uses up 2048 bytes of Flash
 
<pre>
 
<pre>
void setup(void)
+
Sketch uses 7062 bytes (22%) of program storage space.
{
+
Maximum is 30720 bytes.
  u8g2.begin();
+
Global variables use 475 bytes (23%) of dynamic memory,
 +
leaving 1573 bytes for local variables. Maximum is 2048 bytes.
  
}
 
 
void loop(void)
 
{
 
  printStringToOLED("VFO-003");
 
}
 
 
void printStringToOLED(char * charStr)
 
{
 
  u8g2.clearBuffer();
 
  u8g2_prepare();
 
  u8g2.drawStr( 0, 0, charStr);
 
  u8g2.sendBuffer();
 
}
 
 
// u8g2_prepare()
 
// Setup the screen font, etc
 
// List of fonts
 
// https://github.com/olikraus/u8g2/wiki/fntlist8#u8g2-fonts-capital-a-height-38
 
void u8g2_prepare(void)
 
{
 
  u8g2.setFont(u8g2_font_t0_11b_tf); // 8 Pixel tall font
 
  u8g2.setFontRefHeightExtendedText();
 
  u8g2.setDrawColor(1);
 
  u8g2.setFontPosTop();
 
  u8g2.setFontDirection(0);
 
}
 
 
</pre>
 
</pre>
  
Line 250: Line 250:
 
</pre>
 
</pre>
  
* Code
+
=== Download/Programming ===
  
<pre>
+
* FTDI cable
// https://github.com/olikraus/u8g2/wiki/u8x8reference#c-example
+
** FTDI jumper is set to 3.3V
 +
** Power wire is not used
 +
** Other connections are 1:1
 +
 
 +
[[File:ArduinoInABox-P18162-720px.jpg]]
  
#include <Arduino.h>
+
==== IDE setup ====
#include <SPI.h>
 
#include <U8x8lib.h>
 
  
#define U8X8_HAVE_HW_I2C
+
* Board: Arduino Pro or Pro Mini
 +
* Processor: ATMega328P (3.3V, 8 MHz)
  
U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE);
+
[[file:ProgrammingArduinoInABox.png]]
  
void setup() {
+
== 3D ==
  // put your setup code here, to run once:
 
  u8x8.begin();
 
}
 
  
void loop() {
+
[[file:ArduinoInABox_FRONT_Rev2_3D.png]]
  // put your main code here, to run repeatedly:
 
  u8x8.setFont(u8x8_font_victoriabold8_r);
 
  u8x8.drawString(0,0,"Hello World!");
 
  delay(1000);
 
  
}
+
[[file:ArduinoInABox_REAR_Rev2_3D.png]]
</pre>
 
  
 
== Assembly Instructions ==
 
== Assembly Instructions ==
  
 
* [[ArduinoInABox Assembly Instructions Rev 1]]
 
* [[ArduinoInABox Assembly Instructions Rev 1]]

Latest revision as of 16:00, 3 August 2022

Tindie-mediums.png

ArduinoInABox-P18170 720px.jpg

Features

  • Arduino Pro Mini
  • Detachable Human Interface design (HID)
  • Flexible Input power
    • On-board DC/DC buck regulator allows 7-23V input
    • Direct 7-9V input (USE VRAW jumper)
    • 3.3V or 5V Arduino support
    • Measured 12 mA with 9V input and 3.3V Arduino Pro Mini
  • I/O Boards
    • DB-25
  • Mounts in a standard extruded Aluminum enclosure

Arduino Pro Mini

  • Inexpensive and widely available
  • Arduino Pro Mini Schematic
  • I/O - 14 digital input/output pins (of which 6 can be used as PWM outputs)
    • Serial: 0 (RX) and 1 (TX).
      • Used to receive (RX) and transmit (TX) TTL serial data.
      • These pins are connected to the TX-0 and RX-1 pins of the six pin header.
    • External Interrupts: 2 and 3.
      • These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value.
      • See the attachInterrupt function for details.
    • PWM: 3, 5, 6, 9, 10, and 11.
      • Provide 8-bit PWM output with the analogWrite function.
    • SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).
      • These pins support SPI communication, which, although provided by the underlying hardware.
    • LED: 13.
      • There is a built-in LED connected to digital pin 13.
      • When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
    • 6 analog inputs
  • On-board resonator (8 or 16 MHz)
  • Reset button
  • A six pin header can be connected to an FTDI cable provide USB power and communication to the board
  • 3.3 or 5V
  • 8 MHz (3.3V) or 16 MHz (5V)
  • Programmable in Arduino IDE

ArdruinoProMini-EBAY PART-720px.png

Detachable Human Interface design (HID)

Input Power Options

  • 2.1mm DC Power Connector Jack
  • Mini360 Switching Mode Power Supply
    • Wide input voltage range
      • 5-23V (for 3.3V Arduino Pro Mini)
      • 7-23V (for 5V Arduino Pro Mini)
      • About $1
  • Jumper to use raw input and not populate the Mini360
    • Uses the inputs jack as RAW power into the Arduino Pro Mini
    • 3.35-12 V (3.3V model) or 5-12 V (5V model)

RF Filters

  • RF filter into Switching regulator board
  • 2nd RF filter into HID card

Connectors

ArduinoInABox CAD X1.png

J1 - OLED

  • Pinout
  1. SDA
  2. SCL
  3. +VCC
  4. GND

J2, J4 - On Base and HID card(s)

ARB J2.PNG

  • Can detach HID to mount in box
  • Pinout
  1. GND
  2. ENCODER A
  3. ENCODER B
  4. ENCODER SWITCH
  5. I2C_SCL
  6. I2C_SDA
  7. VCC
  8. GND

J4, J7, J8 - BNC/SMA input headers

  • Connect here to use the BNC or SMA jacks on the rear (option)

J5 - Arduino Pins

  • 2x13 header

ARB J5.PNG

J6 - Voltage Adjustment

  • Adjust voltage for 3.3V or 5V to match Pro Mini voltage before installing jumper

J9 - Use Raw Power

AIB J9.PNG

  1. DC_FILT (top pin)
  2. VRAW (bottom pin)

FTDI (on Arduino Pro Mini)

  • Used to download program to Arduino Pro Mini

Human Interface (HID)

  • OLED
  • Rotary Switch with Pushbutton
  • Detachable board
    • Can be mounted to Front Panel of enclosure

HID Connect.PNG

OLED

  • 0.91" 128x32 or so rotary switch (installed in SW1 location) is to the right
  • 0.96" 128x64 (rotated) with rotary switch (installed in SW1 location) below
  • SSD1306 family of displays
  • Connections to Arduino Pins
    • A4/SDA
    • A5/SCL

Rotary Encoder

  • Connections to Arduino Pins
    • A=P2
    • B=P3
    • Switch=P4

I/O Boards

  • Base board has 3 optional BNC (P1-P3) or edge launch SMA (P4-P6) connectors
    • Brought to headers (J4, J7, J8)
  • Easy to application specific custom I/O cards
    • All Arduino pins brought to J5 - 2x13 pin header
    • I/O pins are on 0.1" grid for easier prototyping
    • P2-P13, A0-A3
    • A4/A5 or SDA/SCL (connects to OLED)
  • Location of mounting holes

DB-25 Mechs DBdMtg.png

DB-25 Example

  • Standard DB-25 female
    • Does not have 26 pin of the 2x13 header in the box
      • OK, extra powers/grounds at the ends
    • Connect with 1:1 cables to 2x10/2x3 Dupont receptacles

MultiCompInBox P1991 cropped.jpg

DB25-02 Schematic.PNG

DB25-02 Pinout.PNG

DB25-02 Mechs.PNG

DB25-02 3D.png

Mechanicals/Enclosure

  • Board is designed to fit into Aluminum Project Box Enclosure DIY 100*76*35mm - ebay search

ArduinoInABox Mechs.png

VFO-003 FrontPanel Holes.PNG

VFO-003 RearPanel Holes.PNG

Schematic

Test

  • Test code - OLED/Rotary Switch Test
  • If there is no display on OLED, verify OLED appears at expected I2C address with I2C scan at I2C address 0x3C
    • Expect results
Scanning...
I2C device found at address 0x3C  !
done
  • May require a different constructor
    • I used
U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE);
    • Your mileage may vary

Software

GitHub Repository

Total Memory usage with u8x8 Library and Rotary Encoder Code

Sketch uses 7062 bytes (22%) of program storage space. 
Maximum is 30720 bytes.
Global variables use 475 bytes (23%) of dynamic memory, 
leaving 1573 bytes for local variables. Maximum is 2048 bytes.

Minimal u8x8 code

Sketch uses 6198 bytes (20%) of program storage space. Maximum is 30720 bytes. Global variables use 446 bytes (21%) of dynamic memory, leaving 1602 bytes for local variables. Maximum is 2048 bytes.

Download/Programming

  • FTDI cable
    • FTDI jumper is set to 3.3V
    • Power wire is not used
    • Other connections are 1:1

ArduinoInABox-P18162-720px.jpg

IDE setup

  • Board: Arduino Pro or Pro Mini
  • Processor: ATMega328P (3.3V, 8 MHz)

ProgrammingArduinoInABox.png

3D

ArduinoInABox FRONT Rev2 3D.png

ArduinoInABox REAR Rev2 3D.png

Assembly Instructions