Jolt.js is a programmable Bluetooth motor driver board
JOLT.JS IS NOT CURRENTLY IN PRODUCTION BUT WILL BE AVAILABLE IN JUNE 2024
Just got your Jolt.js? Take a look here!
Jolt.js allows you to power things at much higher voltages and currents than normal microcontrollers. If these higher voltages are wired up wrong they can cause sparks, get hot, and will cause electrical damage.
While we have tried to make Jolt.js as hardy as possible, there are limits to how tough we can make it while also allowing it to run off a wide voltage range with a low power consumption.
We cannot offer warranty for a Jolt.js that has been wired up backwards or powered with too high a voltage
We'd recommend some safety precautions:
Powering Jolt.js
below before you attempt to power Jolt.js from anything other than USB or a 3.7v LiPo battery on the JST connector⚠️WARNING⚠️ Jolt.js is rated for 18v maximum voltage. Higher than 18v will cause damage. '18v' power tool batteries can be up to 21v when charged and are not suitable.
Jolt.js can be powered in multiple ways:
USB +
solder jumper on the rear of Jolt.jsSolder Jumpers
below for more info on configuring for different battery situations.USB | LiPo | Terminals | Voltage | |
---|---|---|---|---|
Y | 4.65v | USB 5v minus 0.35v diode voltage drop | ||
Y | ~3.3v | LiPo voltage minus 0.35v diode voltage drop | ||
Y | Y | 4.65v | USB 5v minus 0.35v diode voltage drop, LiPo charged @ 100mA | |
- | - | Y | ---- | Terminals power motor drivers directly. Note: if USB/LiPo is connected and voltage is higher, they will be used |
As mentioned above, you can change the behaviour by modifying the solder jumpers on the rear of the board:
On the rear of Jolt.js are some pads which can be cut/soldered to change how it can be powered.
Note: these pads are connected to the LiPo/USB/terminals so should not be left bare.
LiPo Pwr
(default open) - Jolt.js includes a 3A, 0.35v drop diode from the JST battery connector to the motor drivers/terminals. If you're planning
on drawing more than 3A or you want to avoid the voltage drop, you can short this jumper which shorts out the diode.LiPo Chg
(default shorted) - Jolt.js includes a 100mA LiPo battery charger which charges a battery on the JST connector. If you don't want charging or are planning on using a multi-cell or non-LiPo battery, cut this jumper so that the battery won't be charged and the charge circuit won't be broken if the voltage is too high.USB Pwr
(default shorted) - Jolt.js includes a 3A, 0.35v drop diode from the USB connection (plus a 1A self-resetting fuse) to the motor drivers/terminals. If you're connecting a <4.6v battery to
the termnals, or you've shorted LiPo Pwr
then you can cut this jumper to disconnect the diode and stop USB power being used for anything other than LiPo Charging (if LiPo Chrg
is shorted)To 'open' a shorted solder pad, you need to cut inbetween the two gold pads. ⚠️ Always check with a multimeter to ensure that the two pads really are disconnected if you need them open.
LiPo Pwr | LiPo Chg | USB Pwr | Notes |
---|---|---|---|
OPEN | SHORT | SHORT | Default 3.7v LiPo on JST only, with charge (but 0.35v voltage drop). Uses USB voltage when USB connected. |
OPEN | SHORT | OPEN | 3.7v LiPo on JST only, with charge (but 0.35v voltage drop). USB only charges battery, but doesn't power Jolt.js |
SHORT | SHORT | SHORT | 3.7v LiPo on JST only, high power, no voltage drop. Do NOT USE USB with battery connected |
SHORT | SHORT | OPEN | 3.7v LiPo on JST only, with USB charge (but not using USB voltage) |
OPEN | OPEN | SHORT | 3->18v battery on JST (but 0.35v voltage drop). Uses USB voltage when USB connected if battery <4.6v |
SHORT | OPEN | SHORT | 3->18v battery on JST, no voltage drop. Do NOT USE USB with battery connected if battery <4.6v |
OPEN | OPEN | OPEN | 3->18v battery on JST (but 0.35v voltage drop). USB power unused. |
SHORT | SHORT | SHORT | DO NOT DO THIS - could break charge circuit |
Note: By JST
we mean the JST PH LiPo connector on the rear edge of the board, not the terminal block.
Jolt.js does not have reverse voltage protection - always check the polarity when you're powering Jolt.js. Wiring Jolt.js up to a battery backwards will void the warranty!
LiPo Pwr
is shorted), but wiring a battery up to the JST connector in reverse will likely destroy the battery charge circuit.All power figures below are with the LCD on:
NRF.setConnectionInterval(200)
)- 0.05mANRF.findDevices
to scan for devices - 12mAOccasionally you may want to hard-reset Jolt.js. To do this you just need to power cycle the board (or you can call E.reboot()
from JavaScript)
Resetting Jolt.js this way will not clear out any saved code - see Hard Reset below.
To clear out all saved code, reset Jolt.js while keeping the button held for around 10 seconds (even while Jolt.js's green LED is active).
Once Jolt.js has stopped flashing LEDs you can release it - this will clear out any previously saved code and bonding data that could have caused problems.
Note: If you release the button when all 3 LEDs are lit (eg the LED is white) then a self-test will be performed. Saved code will not be loaded from flash, but will not be erased from flash either - a subsequent reset will start Espruino up loading the saved code as normal.
First, it's best to check out the Getting Started Guide
There is more information below about using the motor driver and Qwiic connectors.
Tutorials using Jolt.js:
(No tutorials are available yet)
Tutorials using Bluetooth LE:
Tutorials using Bluetooth LE and functionality that may not be part of Pixl.js:
There are many more tutorials that may not be specifically for you device but will probably work with some tweaking. Try searching to find what you want.
Hover the mouse over a pin function for more information. Clicking in a function will tell you how to use it in Espruino.
Note: Jolt.js has one available I2C, SPI and USART (and infinite software SPI and I2C). Unlike STM32-based Espruino boards, these peripherals can be used on any pin.
Jolt.js comes with a 10 pin screw terminal block on one side. On it are the high power motor driver outputs, as well as screw terminals for GND
and whatever voltage it is being powered from.
From the factory, the terminal blocks are closed. Even though there appears to be a hole, to insert a wire you must unscrew the terminals, insert the wire above the blade in the terminal block, and then screw the terminal block back up.
Certifications:
Jolt.js has 8 powered outputs, divided between two motor drivers (H0/H1/H2/H3
are on driver 0,H4/H5/H6/H7
are on driver 1). Each output can supply 1A.
When enabled, the 2 motor drivers each draw around 2.7mA, so they are disabled by default and all outputs are then mostly (~2.5 kOhm to GND
) open circuit, but are clamped with internal diodes between GND
and +V
on the terminal block.
To enable a motor driver, use Jolt.setDriverMode(driverNumber,mode)
, and then set the pin to the value you want. For example:
Jolt.setDriverMode(0,true); // enables H0..H3
H0.set(); // H0 now outputs a high voltage
setTimeout(function() {
Jolt.setDriverMode(0,false); // disables H0..H3
}, 1000);
Jolt.setDriverMode(1,true); // enables H4..H7
H4.set(); // H4 now outputs a high voltage
setTimeout(function() {
Jolt.setDriverMode(0,false); // disables H4..H7
}, 1000);
The argument to Jolt.setDriverMode
can be one of several different values (see the reference)
but the most useful values are true
(enable in the default mode where all pins are pulled either high or low) or false
(disables, making all pins open circuit).
The motor drivers can supply 1A per output, however they will cut out to protect themselves if they detect too much current flowing or that they are getting too hot.
When this happens with something physical like a motor you may hear a high-pitched whine as the motor driver turns itself on and off repeatedly.
You may well find that a motor that refuses to run at a high voltage (with a whine) will run perfectly fine at a lower voltage as the current required is then low enough.
If you need to control a larger load, consider using Jolt.js to power a relay which then powers your load. Automotive relays are commonly available, will supply large amounts of current, and can easily be connected to Jolt.js's powered outputs.
Note: If you attach an ammeter right across an output it won't read 1A, as the motor driver will detect a current draw higher than 1A and will turn off immediately.
Where possible, loads should be connected between GND
and the motor driver. This ensures that when the motor driver is off, the ~2.5kOhm internal resistance of the motor driver is not causing excess power draw.
If you do have to attach loads between +V
and the motor driver, consider powering the positive side of the load from one of the motor driver outputs too so you can turn it off when you don't need it.
Jolt.js contains a Stepper
class for easy control of stepper motors. For instance you can wire a 5 wire stepper motor between GND
and H0
..H3
, you can use the following code:
Jolt.setDriverMode(0,true); // enables H0..H3
var s = new Stepper({pins : [H0,H1,H2,H3], freq : 100 });
// step 1000 steps...
s.moveTo(1000, {turnOff:true}).then(() => {
print("Done!");
});
Jolt.js can easily drive RGB strip where there are separate wires for red, green and blue.
This LED strip is often 'common-anode', meaning there might be a 12v wire, then R, G and B wires which need to be pulled down to ground to turn the LEDs on.
While you can connect the 12v wire direct to the +V
pin on the terminal block, when the motor
driver is off there is a small (2.5kOhm to GND
) resistance on the motor driver pins which can
cause the LEDs to light slightly (as well as some extra power draw).
To avoid this we'd recommend connecting the 12v wire to the motor drivers as well, so that everything can be turned off at the same time.
Jolt.setDriverMode(0,true);
H3.set(); // enable LEDs
function timer() {
var c = E.HSBtoRGB(getTime()/3,1,1,true);
analogWrite(H0, 1-(c[0]/256));
analogWrite(H1, 1-(c[1]/256));
analogWrite(H2, 1-(c[2]/256));
}
setInterval(timer,20);
Espruino supports sending the signals needed for WS2811/WS2812/WS2812B/APA104/APA106/SK6812 Individually Addressable LEDs (collectively called Neopixels by Adafruit) using the Neopixel library.
For some types of LED, the 3.3v signals from the Qwiic connectors are not high enough voltage to reliably drive the strip directly, but on Jolt.js you can just use the motor drivers to get the required voltage.
Even when off, the LEDs can draw a significant amount of power (up to 1mA per LED) so if you're planning on having the LEDs off for any period of time and running off a battery, consider connecting the 5v supply wire to Jolt.js's motor drivers as well as the data wire. You can then turn off the LEDs completely and go back to drawing microamps.
For example if you connect 5v to H0
and the data line to H1
:
Jolt.setDriverMode(0,true);
H0.set(); // turn on the LEDs
var rgb = new Uint24Array(20); // for 20 LEDs
for (var i in rgb)
rgb[i] = E.HSBtoRGB(i/10,1,1,24); // fill with rainbow colours
require("neopixel").write(H1, rgb); // send to the LEDs
Jolt.js has 8 analog inputs in total:
Q0
SDA
/SCL
pins (returning a value of 0..1 for 0 -> 3.3v)Q1
SDA
/SCL
pins (returning a value of 0..1 for 0 -> 3.3v)H0
, H2
, H4
and H6
(returning a value in volts). These can be used without the motor driver enabled.Jolt.js has 4 Qwiic/Stemma compatible connectors. Each variable (Jolt.Q0
/etc) is an instance of the Qwiic
class and contains at minimum sda
and scl
fields
which correspond to the Qwiic pins.
You can use Jolt.Q0.setPower(1)
to set power on the connector (see below) or Jolt.Q0.i2c
to directly access an I2C
Instance
For instance if you wish to control a SSD1306 OLED from the Q0
Qwiic connector you could do:
Jolt.Q0.setPower(1);
var g = require("SSD1306").connect(Jolt.Q0.i2c, function(){
g.drawString("Hello World!",2,2);
g.flip();
}, { height : 16 });
The rear of Jolt.js is marked as follows:
Marking | Pin |
---|---|
0 | GND |
+ | VCC (3.3v) |
D | SDA |
C | SCL |
Q0
and Q1
These have two GPIO connected to sda
and scl
, and have their power controlled by a 500mA FET which switches GND. To turn the connector on run Jolt.Q0.setPower(1)
, or use Jolt.Q0.fet
to directly access the pin connected to the FET.
The sda
and scl
pins on these ports are also analog inputs - use analogRead(Jolt.Q0.sda)
/etc
Q2
and Q3
All 4 pins are connected to Jolt.js's GPIO (including those usually used for power). As such only around 8mA of power can be supplied to any connected device.
Jolt.Q2.setPower(1)
will set the GPIOs for GND and VCC such that whatever is connected to Q2
is turned on. These contain gnd
and vcc
fields which reference the pins connected to GND and VCC on the Qwiic connector.
All Jolt.js's analog pins are used for GPIO so it doesn't have a built-in method of detecting the battery voltage. You have two options:
E.getAnalogVRef()
will return the voltage on the microcontroller, which is powered by a 3.3v voltage regulator. If the voltage drops below 3.3v then you know that the power source is getting close to or has dropped below 3.3v too. For Lithium ion batteries, a voltage of 3.3v means the battery is about 90% discharged.H0
, H2
, H4
and H6
) - just turn one on and measure the voltage on it (you just need to ensure it's not connected to anything that you don't want turned on!). For example:function getBatteryVoltage() {
Jolt.setDriverMode(0,true);
H0.set();
return new Promise(resolve => {
setTimeout(function() {
let voltage = H0.analog();
H0.reset();
Jolt.setDriverMode(0,false);
resolve(voltage);
}, 50);
});
}
getBatteryVoltage().then(print);
Jolt.js has 3 programmable LEDs, controllable via the LED
or LED1
(red), LED2
(green) and LED3
(blue) variables.
digitalWrite(LED,1)
, LED.write(1)
or LED.set()
turns the red LED ondigitalWrite(LED,0)
, LED.write(0)
or LED.reset()
turns the red LED offThere is 1 buttons on Pixl.js, accessible as BTN
or BTN1
.
digitalRead(BTN1)
or BTN1.read()
(the two commands are identical).setWatch
to call a function whenever the button changes state:setWatch(function() {
console.log("Pressed");
}, BTN, {edge:"rising", debounce:50, repeat:true});
Note: as of the current 2v21 firmware build, NFC functionality is not enabled in software.
NFC hardware is available on Jolt.js, however it requires you to wire up an antenna, and to solder tuning capacitors to the two capacitor pads on the rear of the board next to the screw hole such that the antenna resonates at 13.56 MHz.
Please see the Firmware Update page for detailed instructions.
For more answers please check out the Bluetooth Troubleshooting or General Troubleshooting pages.
This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.