The Breadboard Block allows you to interface various peripherals. It's a very versatile block in that you can get readings from a wide range of sensors as well as control things like LEDs or buzzers.
You can insert the Breadboard Block into the Workspace of the Kitsunei Creator by opening the Quick Menu and selecting the Breadboard Block in the Hardware Blocks Menu.
To begin configuring the pins open the Properties Panel of the Breadboard Block by clicking on the gear icon under the block.
In the Properties Panel select the Custom Settings drop down and click the Visual Map button. This will open the Pin Configuration window.
When using you Breadboard Block it is useful to know the pinouts of the the peripheral you are trying to use. Either check out the Arduino Modules to see the the pinouts or use the specific data-sheet for your sensor. Once you know the corresponding pin mode required for each pin of you sensor it is time to configure the pins on the Breadboard Block.
To configure your pins follow the steps below:
- Select the pin on the Breadboard Block image.
- From the Pin Modes drop down menu select your desired pin mode.
- Click the Save button to set the pin mode for the selected pin. BE CAREFUL. Not saving and clicking on the next Pin will lose your changes.
You are able to switch sides of the Breadboard Block by clicking the switch in the bottom left corner of the window.
Pin Layout
Each pin has a different set of possible pin modes that can be accessed within the Pin Configuration. The layout of the Breadboard Block and corresponding pin modes are shown below:
IO0 | IO1 | IO2 | IO3 | IO4 | IO9 |
Disabled | Disabled | Disabled | Disabled | Disabled | Disabled |
Input | Input | Input | Input | Input | Input |
InputPullUp | InputPullUp | InputPullUp | InputPullUp | InputPullUp | InputPullUp |
PulseOutHigh | PulseOutHigh | PulseOutHigh | PulseOutHigh | PulseOutHigh | PulseOutHigh |
PulseOutLow | PulseOutLow | PulseOutLow | PulseOutLow | PulseOutLow | PulseOutLow |
PulseInHigh | PulseInHigh | PulseInHigh | PulseInHigh | PulseInHigh | PulseInHigh |
PulseInLow | PulseInLow | PulseInLow | PulseInLow | PulseInLow | PulseInLow |
Output | Output | Output | Output | Output | Output |
PWM | PWM | PWM | PWM | PWM | PWM |
Vcc | Vcc | Vcc | Vcc | ||
Gnd | Gnd | Gnd | Gnd | ||
AnalogIn | |||||
I2cSCL | I2cSDA |
IO0 | IO1 | IO2 | IO3 | IO4 | IO9 |
IO10 | IO5 | IO6 | IO7 | IO8 | IO11 |
IO10 | IO5 | IO6 | IO7 | IO8 | IO11 |
Disabled | Disabled | Disabled | Disabled | Disabled | Disabled |
Input | Input | Input | Input | Input | Input |
InputPullUp | InputPullUp | InputPullUp | InputPullUp | InputPullUp | InputPullUp |
PulseOutHigh | PulseOutHigh | PulseOutHigh | PulseOutHigh | PulseOutHigh | PulseOutHigh |
PulseOutLow | PulseOutLow | PulseOutLow | PulseOutLow | PulseOutLow | PulseOutLow |
PulseInHigh | PulseInHigh | PulseInHigh | PulseInHigh | PulseInHigh | |
PulseInLow | PulseInLow | PulseInLow | PulseInLow | PulseInLow | |
Output | Output | Output | Output | Output | Output |
PWM | PWM | PWM | PWM | ||
Vcc | Vcc | Vcc | Vcc | ||
Gnd | Gnd | Gnd | Gnd | ||
AlalogIn |
AlalogIn |
Pin Modes
A small explanation of each of the pin modes has been collated in the table below:
Pin Mode | Action/Input | What it does |
Disabled | N/A | Disables the pin. |
Input | Input | Used to read digital values (1s and 0s) |
InputPullUp | Input | Reads digital values and has an internal resistor connected to +3.3V. The default value is always 1. |
PulseOutHigh | Action | Generates a HIGH pulse (+3.3v) for the specified amount of microseconds. Use a value gate in the Logic Maker to define the pulse time |
PulseInHigh | Input | Measures the number of microseconds the pin remains in HIGH state (requires a pulldown resistor) |
PulseInLow | Input | Measures the number of microseconds the pin remains in LOW state |
Output | Action |
Produces digital values 1s and 0s, where 1 is +3.3V and 0 is the ground line Additional input: Default State (0 or 1) You are able to choose if an event will push the pin high or low. |
PWM | Action |
Generates a "Pulse Width Modulation" with a default Duty Cycle of 50% Additional input: Period (in microseconds) By changing the period you can alter the frequency of your square wave. |
Vcc | N/A | Connected to +3.3V internally |
Gnd | N/A | Connected to the ground line |
AnalogIn | Input |
Reads the voltage presented in the pin from 0 to 3.3V, where the maximum value is equivalent to 65535. You can read this value from the Logic Maker Additional input: Trigger Mode By changing the trigger mode it will allow you to change when information is sent to the logic maker. -Always: The sensor readings will always be sent to the Logic Maker -GreaterThan: Data will only be sent to the Logic Maker if it is greater than the specified value (0-65535) -LessThan: Data will only be sent to the Logic Maker if it is equal to the specified value (0-65535) -Equal: Data will only be sent to the Logic Maker if it is equal to the specified value (0-65535) -NotEqual: Any time the data is not equal to the specified value (0-65535) data will be sent to the Logic Maker -ChangeBy: If the readings change by the specified value they will be sent to the Logic Maker
|
I2cSCL/I2cSDA | N/A |
These two pins must be used together to send and receive data using the i2c protocol. To use these pins you will need to use the Script Block and the hardware APIs. I2cSDA: I2C Data Line. I2cSCL: I2C Clock Line. |
Sensor Configuration Example
We will take the moisture sensor below as an example. You should see labels located next to each of the pins. For the moisture sensor below you should be able to see an S, + and -.
These indicate what each of the pins do. In most cases sensors will be labelled with either a Vcc or + for the power input and a - or Gnd for the zero voltage point. All sensors require power so they will always need to be connected to Vcc and Gnd to get power.
Next is to figure out what the S needs to be configured as. S can be interpreted as signal, but we are still unsure how the signal is being sent. We can try and figure it out by looking at the datasheet. If you check the document you should be able to see that on the second page it says:
Sensor type: Analog
Since it is an analog sensor we can use an AnalogIn pin mode. Now that we know all our pin modes we can choose where we want to place our sensor in the Breadboard Block. The table below shows the pin modes and order of the pins.
S | + | - |
AnalogIn | Vcc | Gnd |
You will need to look at the Pin Layout in the previous section and check where you can place your sensor. Make sure that each pin is able to be set to its correct pin mode next to each other.
You should be able to see that there are three possible places that the sensor can be put in. The table below shows the three positions and the pin modes.
S | + | - |
IO1-AnalogIn | IO2-Vcc | IO3-Gnd |
IO5-AnalogIn | IO6-Vcc | IO7-Gnd |
IO6-AnalogIn | IO7-Vcc | IO8-Gnd |
You can now follow the process the set up each of your pins and your sensor should work in the Logic Maker.
The table below summarises the pin modes for labelled sensors:
Sensor Label | Pin Mode Configuration |
Vcc or + | Vcc |
Gnd or - | Gnd |
Other | You will have to check the data sheet to figure out which pin mode is required |
Check out the Arduino Modules page see some examples of sensors you can connect up to your breadboard.