A resistor from the base to one of Espruino's spare IOs
A resistor from the base to the emitter (this is optional, but it's probably good to have it)
The emitter to 3.3v (I think that's what is needed to power the ERF?)
The collector to the ERF modules voltage input
Then the software's just:
var PWR = pin_connected_to_transistor;
function sendReading() {
digitalWrite(PWR,0); // power on
setTimeout(function() { // wait for radio to start
Serial2.print("my data");
setTimeout(function() { // wait for radio to finish
digitalRead(PWR); // Make PWR an input -> power off
}, 500);
}, 500);
}
setInterval(sendReading, 1000*60*15); // 15 mins
2
I don't know of anywhere offhand, however so far I've just cut a piece of solid core wire of the right length and soldered it on. It seems to work ok.
If you need it smaller you might be able to wrap it around a pencil to make it spring-shaped, but I'm not a radio engineer so I don't know if that's good or bad :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
No problem :)
1
Actually I'd probably suggest using a PNP transistor. You should be able to use pretty much anything adafruit suggest a PN2907 as a general purpose one. Then get 2x 1kOhm resistors, and connect:
Then the software's just:
2
I don't know of anywhere offhand, however so far I've just cut a piece of solid core wire of the right length and soldered it on. It seems to work ok.
If you need it smaller you might be able to wrap it around a pencil to make it spring-shaped, but I'm not a radio engineer so I don't know if that's good or bad :)