I'm new myself (within the past 2 months). I have little experience with embedded devices, circuits, and C/C++ - so it's taking a bit to get up to speed. The initial device I built I used this tutorial (I didn't use Javascript, instead I rewrote all of the code in C++):
https://www.safaribooksonline.com/blog/2013/07/25/an-arduino-powered-bbq-thermometer/
Another cool (but limited) tool is Circuits IO - definitely helps with quick prototyping and has saved my ass a couple times from frying my Arduino/components:
I've used https://circuits.io/ which is nice, but does lack some things.
http://virtronics.com.au/Simulator-for-Arduino.html it has more debugging stuff on the programming. The licencing sucks though.
You had your power and ground the wrong way around. The red terminal on the battery was connected to the + row on the breadboard, BUT you use the + row like ground. Your LEDs were also the wrong way around.
The fixed version is here: https://circuits.io/circuits/2831398/
When I run the simulation one of the LEDs has a steady on-off and the other ones strobes. There might be other issues but this should be a step in the right direction.
It basically activates a graceful shutdown script through GPIO while remaining powered on via relay.
>One dual push button to power on the RPi, the same button to send a signal to shutdown it gracefully
>The push button pass 5v to the Pi, then the Pi circuits provide energy to the relay, and makes the circuit self activated. Then the push button can be released and the Pi remains powered (by means of relay)
>When the RPi is full powered on, a script can wait for the push button shutdown signal on the other headers
>One button to power on, and same button to power off (and maybe other to reset/power on from standby on P6 headers on the RPi)
https://circuits.io/circuits/475133-raspberry-pi-poweron-and-shutdown-circuit
Haven't used it much but circuits.io has an arduino simulator so you can play around with it without having to purchase one. I'm sure there are others as well. Beyond that, I'd recommend just getting an uno and some LEDs and just start tinkering.
Here's the mockup. This is using NPN transistors like 2222's, but I'm not totally sure that's the right choice. You might be better of using a FET transistor. As I understand it, BJTs (like the 2222) sense current on the base, but FETs sense voltage.
edit: I added some simple blink code to the mockup, and the transistor selecting seems to work great.
Your first circuit is only allowing 7.5 micro-amps through the light bulb, and the resistors are dropping almost all of the voltage in the circuit. Hardly enough to run most anything.
Second circuit shorts the light to the battery, which lights it, but then your voltage divider is only reading the voltages on that wire, which wires have low resistance, so low voltages will show.
Here is the way to use the voltage divider so that it is reading the voltage across the light/battery, with out impeding the current going through the light.
http://www.neato3000.com/wp-content/uploads/2016/12/VoltageDividerAnalogPin.png
put it together in circuits.io in order to check that your code was fine (don't know what the terminal codes are for, but the analog read and the maths worked right)
https://circuits.io/circuits/3595201-voltage-divider-on-an-analog-pin
Also based on some the behavior you are describing, I would like to see the circuit.
You might try your circuit / code in a tool like https://circuits.io/ it can help you see what is going on and debug your project. And if not, it lets others see what you are doing.
I'm really digging the interface on this one but it seems like the only reason it is free is because they make you purchase the PCB from them instead of letting you download a universal file ( what would that be?) that you can send to some vendor...
Not sure about circuits.io, but tinkercad is what I use to simulate arduino circuits (its owned by Autodesk). It includes a fair bit of modules and components, and will simulate your code in the browser.
You can also (as the name implies) perform cad functions as well, but I've only used it for arduino simulation (I used fusion360 for cad stuff).
The YouTube channel looks really great. However, I am looking for practical, hands-on effect of all the electronics component, similar to this video: https://www.youtube.com/watch?v=wvPjnuLhwUI&index=71&list=WL
What do you think about https://circuits.io/?
http://imgur.com/gallery/BAFy6
https://circuits.io/circuits/1842568-88-91-honda-crx-fuel-gauge
second link is the program for arduino and how it's wired. each LED is a digital output which is controlled by an analog input (the fuel level sender). the fuel sender is a 0-220 ohm 2 pin variable resistor for crx and 87-91 civic.. probably later civic models too. a 300 ohm resistor runs between the 5v output from the arduino and one pin of on the sending unit. other pin goes to the ground input on the arduino. reason for adding that resistor between the two is so the analog input can read a 0v to 12v difference when the float moves, which provides the program with the info needed to display fuel level. pretty simple, super reliable, and accurate enough.. been running this daily for about a year now.
I can make it work with 2 seperate RGB leds and 2 transistors( one NPN and one PNP) but I am having trouble with using only one rgb
Here is what I am trying to accomplish. The button press simulates the "HIGH" of GPIO pin https://circuits.io/circuits/4061526-rgb-led#breadboard
Why don't you use https://circuits.io/ - here is a very basic one I did when I started and did not have all the components: https://circuits.io/circuits/2116940-potentiometer.
There are two parts to your sketch, first you set up all your variables and then the main program that will loop from the moment you switch it on intil you switch it off. Enjoy!
No code for you! Actually, this is an example of a push-on push-off project HERE that does exactly what you want except for the 30 minute thing. I can probably have it for you Thursday morning. You might be able to get this simulated circuit HERE to work. The circuits.io site is a good simulator.
Added: I can see /u/chrwei posted this a day ago. Good Job!
Hey, sorry it took so long. Here's the circuits.io prototype. https://circuits.io/circuits/2343027-dg-finder#breadboard
I'm not sure how it works with the sizing of the parts, those in the diagram aren't the right size. I can send you the DigiKey order of what I bought if that would help.
Thank you so much!
Do you have a makerspace near you? There might be people who can help you do what you are trying to do. I went from being a software-type person to learning arduino to designing PCBs for fun (and no profit) in the span of a year or so thanks to my local makerspace.
For easy designs, check out circuits.io.
For more complex PCB designs, learn KiCAD.
Prototype everything with a breadboard, and then draw out your schematic in one of the above tools. The tools take the schematic, map it to part footprints, and then you layout how you want the board to look.
For prototyping there are a few methods out there for doing your own single sided pcbs, but you are limited in terms of complexity because it's single sided. OSH Park is what I use; in the end 3 weeks isn't that bad, considering i then have a legit PCB in hand. THAT I DESIGNED. it's still very cool to me.
And yes, you'll make mistakes and have to redesign and reorder. Just give yourself enough lead time. That's the thing I am the worst at, i'm usually placing my final PCB orders so late that they show up with maybe a day to spare.