Avatar for lavamantis

lavamantis

Member since Jul 2014 • Last active Sep 2014
  • 8 conversations
  • 29 comments

Node.js programmer, Espruino enthusiast

Most recent activity

  • in Interfacing
    Avatar for lavamantis

    I did NOT remember the diode. I will add it.

    What size capacitor? And in general, how would I calculate what type of capacitor I need?

    Thanks!

  • in Interfacing
    Avatar for lavamantis

    Gordon, do you think that it's possible TOO much current is being drawn and that the power supply is shutting down to protect itself?

    Also - what kind of capacitor could I try and where could I insert it into the circuit?

  • in Interfacing
    Avatar for lavamantis

    So, I got this all working, including adjusting the speed with PWM. I used a 5V/500mah power supply. So far so good.

    For a different iteration of the project, I needed to change the motor out and use this one: https://www.adafruit.com/products/1150. This motor is 12v and uses 200-300ma of current.

    A few other components in the project require a lot of power, so my power supply is 12v/5 amps.

    Here's the problem. With everything wired exactly as indicated above, it doesn't work very well with the new motor. It's set up so that when I press a button on the Espruino, an LED is lit and the motor is turned on (via PWM on the pin attached to the mosfet's gate). Instead of nice smooth motor power, the motor is very choppy and the LED starts blinking off and on in sync with the motor cutting out. It's almost as if there's not enough power for both the Espruino and the motor. But, the power supply is 5A and I disconnected everything else, so that's ridiculous.

    I've tried various PWM duty cycles and frequencies and I can't seem to smooth out the motor.

    What am I doing wrong?

  • in Interfacing
    Avatar for lavamantis

    OK, that worked. I check the magical "process.env" on onInit, and if CONSOLE === USB then then I move the console to LoopbackA. All works well. Thanks!

  • in General
    Avatar for lavamantis

    Pat, not sure if you're still working on this, but this iOS sample code worked for me:

    http://www.jnhuamao.cn/download_rom_en.a­sp?id=66 -> "4.0 BLE IOS7 Source code"

    If the link dies, you might be able to google "huamao technology ble ios7 source code".

    Once you get the code running on your iPhone (it doesn't seem to work in the simulator), you can see the HM-10 in the list, click it, and there's a text box to send text back and forth to Espruino.

    There's some sample code here that is a great starting point for the Espruino side: http://www.espruino.com/USART

  • in Interfacing
    Avatar for lavamantis

    I never could get that HM-10 module working, so I replaced it with a new one which worked great on the first try. Oh well. I've gotten a few parts now that are just simply DOA.

    Anyway, next question. When Espruino is plugged in and powered by the computer's USB, I can successfully connect to and communicate back and forth between the Espruino and my iPhone across bluetooth. Based on the tutorial I used (http://www.espruino.com/Bluetooth+BLE), I've been reading from and writing to Serial1.

    The problem is when I disconnect from the computer and power Espruino from the wall. I can successfully connect to it from the iPhone over bluetooth (I know this because the blinking status LED on pin 24 goes to solid on), but there's no communication going back and forth.

    What is happening?

    Thanks!

  • in General
    Avatar for lavamantis

    @DrAzzy a tutorial would be awesome. I know you gave me some tips about driving a motor in another thread, but I just don't have enough background to feel confident about wiring it up and troubleshooting it when (inevitably) it doesn't work. I have a buddy who's an electrical engineer, I may enlist his help.

    Quick update, I got my new relay from overseas and it works fine. The problem now is that when the system runs for a few hours and the voltage in the battery pack drops a bit, as soon as the relay closes and the lamp comes on, the Espruino goes dark and everything shuts off. So, for now, I'm going to try to use two separate dedicated power sources - one for the Espruino and one for the lamp. That seems easiest.

    Thanks @Stuart.d.d and @user7143 for your tips as well.

Actions