Jump to content

JavaLaurence

Members
  • Gesamte Inhalte

    216
  • Benutzer seit

  • Letzter Besuch

Alle erstellten Inhalte von JavaLaurence

  1. Hi, Another PSU question. I'm hearing an extremely high pitched whistle from the PSU powering my LED strip. Since my LED strip is used in a wall clock, I cannot have *any* sound coming off the setup... Googling for the subject turns up lots of hits, but I was wondering if there's anything easy I can do to this particular TF model to stop the whistling? I don't know enough about electricity/electronics to try different things.. Thx.
  2. Hi, I've got the following hooked up to a Watt meter: a Tinkerforge 8A AC/DC Power Adapter, a Tinkerforge 50-LED strip, a Brick and LED Strip, and a Raspberry Pi B to run my logic. The Watt meter indicates a 69-70W consumption (I'm animating the LEDs somewhat, so their brightness varies). Even when all LEDs are dark, I'm getting 67-68W. What is consuming this? Neither the Tinkerforge nor Raspberry consume more than a few Watts... and dark LEDs ..? Does the power adapter itself consume anything? Thx for any insights.
  3. Hi, The presence of which file(s) tell me whether or not a brick deamon has been installed correctly on a Raspberry ? Thx. Laurence
  4. Some success is not really what I'm after. I'm after 100.000% reliability, long-term. So that those silly mechanical counters can be completely ignored henceforth. And that is probably only achievable with a completely power-independent solution: if the mains electricity goes away, whatever runs the Tinkerforge logic (RED Brick, Raspberry, whatever), still needs to carry on as if nothing happened. But currently my problem is in the algorithm.. it's not good enough to translate the raw signal into something that can accurately track the counter. Did you use anything fancy, on the software side, to avoid being tripped by noisy raw input?
  5. I think you can talk the underlying TF protocol, and bypass the daemon. There's nothing in Android that will stop you from taking this approach..
  6. Hi, I'm attempting to track our gas consumption by having a Line bricklet look at the last digit of our meter, which contains a metalic reflective area on the '6' digit. So far my code can track the meter's counter, but without 100% precision, which means that a tracking error accumulates over time until the physical counter value completely differs from what the software manages. Just wondering if anyone has a set-up that works 100% ? Thx. Laurence
  7. The other night, my girlfriend woke me up in the middle of the night.. "The light just switched on", she whispered, with a serious tone in her voice. I was fully asleep just moments before, so it took a while before my brain absorbed what she said. "The light, the light is on.", she repeated, while I still didn't understand why she would wake me for a stupid light being on. But the light was, as she said, and without any shadow of a doubt, on. A while back I created a simple "poor man's" burglar alarm by using a Motion bricklet, and a bunch of other things, plus a Raspberry Pi hooked up to a loud speaker for a real, convincing alarm. My stack also switches on a bedside lamp (using a Remote Switch bricklet) if and when, the Motion bricklet detects motion after 22:00, and before 08:00. So it was past midnight, with both of us fast asleep, and my burglar alarm had triggered, because the light had switched on (the alarm didn't trigger any sound, because I had disconnected the speaker that evening). "Are you kidding me? Did you switch on that light yourself?", I asked her, a bit grumpy. "No, no, the light just switched on, it woke me..." .. slowly, very slowly, it dawned on me (in the middle of the night) that a burglar could be downstairs while we were in bed, upstairs. I had to get to the bottom of this. Much against my sense of well-being, and not relishing the idea of a midnight encounter with a burglar, I crept down the stairs, to the lower floor where I could look at my Mac's screen, and the log file of my stack. Sure enough, there it was on the screen: 10 minutes earlier the Motion bricklet had detected motion. My heart sank.. this was not a practical joke by my girlfriend! I had to go downstairs to ground level (where the sensor is placed), and check out the cause of the whole situation. We don't have guns or baseball bats in the house, so I armed myself with a screwdriver and a pair of scissors. And so I descended, prepared and armed to the teeth. ... Nobody in the front room. ... Nobody in the kitchen... Nobody in the living room. All lights on... and still nobody. Relieved that the lethal encounter hadn't happened, I walked back towards the stairs, and past the motion sensor, which is close to where my Raspberry is taped to the electricity meter. I noticed the tape holding the Raspberry had failed on one side, so the Raspberry was hanging from the remaining side of tape.. so I held the Raspberry and re-attached the tape, and went back upstairs to bed. Then my penny dropped: the failing tape had caused the Raspberry to fall a few centimeters and rotate... it was the Raspberry that caused the Motion bricklet to trigger the alarm!! Whatever you make with those Motion bricklets, be careful not to suffer any heart attacks because of a semantic mismatch between what your software is programmed to "think" in response to what reality is throwing at your sensor !! Parts list: 1x Motion 1x Remote Switch 1x Rotary Poti (to set alarm severity level) 1x 7-segment Display (just for a little HH:MM clock) 1x RPI
  8. I hope the TF team can put itself in the following shoes: imagine that you are a client of a really cool technology produced in Uzbekistan. The Uzbek company selling the stuff has two forums to support its customers: one in the Uzbek language, and one in English. And the Uzbek forum is much more active than the English one. Frustrating, isn't it ? I've tried many times to use Google translate to distill what is being written on your German forum, but gave up in the end. The translation is just not good enough. I hope that one day Tinkerforge makes so much money from international customers that you are forced to switch your current linguistic priorities.. Yours, always a big TF fan
  9. The non-German reading/speaking community would be grateful if this thread would be available in English too. Thanks.
  10. Thanks! Upgrading bricklet firmware always gives a nice, warm feeling ;D
  11. Cool, just what I need. Did you just add this for me, or has 2.0.2 been out a while? BTW, it would be nice if changelogs contained release date and version.
  12. In an attempt to play some MIDI music files through the speaker, it would help if the API had noteOn(freq) and noteOff() .. the current beep with its duration parameter makes it hard to parse MIDI events which do not tell you what duration a note is. The note duration is implied from the distance between NOTE ON and NOTE OFF. Any chance of an API enhancement in a forthcoming release? Pretty please.
  13. Given that this display uses SPI as a control protocol, it would be much cooler if there was a generic SPI (and I2C) bricklet. Then you could control this LCD display, but also hundreds of other peripherals...
  14. Can anyone at TF explain the reasoning why the Hall Effect bricklet doesn't give us any field strength measuring capabilities? I mean, I understand the underlying chip is designed as a switch, not a metering sensor.. but is there a good reason why you didn't go with something that could simply give us a strength value, like so many of the other bricklets do?
  15. Required: * 1x 50-LED strip of RGB "pixels". * 1x LEDStrip bricklet * 1x round, drillable disc * 1x piece of paper cut to disc shape * 1x drill with 12mm drill bit * 1x bit of software A clock face consists of at least 12 indications for the 12 hours. I organised the LEDs to show each hour as a 3-LED "line", and the remaining LEDs I used to indicate the half-hour points between the hours (see picture). That meant using 4 LEDs per hour segment, using up 48 LEDs of the available 50. I used a plastic paint tub lid as my physical foundation to position the LEDs. Drilling the holes had to be done fairly accurately, otherwise the end-effect would look messy. Once all LEDs were pushed through their holes, I also added a sheet of paper to cover them all, and diffuse the individual lights. This gives the clock a more "designer" look, and hides the raw LEDs completely. I've got the LED power supply hooked up to a power meter, and I'm delighted to see that the LEDs only consume 1-3 Watts (the consumption varies, because the software actually creates a pulsating light effect with the "background" LEDs).
  16. I've got a 50-LED strip connected to a LEDStrip bricklet. In the Brick Viewer (2.1.1), I tell the strip (all 50 LEDs) to "Show Color" with the following results: 0,0,0 all LEDs dark 1,0,0 all LEDs dark BLUE (should be red) 0,1,0 all LEDs dark GREEN 0,0,1 all LEDs dark RED (should be blue) My own code also fails to get the expected colours by mixing R,G,B parameters. Have I got a wonky strip? Can't imagine the bricklet to be at fault since there's no direct R, G, B lines going out to the LEDs.
  17. Q to TF team: you're probably aware of the above (the German forum also has a few references to Pixy).. this super-cool camera module supports SPI, I2C, UART, and analog/digital I/O. What would be the most sensible way to hook this camera up to a TF stack? Would it be via an IO-4 or IO-16? Given that you guys are I2C experts, what are the chances that the IO-4/16 Bricklets APIs are enhanced to support direct I2C communications (at least the slow speed variety)?
  18. I took a 50cm cable, cut it in two, carefully noting which ends are paired, then soldered bits of Ethernet strands between the ends, for a total of about 5m. Used it to put an LCD bricklet a "long" way from where my stack was.. and it worked. Since I don't have an electronics background, I have no idea how hard I'm pushing the electrical limits of the TF bricklet design... Would be very interested if anyone manages to significantly go further than 5m.
  19. I see. Yes, I agree that the API should, one way or the other, inform the application that a bricklet has ceased to function, or in any case, be available. It is not correct for any getXXXX() to return a value, when in fact the bricklet has not produced that value.
  20. Curious what the TF guys will answer, but may I ask why you need this feature? Once a stack is configured with X bricklets, why you need that configuration to change.. at runtime?
  21. Now my girlfriend thinks she may be sensitive to electromagnetic radiation, so in the interest of domestic peace, I removed my (Wifi-based) setup :'( So now I need an EM radiation sensor.. hmmm... where could I find one of those?
  22. Required: * two Sound Intensity bricklets, dangling some 50cm above where your heads are normally positioned in bed. * [optional] Wifi module to pipe the collected data to your PC in another room * some trivial software (below) continuously sampling the stereo bricklets, and dumping the measured values to files. I chose to dump the samples as 32-bit floats so that I can import the "nightly dumps" into Audacity using its "File > Import > Raw Data" feature. My setup produces 2 raw files, one for the "left" and "right" bed positions. Audacity quickly proves that my girlfriend was right in claiming I snore quite loudly. package com.softwarepearls.apps.hardware.tinkerforge.health.snoring; import static com.softwarepearls.lego.time.TimeAndDateKit.*; import com.softwarepearls.lego.audio.enums.StereoPosition; import com.softwarepearls.lego.filesystem.files.FileKit; import com.softwarepearls.lego.hardware.tinkerforge.enums.BrickletType; import com.softwarepearls.lego.hardware.tinkerforge.interfaces.input.SoundIntensity; import com.softwarepearls.lego.hardware.tinkerforge.stack.BrickletDescriptor; import com.softwarepearls.lego.hardware.tinkerforge.stack.TinkerForgeStack; import com.softwarepearls.lego.java.system.SystemProperties; import com.softwarepearls.lego.time.Frequency; import com.softwarepearls.lego.time.TimeAndDateKit; import com.tinkerforge.TinkerforgeException; import java.io.*; import java.util.Arrays; import java.util.List; /** * Bare-bones two-person "sleep noise" recorder (meant to record snoring). For * every night, produces two mono sound files holding the noise volume (not true * sound!) recorded between 20:00 and 09:00. * <P> * Find out who snores the loudest, and when (apnea diagnoser?). */ public final class SleepRecorder implements Runnable { private static final int RECORD_START_HOUR = 20; private static final int RECORD_STOP_HOUR = 9; private final static Frequency SAMPLING_FREQUENCY = Frequency.EVERY_10_MS; // the following constants are specific to my personal setup. Modify to suit // yours. private final static String STACK_IP_ADDRESS = "192.168.0.114"; private final static String DUMP_FOLDER = "Documents/Audacity/SleepRecordings"; private final static String RIGHT_SENSOR_UID = "mkt"; private final static String LEFT_SENSOR_UID = "mmV"; private static final List<BrickletDescriptor> EXPECTED_BRICKLETS = Arrays.asList( // new BrickletDescriptor(BrickletType.BRICKLET_SOUND_INTENSITY, "mkt"),// new BrickletDescriptor(BrickletType.BRICKLET_SOUND_INTENSITY, "mmV")// ); private DataOutputStream rightOut; private DataOutputStream leftOut; private void go() throws TinkerforgeException, IOException { Runtime.getRuntime().addShutdownHook(new Thread(this)); final TinkerForgeStack tinkerForgeStack = TinkerForgeStack.initializeTinkerForgeStack(EXPECTED_BRICKLETS, STACK_IP_ADDRESS); final SoundIntensity rightSoundIntensity = (SoundIntensity) tinkerForgeStack.getBricklet(RIGHT_SENSOR_UID); final SoundIntensity leftSoundIntensity = (SoundIntensity) tinkerForgeStack.getBricklet(LEFT_SENSOR_UID); boolean recording = false; while (true) { if (recording) { recordSounds(rightSoundIntensity, leftSoundIntensity); recording = !waitForEnd(); if (!recording) { closeFiles(); } SAMPLING_FREQUENCY.delay(); } else { recording = waitForStart(); if (recording) { initFiles(); continue; } Frequency.EVERY_10_SECOND.delay(); } } } private void recordSounds(final SoundIntensity rightSoundIntensity, final SoundIntensity leftSoundIntensity) throws TinkerforgeException, IOException { final int rightIntensity = rightSoundIntensity.getIntensity(); final int leftIntensity = leftSoundIntensity.getIntensity(); writeToAudioFile(rightIntensity, StereoPosition.RIGHT); writeToAudioFile(leftIntensity, StereoPosition.LEFT); } private void initFiles() throws IOException { System.out.println("Initializing recordings for today " + currentDayOfMonth() + " " + currentMonth()); rightOut = initRecordingFile(StereoPosition.RIGHT); leftOut = initRecordingFile(StereoPosition.LEFT); } private void closeFiles() throws IOException { System.out.println("Closing recordings."); rightOut.close(); leftOut.close(); rightOut = leftOut = null; } private DataOutputStream initRecordingFile(final StereoPosition stereoPosition) throws IOException { final File userHome = new File(SystemProperties.getUserHome()); final File dumpRootDirectory = new File(userHome, DUMP_FOLDER); final File yearDirectory = new File(dumpRootDirectory, "" + currentYear()); final String monthDirName = String.format("%02d_%s", currentMonthNumber() + 1, currentMonth()); final File monthDirectory = new File(yearDirectory, monthDirName); FileKit.ensurePathExists(monthDirectory.getAbsolutePath()); final String filename = String.format("%02d_%s_%s.raw", currentDayOfMonth(), currentDayName().substring(0, 3), stereoPosition); final File noiseFile = new File(monthDirectory, filename); System.out.println("Opened OK: " + noiseFile); final FileOutputStream fos = new FileOutputStream(noiseFile); final BufferedOutputStream bos = new BufferedOutputStream(fos); final DataOutputStream dos = new DataOutputStream(bos); return dos; } private void writeToAudioFile(final int intensity, final StereoPosition position) throws IOException { DataOutputStream out = rightOut; if (position == StereoPosition.LEFT) { out = leftOut; } final float floatIntensity = ((float) intensity) / 4096; out.writeFloat(floatIntensity); } private boolean waitForStart() { // return true; return TimeAndDateKit.currentHour() == RECORD_START_HOUR; } private boolean waitForEnd() { return TimeAndDateKit.currentHour() == RECORD_STOP_HOUR; } public static void main(final String[] args) throws TinkerforgeException, IOException { new SleepRecorder().go(); } @Override public void run() { try { closeFiles(); } catch (final IOException e) { e.printStackTrace(); } } }
×
×
  • Neu erstellen...