OV7670 + Lepton Module

OV7670 + Lepton Using Featherboard M0

This is camera streaming test using Featherboard M0OV7670, and also Lepton.
I previously tested OV7670 and Lepton individually, and this time I tried to combine both OV7670 and Lepton so that I can see the RGB image and thermal image at the same time.
I was assuming that it would not work well because of the mechanical alignment but this quick test is just to see how it works and get an idea for the next step.

Connection

This time, I decided to use an interface board between featherboard and each sensors rather than using wires.
Here is the hardware setup of my test.

The green board is the interface board between OV7670 module, Lepton module and Featherboard M0.
OV7670 and Lepton sensor do not align perfectly, but it is much better than using jumper wires that I have been using the previous camera tests.

You can enable thermal image with your phone!

Test

Here is the test video. I am using Arduino IDE and Processing for this test.


Left side image is OV7670 module and right side image is Lepton module.
The frame rate is not high at this moment, but this would be something that can be improved in the future.


FLIR Lepton Module

FLIR Lepton Module Test Using Featherboard M0

This is thermal image sensor streaming test using Featherboard M0 and FLIR Lepton sensor.
FLIR lepton sensor is 80x60 resolution and you can use I2C and SPI to communicate with the sensor. The module breakout board is available here.

Connection

Here is the connection.
Lepton Featherboard
CS GND
MOSI MOSI
MISO MISO
CLK SCK
GND GND
VIN 3.3V
SDA
SCL
I am not using I2C at this moment and just getting the image data with the default settings.

You can enable thermal image with your phone!

Test

Here is the video and I am using Arduino IDE and Processing.


                                                     

OV7670 Camera Module with FIFO

OV7670 Camera Module with FIFO Using Featherboard M0

This is camera streaming test using Featherboard M0 and OV7670.

First of all, it is difficult to stream video using this M0 core.. so I decided to use the camera module that has FIFO.
With this implementation, MCU can just grab the images from the FIFO and send it to the host without considering the timing of camera interface.

OV7670 camera module I am using is has AL422B FIFO behind the camera and you can find the datasheets here and here.


Connection

My connection between Featherboard M0 and OV7670 module is listed below.
OV7670 Featherboard
1 VDD
2 GND
3 SCL
4 SDA
5 9
6
7 6
8 5
9 A5
10 A4
11 A3
12 A2
13 A1
14 A0
15 VDD
16 GND
17
18 10
19 11
20 GND
21 13
22 12

I2C bus requires the pull-up registers and I have 4.7k-ohm registers to 3.3V on both SDA and SCL.

Test

Here is the video of the test code.

As you can see in the video, frame rate is not so fast at this moment (less than 4fps), but it is good enough to use this as small camera project like monitoring system.



                 

Featherboard M0 Basic ~GPIO~

Featherboard M0 Basic ~GPIO~


This is the GPIO test of Featherboard M0 using Arduino IDE. 
I sometimes need to toggle the GPIO as fast as possible, and it is difficult to achieve the requirements using Arduino API, such as digitalWrite function.
In this case, you need to check the necessary source code under the Arduino package like \hardware\samd\1.x.x\cores\arduino and find the functions to optimize the behavior.


digitalWrite Function

digitalWrite function is defined in the wiring_digital.c file.
void digitalWrite( uint32_t ulPin, uint32_t ulVal )
{
  // Handle the case the pin isn't usable as PIO
  if ( g_APinDescription[ulPin].ulPinType == PIO_NOT_A_PIN )
  {
    return ;
  }

  // Enable pull-up resistor
  PORT->Group[g_APinDescription[ulPin].ulPort].PINCFG[g_APinDescription[ulPin].ulPin].reg=(uint8_t)(PORT_PINCFG_PULLEN) ;

  switch ( ulVal )
  {
    case LOW:
      PORT->Group[g_APinDescription[ulPin].ulPort].OUTCLR.reg = (1ul << g_APinDescription[ulPin].ulPin) ;
    break ;

    default:
      PORT->Group[g_APinDescription[ulPin].ulPort].OUTSET.reg = (1ul << g_APinDescription[ulPin].ulPin) ;
    break ;
  }

  return ;
}
As you can see, ulval is used in the switch statement and if it is 0, it clears the port, and if it is 1, it sets the port.
If you are sure which port you access and the pin configuration, the lines before the switch statement would not be needed which saves the time used for those operations.
Also, if you do not need to have the function and directly control the pins from the main code, you can just reuse the lines written in the switch statement.
PORT->Group[g_APinDescription[ulPin].ulPort].OUTCLR.reg = (1ul << g_APinDescription[ulPin].ulPin) ;
PORT->Group[g_APinDescription[ulPin].ulPort].OUTSET.reg = (1ul << g_APinDescription[ulPin].ulPin) ;
When you use those lines in the main function, you need to replace ulPin with the actual values based on the pin you want to use.
You can find the variant.cpp file and WVariant.h.
If you need it to be more faster, you can assign specific bit values instead of the bit shift operation and also assign the right number to the Group[].
For example, using digital pin 13, the set and clear can be done something like below.
PORT->Group[0].OUTCLR.reg = 0x00020000;
PORT->Group[0].OUTSET.reg = 0x00020000;
This will make it much faster than using digitalWrite function.

Grid-Eye Module Test

Grid-Eye Module Test

Panasonic Grid-Eye is 8x8 infrared array sensor.
This sensor supports I2C interface and you can get each 64 elements temperature data at 10Hz rate. 
There is a great software example to test the sensor using Arduino here and the processing code is available here.

Test Setup

Here is my test setup. 
Using Arduino Uno for this quick test.

Grid-Eye has two versions of power supply voltage 3.3V and 5.0V.
I am using 3.3V version. 
VIH of Arduino seems to be 3.0V, so as long as the I2C pull-up resistor value and bus speed are not so high, it should work properly. 
(Since it only has interrupt output and I2C, I just checked VIH.)



You can enable thermal image with your phone!

       

Test Run

Here is the video running the processing code.

There is 8x8 grid and the number in each grid is the temperature reading from the sensor.
I am moving my finger left and right, and as you can see, the red part (high temperature) is moving left and right as well.


If you want more pixel or resolution, use lepton and check this post!




                 

Featherboard M0 Basic Proto

Featherboard M0 Basic Proto


Featherboard M0 Basic Proto is very simple design and easy to use ARM M0 based board.
Arduino IDE supports this board and most of the sample code works with it.
The great feature is that it has a battery connector and it can be used as portable devices without having extra board like other MCU boards.
The MCU is actually same as Arduino M0/Zero which is  ATSAMD21G18 48MHz, but the board is much smaller. The technical details are available here.

Featherboard has other versions with WiFi, Bluetooth, and so on, so depending on what you would like to do, you can get the one with those features.

Setup


Follow the setup instruction here and here.
How it works is a little bit different from the Arduino, but once it set up, it would be very easy to switch between Arduino and Featherboard.

Once you install the necessary software, it generates most of the source files under your user folder which is \AppData\Local\Arduino15\packages.
If you prefer not to use the predefined APIs, you can refer to these files and generate your own functions. 

[AKM Chip Booster] Audio ADC AK5704 PCB Design

Designing a PCB prototype with AK5704 is not so difficult and I show an example with my design. People who are not familiar with AK5704,...