Steps to be followed initiallySetting up the environmentInstall BootloaderExample sketch to verify installationTesting camera module is very important task and follow some critical hardware connections:Flashing example camera code in arduino
Burning Bootloader
Steps to be followed initially
This guide is for arduino based bootloader
Install arduino IDE
Install CP210x USB to serial driver
Install Spresense Arduino Library
1. Open Arduino IDE
2. Open the preferences in [File→Preferences].
Copy and paste the following URL into the field calledÂ
Additional Boards Managers URLs:
https://github.com/sonydevworld/spresense-arduino-compatible/releases/download/generic/package_spresense_index.json
Open theÂ
Boards Manager
 [Tools→Board→Boards Manager].Search for Spresense. Once found in the list, select it and click install.
The Spresense Arduino Library is now installed.
Setting up the environment
Identify serial port used by spresense
Install Bootloader
Follow these steps carefully otherwise your device might be bricked!
Select the Spresense board in the [Tools→Boards→Spresense] menu.
Select the serial port used by Spresense from the menu [Tools→Port]. If there is more than one port see Identify the serial port used by Spresense board for more info.
If you are using the Spresense board for the first time, or if you are using an updated version of the Spresense Arduino Library, update the boot loader by selecting [Tools→Programmer→Spresense Firmware Updater].
Then select [Tools→Programmer→Burn Bootloader].
Review and accept the EULA by following the dialog.
Once the upload completes, this is how it should look like:
Congrats 🎉 Bootloader is successfully flashed!
Example sketch to verify installation
You have now finished setting up the board. To verify the setup is correct, copy and paste the following example LED test code into a new sketch:
void setup() { pinMode(LED0, OUTPUT); pinMode(LED1, OUTPUT); pinMode(LED2, OUTPUT); pinMode(LED3, OUTPUT); } void loop() { digitalWrite(LED0, HIGH); delay(100); digitalWrite(LED1, HIGH); delay(100); digitalWrite(LED2, HIGH); delay(100); digitalWrite(LED3, HIGH); delay(1000); digitalWrite(LED0, LOW); delay(100); digitalWrite(LED1, LOW); delay(100); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED3, LOW); delay(1000); }
Build and upload the LED test sketch by clicking Upload.
Wait for the upload to complete.
Your sketch should run automatically. When the LEDs on the main board are flashing, congratulations! Your setup is now complete!
Testing Camera
Testing camera module is very important task and follow some critical hardware connections:
Fit camera into case slot carefully.
Make sure your main board is correctly placed on extension board
- High density connector of both extension board and main board should snugly fit into each other.
- There will be a click sound, if it does not fit properly remove carefully in one direction and try again.
- Do not put large amount of force!
- SD card, microphone, speaker might not work in case of connection are loose.
Next step is to connect camera
- Connect carefully according to side mentioned above
- Insert cable into the slot slowly until you feel sliding motion
- Do not put extra force on cable and make sure you are applying force equally from both side
Power main board to use both main board and extension board.
Flashing example camera code in arduino
File → Examples → Camera → camera
Change number of pictures taken in line 196 from 100 to something 10-20
if (take_picture_count < 100)
You can also add some inbuilt LED functions to know current status.
Upload on spresense board similarly
You can now insert SD card into the slot and open serial monitor to show output of code.
In case you get
Insert SD card
error repeatedly double check your main board and extension board connection.Once code running is stopped you can insert SD card into your PC and check images.
Add Microphone
Â
Using analog microphone [MEMS microphone / electret microphone]
Identify GND and output of microphone [GND have a line]
Solder carefully and attach long enough wires
To make microphone work certain bias resistor is required to be soldered on extension board [as in figure below] but there is workaround which is in next step.
Take female berg and attach on the connectors and follow this schematic to solder or attach microphone and bias resistor [2.2kΩ]
In case there is any IO confusion test with continuity with help of multimeter
Format SD card with FAT32 format and make a folder
BIN
, final it should look like this
→ SD_Card
→ BIN
→ MP3DEC
→ MP3ENC
→ WAVDEC
→ SRCÂ